PortalToolManager

The PortalToolManager is the main component of the PortalTools framework. It contains information about all plugins and their configurations. It also provides easy access to all required PortalObjects. Most of the methods are not used by tool developers. A plugin will normally just use it to access PortalObjects (via Flow).

Configuration

The PortalToolManager is a cocoon component and must be configured in cocoon.xconf (2.1.x) or the portal's xconf (2.2). It's almost the only configuration you have to do if you add the PortalTools to an existing portal.

cocoon.xconf:

  <component class="org.apache.cocoon.portal.tools.PortalToolManager" role="org.apache.cocoon.portal.tools.PortalToolManager">
   <parameter name="root" value="context://samples/blocks/portal/tools/"/>
   <parameter name="conf" value="conf.xml"/>
   <parameter name="auth" value="auth.xml"/>
 </component>

Parameters: root: root directory of the PortalTools
conf: name of the configuration file
auth: name of the authentication file

Important Methods

getConfiguration(String path): returns a configuration object for the specified path
saveConfiguration(): saves the configuration
sGet(String path): Gets the value of the specified path from the authentication-context.
sSet(String path, String value): Stores the specified value under the path in the authentication-context.
getPortalObjects(): returns a PortalObjects object which provides easy access to the important portal objects
releasePortalObjects(PortalObjects): releases a PortalObjects object

For more information have a look at the source.

Sample

How to use the PortalToolManager in Flow:

  function editCoplet() {
    var toolManager = getPTM();
    var portalObjects = toolManager.getPortalObjects();
    var portalLayout = portalObjects.getPortalLayout();
    // Do something
    toolManager.releasePortalObjects(portalObjects);
    relPTM(toolManager);
  }

PortalToolManager (last edited 2009-09-20 23:41:40 by localhost)