3.1. Defining structure of a site

The structure of a site is mainly defined into 3 files: portal.xml, pages.xml and navigation.xml. You can create multiple pages within a single site.

Understanding the "Intranet" site of eXo Platform is a good approach to the site structure. The configuration of the "Intranet" site can be found in the $PLATFORM_TOMCAT_HOME/webapps/acme-intranet.war directory.

portal.xml

The portal.xml file describes the layout and portlets that will be shown on all pages:

navigation.xml

The navigation.xml file defines all navigation nodes of a site. The syntax is simply using the nested node tags. Each node refers to a page defined in the pages.xml file that will be explained later.

pages.xml

The pages.xml defines the layout and portlets of specific pages. A page defined in pages.xml will declare name, title, access and edit permissions, and containers (optional). Also, the <portlet-application> is used to declare portlets in a page.


<page>
    <name>activities</name>
    <title>Activities</title>
    <access-permissions>*:/platform/users</access-permissions>
    <edit-permission>manager:/platform/administrators</edit-permission>
    <container id="UIUserNavigationPortlet" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
        <access-permissions>*:/platform/users</access-permissions>
        <portlet-application>
            <portlet>
                <application-ref>platformNavigation</application-ref>
                <portlet-ref>UIUserNavigationPortlet</portlet-ref>
            </portlet>
            <title>User Navigation Portlet</title>
            <access-permissions>*:/platform/users</access-permissions>
            <show-info-bar>false</show-info-bar>
            <show-application-state>true</show-application-state>
        </portlet-application>
    </container>
    <container id="ProfileActivity" template="system:/groovy/portal/webui/container/UIContainer.gtmpl">
        <access-permissions>*:/platform/users</access-permissions>
        <portlet-application>
            <portlet>
                <application-ref>social-portlet</application-ref>
                <portlet-ref>UserActivityStreamPortlet</portlet-ref>
            </portlet>
            <title>User Activity Stream</title>
            <access-permissions>*:/platform/users</access-permissions>
            <show-info-bar>false</show-info-bar>
            <show-application-state>true</show-application-state>
        </portlet-application>
    </container>
</page>
Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus