Author: smumford
Date: 2011-11-29 23:51:52 -0500 (Tue, 29 Nov 2011)
New Revision: 8159
Modified:
epp/docs/branches/5.2/Reference_Guide/en-US/Book_Info.xml
epp/docs/branches/5.2/Reference_Guide/en-US/Revision_History.xml
epp/docs/branches/5.2/Reference_Guide/en-US/modules/PortalDevelopment/Skinning.xml
Log:
JBEPP-1289: Added 'Define Custom CSS File' section
Modified: epp/docs/branches/5.2/Reference_Guide/en-US/Book_Info.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide/en-US/Book_Info.xml 2011-11-29 13:11:34 UTC (rev
8158)
+++ epp/docs/branches/5.2/Reference_Guide/en-US/Book_Info.xml 2011-11-30 04:51:52 UTC (rev
8159)
@@ -9,7 +9,7 @@
<productname>JBoss Enterprise Portal Platform</productname>
<productnumber>5.2</productnumber>
<edition>5.2.0</edition>
- <pubsnumber>11</pubsnumber>
+ <pubsnumber>12</pubsnumber>
<abstract>
<para>
This Reference Guide is a high-level usage document. It deals with more
advanced topics than the Installation and User Guides, adding new content or taking
concepts discussed in the earlier documents further. It aims to provide supporting
documentation for advanced users of the JBoss Enterprise Portal Platform product. Its
primary focus is on advanced use of the product and it assumes an intermediate or advanced
knowledge of the technology and terms.
Modified: epp/docs/branches/5.2/Reference_Guide/en-US/Revision_History.xml
===================================================================
--- epp/docs/branches/5.2/Reference_Guide/en-US/Revision_History.xml 2011-11-29 13:11:34
UTC (rev 8158)
+++ epp/docs/branches/5.2/Reference_Guide/en-US/Revision_History.xml 2011-11-30 04:51:52
UTC (rev 8159)
@@ -8,6 +8,20 @@
<simpara>
<revhistory>
<revision>
+ <revnumber>5.2.0-12</revnumber>
+ <date>Wed Nov 30 2011</date>
+ <author>
+ <firstname>Scott</firstname>
+ <surname>Mumford</surname>
+ <email></email>
+ </author>
+ <revdescription>
+ <simplelist>
+ <member>Added "Define Custom CSS File"
section.</member>
+ </simplelist>
+ </revdescription>
+ </revision>
+ <revision>
<revnumber>5.2.0-11</revnumber>
<date>Tue Nov 29 2011</date>
<author>
Modified:
epp/docs/branches/5.2/Reference_Guide/en-US/modules/PortalDevelopment/Skinning.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide/en-US/modules/PortalDevelopment/Skinning.xml 2011-11-29
13:11:34 UTC (rev 8158)
+++
epp/docs/branches/5.2/Reference_Guide/en-US/modules/PortalDevelopment/Skinning.xml 2011-11-30
04:51:52 UTC (rev 8159)
@@ -449,7 +449,8 @@
</section>
<section
id="sect-Reference_Guide-Creating_New_Skins-How_to_Create_New_Portlet_Skins">
- <title>How to Create New Portlet Skins</title>
+ <title><remark>How to Create New Portlet
Skins</remark></title>
+
<para>
Portlets often require additional styles that may not be defined by the
portal skin. JBoss Enterprise Portal Platform allows portlets to define additional
stylesheets for each portlet and will append the corresponding
<literal>link</literal> tags to the <literal>head</literal>.
</para>
@@ -474,6 +475,130 @@
</para>
</note>
+ <section
id="sect-Reference_Guide-How_to_Create_New_Portlet_Skins-Define_a_Custom_CSS_File">
+ <title><remark>Define a Custom CSS
File</remark></title>
+
+ <para>
+ JBoss Enterprise Portal Platform &VX; does not serve CSS files
directly, but uses a filter as well as a skin service in order to:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Cache the CSS files.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Merge them into one file if possible. This will be discussed
further in <xref
linkend="sect-Reference_Guide-Tips_and_Tricks-Easier_CSS_Debugging"/>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add support for Right-To-Left (RTL) languages. This is
discussed in more detail in <xref
linkend="sect-Reference_Guide-Right_To_Left_RTL_Framework-Stylesheet"/>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ This causes JBoss Enterprise Portal Platform to create
non-functioning a CSS-link in html-src-code.
+ </para>
+ <procedure>
+ <title>To Resolve This:</title>
+ <step>
+ <para>
+ Add the following files to the custom portlet
application:
+ </para>
+ <variablelist>
+ <title></title>
+ <varlistentry>
+
<term><filename>WEB-INF/gatein-resources.xml</filename>:</term>
+ <listitem>
+<programlisting><![CDATA[<portlet-skin>
+ <application-name>custom</application-name>
+ <portlet-name>test</portlet-name>
+ <skin-name>Default</skin-name>
+ <css-path>/css/main.css</css-path>
+</portlet-skin>
+]]></programlisting>
+ <note>
+ <title>Note:</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The value of the
<parameter>application-name</parameter> element needs to match the value of
the <parameter>display-name</parameter> element in
<filename>web.xml</filename>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The value of the
<parameter>portlet-name</parameter> element needs to match the value of the
<parameter>portlet-name</parameter> element in
<filename>portlet.xml</filename>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+
<term><filename>WEB-INF/web.xml</filename>:</term>
+ <listitem>
+<programlisting><![CDATA[<display-name>custom</display-name>
+
+<filter>
+ <filter-name>ResourceRequestFilter</filter-name>
+
<filter-class>org.exoplatform.portal.application.ResourceRequestFilter</filter-class>
+</filter>
+
+<filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+</filter-mapping>
+]]></programlisting>
+ <note>
+ <title>Note:</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The value of the
<parameter>display-name</parameter> element needs to match the value of the
<parameter>application-name</parameter> element in
<filename>gatein-resources.xml</filename>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The
<literal>ResourceRequestFilter</literal> needs to be added to the custom
portlet application for proper CSS file handling within the Portal container.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+
<term><filename>WEB-INF/portlet.xml</filename>:</term>
+ <listitem>
+<programlisting><![CDATA[<portlet-name>test</portlet-name>
+]]></programlisting>
+ <note>
+ <title>Note:</title>
+ <para>
+ The value of the
<parameter>portlet-name</parameter> element needs to match the value of the
<parameter>portlet-name</parameter> element in
<filename>gatein-resources.xml</filename>.
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ The final portlet application will be structured as
illustrated below:
+ </para>
+<programlisting>custom.war
+ ├── css
+ │ └── main.css
+ └── WEB-INF
+ ├── classes
+ │ [... custom portlet class ...]
+ ├── gatein-resources.xml
+ ├── portlet.xml
+ └── web.xml
+</programlisting>
+ </step>
+ </procedure>
+ </section>
+
<section
id="sect-Reference_Guide-How_to_Create_New_Portlet_Skins-Change_Portlet_Icons">
<title>Change Portlet Icons</title>
<para>