JBoss Community Archive (Read Only)

GateIn Portal 3.9

Portal Navigation Configuration

There are three navigation types available to portal users:

These navigations are configured using the standard XML syntax in the portal.war:/WEB-INF/conf/portal/portal-configuration.xml file.

<component>
   <key>org.exoplatform.portal.config.UserPortalConfigService</key>
   <type>org.exoplatform.portal.config.UserPortalConfigService</type>
   <component-plugins>
      <component-plugin>
         <name>new.portal.config.user.listener</name>
         <set-method>initListener</set-method>
         <type>org.exoplatform.portal.config.NewPortalConfigListener
      </type>
         <description>this listener init the portal configuration
      </description>
         <init-params>
            <value-param>
               <name>default.portal</name>
               <description>The default portal for checking db is empty or not</description>
               <value>classic</value>
            </value-param>
            <value-param>
               <name>page.templates.location</name>
               <description>the path to the location that contains Page templates</description>
               <value>war:/conf/portal/template/pages</value>
            </value-param>
            <value-param>
               <name>override</name>
               <description>The flag parameter to decide if portal metadata is overriden on restarting server
            </description>
               <value>false</value>
            </value-param>
            <object-param>
               <name>site.templates.location</name>
               <description>description</description>
               <object type="org.exoplatform.portal.config.SiteConfigTemplates">
                  <field name="location">
                     <string>war:/conf/portal</string>
                  </field>
                  <field name="portalTemplates">
                     <collection type="java.util.HashSet">
                        <value><string>basic</string></value>
                        <value><string>classic</string></value>
                     </collection>
                  </field>
                  <field name="groupTemplates">
                     <collection type="java.util.HashSet">
                        <value><string>group</string></value>
                     </collection>
                  </field>
                  <field name="userTemplates">
                     <collection type="java.util.HashSet">
                        <value><string>user</string></value>
                     </collection>
                  </field>
               </object>
            </object-param>
            <object-param>
               <name>portal.configuration</name>
               <description>description</description>
               <object type="org.exoplatform.portal.config.NewPortalConfig">
                  <field name="predefinedOwner">
                     <collection type="java.util.HashSet">
                        <value><string>classic</string></value>
                     </collection>
                  </field>
                  <field name="ownerType">
                     <string>portal</string>
                  </field>
                  <field name="templateLocation">
                     <string>war:/conf/portal/</string>
                  </field>
                  <field name="importMode">
                     <string>conserve</string>
                  </field>
               </object>
            </object-param>
            <object-param>
               <name>group.configuration</name>
               <description>description</description>
               <object type="org.exoplatform.portal.config.NewPortalConfig">
                  <field name="predefinedOwner">
                     <collection type="java.util.HashSet">
                        <value><string>/platform/administrators</string></value>
                        <value><string>/platform/users</string></value>
                        <value><string>/platform/guests</string></value>
                        <value><string>/organization/management/executive-board</string></value>
                     </collection>
                  </field>
                  <field name="ownerType">
                     <string>group</string>
                  </field>
                  <field name="templateLocation">
                     <string>war:/conf/portal</string>
                  </field>
                  <field name="importMode">
                     <string>conserve</string>
                  </field>
               </object>
            </object-param>
            <object-param>
               <name>user.configuration</name>
               <description>description</description>
               <object type="org.exoplatform.portal.config.NewPortalConfig">
                  <field name="predefinedOwner">
                     <collection type="java.util.HashSet">
                        <value><string>root</string></value>
                        <value><string>john</string></value>
                        <value><string>mary</string></value>
                        <value><string>demo</string></value>
                        <value><string>user</string></value>
                     </collection>
                  </field>
                  <field name="ownerType">
                     <string>user</string>
                  </field>
                  <field name="templateLocation">
                     <string>war:/conf/portal</string>
                  </field>
                  <field name="importMode">
                     <string>conserve</string>
                  </field>
               </object>
            </object-param>
         </init-params>
      </component-plugin>
   </component-plugins>
</component>

This XML configuration defines where in the portal's war to look for configuration, and which portals, groups, and user specific views to include in portal/group/user navigation. Those files will be used to create an initial navigation when the portal is launched for the first time. That information will then be stored in the JCR content repository, and can subsequently be modified and managed from the portal UI.

Each portal, groups and users navigation is indicated by the respective configuration paragraph, for example:

<object-param>
   <name>portal.configuration</name>
   <description>description</description>
   <object type="org.exoplatform.portal.config.NewPortalConfig">
      <field name="predefinedOwner">
         <collection type="java.util.HashSet">
            <value><string>classic</string></value>
         </collection>
      </field>
      <field name="ownerType">
         <string>portal</string>
      </field>
      <field name="templateLocation">
         <string>war:/conf/portal/</string>
      </field>
      <field name="importMode">
         <string>conserve</string>
      </field>
   </object>
</object-param>

The meaning of elements used in the above listing is a follows:

predefinedOwner: Define the navigation owner. The portal will look for the configuration files in folder with this name. If there is no suitable folder, a default portal will be created with a name equal to this value.

ownerType: Define the type of portal navigation. The possible values are: portal, group or user.

templateLocation: Define the classpath where the portal configuration files are located.

importMode: Define the mode for navigation import. There are 4 possible values:

Based on these parameters, portal will look for the configuration files and create a relevant portal navigation, pages and data import strategy.

Portal Navigation

The portal navigation incorporates the pages that can be accessed even when the user is not logged in (assuming the applicable permissions allow the public access). For example, several portal navigations are used when a company owns multiple trademarks, and sets up a website for each of them.

The classic portal is configured by three XML files in the portal.war:/WEB-INF/conf/portal/portal/classic directory: portal.xml, navigation.xml and pages.xml.

