JBoss Community Archive (Read Only)

Portlet Bridge 3.3

Installing Portlet Bridge

Prerequisites

There are no specific requirements to use Portlet Bridge in a JSF portlet, but it does need to be a JSF2 portlet for this version of the Portlet Bridge to function as expected.

Maven

There are now a few different ways to include Portlet Bridge into your application.

Artifact dependencies

The following dependencies are required in your pom.xml for a JSF2 portlet:

Portlet Bridge Maven Artifacts for JSF2
<dependency>
    <groupId>org.jboss.portletbridge</groupId>
    <artifactId>portletbridge-api</artifactId>
    <version>3.3.1.Final</version>
</dependency>
<dependency>
    <groupId>org.jboss.portletbridge</groupId>
    <artifactId>portletbridge-impl</artifactId>
    <version>3.3.1.Final</version>
    <scope>runtime</scope>
</dependency>

If your portlet uses RichFaces 4, then you will also need the following dependency:

Portlet Bridge Maven Artifacts for RichFaces
<dependency>
    <groupId>org.jboss.portletbridge</groupId>
    <artifactId>portletbridge-extension-richfaces</artifactId>
    <version>3.3.1.Final</version>
    <scope>runtime</scope>
</dependency>

Depchain

Using the new Portlet Bridge depchain poms it's possible to reduce what needs to be added to your pom.xml to a single dependency.

For a JSF2 portlet add:

<dependency>
    <groupId>org.jboss.portletbridge</groupId>
    <artifactId>jsf2-depchain</artifactId>
    <version>3.3.1.Final</version>
    <type>pom</type>
</dependency>

For a RichFaces 4 portlet add:

<dependency>
    <groupId>org.jboss.portletbridge</groupId>
    <artifactId>richfaces4-depchain</artifactId>
    <version>3.3.1.Final</version>
    <type>pom</type>
</dependency>

Deploying to GateIn

When deploying to GateIn, the Portlet Bridge is automatically included for JSF2 portlets.

If you use the Portlet Bridge API in your code you still need to add it to your pom.xml with a provided scope. To do this the following dependency is required in your pom.xml:

<dependency>
    <groupId>org.jboss.portletbridge</groupId>
    <artifactId>portletbridge-api</artifactId>
    <version>3.3.1.Final</version>
    <scope>provided</scope>
</dependency>

If your portlet uses RichFaces 4, then you will need to include the Portlet Bridge RichFaces extension as this is not included with GateIn. It is important that you include the same version of the extension as the one bundled with GateIn.

You can find out what version is included in GateIn by looking in the directory $GATEIN_HOME/modules/org/jboss/portletbridge/api/main.

To do this the following dependency is required in your pom.xml:

<dependency>
    <groupId>org.jboss.portletbridge</groupId>
    <artifactId>portletbridge-extension-richfaces</artifactId>
    <version>INSERT VERSION INCLUDED IN GATEIN</version>
    <scope>runtime</scope>
</dependency>

Disable automatic inclusion of Portlet Bridge

If you still want to include the Portlet Bridge in your application you can disable the automatic inclusion of Portlet Bridge. This could, for example, be useful if you need to use a different version of Portlet Bridge.

To do that, just specify the WAR_BUNDLES_PORTLETBRIDGE context param in your web.xml file like this:

<context-param>
    <param-name>org.gatein.portletbridge.WAR_BUNDLES_PORTLETBRIDGE</param-name>
    <param-value>true</param-value>
</context-param>

The automatic inclusion of Portlet Bridge is also disabled if you are not using the bundled JSF2 implementation (by specifying either WAR_BUNDLES_JSF or JSF_CONFIG_NAME context parameters).

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:28:51 UTC, last content change 2014-01-15 11:28:32 UTC.