Show TOC

Working with Administration (PCM) ObjectsLocate this document in the navigation structure

Use

When working with PCD objects, you can use administration objects, which provide a set of common interfaces that are implemented by all semantic objects. Although less specific than methods exposed by semantic interfaces, the administrative interfaces serve as an abstraction layer above the low-level PCD interfaces.

More information about PCM and the purpose of administration interfaces: Portal Content Model (PCM) .

There is one main administration interface, IAdminBase , which you obtain directly from a PCD lookup, as described below. From the IAdminBase interface, you can derive the following additional interfaces:

  • IAttributeSet: Provides access to an object's attributes, and enables you to look up, create, modify and delete attributes and meta-attributes, as described in Getting or Setting Attributes of Administration Objects .

  • IPermission: Provides access to an object's permissions, and enables you to check if a user has a specific permission for an object, as described in Checking Permissions .

  • ICatalogNode: Provides information about the object that is useful for building an administration editor, as described in Catalog Node Attributes .

    For example, this interface provides the icon and display name for the underlying object, which can then be displayed in an editor.

You can also find out the underlying object type of a PCD object by calling the IAdminBase.getObjectType() method.

Getting the IAdminBase Interface

The following describes how to get the main administration interface, IAdminBase , for a specific object.

  1. Set the parameters for a JNDI lookup in the PCD, including setting the aspect to ASPECT_ADMINISTRATION .

                         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_ADMINISTRATION);
    
                      
  2. Perform a lookup by doing the following:

    1. Create an initial context with the parameters in your Hashtable object.

    2. Perform a lookup on your initial context, supplying the PCD name of the object, and then cast the returned object to IAdminBase .

                         InitialContext iCtx = null;
    try {
        String objectName = "pcd:portal_content/myFolder/stocks";
     
        iCtx = new InitialContext(env);
        IAdminBase result =(IAdminBase)iCtx.lookup(objectName);
    }       
    catch(Exception e) {}
    
                      

Getting Other Interfaces

The following shows how to get secondary administration interfaces ( IAttributeSet , IPermission and ICatalogNode ) from an IAdminBase object:

               IAdminBase result =(IAdminBase)iCtx.lookup(objectName);
 
IAttributeSet myIview = (IAttributeSet)
    result.getImplementation(IAdminBase.ATTRIBUTE_SET);

            
Note

For information about additional administration interfaces, refer to the IAdminBase Javadoc.