Tuesday, April 19, 2011

WebCenter Navigation: Linking between nodes

The WebCenter PS3 release introduced the "Navigation Model" concept.  You can see the sort of navigation that you can create in John Brunswick's post.

One feature in the navigation model is an "ExtenalId" attribute.  This attribute allows you to have a direct reference to node within the navigation model without having to go through the parent nodes.
However, you can actually use the node directly within the navigation model itself.  This means you can have nodes that reference other nodes and create something similar to a symbolic link between nodes.

eg:  If you have a basic navigation model listing a number of pages, you can reference any of these pages by adding an "ExternalId" attribute to it.  See the bolded entries below:


    <url factoryClass="oracle.webcenter.portalframework.sitestructure.rc.AdfPageResourceFactory"
         url="page://oracle/webcenter/portalapp/pages/hr.jspx"
         id="HumanResources"
         visible="#{true}">
      <attributes>
        <attribute attributeId="Title" isKey="false" value="Human Resources"/>
        <attribute attributeId="ExternalId" isKey="false"
                   value="humanResources"/>

      </attributes>
    </url>
    <url factoryClass="oracle.webcenter.portalframework.sitestructure.rc.AdfPageResourceFactory"
         url="page://oracle/webcenter/portalapp/pages/customerService.jspx"
         id="CustomerService" visible="#{true}">
      <attributes>
        <attribute attributeId="Title" isKey="false" value="Customer Service"/>
      </attributes>
    </url>
    <url factoryClass="oracle.webcenter.portalframework.sitestructure.rc.AdfPageResourceFactory"
         url="page://oracle/webcenter/portalapp/pages/support.jspx" id="Support"
         visible="#{true}">
      <attributes>
        <attribute attributeId="Title" isKey="false" value="Support"/>
      </attributes>
    </url>
    <url factoryClass="oracle.webcenter.portalframework.sitestructure.rc.UrlResourceFactory"
         id="linkToHumanResources" visible="#{true}" url="wcnav_externalId/humanResources">
      <attributes>
        <attribute attributeId="Title" isKey="false"
                   value="Link To Human Resources"/>
      </attributes>
    </url>

When you click on "Link To Human Resources" the current selection will be set to the actual "Human Resources" node and will navigate to that node.  This is all done within the request so there is no re-direct required.

You can use this feature to also link from a parent entry to a desired child.  eg: 

    <url factoryClass="oracle.webcenter.portalframework.sitestructure.rc.UrlResourceFactory"
         id="ContactUs" visible="#{true}" url="wcnav_externalId/humanResources">
      <attributes>
        <attribute attributeId="Title" isKey="false"
                   value="Contact Us"/>
      </attributes>
      <contents>
        <url factoryClass="oracle.webcenter.portalframework.sitestructure.rc.AdfPageResourceFactory"
             url="page://oracle/webcenter/portalapp/pages/support.jspx"
             id="Support" visible="#{true}">
          <attributes>
            <attribute attributeId="Title" isKey="false" value="Support"/>
          </attributes>
        </url>
        <url factoryClass="oracle.webcenter.portalframework.sitestructure.rc.AdfPageResourceFactory"
             url="page://oracle/webcenter/portalapp/pages/hr.jspx"
             id="HumanResources" visible="#{true}">
          <attributes>
            <attribute attributeId="Title" isKey="false"
                       value="Human Resources"/>
            <attribute attributeId="ExternalId" isKey="false"
                       value="humanResources"/>

          </attributes>
        </url>
        <url factoryClass="oracle.webcenter.portalframework.sitestructure.rc.AdfPageResourceFactory"
             url="page://oracle/webcenter/portalapp/pages/customerService.jspx"
             id="CustomerService" visible="#{true}">
          <attributes>
            <attribute attributeId="Title" isKey="false"
                       value="Customer Service"/>
          </attributes>
        </url>
      </contents>
    </url>

No comments:

Post a Comment