org.apache.jetspeed.services.portletfactory
Class JetspeedPortletFactoryService

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.portletfactory.JetspeedPortletFactoryService
All Implemented Interfaces:
org.apache.turbine.services.Initable, PortletFactoryService, org.apache.turbine.services.Service

public class JetspeedPortletFactoryService
extends org.apache.turbine.services.TurbineBaseService
implements PortletFactoryService

Simple implementation of the PortalFactoryService.

Version:
$Id: JetspeedPortletFactoryService.java,v 1.25 2005/03/21 18:21:44 sgala Exp $
Author:
Raphaël Luta, Scott T. Weaver

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.portletfactory.PortletFactoryService
SERVICE_NAME
 
Constructor Summary
JetspeedPortletFactoryService()
           
 
Method Summary
protected  void addParentInitParameters(PortletEntry entry, java.util.Map hash)
          Maps all parameters, not found within the entry, from the entry's parent into the entry
protected  java.lang.String getClassname(PortletEntry entry)
          Retruns the classname defined for this PortletEntry.
protected static MetaData getMetaData(Entry entry)
          Create a MetaData object from a PSML Metainfo object
protected static MetaData getMetaData(PortletEntry entry)
          Create a MetaData object from a registry Metainfo object
protected static java.util.Map getParameters(Entry entry)
          Fetches the parameters out of a PSML Entry
protected static PortletEntry getParentEntry(PortletEntry entry)
           
 Portlet getPortlet(Entry entry)
          Given a PSML Entry return an instanciated Portlet.
protected  Portlet getPortlet(java.lang.String classname, PortletConfig pc, java.lang.String id)
          Instanciates or retrieve from memory cache a portlet corresponding to the passed parameters
 Portlet getPortlet(java.lang.String name, java.lang.String id)
          Given a Portlet registry entry name, instanciate it
protected  PortletConfig getPortletConfig(PortletEntry portletEntry, java.lang.String id)
          Given a Registry Entry, get the value of what its PortletConfig would be.
protected  SecurityReference getSecurityReference(Entry entry, PortletEntry pEntry)
          Figures out how to produce a security reference for this portlet.
 void init(javax.servlet.ServletConfig conf)
          This is the early initialization method called by the Turbine Service framework
 
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

JetspeedPortletFactoryService

public JetspeedPortletFactoryService()
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

getPortlet

public Portlet getPortlet(Entry entry)
                   throws PortletException
Given a PSML Entry return an instanciated Portlet.

Specified by:
getPortlet in interface PortletFactoryService
Parameters:
entry - a PSML Entry describing a portlet
Returns:
an instanciated portlet corresponding to this entry
Throws:
PortletException

getPortlet

public Portlet getPortlet(java.lang.String name,
                          java.lang.String id)
                   throws PortletException
Given a Portlet registry entry name, instanciate it

Specified by:
getPortlet in interface PortletFactoryService
Parameters:
name - the name of a portlet in the registry
Returns:
an instanciated portlet corresponding to this entry
Throws:
PortletException

getPortlet

protected Portlet getPortlet(java.lang.String classname,
                             PortletConfig pc,
                             java.lang.String id)
                      throws PortletException
Instanciates or retrieve from memory cache a portlet corresponding to the passed parameters

Parameters:
classname - the classname of the portlet to instanciate
pc - the PortletConfig object to be associated with this object
id - the PSML entry's portlet id
Returns:
the Portlet created or retrieve from cache
Throws:
PortletException

getPortletConfig

protected PortletConfig getPortletConfig(PortletEntry portletEntry,
                                         java.lang.String id)
Given a Registry Entry, get the value of what its PortletConfig would be.

Returns:
the newly created PortletConfig object

getParameters

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

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

getMetaData

protected static MetaData getMetaData(Entry entry)
Create a MetaData object from a PSML Metainfo object

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

getMetaData

protected static MetaData getMetaData(PortletEntry entry)
Create a MetaData object from a registry Metainfo object

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

getParentEntry

protected static PortletEntry getParentEntry(PortletEntry entry)
Returns:
PortletEntry Parent of Entry

getClassname

protected java.lang.String getClassname(PortletEntry entry)
Retruns the classname defined for this PortletEntry. If no classname was defined, the parent is queried


addParentInitParameters

protected void addParentInitParameters(PortletEntry entry,
                                       java.util.Map hash)
Maps all parameters, not found within the entry, from the entry's parent into the entry


getSecurityReference

protected SecurityReference getSecurityReference(Entry entry,
                                                 PortletEntry pEntry)
Figures out how to produce a security reference for this portlet.



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