Show TOC Start of Content Area

Procedure documentation Adding Related Items  Locate the document in its SAP Library structure

This section describes how to associate iViews with other iViews or pages, so that when an iView is displayed, links to its related iViews and pages are displayed in the detailed navigation panel.

The following types of related items can be created:

      Related Links: Links to the related iViews and pages are displayed in the Related Links iView of the navigation panel.

      Dynamic Navigation: The content of the related iViews and pages are displayed in the Dynamic Navigation iView of the navigation panel.

      Target Components: Links to the related iViews and pages are displayed in the Drag&Relate Targets iView of the navigation panel.

Procedure

...

       1.      Set the parameters for a JNDI lookup in the PCD.

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY,
    IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);

env.put(Context.SECURITY_PRINCIPAL, request.getUser());

env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);

       2.      Perform a lookup of the iView to which you want to add related items, and cast the object as an IiView object.

InitialContext iCtx = null;

try

{

    iCtx = new InitialContext(env);

    IiView myIView =(IiView)iCtx.lookup(iViewId);

 

...

       3.      Create a descriptor (INewObjectDescriptor object) for the iView or page that you want to add as a related link.

    IiViews iViewSrv = (IiViews)
        PortalRuntime.getRuntimeResources().getService(IiViews.KEY);

   

    INewObjectDescriptor iViewDescriptor =
   
    (INewObjectDescriptor)iViewSrv.instantiateDescriptor
       
    (CreateMethod.DELTA_LINK,
           
    "pcd:portal_content/testxml", request.getUser());

       4.      Add the related item descriptor to the iView.

...

 

    myIView.addRelatedItem(iViewDescriptor,"testxml",
   
    RelatedItemType.DYNAMIC_NAVIGATION);

 

}      

catch(NamingException e)

{

}

 

 

 

End of Content Area