org.apache.jetspeed.services.portaltoolkit
Class JetspeedPortalToolkitService

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.jetspeed.services.portaltoolkit.JetspeedPortalToolkitService
All Implemented Interfaces:
org.apache.turbine.services.Initable, PortalToolkitService, org.apache.turbine.services.Service

public class JetspeedPortalToolkitService
extends org.apache.turbine.services.TurbineBaseService
implements PortalToolkitService

Simple implementation of the PortalFactoryService.

Version:
$Id: JetspeedPortalToolkitService.java,v 1.34 2005/03/21 18:21:43 sgala Exp $
Author:
RaphaŽl Luta, David Sean Taylor, Mark Orciuch

Nested Class Summary
protected static class JetspeedPortalToolkitService.VariableInteger
           
 
Field Summary
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, properties, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.jetspeed.services.portaltoolkit.PortalToolkitService
SERVICE_NAME
 
Constructor Summary
JetspeedPortalToolkitService()
           
 
Method Summary
protected  java.lang.String findSkin(Portlets portlets)
          Helps locate a skin, recursively if neccesary.
 PortletControl getControl(Control control)
          Instanciates a PortletControl based on a PSML Control object
protected  PortletControl getControl(Control control, PortletEntry entry)
           
 PortletControl getControl(java.lang.String name)
          Instanciates a PortletControl based on a Registry entry, if available or directly from a classname.
 PortletController getController(Controller controller)
          Instantiates a PortletController based on a PSML Controller object
 PortletController getController(java.lang.String name)
          Instanciates a PortletController based on a Registry entry, if available or directly from a classname.
 SecurityReference getDefaultSecurityRef(Profile profile)
          Gets default security ref based on the profile type (user|role|group).
 SecurityReference getDefaultSecurityRef(java.lang.String type)
          Gets default security ref based on the profile type (user|role|group).
protected static MetaData getMetaData(Portlets portlets)
          Create a MetaData object from a PSML Metainfo object
protected static java.util.Map getParameters(Control control)
          Retrieves the parameters from a PSML Control object
protected static java.util.Map getParameters(Controller controller)
          Retrieves the parameters from a PSML Controller object
protected static java.util.Map getParameters(Layout layout)
          Retrieves a parameter Map from an array of PSML Layout object
protected static java.util.Map getParameters(Portlets portlets)
          Fetches the parameters out of a PSML Portlets entry
protected static java.util.Map getParameters(Skin skin)
          Retrieves a parameter Map from a PSML skin object
protected  PortletConfig getPortletConfig(Portlets portlets)
          Given a PSML Portlets, get the value of what its PortletConfig would be.
protected static int getPosition(Layout layout)
          Get the position value in a Layout object
 Portlets getReference(java.lang.String locatorPath)
          Given a locator String path, returns a Portlets collecton
 PortletSet getSet(Portlets portlets)
          Creates a PortletSet from a PSML portlets description
protected  PortletSet getSet(Portlets portlets, JetspeedPortalToolkitService.VariableInteger theCount)
          Creates a PortletSet from a PSML portlets description, updating the portletset name based on its position within the tree
 PortletSkin getSkin(Skin skin)
          Create a PortletSkin object based on PSML skin description
 PortletSkin getSkin(java.lang.String name)
          Create a PortletSkin object based on a Registry skin name
 void init(javax.servlet.ServletConfig conf)
          This is the early initialization method called by the Turbine Service framework
protected  PortletControl initControl(PortletControl pc, Portlet portlet)
          Associates a PortletControl with an existing Portlet and returns the Control
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init, init, shutdown
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, init, setInitableBroker, shutdown
 

Constructor Detail

JetspeedPortalToolkitService

public JetspeedPortalToolkitService()
Method Detail

init

public void init(javax.servlet.ServletConfig conf)
          throws org.apache.turbine.services.InitializationException
This is the early initialization method called by the Turbine Service framework

Throws:
org.apache.turbine.services.InitializationException

getControl

public PortletControl getControl(java.lang.String name)
Instanciates a PortletControl based on a Registry entry, if available or directly from a classname.

Specified by:
getControl in interface PortalToolkitService
Parameters:
name - a PortletControl name available in the registry or a classname
Returns:
the created PortletControl

getControl

public PortletControl getControl(Control control)
Instanciates a PortletControl based on a PSML Control object

Specified by:
getControl in interface PortalToolkitService
Parameters:
control - the PSML control object
Returns:
the created PortletControl

getControl

protected PortletControl getControl(Control control,
                                    PortletEntry entry)

getController

