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
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.
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.
You do not need to touch your settings.xml because of this quickstart. All necessary artifacts are available in public repositories.
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:
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
Open a command line and navigate to the root directory of this quickstart.
Run the following command to build the archive:
mvn clean package
This will create ear/target/gatein-portal-extension.ear
.
Copy this file into the GateIn Portal extension deployment folder: $JBOSS_HOME/gatein/extensions
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.
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
To delete a Portal Extension or Portal Container:
JBOSS_HOME/gatein/extensions/gatein-portal-extension.ear
Please note that the content written to the database by the Extension or Portal Container (such as adding new pages) is not reversible.
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.
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
Please post feedback on this quickstart or GateIn Portal on GateIn Forums.