Show TOC

Procedure documentationAdding Related Items Locate this document in the navigation 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.

    Syntax Syntax

    1. 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);
      
    End of the code.
  2. Perform a lookup of the iView to which you want to add related items, and cast the object as an IiView object.

    Syntax Syntax

    1. InitialContext iCtx = null;
      try
      {
          iCtx = new InitialContext(env);
          IiView myIView =(IiView)iCtx.lookup(iViewId);
      
      ...
      
    End of the code.
  3. Create a descriptor (NewObjectDescriptor object) for the iView or page that you want to add as a related link.

    Syntax Syntax

    1. IiViews iViewSrv = (IiViews)
              PortalRuntime.getRuntimeResources().getService(IiViews.KEY);
      
          NewObjectDescriptor iViewDescriptor =
              (NewObjectDescriptor)iViewSrv.instantiateDescriptor
                  (CreateMethod.DELTA_LINK,
                      "pcd:portal_content/testxml", request.getUser());
      
    End of the code.
  4. Add the related item descriptor to the iView.

    Syntax Syntax

    1. ...
      
          myIView.addRelatedItem(iViewDescriptor,"testxml",
              RelatedItemType.DYNAMIC_NAVIGATION);
      
      }       
      catch(NamingException e)
      {
      }
      
    End of the code.