public PortletController getController(java.lang.String name)
Instanciates a PortletController based on a Registry entry, if available or directly from a classname.

Specified by:
getController in interface PortalToolkitService
Parameters:
name - a PortletController name available in the registry or a classname
Returns:
the created PortletController

getController

public PortletController getController(Controller controller)
Instantiates a PortletController based on a PSML Controller object

Specified by:
getController in interface PortalToolkitService
Parameters:
controller - the PSML controller object
Returns:
the created PortletController

getSkin

public PortletSkin getSkin(java.lang.String name)
Create a PortletSkin object based on a Registry skin name

Specified by:
getSkin in interface PortalToolkitService
Parameters:
name - the registry SkinEntry name
Returns:
the new PortletSkin object

getSkin

public PortletSkin getSkin(Skin skin)
Create a PortletSkin object based on PSML skin description

Specified by:
getSkin in interface PortalToolkitService
Parameters:
skin - the PSML Skin object
Returns:
the new PortletSkin object

getSet

public PortletSet getSet(Portlets portlets)
Creates a PortletSet from a PSML portlets description

Specified by:
getSet in interface PortalToolkitService
Parameters:
portlets - the PSML portlet set description
Returns:
a new instance of PortletSet

getSet

protected PortletSet getSet(Portlets portlets,
                            JetspeedPortalToolkitService.VariableInteger theCount)
Creates a PortletSet from a PSML portlets description, updating the portletset name based on its position within the tree

Parameters:
portlets - the PSML portlet set description
Returns:
a new instance of PortletSet

initControl

protected PortletControl initControl(PortletControl pc,
                                     Portlet portlet)
Associates a PortletControl with an existing Portlet and returns the Control

Parameters:
pc - the existing PortletControl
portlet - the existing Portlet to be associated with the control
Returns:
first PortletControl associated with the portlet

getPortletConfig

protected PortletConfig getPortletConfig(Portlets portlets)
Given a PSML Portlets, get the value of what its PortletConfig would be.

Returns:
the newly created PortletConfig object

getParameters

protected static java.util.Map getParameters(Portlets portlets)
Fetches the parameters out of a PSML Portlets entry

Parameters:
portlets - the Portlets entry to check for parameters
Returns:
a Map containing the parameters names/values, an empty Dictionary is returned if there are no parameters

getParameters

protected static java.util.Map getParameters(Control control)
Retrieves the parameters from a PSML Control object

Parameters:
control - the PSML object to explore
Returns:
a Map of the existing control parameters or an empty map

getParameters

protected static java.util.Map getParameters(Controller controller)
Retrieves the parameters from a PSML Controller object

Parameters:
controller - the PSML object to explore
Returns:
a Map of the existing controller parameters or an empty map

getParameters

protected static java.util.Map getParameters(Layout layout)
Retrieves a parameter Map from an array of PSML Layout object

Parameters:
layout - the Layout object to use
Returns:
a Map containing the names/values, an empty map is returned if there are no properties

getParameters

protected static java.util.Map getParameters(Skin skin)
Retrieves a parameter Map from a PSML skin object

Parameters:
skin - the Skin object to use
Returns:
a Map containing the names/values, an empty map is returned if there are no properties

getMetaData

protected static MetaData getMetaData(Portlets portlets)
Create a MetaData object from a PSML Metainfo object

Returns:
the new MetaData object, empty if meta is null

getPosition

protected static int getPosition(Layout layout)
Get the position value in a Layout object

Parameters:
layout - the Layout object to use
Returns:
the defined position or -1 if undefined

getReference

public Portlets getReference(java.lang.String locatorPath)
Given a locator String path, returns a Portlets collecton

Specified by:
getReference in interface PortalToolkitService
Parameters:
locatorPath - ProfileLocator resource path identifier
Returns:
a portlets collection from the PSML resource

findSkin

protected java.lang.String findSkin(Portlets portlets)
Helps locate a skin, recursively if neccesary.

getDefaultSecurityRef

public SecurityReference getDefaultSecurityRef(Profile profile)
Gets default security ref based on the profile type (user|role|group). Returns null if no default is defined.

Specified by:
getDefaultSecurityRef in interface PortalToolkitService
Parameters:
profile -
Returns:
default security reference

getDefaultSecurityRef

public SecurityReference getDefaultSecurityRef(java.lang.String type)
Gets default security ref based on the profile type (user|role|group). Returns null if no default is defined.

Specified by:
getDefaultSecurityRef in interface PortalToolkitService
Parameters:
type - of entity to return default security ref for
Returns:
default security reference


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.