Show TOC

Procedure documentationLooking Up Objects Locate this document in the navigation structure

 

This section describes how to look up a PCD object and get the semantic object for the object.

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 the lookup by supplying the PCD name of the object, and then cast the returned object to the appropriate semantic object interface.

    Syntax Syntax

    1. InitialContext iCtx = null;
      try
      {
          String iViewID = "pcd:portal_content/myFolder/stocks";
      
          iCtx = new InitialContext(env);
          IiView myIView =(IiView)iCtx.lookup(iViewID);
      }       
      catch(NamingException e)
      {
      }
      
    End of the code.