PortalToolManager

The P'ortalToolManager 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 P'ortalObjects. Most of the methods are not used by tool developers. A plugin will normally just use it to access P'*_ortalObjects (via Flow).

Configuration

The P_*'ortalToolManager 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 P'*_ortalObjects object which provides easy access to the important portal objects

releasePortalObjects(P*'ortalObjects)_: releases a P'*_ortalObjects object

For more information have a look at the source.

Sample

How to use the P_*'ortalToolManager in Flow:

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