5 Replies Latest reply on Aug 31, 2012 2:03 AM by sreenureddy20

    How to create menus linking to portal pages in user Navigation.xml

    opic

      Gatein supports customizing the

       

      portal/WEB-INF/conf/portal/user/template/user/navigation.xml

       

      file to create default nodes any user can use when he goes to the dashboard page. In this navigation.xml we add nodes in the following syntax

       

      <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>3</priority>

                <page-nodes>

                          <!-- The default dashboard tab -->

                          <node>

                                         <name>MySpace</name>

                                         <label>MySpace</label>

                                         <page-reference>user::@owner@::Tab_Default</page-reference>

                          </node>

                          <node>

                                         <uri>Contracts</uri>

                                         <name>Contracts</name>

                                         <label>Contracts</label>

                                         <page-reference>portal::MyPortal::Contracts</page-reference>

                          </node>

        </page-nodes>

      </node-navigation>

       

      As you see we add a dashboard TAB with a page reference to user:@owner@::Tab_Default

      And an aother node pointing to page-reference portal::MyPortal::Contracts

       

      We also add navigation portlet to the portal/WEB-INF/conf/portal/user/template/user/user.xml

       

      As is :

       

      <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>

       

      When the user goes to the dashboard page, evrything seems to work ok, the dashboard is displayed with a NavigationPortlet with a 'MySpace' and a 'Contract' menu. But, when the users clicks on the menu, the link is computed to

       

      http://<server>/portal/u/<username>/<nodename> instead of http://<server>/portal/<MyPortal>/<NodeName>

       

      preventing the user to link to the standard portal pages.

       

      Any ideas ?

        • 1. Re: How to create menus linking to portal pages in user Navigation.xml
          hoang_to

          In GateIn, there are two concepts navigational node and page , which are relevant but completly different

           

          1. Navigational node: represents a tree node in logical hierachy of web pages in GateIn portal

           

          2. Page: refers to the physical content that might be referenced by a navigational node

           

                              <node>

                                             <uri>Contracts</uri>

                                             <name>Contracts</name>

                                             <label>Contracts</label>

                                             <page-reference>portal::MyPortal::Contracts</page-reference>

                              </node>

           

           

          As we put above config in user/navigation.xml, we have a navigational node named Contracts of type USER (other types are GROUP, PORTAL) for each user, and that navigational node points to a page identified by portal::MyPortal::Contracts .  The URL appearing on address bar is determined by navigational node 's properties. For a navigational node of type USER, it is normal that we have /portal/u/... on address bar.

          • 2. Re: How to create menus linking to portal pages in user Navigation.xml
            opic

            Hello,

             

            If I understand putting nodes in user/navigation.xml will always generate links in the form http://<server>/portal/u/<username>, there is no way I can make it point to a portal page ?  Can I specify a explicit physical URL  for example ?

            • 3. Re: How to create menus linking to portal pages in user Navigation.xml
              hoang_to

              Can I specify a explicit physical URL  for example ?

               

              GateIn 3.1 : YES

              GateIn 3.2 : NO

              • 4. Re: How to create menus linking to portal pages in user Navigation.xml
                nscavell

                it can still point to a portal page, but you will be within the "user" context and will use the user site layout.

                • 5. Re: How to create menus linking to portal pages in user Navigation.xml
                  sreenureddy20

                  Hi ,

                   

                  Can any body help me . How to develop a custom navigation bar in gatein portal.