Gatein tutorial: how to create a new Portal

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

This is the second tutorial about Gatein. In the first one we showed how to create a basic Portlet and deploy it. In this tutorial we will show how to create a basic new portal using GateIn Portal.

Creating the Portal using the Gatein Wizard

The first thing you need to do in order to get started is logging into the GateIn Console http://localhost:8080/portal/ and Log In as "Administrator" (click on the lower Icon on the left labeled as "Administrator"). Now reach the "Site" Option on the upper Menu and click on it. You will see a list of available Portals. Click on "Add new Portal".

jboss portal gatein tutorial

A little wizard will assist you in the creation of the new Portal. In the upper tab of this wizard you will need to define at first some basic Portal settings such as the Portal Name, the Locale and the Skin:
jboss portal gatein tutorial
In the Properties tab you can specify how the session timeout is handled for the web portal. You can leave the default option ("On Demand"). If you don’t want the session to ever expire, you can select "Never" from the drop-down list.
jboss portal gatein tutorial
In the Permission Setting you need to specify the user groups and roles who can access the portal and make modifications to it.
jboss portal gatein tutorial
Check the option Make it public to everyone which means that the portal will be accessible to anyone, even anonymous users. Next you need to specify Permission Settings which define which users and groups are able to modify this portal.
Since we don't want to grant this option to anyone, we will choose to leave this job to the Administrator. The Administrator user has managermembership in the Administrators group, so to assign edit permission to the Administrator user you need to select in the left tree Platform->Administrator and in the right panel manager as the membership.
jboss portal gatein tutorial

When you select the membership, the selected permission is displayed in the Edit Permission Setting tab, as shown here:
jboss portal gatein tutorial
Fine we are ready to go so choose Save. Now if you move to the Upper Site Menu, you will see it now contains another option for your newly created Portal.

jboss portal gatein tutorial

Adding Pages to your Portal

If you click on it you will see your DemoPortal in action which however, being based on the default template will now look much different from the Classic Portal. So let's customize our demo portal by removing at first the default Home page of our site. Select Site and then the "Edit Navigation" option.

jboss portal gatein tutorial
There you can remove the default Home page node by right-clicking on it and Choosing "Delete Node".

jboss portal gatein tutorial

Now let's add a new Home page node by clicking on the Add Node button. In the Page Node Setting enter as Node Name "Home". Next move to the Page Selector.

jboss portal gatein tutorial

There we will associate our node with a Page. Since we don't have any other Page available just enter a name for the page as well and click on "Create Page"  .

jboss gatein tutorial example portal

 

 Note you can further refine the page navigation by selecting "Move up" option right-clicking on the Home page and moving it as first option. Click Save when you are done with it.

Editing the Portal Layout

The last step will be editing the Site layout which can be carried out through the "Edit Layout". Click on the Edit layout link. From there you can see a layout skeleton of your Portal. Try adding one portlet (we have described in this tutorial how to develop and deploy a simple portlet) and a Widget, like the Calendar Widget.

jboss gatein portlet tutorial example
Once done click on the Save button into the "Edit Inline Composer" Window.

Here's your first Portlet, containing a Gadget Calendar Portlet and an HelloWorld Portlet which displays the current date/time!
jboss portal gatein example howto tutorial

Follow us on Twitter