Author: mmcallis
Date: 2008-03-31 19:48:01 -0400 (Mon, 31 Mar 2008)
New Revision: 10439
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
Log:
6.2.3. The jboss-portlet.xml Descriptor
revising content
Modified:
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
---
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-03-31
22:30:32 UTC (rev 10438)
+++
docs/branches/JBoss_Portal_Branch_2_6/referenceGuide/en/modules/xmldescriptors.xml 2008-03-31
23:48:01 UTC (rev 10439)
@@ -1279,24 +1279,22 @@
<note>
<title>Is the <filename>portlet-instances.xml</filename> descriptor
required?</title>
<para>
- Technically, they are not. The portal object hierarchy, such as creating portals,
pages, instances, and organizing them on the page, can be defined using the management
portlet, which is accessible to JBoss Portal administrators.
+ Technically, it is not. The portal object hierarchy, such as creating portals,
pages, instances, and organizing them on the page, can be defined using the management
portlet, which is accessible to JBoss Portal administrators.
</para>
</note>
</sect2>
<sect2>
- <title>jboss-portlet.xml</title>
- <note>
- <emphasis>Is this descriptor mandatory?</emphasis>
- Technically, no, but might be required to access JBoss-specific functionality
that is not covered by the
- Portlet specification.
- </note>
- <para>This descriptor is useful when you need to access JBoss-specific
functionality within your portlet
- application. It would normally be packaged inside your portlet war, alongside
the other descriptors
- in this section.</para>
+ <title>The <filename>jboss-portlet.xml</filename>
Descriptor</title>
+ <para>
+ The <filename>jboss-portlet.xml</filename> descriptor allows you to use
JBoss-specific functionality within your portlet application. This descriptor is covered
by the <ulink
url="http://www.jcp.org/en/jsr/detail?id=168">JSR-168
Portlet Specification</ulink>, and would normally be package inside your portlet
WAR, alongside the other descriptors in these sections.
+ </para>
<sect3>
<title>Injecting Header Content</title>
<para>
- <programlisting><![CDATA[
+ The following example injects a specific style sheet,
<computeroutput>/images/management/management.css</computeroutput>, allowing
the porlet to leverage a specific style:
+ </para>
+ <para>
+<screen><![CDATA[
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE portlet-app PUBLIC
"-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
@@ -1309,15 +1307,20 @@
media="screen"/>
</header-content>
</portlet>
-</portlet-app>]]></programlisting>
- The above example will inject a specific style sheet link in the top of
the portal page, allowing this
- portlet to leverage its specific style selectors.
+</portlet-app>]]>
+</screen>
+ </para>
+ <para>
+ Use the <computeroutput><header-content></computeroutput>
and <computeroutput><link></computeroutput> elements to specify
a style sheet to use.
</para>
</sect3>
<sect3>
- <title>Injecting Services in the portlet context</title>
+ <title>Injecting Services in the Portlet Context</title>
+ <para>
+ The following example injects the
<computeroutput>UserModule</computeroutput> service as an attribute to the
portlet context:
+ </para>
<para>
- <programlisting><![CDATA[
+<screen><![CDATA[
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE portlet-app PUBLIC
"-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
@@ -1328,20 +1331,28 @@
<service-class>org.jboss.portal.identity.UserModule</service-class>
<service-ref>:service=Module,type=User</service-ref>
</service>
-</portlet-app>]]></programlisting>
- Injects the UserModule service as an attribute to the portlet context,
allowing a portlet to then leverage the
- service. For example:
- <programlisting><![CDATA[
+</portlet-app>]]>
+</screen>
+ </para>
+ <para>
+ This allows the portlet to leverage the service, for example:
+ </para>
+ <para>
+<screen><![CDATA[
UserModule userModule = (UserModule)
getPortletContext().getAttribute("UserModule");
String userId = request.getParameters().getParameter("userid");
User user = userModule.findUserById(userId);
-]]></programlisting>
+]]>
+</screen>
</para>
</sect3>
<sect3>
- <title>Defining extra portlet information</title>
- <para>Since JBoss Portal 2.6.3, icons can be defined for a portlet.
- <programlisting><![CDATA[
+ <title>Defining Extra Portlet Information</title>
+ <para>
+ As of JBoss Portal 2.6.3, icons can be defined for a portlet, by using the
<computeroutput><icon></computeroutput>,
<computeroutput><small-icon></computeroutput>, and
<computeroutput><large-icon></computeroutput> elements:
+ </para>
+ <para>
+<screen><![CDATA[
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE portlet-app PUBLIC
"-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
@@ -1356,10 +1367,12 @@
</icon>
</portlet-info>
</portlet>
-</portlet-app>]]></programlisting>
- The reference can be absolute
(
http://www.example.com/images/smallIcon.png) or relative to the webapp
- context if starting with a '/'. Those icons can be used by
different parts of the portal User Interface.
- </para>
+</portlet-app>]]>
+</screen>
+ </para>
+ <para>
+ The reference can be absolute, for example,
<
emphasis>http://www.example.com/images/smallIcon.png</emphasis>, or relative
to the web application context, by starting with a
<computeroutput>/</computeroutput>, as shown above. These icons can be used by
different parts of the portlet user interface.
+ </para>
</sect3>
<sect3>
<title>Portlet Session Replication in a Clustered
Environment</title>
@@ -1475,6 +1488,14 @@
<note>This is a simple portlet.xml primer, and is not meant as a
replacement for what is covered in the
actual Portlet specification.</note>
</para>
+ <para>
+ <note>
+ <title>Is the <filename>jboss-portlet.xml</filename> descriptor
required?</title>
+ <para>
+ Technically, it is not; however, it may be required to access JBoss-specific
functionality that is not covered by the Portlet specification.
+ </para>
+ </note>
+ </para>
</sect2>
</sect1>
<sect1 id="portaldescriptors">