org.jaffa.presentation.portlet.component
Class ComponentManager

java.lang.Object
  extended byorg.jaffa.presentation.portlet.component.ComponentManager

public class ComponentManager
extends Object

This is a Factory for creating Component instances


Constructor Summary
ComponentManager()
           
 
Method Summary
static ComponentDefinition find(String comp)
          Locate the named component.
static Map getComponentRequirements()
          Get the component requirements, this is Map of mandatory business functions that a user must have access to, to run this component.
static Component run(String comp, UserSession us)
          Creates an instance of the named component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentManager

public ComponentManager()
Method Detail

run

public static Component run(String comp,
                            UserSession us)
Creates an instance of the named component. This component is then added to the UserSession. This may throw the runtime ComponentCreationRuntimeException

Parameters:
comp - The name of the component to create. There should be a valid definition for this name in the 'components.xml' file
us - The UserSession to which this component will be added
Returns:
An instance of the Component

find

public static ComponentDefinition find(String comp)
Locate the named component. This routine uses a cache of ComponentDefinitions. If the cache has not been initialized, this will initialize it by reading in and XML file into the component domain objects (via JAXB), and then create a pool of component definition objects. If the specified component id not found this throws a ComponentCreationRuntimeException


getComponentRequirements

public static Map getComponentRequirements()
Get the component requirements, this is Map of mandatory business functions that a user must have access to, to run this component. Each entry in the map is a component and its 'required' functions is stored as the 'value'. The 'value' is stored as and Array([]) of Strings . If there is no entry in the map for a given a component, it has no required business functions and is there for not constrained by the security system.

Returns:
a Map containing component requirements.


Copyright © 2002-2004 JAFFA Project.