[gatein-commits] gatein SVN: r9116 - epp/docs/branches/6.0/Developer_Guide/en-US.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Feb 4 19:23:30 EST 2013
Author: jaredmorgs
Date: 2013-02-04 19:23:30 -0500 (Mon, 04 Feb 2013)
New Revision: 9116
Modified:
epp/docs/branches/6.0/Developer_Guide/en-US/Developer_Guide.xml
epp/docs/branches/6.0/Developer_Guide/en-US/chapter-1-GDG_Introduction.xml
epp/docs/branches/6.0/Developer_Guide/en-US/chapter-2-GDG_Architectural_choices.xml
epp/docs/branches/6.0/Developer_Guide/en-US/chapter-3-GDG_Design_choices.xml
epp/docs/branches/6.0/Developer_Guide/en-US/chapter-4-GDG_Portal_Development.xml
epp/docs/branches/6.0/Developer_Guide/en-US/chapter-5-GDG_Application_development.xml
Log:
Normalized all IDREFS up to JavaScript Development. Will now go and chunk content into parts in the guide
Modified: epp/docs/branches/6.0/Developer_Guide/en-US/Developer_Guide.xml
===================================================================
--- epp/docs/branches/6.0/Developer_Guide/en-US/Developer_Guide.xml 2013-02-04 23:48:13 UTC (rev 9115)
+++ epp/docs/branches/6.0/Developer_Guide/en-US/Developer_Guide.xml 2013-02-05 00:23:30 UTC (rev 9116)
@@ -9,8 +9,12 @@
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter-1-GDG_Introduction.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter-2-GDG_Architectural_choices.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter-3-GDG_Design_choices.xml"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter-4-GDG_Portal_Development.xml"/>
- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter-5-GDG_Application_development.xml"/>
+<!--<part>
+ <title>Portal Development</title>
+</part>--> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter-4-GDG_Portal_Development.xml"/>
+<!--<part>
+ <title>Application Development</title>
+</part>--> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter-5-GDG_Application_development.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chapter-6-GDG_JavaScript_Development.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Revision_History.xml"/>
</book>
Modified: epp/docs/branches/6.0/Developer_Guide/en-US/chapter-1-GDG_Introduction.xml
===================================================================
--- epp/docs/branches/6.0/Developer_Guide/en-US/chapter-1-GDG_Introduction.xml 2013-02-04 23:48:13 UTC (rev 9115)
+++ epp/docs/branches/6.0/Developer_Guide/en-US/chapter-1-GDG_Introduction.xml 2013-02-05 00:23:30 UTC (rev 9116)
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
-<chapter id="sid-819799">
+<chapter id="Introduction">
<title>Introduction</title>
<para>
This is the JBoss Portal Platform Developer Guide. This document is intended for those developing applications and gadgets for the JBoss Portal Platform product and outlines options and strategies for successful deployment.
Modified: epp/docs/branches/6.0/Developer_Guide/en-US/chapter-2-GDG_Architectural_choices.xml
===================================================================
--- epp/docs/branches/6.0/Developer_Guide/en-US/chapter-2-GDG_Architectural_choices.xml 2013-02-04 23:48:13 UTC (rev 9115)
+++ epp/docs/branches/6.0/Developer_Guide/en-US/chapter-2-GDG_Architectural_choices.xml 2013-02-05 00:23:30 UTC (rev 9116)
@@ -1,11 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
-<chapter id="sid-7372876">
- <title>Architectural choices</title>
+<chapter id="Architectural_Choices">
+ <title>Architectural Choices</title>
<para>
Depending on environment and goals, decisions have to be made regarding the components that will make up the final website. Some elements may already be in place (such as an identity server) and some elements may still be free to choose. This section aims at helping taking the right decisions.
</para>
- <section id="sid-7372876_GDG-Architecturalchoices-Identityserver">
+ <section id="Identity_Server">
<title>Identity server</title>
<para>
JBoss Portal Platform &VY; comes with a component named PicketLink IDM, which is made to adapt to store and retrieve users and groups from various identity servers. We can separate the different options into three:
@@ -34,7 +34,7 @@
For more information about PicketLink IDM, please check the JBoss Portal Platform &VY; reference guide and the PicketLink IDM documentation.
</para>
</section>
- <section id="sid-7372876_GDG-Architecturalchoices-Storage">
+ <section id="Storage">
<title>Storage</title>
<para>
The portal framework stores page compositions, portlet preferences, gadget code in a database through a Java Content Repository (JCR) API. A set of database servers and JDBC connectors are part of our quality assurance cycles and the certified environments are mentioned <ulink url="http://www.jboss.com/products/platforms/portals/testedconfigurations/">here</ulink> .
@@ -52,7 +52,7 @@
As said earlier, content is stored through a JCR API, RDBMS aren't a great fit to store large files and it is possible to configure eXo JCR to store such files in the filesystem instead of a database, whereas metadata about the files would still be stored in the database. Note that if the website is running on a cluster, the filesystem will need to be accessible from all the nodes and a NFS solution needs to be set up. For more details see the notion of "value storage" in the reference guide.
</para>
</section>
- <section id="sid-7372876_GDG-Architecturalchoices-Cluster">
+ <section id="Cluster">
<title>Cluster</title>
<para>
Clustering for failover or load-balancing requirements requires spending more time configuring it for your environment, we made it easy to handle common situations though. There is a cost associated with clustering (JBoss Portal Platform &VY; has some optimizations when running on a single node), but the product is designed to linearly scale up so that the same performance is added every time a new node is added. All critical parts are kept in sync among nodes and the less critical ones are left aside to achieve better performance. It will be equally critical that applications developed for the final websites pay the same attention when it comes to replicating data across a cluster of nodes.
@@ -64,12 +64,12 @@
It is usually recommended to run a cluster to achieve high availability.
</para>
</section>
- <section id="sid-7372876_GDG-Architecturalchoices-SSO">
+ <section id="SSO">
<title>SSO</title>
<para>
- If a website is a part of a more global infrastructure with various components (the website being one of several), it may be in the benefit of users to use a Single-Sign-On solution. Various SSO solutions are supported by JBoss Portal Platform &VY; as seen <ulink url="http://www.jboss.com/products/platforms/portals/testedconfigurations/">here</ulink> . In some cases it can be better to have the token manager service on a specific server.
+ If a website is a part of a more global infrastructure with various components (the website being one of several), it may be in the benefit of users to use a Single-Sign-On solution. Various SSO solutions are supported by JBoss Portal Platform &VY;, documented on the <ulink url="http://www.jboss.com/products/platforms/portals/testedconfigurations/">Supported Configurations</ulink> page. In some cases it can be better to have the token manager service on a specific server.
</para>
- <section id="sid-7372876_GDG-Architecturalchoices-Summary">
+ <section id="Summary">
<title>Summary</title>
<para>
By now you should know what infrastructure you will need:
@@ -104,23 +104,29 @@
<para>
Here is an example of the simplest set-up:
</para>
- <figure>
- <title>Example</title>
+ <figure id="fig-Simple_SSO_Setup">
+ <title>Simple SSO Example</title>
<mediaobject>
<imageobject role="html">
<imagedata align="center" scale="100" fileref="images/7372876/simpleinfra.png" format="PNG"/>
</imageobject>
+ <textobject>
+ <para>Simple SSO Setup, featuring users connecting to a single JPP Node with a shared folder and a Database server.</para>
+ </textobject>
</mediaobject>
</figure>
<para>
Here is an example of a more complex set-up:
</para>
- <figure>
- <title>Example</title>
+ <figure id="fig-Multi-node_SSO_Example">
+ <title>Multi-node SSO Example</title>
<mediaobject>
<imageobject role="html">
<imagedata align="center" scale="100" fileref="images/7372876/complexinfra.png" format="PNG"/>
</imageobject>
+ <textobject>
+ <para>Multi-node cluster consisting of three nodes, a primary database, LDAP server, SSO ticket server, load balancer, with NFS share connecting the three nodes.</para>
+ </textobject>
</mediaobject>
</figure>
</section>
Modified: epp/docs/branches/6.0/Developer_Guide/en-US/chapter-3-GDG_Design_choices.xml
===================================================================
--- epp/docs/branches/6.0/Developer_Guide/en-US/chapter-3-GDG_Design_choices.xml 2013-02-04 23:48:13 UTC (rev 9115)
+++ epp/docs/branches/6.0/Developer_Guide/en-US/chapter-3-GDG_Design_choices.xml 2013-02-05 00:23:30 UTC (rev 9116)
@@ -1,11 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
-<chapter id="sid-7372952">
- <title>Design choices</title>
+<chapter id="Design_Choices">
+ <title>Design Choices</title>
<para>
Now that the main components of the architecture have been decided, choices must be made on the overall design.
</para>
- <section id="sid-7372952_GDG-Designchoices-Dashboards">
+ <section id="Dashboards">
<title>Dashboards</title>
<para>
User dashboards may be very costly in a website. Each user has an opportunity to design his own personal website, it comes with the cost of storing all that information. Efforts have been made (and are still being made) to reduce this cost, but there will always be an overhead.
@@ -26,8 +26,8 @@
</listitem>
</itemizedlist>
</section>
- <section id="sid-7372952_GDG-Designchoices-JCRindexreplicationforclusterset-up">
- <title>JCR index replication for cluster set-up</title>
+ <section id="JCR_Index_Replication_for_Cluster_Set-up">
+ <title>JCR Index Replication for Cluster Set-up</title>
<para>
The JCR implementation uses Apache Lucene for indexing the data. The indexes are used to search for content (It can be page nodes or WCM content for instance).
</para>
@@ -72,22 +72,25 @@
<para>
But there are choices to be made. The JCR implementation used by JBoss Portal Platform (eXo JCR) makes it possible to configure the storage and retrieval of indexes according to architect's choice on where it is acceptable to relax some constraints. For configuration details please refer to the JBoss Portal Platform Reference Guide.
</para>
- <section id="sid-7372952_GDG-Designchoices-Standaloneindex">
- <title>Standalone index</title>
+ <section id="Standalone_Index">
+ <title>Standalone Index</title>
<para>
This is only for a non-cluster environment, this is obviously the easiest set-up, with a combination of in-memory and file based indexes. There is no replication involved so any entry can be found by a search as soon as it is created.
</para>
- <figure>
- <title>Example</title>
+ <figure id="fig-Standalone_Index">
+ <title>Standalone Index</title>
<mediaobject>
<imageobject role="html">
<imagedata align="center" scale="100" fileref="images/7372952/diagram-standalone-index.png" format="PNG"/>
</imageobject>
+ <textobject>
+ <para>Diagram explaining the basic premise of a Standalone Index.</para>
+ </textobject>
</mediaobject>
</figure>
</section>
- <section id="sid-7372952_GDG-Designchoices-Localindex">
- <title>Local index</title>
+ <section id="Local_Index">
+ <title>Local Index</title>
<para>
This environment is easy to set up, each node keeps a local copy of the full indexes so that when a search is requested on a node, there is no network communication required. The downside is that when a node indexes an item, it is required to replicate that index on each and every node. If a node is unavailable at that time, it may miss an index update request and then the different nodes may be inconsistent.
</para>
@@ -95,19 +98,22 @@
Also when a node is added, it has to recreate it's own full index.
</para>
<para>
- An alternative to this set-up is to ask a node to retrieve the info from a coordinator on each search, which makes the startup of the new node faster, but impacts its performance during the runtime. This set-up is new to JBoss Portal Platform &VY;.
+ An alternative to this set-up is to ask a node to retrieve the info from a coordinator on each search, which makes the startup of the new node faster, but impacts its performance during the runtime.
</para>
- <figure>
- <title>Example</title>
+ <figure id="fig-Local_Index">
+ <title>Local Index</title>
<mediaobject>
<imageobject role="html">
<imagedata align="center" scale="100" fileref="images/7372952/diagram-local-index.png" format="PNG"/>
</imageobject>
+ <textobject>
+ <para>Diagram explaining JCR volatile indexes across multiple indexes.</para>
+ </textobject>
</mediaobject>
</figure>
</section>
- <section id="sid-7372952_GDG-Designchoices-Sharedindex">
- <title>Shared index</title>
+ <section id="Shared_Index">
+ <title>Shared Index</title>
<para>
In this set-up there is a unique index created and shared among all the nodes. It is required to configure the infrastructure so that a network file system is installed where all nodes can read content.
</para>
@@ -117,7 +123,7 @@
<itemizedlist>
<listitem>
<para>
- Consistency, all the nodes see the same data
+ Consistency: all the nodes see the same data.
</para>
</listitem>
</itemizedlist>
@@ -127,21 +133,22 @@
<itemizedlist>
<listitem>
<para>
- Requires a highly available NFS set-up (NFS 3 is recommended)
- </para>
+ Requires a highly available NFS set-up (NFS 3 is recommended). </para>
</listitem>
<listitem>
<para>
- More network communication
- </para>
+ More network communication. </para>
</listitem>
</itemizedlist>
- <figure>
- <title>Example</title>
+ <figure id="fig-Shared_Index">
+ <title>Shared Index</title>
<mediaobject>
<imageobject role="html">
<imagedata align="center" scale="100" fileref="images/7372952/diagram-shared-index.png" format="PNG"/>
</imageobject>
+ <textobject>
+ <para>Diagram explaining the shared index across all JCR instances.</para>
+ </textobject>
</mediaobject>
</figure>
</section>
Modified: epp/docs/branches/6.0/Developer_Guide/en-US/chapter-4-GDG_Portal_Development.xml
===================================================================
--- epp/docs/branches/6.0/Developer_Guide/en-US/chapter-4-GDG_Portal_Development.xml 2013-02-04 23:48:13 UTC (rev 9115)
+++ epp/docs/branches/6.0/Developer_Guide/en-US/chapter-4-GDG_Portal_Development.xml 2013-02-05 00:23:30 UTC (rev 9116)
@@ -1,9 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
-<chapter id="sid-8094155">
+<chapter id="Portal_Development">
<title>Portal Development</title>
- <section id="sid-7372962">
- <title>Portal containers</title>
+ <section id="Portal_Containers">
+ <title>Portal Containers</title>
<para>
In a single instance (or cluster) of JBoss Portal Platform, multiple portals can be running and share resources with other portals with two levels of granularity:
</para>
@@ -31,55 +31,51 @@
<para>
The procedure for creating portal containers and extending existing portal containers is similar: create an enterprise archive (EAR) containing configuration details, runnable code and static resources.
</para>
- <figure>
- <title>Example</title>
- <mediaobject>
- <imageobject role="html">
- <imagedata align="center" scale="100" fileref="images/portalextensionstructure.png" format="PNG"/>
- </imageobject>
- </mediaobject>
- </figure>
- <section id="Portal_Extension">
- <title>Portal Extension</title>
- <remark>Source taken from: https://docs.jboss.org/author/display/GTNPORTAL35/Portal+Extension</remark>
- <para>When extending an existing Portal Container, the name of the portal in the Extension configuration is the same as the name of the existing Portal Container. The configuration (and other aspects) of the existing Portal Container can therefore be shadowed by the Extension. Using this approach, many aspects of an available Portal Container can be customized, such as (but not limited to) the following topics described in the indicated sections:</para>
- <itemizedlist>
- <listitem>
- <para>
+ </section>
+ <section id="Portal_Extension">
+ <title>Portal Extension</title>
+ <remark>Source taken from: https://docs.jboss.org/author/display/GTNPORTAL35/Portal+Extension</remark>
+ <para>When extending an existing Portal Container, the name of the portal in the Extension configuration is the same as the name of the existing Portal Container. The configuration (and other aspects) of the existing Portal Container can therefore be shadowed by the Extension. Using this approach, many aspects of an available Portal Container can be customized, such as (but not limited to) the following topics described in the indicated sections:</para>
+ <itemizedlist>
+ <listitem>
+ <para>
<xref linkend="Custom_Groovy_Template_For_Portlet"/>
</para>
- </listitem>
- <listitem>
- <para>
+ </listitem>
+ <listitem>
+ <para>
<xref linkend="Custom_Skin_For_Portlet"/>
</para>
- </listitem>
- <listitem>
- <para><xref linkend="CSS_and_Images"/></para>
- </listitem>
- <listitem>
- <para>
+ </listitem>
+ <listitem>
+ <para><xref linkend="CSS_and_Images"/></para>
+ </listitem>
+ <listitem>
+ <para>
<xref linkend="Custom_Navigation_And_Pages"/>
</para>
- </listitem>
- <listitem>
- <para>
+ </listitem>
+ <listitem>
+ <para>
<xref linkend="Internationalization_Navigation_Nodes"/>
</para>
- </listitem>
- </itemizedlist>
- <section id="How_The_Shadowing_Mechanism_Works">
- <title>How the Shadowing Mechanism Works</title>
- <para>A schematic representation of the shadowing mechanism can be seem in <xref linkend="fig-Shadowing_Mechanism"/>.</para>
- <figure id="fig-Shadowing_Mechanism">
- <title>Shadowing Mechanism</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/portalextensionstructure.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>
+ </listitem>
+ </itemizedlist>
+ <section id="How_The_Shadowing_Mechanism_Works">
+ <title>How the Shadowing Mechanism Works</title>
+ <para>A schematic representation of the shadowing mechanism can be seem in <xref linkend="fig-Shadowing_Mechanism"/>.</para>
+ <figure id="fig-Shadowing_Mechanism">
+ <title>Shadowing Mechanism</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/portalextensionstructure.png"/>
+ </imageobject>
+ <textobject>
+ <para>Diagram explaining how shadowing works, linking portal.war to my-extension.war inside the customized extension, and linking the main gatein/configuration.xml file with the conf/configuration.xml file in the customized extension.</para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <para>
The Extension EAR's <code>conf/configuration.xml</code> file plays a crucial role in shadowing. Consider the following code extract present in the
<ulink url="https://github.com/gatein/gatein-portal-quickstart/tree/master/gatein-portal-extension">Portal Extension Quickstart</ulink>
. In this code extract, the
@@ -90,9 +86,9 @@
<code>"portal"</code>
. Because a portal container called "portal" already exists in the default JBoss Portal Platform 6 installation, the container name is redefined in this file:
</para>
- <example>
- <title>configuration.xml</title>
- <programlisting language="XML"><configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <example>
+ <title>configuration.xml</title>
+ <programlisting language="XML"><configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd" xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
<external-component-plugins>
<!-- The full qualified name of the PortalContainerConfig -->
@@ -173,67 +169,67 @@
</component-plugin>
</external-component-plugins>
</configuration></programlisting>
- </example>
- <para>Other resources available in an existing Portal Container can be customized in a similar way. Please refer to the following sections for more details.</para>
- </section>
- <section id="Custom_Groovy_Template_For_Portlet">
- <title>Custom Groovy Template for a Portlet</title>
- <remark>Source: https://docs.jboss.org/author/display/GTNPORTAL35/Custom+Groovy+Template+for+a+Portlet</remark>
- <para>
+ </example>
+ <para>Other resources available in an existing Portal Container can be customized in a similar way. Please refer to the following sections for more details.</para>
+ </section>
+ <section id="Custom_Groovy_Template_For_Portlet">
+ <title>Custom Groovy Template for a Portlet</title>
+ <remark>Source: https://docs.jboss.org/author/display/GTNPORTAL35/Custom+Groovy+Template+for+a+Portlet</remark>
+ <para>
After having set up the
<code>conf/configuration.xml</code>
file as described in
<xref linkend="How_The_Shadowing_Mechanism_Works"/> you can proceed with customizing the Groovy templates of portlets.
</para>
- <para>Shadowing of built-in Groovy templates is controlled by the order of
+ <para>Shadowing of built-in Groovy templates is controlled by the order of
<code><dependencies></code>
in the configuration of the Portal Container (or Extension) as described in <xref linkend="How_The_Shadowing_Mechanism_Works"/>. </para>
- <para>If a template with the same path (for example,
+ <para>If a template with the same path (for example,
<filename>/dir/subdir/template.gtmpl</filename>) is available in more than one of the dependencies, the template from the context closest to the end of the list of dependencies is chosen. To ensure that the template created in <xref linkend="proc-Customizing_HomePagePortlet"/> is chosen,
<code>gatein-portal-extension</code>
is added as the last element in the list.
</para>
- <note>
- <para> This section mentions code directly available from the Portal Extension Example in the
+ <note>
+ <para> This section mentions code directly available from the Portal Extension Example in the
JBoss Portal Platform Quickstarts
collection.
</para>
- </note>
- <procedure id="proc-Customizing_HomePagePortlet">
- <title>Customizing HomePagePortlet</title>
- <para>Complete this procedure to change the text and layout used in the default HomePagePortlet shipped with the platform in a custom Extension. </para>
- <step>
- <para>Copy <filename><replaceable>JPP_HOME</replaceable>/gatein/gatein.ear/portal.war/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</filename> </para>
- </step>
- <step>
- <para>Paste the file into the <filename>war/src/main/webapp/templates/groovy/webui/component/</filename> folder of the Extension EAR. </para>
- <important>
- <para>The file location in the custom extension must mirror the original location of the file for shadowing to work correctly.</para>
- </important>
- </step>
- <step>
- <para>Make the desired changes to the text and layout of the HomePagePortlet in the custom extension.</para>
- </step>
- <step>
- <para>Deploy the extension EAR to the portal platform. The HomePagePortlet mirrors the changes made in the custom extension.</para>
- </step>
- </procedure>
- </section>
- <section id="Custom_Skin_For_Portlet">
- <title>Custom Skin for a Portlet</title>
- <remark>Source: https://docs.jboss.org/author/display/GTNPORTAL35/Custom+Skin+for+a+Portlet</remark>
- <para>
+ </note>
+ <procedure id="proc-Customizing_HomePagePortlet">
+ <title>Customizing HomePagePortlet</title>
+ <para>Complete this procedure to change the text and layout used in the default HomePagePortlet shipped with the platform in a custom Extension. </para>
+ <step>
+ <para>Copy <filename><replaceable>JPP_HOME</replaceable>/gatein/gatein.ear/portal.war/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</filename> </para>
+ </step>
+ <step>
+ <para>Paste the file into the <filename>war/src/main/webapp/templates/groovy/webui/component/</filename> folder of the Extension EAR. </para>
+ <important>
+ <para>The file location in the custom extension must mirror the original location of the file for shadowing to work correctly.</para>
+ </important>
+ </step>
+ <step>
+ <para>Make the desired changes to the text and layout of the HomePagePortlet in the custom extension.</para>
+ </step>
+ <step>
+ <para>Deploy the extension EAR to the portal platform. The HomePagePortlet mirrors the changes made in the custom extension.</para>
+ </step>
+ </procedure>
+ </section>
+ <section id="Custom_Skin_For_Portlet">
+ <title>Custom Skin for a Portlet</title>
+ <remark>Source: https://docs.jboss.org/author/display/GTNPORTAL35/Custom+Skin+for+a+Portlet</remark>
+ <para>
This section mentions code from the Portal Extension Examples available for download from <ulink url="https://access.redhat.com/"/> as part of your JBoss Portal Platform subscription.
</para>
- <para>The same guidelines that apply when creating a new portlet skin also apply when creating a custom skin for a built-in portlet distributed with JBoss Portal Platform. </para>
- <para>Declare the skin first in the
+ <para>The same guidelines that apply when creating a new portlet skin also apply when creating a custom skin for a built-in portlet distributed with JBoss Portal Platform. </para>
+ <para>Declare the skin first in the
<code>gatein-resources.xml</code>
file, and then create the CSS and other supporting files such as backgrounds.
</para>
- <para>Shadowing of built-in Groovy templates is controlled by the order of
+ <para>Shadowing of built-in Groovy templates is controlled by the order of
<code><dependencies></code>
in the configuration of the Portal Container (or Extension) as described in <xref linkend="How_The_Shadowing_Mechanism_Works"/>. </para>
- <para>When the
+ <para>When the
<code>HomePagePortlet</code>
skin defined in
<code>web.war</code>
@@ -242,16 +238,16 @@
<code>gatein-portal-extension</code>
is added as the last element in the list.
</para>
- <section id="gatein-resources-xml">
- <title>gatein-resources.xml</title>
- <para> <code>gatein-resources.xml</code>
+ <section id="gatein-resources-xml">
+ <title>gatein-resources.xml</title>
+ <para> <code>gatein-resources.xml</code>
is located in the
<filename>war/src/main/webapp/WEB-INF</filename>
sub-folder of the Portal Extension Quickstart project.
</para>
- <example>
- <title>gatein-resources.xml</title>
- <programlisting language="XML">
+ <example>
+ <title>gatein-resources.xml</title>
+ <programlisting language="XML">
<gatein-resources xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_resources_1_3 http://www.gatein.org/xml/ns/gatein_resources_1_3"
xmlns="http://www.gatein.org/xml/ns/gatein_resources_1_3">
@@ -269,11 +265,11 @@
<skin-name>Default</skin-name>
<css-path>/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css</css-path>
</portlet-skin></programlisting>
- </example>
- </section>
- <section id="CSS_and_Images">
- <title>CSS and Images</title>
- <para>
+ </example>
+ </section>
+ <section id="CSS_and_Images">
+ <title>CSS and Images</title>
+ <para>
In the
<code>gatein-resources.xml</code> file in <xref linkend="gatein-resources-xml"/>, the custom skin is set to use the CSS file
<filename>/templates/skin/webui/component/UIHomePagePortlet/DefaultStylesheet.css</filename>
@@ -283,77 +279,77 @@
In the CSS file itself, image files use relative paths as demonstrated in <xref linkend="exam-DefaultStylesheetCss"/>:
</para>
- <example id="exam-DefaultStylesheetCss">
- <title>DefaultStylesheet.css</title>
- <programlisting>.UIHomePagePortlet .TRContainer .DotLine {
+ <example id="exam-DefaultStylesheetCss">
+ <title>DefaultStylesheet.css</title>
+ <programlisting>.UIHomePagePortlet .TRContainer .DotLine {
background: url("DefaultSkin/background/Line.gif") no-repeat -2px top;
height: 1px;
width: 182px;
margin: 7px auto;
}</programlisting>
- </example>
- <note>
- <para>For further information about creating portlets skins, refer to<citetitle> Skinning the Portal</citetitle> in the JBoss Portal Platform <citetitle>Reference Guide</citetitle>.</para>
- </note>
- </section>
+ </example>
+ <note>
+ <para>For further information about creating portlets skins, refer to<citetitle> Skinning the Portal</citetitle> in the JBoss Portal Platform <citetitle>Reference Guide</citetitle>.</para>
+ </note>
</section>
- <section id="Custom_Navigation_And_Pages">
- <title>Custom Navigation and Pages</title>
- <remark>Source: https://docs.jboss.org/author/display/GTNPORTAL35/Custom+Navigation+and+Pages</remark>
- <para>
+ </section>
+ <section id="Custom_Navigation_And_Pages">
+ <title>Custom Navigation and Pages</title>
+ <remark>Source: https://docs.jboss.org/author/display/GTNPORTAL35/Custom+Navigation+and+Pages</remark>
+ <para>
This section mentions code from the Portal Extension Examples available for download from <ulink url="https://access.redhat.com/"/> as part of your JBoss Portal Platform subscription.
</para>
- <section id="portal-configuration-xml">
- <title>portal-configuration.xml</title>
- <para>This configuration file is located in
+ <section id="portal-configuration-xml">
+ <title>portal-configuration.xml</title>
+ <para>This configuration file is located in
<filename>war/src/main/webapp/WEB-INF/conf/sample-ext/portal</filename>
directory of the Portal Extension quickstart. It is the starting point for navigation customization. Generally, there is no need to change any configuration in this file, although it is useful to know of it's location.</para>
- <para>For more information about <filename>portal-configuration.xml</filename>, refer to the "Portal Navigation Configuration" section in the JBoss Portal Platform <citetitle>Reference Guide</citetitle>.
+ <para>For more information about <filename>portal-configuration.xml</filename>, refer to the "Portal Navigation Configuration" section in the JBoss Portal Platform <citetitle>Reference Guide</citetitle>.
</para>
- </section>
</section>
- <section id="Three_Kinds_Of_Navigation">
- <title>Navigation Node Types</title>
- <para>There are three types of navigation nodes, as described in <xref linkend="fig-Types_of_Navigation_Nodes"/> :</para>
- <figure id="fig-Types_of_Navigation_Nodes">
- <title>Types of Navigation Nodes</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/Kinds+of+Navigation.png"/>
- </imageobject>
- <textobject>
- <para>The JBoss Portal Platform home screen, with the Home tab, Group menu, and Dashboard menu called-out.</para>
- </textobject>
- </mediaobject>
- </figure>
- <variablelist>
- <varlistentry>
- <term>1 (Site)</term>
- <listitem>
- <para>Navigation nodes of the current site.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>2 (User Group)</term>
- <listitem>
- <para>Navigation nodes of <emphasis>user groups</emphasis> which the current user is a member.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>3 (User)</term>
- <listitem>
- <para>Navigation nodes of the current user.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- <example id="exam-Adding_Navigation_Node_Site">
- <title>Adding a Navigation Node to a Site Navigation</title>
- <para>The file
+ </section>
+ <section id="Three_Kinds_Of_Navigation">
+ <title>Navigation Node Types</title>
+ <para>There are three types of navigation nodes, as described in <xref linkend="fig-Types_of_Navigation_Nodes"/> :</para>
+ <figure id="fig-Types_of_Navigation_Nodes">
+ <title>Types of Navigation Nodes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/Kinds+of+Navigation.png"/>
+ </imageobject>
+ <textobject>
+ <para>The JBoss Portal Platform home screen, with the Home tab, Group menu, and Dashboard menu called-out.</para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ <variablelist>
+ <varlistentry>
+ <term>1 (Site)</term>
+ <listitem>
+ <para>Navigation nodes of the current site.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>2 (User Group)</term>
+ <listitem>
+ <para>Navigation nodes of <emphasis>user groups</emphasis> which the current user is a member.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>3 (User)</term>
+ <listitem>
+ <para>Navigation nodes of the current user.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <example id="exam-Adding_Navigation_Node_Site">
+ <title>Adding a Navigation Node to a Site Navigation</title>
+ <para>The file
<code>war/src/main/webapp/WEB-INF/conf/sample-ext/portal/portal/classic/navigation.xml</code>
contains the
<emphasis role="italics">classic</emphasis> site navigation which can be modified.
</para>
- <programlisting language="XML"><node-navigation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <programlisting language="XML"><node-navigation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_3 http://www.gatein.org/xml/ns/gatein_objects_1_3" xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_3">
<!-- Priority has no significance in site navigations. But it is required. See GTNPORTAL-2751 -->
<priority>1</priority>
@@ -375,19 +371,19 @@
</node>
</page-nodes>
</node-navigation></programlisting>
- <para>By appending the
+ <para>By appending the
<code>page-just-added</code>
navigation node into the portal navigation, the new site navigation node is now visible in the navigation bar.
</para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/navigation-bar.png"/>
- </imageobject>
- <textobject>
- <para>Navigation menu, with Page Just Added now visible as a site navigation option.</para>
- </textobject>
- </mediaobject>
- <para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/navigation-bar.png"/>
+ </imageobject>
+ <textobject>
+ <para>Navigation menu, with Page Just Added now visible as a site navigation option.</para>
+ </textobject>
+ </mediaobject>
+ <para>
The
<code>page-just-added</code>
navigation node refers to
@@ -397,7 +393,7 @@
file located in the same directory as the
<code>navigation.xml</code> file.
</para>
- <programlisting language="XML"><page-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_3 http://www.gatein.org/xml/ns/gatein_objects_1_3"
+ <programlisting language="XML"><page-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_3 http://www.gatein.org/xml/ns/gatein_objects_1_3"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_3">
<page>
<name>justAddedPage</name>
@@ -418,7 +414,7 @@
</portlet-application>
</page>
</page-set></programlisting>
- <para>
+ <para>
Note that
<code>page-just-added</code>
navigation node and the related pages are visible to all portal visitors (signed in or anonymous) due to
@@ -427,10 +423,10 @@
<code>Everyone</code>
in the above file.
</para>
- </example>
- <example id="exam-Adding_Navigation_Node_Group">
- <title>Adding a Navigation Node to a Group Navigation</title>
- <para>
+ </example>
+ <example id="exam-Adding_Navigation_Node_Group">
+ <title>Adding a Navigation Node to a Group Navigation</title>
+ <para>
To add a new navigation node visible to the members of
<code>/platform/administrators</code>
group, create a <code>navigation.xml</code>
@@ -439,7 +435,7 @@
. The name of the user group
<code>/platform/administrators</code> forms part of the path.
</para>
- <programlisting><node-navigation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <programlisting language="XML"><node-navigation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_3 http://www.gatein.org/xml/ns/gatein_objects_1_3" xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_3">
<!-- Priority is currently ignored for importMode merge. But it is required. See GTNPORTAL-2751 -->
<priority>1</priority>
@@ -456,7 +452,7 @@
</node>
</page-nodes>
</node-navigation></programlisting>
- <para>
+ <para>
The navigation node
<code>admins-sitemap</code>
refers to
@@ -465,7 +461,7 @@
<code>pages.xml</code>
file:
</para>
- <programlisting> xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_3">
+ <programlisting language="XML"> xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_3">
<!--
adminsSitemap page contains just SiteMapPortlet. There is nothing special about it.
It is here just to demonstrate the adding of nodes to group navigation in the sibling
@@ -487,10 +483,10 @@
</portlet-application>
</page>
</page-set></programlisting>
- </example>
- <example id="exam-Adding_Navigation_Node_User">
- <title>Adding a Navigation Node to a User Navigation</title>
- <para>
+ </example>
+ <example id="exam-Adding_Navigation_Node_User">
+ <title>Adding a Navigation Node to a User Navigation</title>
+ <para>
To add a new navigation node visible to a particular user, say
<code>root</code>
we need to create a
@@ -501,7 +497,7 @@
<code>root</code>
is a part of the path.
</para>
- <programlisting><node-navigation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <programlisting language="XML"><node-navigation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_3 http://www.gatein.org/xml/ns/gatein_objects_1_3" xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_3">
<!-- Priority has no significance in user navigations. But it is required. See GTNPORTAL-2751 -->
<priority>1</priority>
@@ -514,7 +510,7 @@
</node>
</page-nodes>
</node-navigation></programlisting>
- <para>
+ <para>
The navigation node
<code>roots-extra-dashboard</code>
refers to
@@ -523,7 +519,7 @@
<code>pages.xml</code>
file:
</para>
- <programlisting><page-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_3 http://www.gatein.org/xml/ns/gatein_objects_1_3"
+ <programlisting language="XML"><page-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_3 http://www.gatein.org/xml/ns/gatein_objects_1_3"
xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_3">
<!--
roots-dashboard page contains just DashboardPortlet. There is nothing special about it.
@@ -546,11 +542,11 @@
</portlet-application>
</page>
</page-set></programlisting>
- </example>
- </section>
- <section id="Internationalization_Navigation_Nodes">
- <title>Internationalization of Navigation Nodes</title>
- <para>
+ </example>
+ </section>
+ <section id="Internationalization_Navigation_Nodes">
+ <title>Internationalization of Navigation Nodes</title>
+ <para>
As you can see in the above
<code>navigation.xml</code>
files the labels of navigation nodes can be internationalized. The files containing translation resources live under
@@ -561,7 +557,7 @@
<code>pages.xml</code>
files:
</para>
- <para>
+ <para>
Note that the navigation resource bundles also need to be named in
<code>init.resources</code>
parameter of
@@ -570,9 +566,9 @@
<code>war/src/main/webapp/WEB-INF/conf/sample-ext/common/common-configuration.xml</code>
:
</para>
- <example>
- <title>common-configuration.xml containing declarations of navigation resource bundles</title>
- <programlisting><configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <example>
+ <title>common-configuration.xml containing declarations of navigation resource bundles</title>
+ <programlisting><configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd http://www.exoplaform.org/xml/ns/kernel_1_2.xsd" xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">
<external-component-plugins>
<!-- The full qualified name of the ResourceBundleService -->
@@ -600,24 +596,24 @@
</values-param>
</init-params>
</component-plugin></programlisting>
- </example>
- </section>
- <section id="Custom_Internationalization_Resource_Bundles">
- <title>Custom Internationalization Resource Bundles</title>
- <remark>Source: https://docs.jboss.org/author/display/GTNPORTAL35/Custom+Internationalization+Resource+Bundles</remark>
- <para>
+ </example>
+ </section>
+ <section id="Custom_Internationalization_Resource_Bundles">
+ <title>Custom Internationalization Resource Bundles</title>
+ <remark>Source: https://docs.jboss.org/author/display/GTNPORTAL35/Custom+Internationalization+Resource+Bundles</remark>
+ <para>
This section mentions code from the Portal Extension Examples available for download from <ulink url="https://access.redhat.com/"/> as part of your JBoss Portal Platform subscription.
</para>
- <para>There are two resource bundle customization scenarios possible with a Portal Extension:</para>
- <itemizedlist>
- <listitem>
- <para>to add new resource bundle items to the ones available in the default JBoss Portal Platform installation.</para>
- </listitem>
- <listitem>
- <para>to assign new values to resource bundle items available in default JBoss Portal Platform installation.</para>
- </listitem>
- </itemizedlist>
- <para>
+ <para>There are two resource bundle customization scenarios possible with a Portal Extension:</para>
+ <itemizedlist>
+ <listitem>
+ <para>to add new resource bundle items to the ones available in the default JBoss Portal Platform installation.</para>
+ </listitem>
+ <listitem>
+ <para>to assign new values to resource bundle items available in default JBoss Portal Platform installation.</para>
+ </listitem>
+ </itemizedlist>
+ <para>
Both scenarios can be demonstrated using the
<code>locale.portal.extension</code>
resource bundle. To use this bundle, include both
@@ -630,9 +626,9 @@
<code>war/src/main/webapp/WEB-INF/conf/sample-ext/common/common-configuration.xml</code>
:
</para>
- <example>
- <title>common-configuration.xml containing declarations of navigation resource bundles</title>
- <programlisting language="XML"><configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ <example>
+ <title>common-configuration.xml containing declarations of navigation resource bundles</title>
+ <programlisting language="XML"><configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd" xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
<external-component-plugins>
<!-- The full qualified name of the ResourceBundleService -->
@@ -669,18 +665,18 @@
</component-plugin>
</external-component-plugins>
</configuration></programlisting>
- </example>
- <para>
+ </example>
+ <para>
The English version of
<code>locale.portal.extension</code> is located in
<filename>war/src/main/webapp/WEB-INF/classes/locale/portal/extension_en.properties</filename>. </para>
- <example>
- <title>English version of locale.portal.extension</title>
- <programlisting>UIHomePagePortlet.Label.Slogan=Congratulations!
+ <example>
+ <title>English version of locale.portal.extension</title>
+ <programlisting>UIHomePagePortlet.Label.Slogan=Congratulations!
UIHomePagePortlet.Label.SubSlogan=You have just installed the GateIn Portal Extension
UIHomePagePortlet.Label.Title=Sign in as:</programlisting>
- </example>
- <para>
+ </example>
+ <para>
<code>UIHomePagePortlet.Label.SubSlogan</code>
is a new key which is not normally available in the default JBoss Portal Platform installation.
@@ -689,41 +685,40 @@
is redefined in
<code>extension_en.properties</code>
shown above. </para>
- <para>In
+ <para>In
<filename>JPP_HOME/gatein/gatein.ear/web.war/WEB-INF/classes/locale/portlet/web/GroovyPortlet_en.properties</filename>
it is already defined as: </para>
- <programlisting>UIHomePagePortlet.Label.Slogan=The Best of eXo and JBoss Portal<div>GateIn #{gatein.version}</div></programlisting>
- <para>Within the Portal Extension, the new value
+ <programlisting>UIHomePagePortlet.Label.Slogan=The Best of eXo and JBoss Portal<div>GateIn #{gatein.version}</div></programlisting>
+ <para>Within the Portal Extension, the new value
<code>Congratulations!</code>
is appended to it.
</para>
- <para>Refer to the <xref linkend="exam-Adding_Navigation_Node_Group"/>
+ <para>Refer to the <xref linkend="exam-Adding_Navigation_Node_Group"/>
for more details on internationalization of navigation nodes.
</para>
- </section>
- <section id="Custom_Sign_In_Page">
- <title>Custom Sign in Page</title>
- <para>When accessing a page that requires privileges, a Sign in page is shown and it can be customized by using an extension. To do so, it would be enough to copy the file located at:</para>
- <example>
- <title>Login JSP</title>
- <programlisting>
+ </section>
+ <section id="Custom_Sign_In_Page">
+ <title>Custom Sign in Page</title>
+ <para>When accessing a page that requires privileges, a Sign in page is shown and it can be customized by using an extension. To do so, it would be enough to copy the file located at:</para>
+ <example>
+ <title>Login JSP</title>
+ <programlisting>
gatein.ear/portal.war/login/jsp/login.jsp
</programlisting>
- </example>
- <para>and include it in a portal extension such as myExtension.ear/myWar.war/login/jsp/login.jsp</para>
- <para>All the logic must be carefully kept in the login page so that the portal will keep working as it should.</para>
- <para>To modify the modal window which pops up when the user decides to sign-in, the extension would have a modified copy of:</para>
- <example>
- <title>Login Form</title>
- <programlisting>
+ </example>
+ <para>and include it in a portal extension such as myExtension.ear/myWar.war/login/jsp/login.jsp</para>
+ <para>All the logic must be carefully kept in the login page so that the portal will keep working as it should.</para>
+ <para>To modify the modal window which pops up when the user decides to sign-in, the extension would have a modified copy of:</para>
+ <example>
+ <title>Login Form</title>
+ <programlisting>
gatein.ear/portal.war/groovy/portal/webui/UILoginForm.gtmpl
</programlisting>
- </example>
- </section>
+ </example>
</section>
</section>
<section id="Visual_Identity">
- <title>Visual identity</title>
+ <title>Visual Identity</title>
<para>
A portal visual identity is made of HTML produced as a result of portal aggregation (the components that make a page like columns and rows combined with the content produced by the portlets) and associated CSS files.
</para>
@@ -731,7 +726,7 @@
JBoss Portal Platform allows to deploy multiple skins consisting of CSS files, which makes it possible to apply styling to the page compositions and components of a page (portlets). Different skins can be applied to the different websites, also if made available to the users, they can choose their preferred skin.
</para>
<section id="Customizing_Login_Page">
- <title>Customizing the login page</title>
+ <title>Customizing the Login Page</title>
<para>
When accessing a page that requires privileges, a login page is shown and it can be customized by using an extension. To do so, it would be enough to copy the file located at:
</para>
Modified: epp/docs/branches/6.0/Developer_Guide/en-US/chapter-5-GDG_Application_development.xml
===================================================================
--- epp/docs/branches/6.0/Developer_Guide/en-US/chapter-5-GDG_Application_development.xml 2013-02-04 23:48:13 UTC (rev 9115)
+++ epp/docs/branches/6.0/Developer_Guide/en-US/chapter-5-GDG_Application_development.xml 2013-02-05 00:23:30 UTC (rev 9116)
@@ -1,10 +1,10 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
-<chapter id="sid-819803">
- <title>Application development</title>
- <section id="sid-819807">
+<chapter id="Application_Development">
+ <title>Application Development</title>
+ <section id="Gadget_Development">
<title>Gadget Development</title>
- <section id="sid-819807_GDG-GadgetDevelopment-Introduction">
+ <section id="Gadget_Development_Introduction">
<title>Introduction</title>
<remark>Source: https://docs.jboss.org/author/display/GTNPORTAL35/GDG-Portlet+Development, incorporated changes up to version 10</remark>
<para>
@@ -14,7 +14,7 @@
Within a portal, it is possible to embed any OpenSocial gadget in a page or in a user's dashboard. Gadgets can be added to the application registry and links can be added to the mini-composer (see the JBoss Portal Platform <citetitle>User Guide</citetitle>).
</para>
</section>
- <section id="sid-819807_GDG-GadgetDevelopment-DevelopingGadgets">
+ <section id="Developing_Gadgets">
<title>Developing Gadgets</title>
<para>
OpenSocial gadgets are made of standard HTML and JavaScript. The container offers an API, the documentation for which is available at <ulink url="http://opensocial-resources.googlecode.com/svn/spec/1.0/Core-Gadget.xml">http://opensocial-resources.googlecode.com/svn/spec/1.0/Core-Gadget.xml</ulink>.
@@ -27,26 +27,26 @@
</para>
</section>
</section>
- <section id="sid-819805">
+ <section id="Portlet_Development">
<title>Portlet Development</title>
<para>
JBoss Portal Platform's interface is fully customizable with applications called portlets. Application development can be done by using the plain Portlet specification JSR286 (refer to the "Portlet Primer" chapter in the JBoss Portal Platform <citetitle>Reference Guide</citetitle> for more information), but it is also possible to use the JBoss Portlet Bridge to write applications with JavaServerFaces (JSF), RichFaces or Seam (refer to the "Getting started with JBoss Portlet Bridge" chapter of the JBoss Portal Platform <citetitle>Reference Guide)</citetitle>.
</para>
<para>
- Whichever technology you choose, refer to <link linkend="sid-55378991">Starting a Portlet Project</link> to learn how to set up your project in a robust and effective way using the JBoss Portal Platform Bill of Materials (BOM).
+ Whichever technology you choose, refer to <xref linkend="Starting_a_Portlet_Project"/> to learn how to set up your project in a robust and effective way using the JBoss Portal Platform Bill of Materials (BOM).
</para>
- <section id="sid-55378991">
+ <section id="Starting_a_Portlet_Project">
<title>Starting a Portlet Project</title>
- <section id="sid-55378991_StartingaPortletProject-TheBOMConcept">
- <title>The BOM Concept</title>
+ <section id="The_Bill_Of_Materials_Concept">
+ <title>The Bill of Materials (BOM) Concept</title>
<para>
- To make the management of dependencies easier, JBoss Portal Platform Team has prepared the Bill of Materials (BOM) needed for developing typical portlet applications. BOM is a Maven <code>pom.xml</code> file which specifies the versions, types and scopes of dependencies which are granted to be compatible with (or indeed in many cases provided by) JBoss Portal Platform.
+ To make the management of dependencies easier, the Bill of Materials (BOM) needed for developing typical portlet applications is available. The BOM is a Maven <code>pom.xml</code> file which specifies the versions, types and scopes of dependencies which are granted to be compatible with (or indeed in many cases provided by) JBoss Portal Platform.
</para>
</section>
- <section id="sid-55378991_StartingaPortletProject-HowtoUseBOM">
- <title>How to Use JBoss Portal Platform BOM</title>
+ <section id="Using_the_BOM">
+ <title>Using the BOM</title>
<para>
- Let us look at the <code>pom.xml</code> file from Simplest Hello World Portket example below, which contains all necessary details.
+ Let us look at the <code>pom.xml</code> file from Simplest Hello World Portlet example below, which contains all necessary details.
</para>
<para>
In its <code><dependencyManagement></code> section, it declares
@@ -55,7 +55,7 @@
with
<code><scope></code>
<code>import</code>
- . It indicates that the dependency will <emphasis role="italics">de facto</emphasis> be replaced with the dependencies in its <code>dependencyManagement</code> section. Due to this fact, in the <code><dependencies></code> section of the Simplest Hello World <code>pom.xml</code>, we can declare the <code>javax.portlet:portlet-api</code> dependency without specifying its <code><version></code>, <code><type></code> or <code><scope></code>. All those details are managed by <code>gatein-3.5-bom</code>.
+ . It indicates that the dependency will <emphasis>de facto</emphasis> be replaced with the dependencies in its <code>dependencyManagement</code> section. Due to this fact, in the <code><dependencies></code> section of the Simplest Hello World <code>pom.xml</code>, we can declare the <code>javax.portlet:portlet-api</code> dependency without specifying its <code><version></code>, <code><type></code> or <code><scope></code>. All those details are managed by <code>gatein-3.5-bom</code>.
</para>
<example>
<title>Simplest Hello World Portlet</title>
@@ -151,10 +151,14 @@
</para>
</section>
</section>
- <section id="sid-55477012">
+ <section id="Standard_Portlet_Development_JSR286">
<title>Standard Portlet Development (JSR286)</title>
- <section id="sid-55477012_StandardPortletDevelopmentJSR286-TheJavaPart">
- <title>The Java Part</title>
+ <note>
+ <para>For an introduction to Portlet development, refer to the "Portlet Primer" section in the JBoss Portal Platform 6 <citetitle>Reference Guide</citetitle>.</para>
+ <para>JSR 286 information is available from the <ulink url="http://jcp.org/en/jsr/detail?id=286">Java Community Process Program</ulink> website.</para>
+ </note>
+ <section id="Java_Configuration">
+ <title>Java Configuration</title>
<para>
After setting up the the Maven <code>pom.xml</code> file as shown in the previous section, we can continue with implementing a basic JSR286 compatible portlet. An example of such a portlet is contained in the JBoss Portal Platform Quickstart "Simplest Hello World Portlet"
</para>
@@ -213,7 +217,7 @@
In this simplest portlet variant, EDIT and HELP portlet modes are not supported. To add them, override the <code>doEdit()</code> and <code>doHelp</code> from <code>javax.portlet.GenericPortlet</code> and configure the <code>portlet.xml</code> file accordingly.
</para>
</section>
- <section id="sid-55477012_StandardPortletDevelopmentJSR286-portlet.xml">
+ <section id="portlet.xml">
<title>portlet.xml</title>
<para>
The
@@ -246,7 +250,7 @@
</programlisting>
</example>
</section>
- <section id="sid-55477012_StandardPortletDevelopmentJSR286-web.xml">
+ <section id="web.xml">
<title>web.xml</title>
<para>
There is no need to configure filters, servlets or mapping for a plain JSR286 portlet to work but maven-war-plugin by default requires the
@@ -266,8 +270,8 @@
</programlisting>
</example>
</section>
- <section id="sid-55477012_StandardPortletDevelopmentJSR286-FurtherSteps">
- <title>Further Steps</title>
+ <section id="Build_and_Deploy">
+ <title>Build and Deploy</title>
<para>
After having done all the above, it is time to
<link linkend="sid-55379158">build and deploy the portlet</link>
@@ -278,772 +282,26 @@
so that you can test its functionality.
</para>
</section>
- <section id="sid-55477012_StandardPortletDevelopmentJSR286-Seealso">
- <title>See also</title>
- <itemizedlist>
- <listitem>
- <para>
- <ulink url="https://docs.jboss.org/author/pages/viewpage.action?pageId=54264602">Portlet Primer</ulink>
- </para>
- </listitem>
- <listitem>
- <para>
- <ulink url="http://jcp.org/en/jsr/detail?id=286">JSR286</ulink>
- </para>
- </listitem>
- </itemizedlist>
- </section>
</section>
- <section id="sid-55477014">
+ <section id="JSF2_Portlet_Development">
<title>JSF2 Portlet Development</title>
+ <remark>DOCS NOTE: This section referenced below needs to end up here. I deleted a whole stack of obsolete info for Portlet Bridge from this section, which is why it is so terse. </remark>
<para>
- The Portlet Bridge pre-installed in JBoss Portal Platform allows for implementing portlets with JavaServer Faces (JSF) 2.1 and RichFaces (RF) 4.2.3. As RichFaces is a component library for JavaServer Faces, the guidelines for using both of them are very similar. More precisely, the setup for a JavaServer Faces portlet project is a superset of a RichFaces project setup. In accordance with that, you need to read both
- <xref linkend="sid-55477016"/>
- and
- <xref linkend="sid-55477018"/>
- when developing with RichFaces.
+Detailed information about JSF2 and Portlet Bridge is contained in the JBoss Portal Platform <citetitle>Reference Guide</citetitle>.
</para>
- <section id="sid-55477016">
- <title>Basic JSF Portlet Development</title>
- <para>JSF stands for JavaServer Pages. The JSF version delivered by the built-in Portlet Bridge is 2.1.</para>
- <section id="sid-55477016_BasicJSFPortletDevelopment-ExampleCode">
- <title>Example Code</title>
- <para>
- This section mentions code from the JSF2 Hello World Portlet example in the JBoss Portal Platform Quickstarts, available for download from <ulink url="https://access.redhat.com/"/> as part of your JBoss Portal Platform subscription.
- </para>
- <section id="sid-55477016_BasicJSFPortletDevelopment-pom.xml">
- <title>pom.xml</title>
- <para>
- There is only one noticeable difference in <filename>pom.xml</filename> against what we have shown as a general case in the <link linkend="sid-55378991">Starting a Portlet Project</link> section. The dependencies are different for JSF:
- </para>
- <example>
- <title>pom.xml</title>
- <programlisting language="XML">
- <dependencies>
- <!--
- The versions, scopes and types of these dependencies are managed in gatein-*-bom.
- You need to name only groupId and artifactId here.
- Name only those artifacts you refer to in your code.
- Look at gatein-*-bom POM file for the complete list of available artifacts.
- -->
- <dependency>
- <groupId>org.jboss.spec.javax.faces</groupId>
- <artifactId>jboss-jsf-api_2.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.portletbridge</groupId>
- <artifactId>portletbridge-api</artifactId>
- </dependency>
- </dependencies>
-</programlisting>
- </example>
- </section>
- <section id="sid-55477016_BasicJSFPortletDevelopment-JSFTemplateFiles">
- <title>JSF Template Files</title>
- <para>
- In the following listing you can see the beginning of a typical JSF portlet template. It is taken from
- <code>main.xhtml</code>
- file located in
- <code>src/main/webapp/pages</code>
- directory.
- </para>
- <para>Code Snippet error: Read timed out.</para>
- <para>
- Note that
- <code><f:view></code>
- as a root element of the portlet template above prevents an erroneous
- <code><html></code>
- within
- <code><body></code>
- coming from portal. Moreover, the
- <code><h:head></code>
- and
- <code><h:body></code>
- elements are always needed for JSF Facelets to work.
- </para>
- <para>
- The following listing shows the use of several JSF elements, such as
- <code><h:outputLabel></code>
- ,
- <code><h:inputText></code>
- and
- <code><h:commandButton></code>
- within
- <code><h:form></code>
- .
- </para>
- <para>Code Snippet error: Read timed out.</para>
- <para>
- The complete source code of the above template can be found in
- <code>src/main/webapp/pages/main.xhtml</code>
- of JSF2 Hello World Portlet project.
- </para>
- </section>
- <section id="sid-55477016_BasicJSFPortletDevelopment-JavaBeans">
- <title>Java Beans</title>
- <para>
- In the JSF template file shown above, we refer to
- <code>helloBean</code>
- . This bean is implemented in Java as follows:
- </para>
- <informalexample>
- <programlisting language="Java">
- /**
- * {@link HelloBean} is the JSF backing bean for the application, holding the input data to be re-displayed.
- */
- @ManagedBean(name = "helloBean")
- @SessionScoped
- public class HelloBean implements Serializable {
-
- private static final long serialVersionUID = -6239437588285327644L;
-
- /**
- * Stores the name which will be used to greet the application user.
- */
- private String name;
-
- /**
- * Initializes {@link #name} with the value {@code "World"}.
- */
- @PostConstruct
- public void postContruct() {
- this.name = "World";
- }
-
- /**
- * Returns {@link #name}.
- *
- * @return {@link #name}
- */
- public String getName() {
- return name;
- }
-
- /**
- * Set {@link #name}.
- *
- * @param name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Resets {@link #name} to the default value {@code "World"}.
- *
- * @param ae ignored
- */
- public void reset(ActionEvent ae) {
- this.name = "World";
- }
-
- }
-</programlisting>
- </informalexample>
- <para>
- The
- <code>@ManagedBean</code>
- and
- <code>@SessionScoped</code>
- annotations allow for omitting of equivalent declarations in the
- <code>faces-config.xml</code>
- file.
- </para>
- </section>
- <section id="sid-55477016_BasicJSFPortletDevelopment-portlet.xml">
- <title>portlet.xml</title>
- <para>portlet.xml is the place where we tie the JSF templates with the portlet.</para>
- <example>
- <title>portlet.xml</title>
- <programlisting language="XML">
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
- <portlet>
- <description>A simple JSF2 portlet.</description>
- <portlet-name>jsf2HelloWorldPortlet</portlet-name>
- <display-name>JSF2 Hello World Portlet</display-name>
- <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
- <init-param>
- <name>javax.portlet.faces.defaultViewId.view</name>
- <value>/pages/main.xhtml</value>
- </init-param>
- <init-param>
- <name>javax.portlet.faces.defaultViewId.edit</name>
- <value>/pages/edit.xhtml</value>
- </init-param>
- <init-param>
- <name>javax.portlet.faces.defaultViewId.help</name>
- <value>/pages/help.xhtml</value>
- </init-param>
- <init-param>
- <name>javax.portlet.faces.preserveActionParams</name>
- <value>true</value>
- </init-param>
- <expiration-cache>0</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
- <portlet-info>
- <title>JSF2 Hello World Portlet</title>
- </portlet-info>
- <container-runtime-option>
- <name>org.gatein.pc.remotable</name>
- <value>true</value>
- </container-runtime-option>
- </portlet>
-</portlet-app>
-
-
-</programlisting>
- </example>
- <para>
- Note that the
- <code>javax.portlet.faces.defaultViewId.*</code>
- <code>init-params</code>
- are used to bind the JSF templates with the respective portlet view modes.
- <code>javax.portlet.faces.GenericFacesPortlet</code>
- as a
- <code><portlet-class></code>
- will serve the purpose for most JSF portlets.
- </para>
- </section>
- <section id="sid-55477016_BasicJSFPortletDevelopment-web.xml">
- <title>web.xml</title>
- <para>
- JSF portlets require a few tweaks in the
- <code>web.xml</code>
- file:
- </para>
- <example>
- <title>web.xml</title>
- <programlisting language="XML">
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
- <display-name>jsf2-hello-world-portlet</display-name>
- <context-param>
- <description>See https://docs.jboss.org/author/display/PBR/Render+Policy</description>
- <param-name>javax.portlet.faces.RENDER_POLICY</param-name>
- <param-value>ALWAYS_DELEGATE</param-value>
- </context-param>
-
- <!-- The following params are documented here: http://myfaces.apache.org/core21/myfaces-impl/webconfig.html -->
- <context-param>
- <param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>
- <param-value>*.xhtml</param-value>
- </context-param>
- <context-param>
- <param-name>facelets.DEVELOPMENT</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
-
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.faces</url-pattern>
- </servlet-mapping>
-</web-app>
-</programlisting>
- </example>
- </section>
- <section id="sid-55477016_BasicJSFPortletDevelopment-CustomCSS">
- <title>Custom CSS</title>
- <para>
- Portlet Bridge supports loading of CSS resources in the "JSF way". Use the
- <code><h:outputStylesheet library="css" name="jsf2-hello-world-portlet.css" /></code>
- as in the
- <code>main.xhtml</code>
- file above. The
- <code>jsf2-hello-world-portlet.css</code>
- file needs to be placed in
- <code>resources/css</code>
- folder of the web application.
- </para>
- <para>
- Note that relative paths like
- <code>url('css/background/jsf-logo.png')</code>
- do not work when used in CSS loaded via
- <code><h:outputStylesheet ...></code>
- . Rather a JSF Expression Language expression
- <code>#{resource['/css/background/jsf-logo.png']</code>
- } needs to be used. This expression is dynamically evaluated to a proper public URL. The path
- <code>'/css/background/jsf-logo.png'</code>
- used in the expression is relative to
- <code>resources</code>
- folder of the web application. See also
- <ulink url="https://docs.jboss.org/author/pages/viewpage.action?pageId=51806374">Resource Serving</ulink>
- .
- </para>
- <example>
- <title>jsf2-hello-world-portlet.css</title>
- <programlisting>
- div.jsf2HelloWorldPortlet {
- padding: 10px;
- /* In the following we use a JSF Expression Language expression rather then plain relative path.
- Plain relative paths do not work in JSF portlets. The expression #{resource['...']} is
- dynamically evaluated to a proper public URL. The path '/css/background/jsf-logo.png'
- used in the expression is relative to resources folder of this web application.
- See https://docs.jboss.org/author/display/PBR/Resource+Serving */
- background: url(#{resource['/css/background/jsf-logo.png']}) no-repeat;
- background-position-x: 753px;
- background-position-y: 10px;
- }
- div.jsf2HelloWorldPortlet p {
- width: 713px;
- }
-</programlisting>
- </example>
- </section>
- <section id="sid-55477016_BasicJSFPortletDevelopment-Internationalization">
- <title>Internationalization</title>
- <para>
- Internationalization is supported via standard Java Resource bundles. In our example project the
- <code>*.property</code>
- files of
- <code>org.jboss.as.quickstarts.jsf.messages</code>
- resource bundle are stored under
- <code>src/main/resources/org/jboss/as/quickstarts/jsf</code>
- . The following settings in
- <filename>faces-config.xml</filename>
- are needed so that this bundle can be used in JSF templates.
- </para>
- <example>
- <title>faces-config.xml</title>
- <programlisting language="XML">
-<faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" version="2.0">
- <application>
- <!-- Declare the internationalization resources -->
- <resource-bundle>
- <!-- The resource bundle property files are in src/main/resources/org/jboss/as/quickstarts/jsf -->
- <base-name>org.jboss.as.quickstarts.jsf.messages</base-name>
- <var>msgs</var>
- </resource-bundle>
- <locale-config>
- <default-locale>en</default-locale>
- <supported-locale>de</supported-locale>
- </locale-config>
- </application>
-</faces-config>
-</programlisting>
- </example>
- <para>
- Note that in the above faces-config.xml, we have made our bundle visible in JSF templates under the variable
- <code>msgs</code>
- . Its individual entries can then be accessed using the usual Expression Language dot notation: e.g.
- <code>#{msgs.Name</code>
- }.
- </para>
- </section>
- </section>
- <section id="sid-55477016_BasicJSFPortletDevelopment-FurtherSteps">
- <title>Further Steps</title>
- <para>
- After having done all the above, it is time to
- <link linkend="sid-55379158">build and deploy the portlet</link>
- ,
- <ulink url="https://docs.jboss.org/author/pages/viewpage.action?pageId=54264662">import it</ulink>
- and
- <ulink url="https://docs.jboss.org/author/pages/viewpage.action?pageId=54264655">add it to a page</ulink>
- so that you can test its functionality.
- </para>
- </section>
- <section id="sid-55477016_BasicJSFPortletDevelopment-Seealso">
- <title>See also</title>
- <itemizedlist>
- <listitem>
- <para>
- <ulink url="https://docs.jboss.org/author/pages/viewpage.action?pageId=54264602">Portlet Primer</ulink>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
- <section id="sid-55477018">
- <title>JSF Portlet Development with RichFaces</title>
- <para>
- As we have already noted, RichFaces (RF) is just a component library for JavaServer Faces (JSF). Therefore, everything said in the
- <xref linkend="sid-55477016"/>
- chapter applies here too.
- </para>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-ExampleCode">
- <title>Example Code</title>
- <para>
- This section mentions code from the JSF2+RF4 Hello World Portlet example in the JBoss Portal Platform Quickstarts, available for download from <ulink url="https://access.redhat.com/"/> as part of your JBoss Portal Platform subscription.
- </para>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-pom.xml">
- <title>pom.xml</title>
- <para>We need to add several RF-specific dependencies to the general JSF ones:</para>
- <example>
- <title>pom.xml</title>
- <programlisting language="XML">
- <dependencies>
- <!--
- The versions, scopes and types of these dependencies are managed in gatein-*-bom.
- You need to name only groupId and artifactId here.
- Name only those artifacts you refer to in your code.
- Look at gatein-*-bom POM file for the complete list of available artifacts.
- -->
- <!-- General JSF dependencies -->
- <dependency>
- <groupId>org.jboss.spec.javax.faces</groupId>
- <artifactId>jboss-jsf-api_2.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.portletbridge</groupId>
- <artifactId>portletbridge-api</artifactId>
- </dependency>
-
- <!-- RF-sprecific dependencies -->
- <dependency>
- <groupId>org.jboss.portletbridge</groupId>
- <artifactId>portletbridge-extension-richfaces</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-components-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-components-ui</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
- </dependencies>
-</programlisting>
- </example>
- </section>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-JSFTemplateFiles">
- <title>JSF Template Files</title>
- <para>
- We use
- <code><rich:*></code>
- components in the templates:
- </para>
- <example>
- <title>Form with rich: components in main.xhtml</title>
- <programlisting language="XML">
- </p>
- <h:form id="jsf2HelloWorldPortlet">
- <h:panelGrid columns="2">
- <h:outputLabel value="#{msgs.Greeting}" for="greeting"/>
- <rich:select id="greeting" value="#{helloBean.greeting}">
- <f:selectItems value="#{helloBean.greetings}" />
- <f:ajax render="output" event="selectitem"/>
- </rich:select>
-
- <h:outputLabel value="#{msgs.Name}" for="nameInput"/>
- <h:inputText id="nameInput" value="#{helloBean.name}">
- <f:validateLength minimum="1" maximum="50" />
- <f:ajax render="output" event="keyup"/>
- </h:inputText>
- </h:panelGrid>
- <p>
- <h:panelGroup id="output">
- <strong><h:outputText value="#{helloBean.greeting} #{helloBean.name}!" rendered="#{not empty helloBean.name}"/></strong>
- </h:panelGroup>
- </p>
- <p>
- <h:commandButton id="reset" value="#{msgs.Reset}" actionListener="#{helloBean.reset}">
- <f:ajax render="@form" />
- </h:commandButton> - #{msgs.ResetComment}
- </p>
- <p>
- <h:commandButton id="reload" value="#{msgs.Reload}" /> - #{msgs.ReloadComment}
- </p>
-</programlisting>
- </example>
- <para>The complete source code of the above template can be found in src/main/webapp/pages/main.xhtml of JSF2+RF4 Hello World Portlet quickstart.</para>
- </section>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-JavaBeans">
- <title>Java Beans</title>
- <para>
- The HelloBean presented in the
- <xref linkend="sid-55477016"/>
- chapter was extended firstly to provide a list of greeting phrases selectable in the drop-down box on the main.xhtml page and secondly to be able to store the greeting phrase selected in the drop-down box.
- </para>
- <example>
- <title>HelloBean.java</title>
- <programlisting language="Java">
- /**
- * Static list of greetings. Contains {@code "Hello"} and {@code "Hi"}.
- */
- private static final List<SelectItem> GREETINGS;
-
- static {
- List<SelectItem> l = new ArrayList<SelectItem>(2);
- l.add(new SelectItem("Hello"));
- l.add(new SelectItem("Hi"));
- GREETINGS = Collections.unmodifiableList(l);
- }
-
- /**
- * Stores the greeting phrase which will be used to greet the application user.
- */
- private String greeting;
-</programlisting>
- </example>
- <example>
- <title>HelloBean.java</title>
- <programlisting language="Java">
- /**
- * Returns {@link #greeting}.
- *
- * @return {@link #greeting}
- */
- public String getGreeting() {
- return greeting;
- }
-
- /**
- * Set {@link #greeting}.
- *
- * @param greeting
- */
- public void setGreeting(String greeting) {
- this.greeting = greeting;
- }
-
- /**
- * Returns {@link #GREETINGS}.
- *
- * @return {@link #GREETINGS}
- */
- public List<SelectItem> getGreetings() {
- return GREETINGS;
- }
-
-
- /**
- * Resets {@link #name} to the default value {@code "World"} and {@link #greeting} with the default value {@code "Hello"}.
- *
- * @param ae ignored
- */
- public void reset(ActionEvent ae) {
- this.name = "World";
- this.greeting = "Hello";
- }
-
- }
-</programlisting>
- </example>
- </section>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-portlet.xml">
- <title>portlet.xml</title>
- <para>
- There is no substantial change in portlet.xml against the
- <xref linkend="sid-55477016"/>
- chapter. Only
- <code><description></code>
- ,
- <code><portlet-name></code>
- ,
- <code><display-name></code>
- and
- <code><title></code>
- have been changed.
- </para>
- <example>
- <title>portlet.xml</title>
- <programlisting language="XML">
-<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
- <portlet>
- <description>A simple portlet usinf JSF2 and RF4.</description>
- <portlet-name>jsf2Rf4HelloWorldPortlet</portlet-name>
- <display-name>JSF2+RF4 Hello World Portlet</display-name>
- <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
- <init-param>
- <name>javax.portlet.faces.defaultViewId.view</name>
- <value>/pages/main.xhtml</value>
- </init-param>
- <init-param>
- <name>javax.portlet.faces.defaultViewId.edit</name>
- <value>/pages/edit.xhtml</value>
- </init-param>
- <init-param>
- <name>javax.portlet.faces.defaultViewId.help</name>
- <value>/pages/help.xhtml</value>
- </init-param>
- <init-param>
- <name>javax.portlet.faces.preserveActionParams</name>
- <value>true</value>
- </init-param>
- <expiration-cache>0</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
- <portlet-info>
- <title>JSF2+RF4 Hello World Portlet</title>
- </portlet-info>
- <container-runtime-option>
- <name>org.gatein.pc.remotable</name>
- <value>true</value>
- </container-runtime-option>
- </portlet>
-</portlet-app>
-</programlisting>
- </example>
- </section>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-web.xml">
- <title>web.xml</title>
- <para>
- We set a few more
- <code>init-params</code>
- in web.xml for RichFaces components to work:
- </para>
- <example>
- <title>web.xml</title>
- <programlisting language="XML">
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
- <display-name>jsf2-rf4-hello-world-portlet</display-name>
- <context-param>
- <description>See https://docs.jboss.org/author/display/PBR/Installing+Portlet+Bridge#InstallingPortletBridge-DisableautomaticinclusionofPortletBridge</description>
- <param-name>org.gatein.portletbridge.WAR_BUNDLES_PORTLETBRIDGE</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <description>See https://docs.jboss.org/author/display/PBR/Render+Policy</description>
- <param-name>javax.portlet.faces.RENDER_POLICY</param-name>
- <param-value>ALWAYS_DELEGATE</param-value>
- </context-param>
-
- <!-- The following params are documented here: http://myfaces.apache.org/core21/myfaces-impl/webconfig.html -->
- <context-param>
- <param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>
- <param-value>*.xhtml</param-value>
- </context-param>
- <context-param>
- <param-name>facelets.DEVELOPMENT</param-name>
- <param-value>false</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>server</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.PROJECT_STAGE</param-name>
- <!-- Change to Production to compress js files, etc. -->
- <param-value>Development</param-value>
- </context-param>
-
- <context-param>
- <description>http://docs.jboss.org/richfaces/latest_4_X/Developer_Guide/en-US/html/chap-Developer_Guide-Skinning_and_theming.html</description>
- <param-name>org.richfaces.skin</param-name>
- <param-value>#{skinBean.skin}</param-value>
- </context-param>
- <context-param>
- <description>See http://docs.jboss.org/richfaces/latest_4_X/Developer_Guide/en-US/html/chap-Developer_Guide-Advanced_features.html</description>
- <param-name>org.richfaces.resourceOptimization.enabled</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.faces</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
- </servlet-mapping>
-
- <mime-mapping>
- <extension>xcss</extension>
- <mime-type>text/css</mime-type>
- </mime-mapping>
-
-</web-app>
-</programlisting>
- </example>
- </section>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-CustomCSS">
- <title>Custom CSS</title>
- <para>
- Fully analogous with
- <link linkend="sid-55477016">plain JSF portlets</link>
- .
- </para>
- </section>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-Internationalization">
- <title>Internationalization</title>
- <para>
- Fully analogous with
- <link linkend="sid-55477016">plain JSF portlets</link>
- .
- </para>
- </section>
- </section>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-FurtherSteps">
- <title>Further Steps</title>
- <para>
- After having done all the above, it is time to
- <link linkend="sid-55379158">build and deploy the portlet</link>
- ,
- <ulink url="https://docs.jboss.org/author/pages/viewpage.action?pageId=54264662">import it</ulink>
- and
- <ulink url="https://docs.jboss.org/author/pages/viewpage.action?pageId=54264655">add it to a page</ulink>
- so that you can test its functionality.
- </para>
- </section>
- <section id="sid-55477018_JSFPortletDevelopmentwithRichFaces-Seealso">
- <title>See also</title>
- <itemizedlist>
- <listitem>
- <para>
- <ulink url="https://docs.jboss.org/author/pages/viewpage.action?pageId=54264602">Portlet Primer</ulink>
- </para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
</section>
<section id="sid-55379158">
<title>Building and Deploying Portlets</title>
<orderedlist>
<listitem>
- <para>Make sure you have your JBoss Portal Platform instance is running.</para>
+ <para>Make sure the JBoss Portal Platform instance is running.</para>
</listitem>
<listitem>
<para>Open a command line and navigate to the root directory of your portlet project.</para>
</listitem>
<listitem>
<para>Type this command to build and deploy the archive:</para>
- <informalexample>
- <programlisting>mvn clean package jboss-as:deploy</programlisting>
- </informalexample>
+ <programlisting>mvn clean package jboss-as:deploy</programlisting>
<para>
To deploy to other than default
<code>localhost:9999</code>
@@ -1060,14 +318,12 @@
elements can be omitted sometimes, depending on JBoss Portal Platform's security settings.
</para>
- <informalexample>
- <programlisting language="XML"><configuration>
+ <programlisting language="XML"><configuration>
<hostname>127.0.0.1</hostname>
<port>9999</port>
<username>admin</username>
<password>secret</password>
</configuration></programlisting>
- </informalexample>
<para>
This will deploy
<code>target/simplest-hello-world-portlet.war</code>
More information about the gatein-commits
mailing list