portal.xml

This file defines the layout and portlets that will be shown on all portal pages. The layout usually contains a banner, menu and breadcrumbs portlets followed by the page body and footer portlet. GateIn Portal3.9 is extremely configurable as every view element (even the banner and footer) is a portlet.

<portal-config
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
   xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
   <portal-name>classic</portal-name>
   <locale>en</locale>
   <access-permissions>Everyone</access-permissions>
   <edit-permission>*:/platform/administrators</edit-permission>
   <properties>
      <entry key="sessionAlive">onDemand</entry>
      <entry key="showPortletInfo">1</entry>
   </properties>

   <portal-layout>
      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>BannerPortlet</portlet-ref>
            <preferences>
               <preference>
                  <name>template</name>
                  <value>par:/groovy/groovy/webui/component/UIBannerPortlet.gtmpl</value>
                  <read-only>false</read-only>
               </preference>
            </preferences>
         </portlet>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>

      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>NavigationPortlet</portlet-ref>
         </portlet>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>

      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>BreadcumbsPortlet</portlet-ref>
         </portlet>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>

      <page-body> </page-body>

      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>FooterPortlet</portlet-ref>
            <preferences>
               <preference>
                  <name>template</name>
                  <value>par:/groovy/groovy/webui/component/UIFooterPortlet.gtmpl</value>
                  <read-only>false</read-only>
               </preference>
            </preferences>
         </portlet>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>

   </portal-layout>

</portal-config>

It is also possible to apply a nested container that can also contain portlets. Row, column or tab containers are then responsible for the layout of their child portlets.
Use the page-body tag to define where the portal should render the current page.
Note that the defined classic portal is accessible to Everyone but only members of /platform/administrators group can edit it.

navigation.xml

This file defines the navigation nodes of the portal. The syntax is simple, based on nested node tags. Each node refers to a page defined in the pages.xml file.
If an administrator wants to create node labels for each language, he can use the xml:lang attribute with the desired locale identifier (e.g. de, fr or pt-BR) in the label element.
Otherwise, if the administrator prefers the localization of the node labels to be performed using resource bundle files, he can use the #{...} syntax. The enclosed property name is then interpreted as a key resolvable through the portal's internationalization mechanism and the locale is taken from the current HTTP request.

<node-navigation
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
   xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
   <priority>1</priority>
   <page-nodes>
      <node>
         <name>home</name>
         <label xml:lang="en">Home</label>
         <page-reference>portal::classic::homepage</page-reference>
      </node>
      <node>
         <name>sitemap</name>
         <label xml:lang="en">SiteMap</label>
         <visibility>DISPLAYED</visibility>
         <page-reference>portal::classic::sitemap</page-reference>
      </node>
      ..........
   </page-nodes>
</node-navigation>

This navigation tree can be accessed from within portlets so that different representations can be achieved, such as breadcrumbs, sitemaps or popup menus. Please refer to the portal source tree to find an example for each kind.

The priority is optional property. It takes responsibility of navigation ordering (to display on UI). The greater priority value is, the higher navigation displays on toolbar. If it is not declared, it will by default value of -1. All navigations have priority less than 1, they display "undefined" when editing navigation on UI.

pages.xml

The structure of this configuration file is very similar to the one of portal.xml. It can also contain container elements. For each portlet application can be decided whether its border should be visible, its window state, the icons or the modes supported by the given portlet.

<page-set
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2 http://www.gatein.org/xml/ns/gatein_objects_1_2"
   xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2">
   <page>
      <name>homepage</name>
      <title>Home Page</title>
      <access-permissions>Everyone</access-permissions>
      <edit-permission>*:/platform/administrators</edit-permission>
      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>HomePagePortlet</portlet-ref>
            <preferences>
               <preference>
                  <name>template</name>
                  <value>system:/templates/groovy/webui/component/UIHomePagePortlet.gtmpl</value>
                  <read-only>false</read-only>
               </preference>
            </preferences>
         </portlet>
         <title>Home Page portlet</title>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
         <show-application-state>false</show-application-state>
         <show-application-mode>false</show-application-mode>
      </portlet-application>
   </page>

   <page>
      <name>sitemap</name>
      <title>Site Map</title>
      <access-permissions>Everyone</access-permissions>
      <edit-permission>*:/platform/administrators</edit-permission>
      <portlet-application>
         <portlet>
            <application-ref>web</application-ref>
            <portlet-ref>SiteMapPortlet</portlet-ref>
         </portlet>
         <title>SiteMap</title>
         <access-permissions>Everyone</access-permissions>
         <show-info-bar>false</show-info-bar>
      </portlet-application>
   </page>
   ...
</page-set>

Group Navigation

Group navigations are dynamically added to the user navigation at login time. This allows users to access (e.g. via menus) all pages assigned to any groups they belong to.

The group navigation is configured by two XML files (navigation.xml and pages.xml). The syntax used in these files is the same as the one described in Portal Navigation.

They are also located in the {templateLocation}/{ownerType}/{predefinedOwner} directory where ownerType is group and predefinedOwner is the full group group name. For example, portal.war/WEB-INF/conf/portal/group/platform/administrators/.

User Navigation

User navigation is a set of nodes and pages that are owned by the user. They are part of the user's dashboard.

Two files configure the user navigation (navigation.xml and pages.xml). They are located in the {templateLocation}/{ownerType}/{predefinedOwner} directory where ownerType is user and predefinedOwner is name of the user for whom we want to create the navigation. For example, if the administrator wants to create navigation for the user named mary, he needs to put the configuration files into the directory portal.war/WEB-INF/conf/portal/user/mary.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 13:30:00 UTC, last content change 2013-12-06 08:19:13 UTC.