gatein-portal-extension: Portal Extension

Author: Thomas Heute, Peter Palaga
Level: Beginner
Technologies: GateIn Portal, Portal Extension
Summary: Portal Extension
Target Product: GateIn
Source: https://github.com/gatein/gatein-portal-quickstart

What is it?

This project demonstrates a simple Portal Extension. It shows how it is possible to extend and customize a portal without modifying the files included in gatein.ear. The main advantage of this approach to customization is that upgrades to new versions of GateIn Portal will be easier to handle as all the customization can be embedded in separate deployable packages.

Portal Extension customizes the default portal available at http://localhost:8080/portal by doing few changes:

For more details, see Portal Extension page of GateIn Portal Developer Guide.

System Requirements

All you need to build this example project is Java 6.0 (Java SDK 1.6) or newer and Maven 3.0 or newer.

The project is designed to be deployed on GateIn Portal 3.6 running on JBoss AS.

Configure Maven

You do not need to touch your settings.xml because of this quickstart. All necessary artifacts are available in public repositories.

Build and Deploy

Portal Extensions and Portal Containers are not hot-deployable. Therefore, it is not possible to deploy them using mvn jboss-as:deploy or copying to the default JBoss AS deployment folder when GateIn Portal is running. Instead of that you will need to:

  1. Make sure that the Portal is not running, e.g. by running

    $JBOSS_HOME/bin/jboss-cli.sh --connect controller=127.0.0.1:9999 command=:shutdown
    
  2. Open a command line and navigate to the root directory of this quickstart.

  3. Run the following command to build the archive:

    mvn clean package
    

    This will create ear/target/gatein-portal-extension.ear.

  4. Copy this file into the GateIn Portal extension deployment folder: $JBOSS_HOME/gatein/extensions

Access the Extension

To ensure that the Portal Extension has been deployed successfully, visit the the base URL of your Portal. Which is http://127.0.0.1:8080/portal in the most common case.

You should see some differences compared to the original Portal.

Start the Portal

  1. Open a command line and navigate to the root of the JBoss server directory.
  2. The following shows the command line to start the server with the web profile:

    For Linux:   JBOSS_HOME/bin/standalone.sh
    For Windows: JBOSS_HOME\bin\standalone.bat
    

Undeploy the Archive

To delete a Portal Extension or Portal Container:

  1. Delete JBOSS_HOME/gatein/extensions/gatein-portal-extension.ear
  2. Restart GateIn Portal

Please note that the content written to the database by the Extension or Portal Container (such as adding new pages) is not reversible.

Use JBoss Developer Studio or Eclipse to Run this Quickstart

Portal Extensions and Portal Containers are not directly deployable from JBoss Developer Studio nor Eclipse at this time. See Build and Deploy section above for an alternative.

Debug the Application

If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.

mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc

Feedback

Please post feedback on this quickstart or GateIn Portal on GateIn Forums.