Author: Thomas Heute, Peter Palaga
Level: Beginner
Technologies: GateIn Portal, Portal Container
Summary: Sample Portal
Target Product: GateIn Portal 3.6
Source: https://github.com/gatein/gatein-portal-quickstart
This project demonstrates a how to create a new Portal Container from scratch. It covers many aspects of new Portal Container creation, such as:
- Custom Home Page Portlet
- Translation resource bundles
- Pages and Site Layouts
- Navigation Definitions
- Custom Sign In Page
For more details, see Portal Containers 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/dca-portal.ear
. -
Copy this file into the GateIn Portal extension deployment folder:
$JBOSS_HOME/gatein/extensions
In JBoss, Datasources and Security Policies need to be defined on the level of Application Server and they
cannot[*] be defined within EARs because otherwise centralized management would not be possible. This is
the reason why it is not enough just to deploy dca-portal.ear
. You also need to define the
Datasources and Security Policies e.g. in $BOSS_HOME/standalone/configuration/standalone.xml
.
The standalone.xml
available in the out-of-the-box GateIn Portal 3.6 installation contains the needed pieces
of XML commented out. Please search for Uncommented this when deploying dca-portal
in the file and uncomment the
necessary XML code blocks. Note that you should uncomment two datasource
s and one security-policy
.
Except for editting standalone.xml, JBoss Datasources and Security Policies can be defined using CLI or JBoss Web Console as described in JBoss AS 7.1 Admin Guide
[*] Datasources can be defined in EARs but such ones are not managed, see JBoss AS 7.1 Admin Guide.
To ensure that the Sample Portal has been deployed successfully visit http://127.0.0.1:8080/dca-portal) with your web browser.
-
Open a command line and navigate to the root of the JBoss server directory.
-
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:
- Delete
JBOSS_HOME/gatein/extensions/dca-portal.ear
- 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.
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.