org.jasig.portal.portlet.registry
Class PortletDefinitionRegistryImpl

java.lang.Object
  extended by org.jasig.portal.portlet.registry.PortletDefinitionRegistryImpl
All Implemented Interfaces:
IPortletDefinitionRegistry, ServletContextAware

public class PortletDefinitionRegistryImpl
extends Object
implements IPortletDefinitionRegistry, ServletContextAware

Implementation of the definition registry, pulls together the related parts of the framework for creation and access of IPortletDefinitions. TODO this needs to listen for channel deletion events and remove the corresponding portlet definition, this would likley need a hook in ChannelRegistryManager.removeChannel

Version:
$Revision$
Author:
Eric Dalquist

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
PortletDefinitionRegistryImpl()
           
 
Method Summary
 IPortletDefinition createPortletDefinition(int channelPublishId)
          Creates a new, persisted, portlet definition for the published channel.
 IChannelRegistryStore getChannelRegistryStore()
           
 org.apache.pluto.OptionalContainerServices getOptionalContainerServices()
           
 IPortletDefinition getOrCreatePortletDefinition(int channelPublishId)
          Convience for IPortletDefinitionRegistry.getPortletDefinition(int) and IPortletDefinitionRegistry.createPortletDefinition(int).
 org.apache.pluto.descriptors.portlet.PortletAppDD getParentPortletApplicationDescriptor(IPortletDefinitionId portletDefinitionId)
          Gets the parent portlet application descriptor for the entity specified by the definition id.
 org.apache.pluto.descriptors.portlet.PortletDD getParentPortletDescriptor(IPortletDefinitionId portletDefinitionId)
          Gets the parent portlet descriptor for the entity specified by the definition id.
 IPortletDefinition getPortletDefinition(int channelPublishId)
          Get an existing portlet definition for the channel publish id.
 IPortletDefinition getPortletDefinition(IPortletDefinitionId portletDefinitionId)
          Get an existing portlet definition for the definition id.
 IPortletDefinitionDao getPortletDefinitionDao()
           
 Tuple<String,String> getPortletDescriptorKeys(IPortletDefinition portletDefinition)
          Get the portletApplicationId and portletName for the specified channel definition id.
 void setChannelRegistryStore(IChannelRegistryStore channelRegistryStore)
           
 void setOptionalContainerServices(org.apache.pluto.OptionalContainerServices optionalContainerServices)
           
 void setPortletDefinitionDao(IPortletDefinitionDao portletDefinitionDao)
           
 void setServletContext(ServletContext servletContext)
           
 void updatePortletDefinition(IPortletDefinition portletDefinition)
          Persists changes to a IPortletDefinition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

PortletDefinitionRegistryImpl

public PortletDefinitionRegistryImpl()
Method Detail

getPortletDefinitionDao

public IPortletDefinitionDao getPortletDefinitionDao()
Returns:
the portletDefinitionDao

setPortletDefinitionDao

public void setPortletDefinitionDao(IPortletDefinitionDao portletDefinitionDao)
Parameters:
portletDefinitionDao - the portletDefinitionDao to set

getOptionalContainerServices

public org.apache.pluto.OptionalContainerServices getOptionalContainerServices()
Returns:
the optionalContainerServices

setOptionalContainerServices

public void setOptionalContainerServices(org.apache.pluto.OptionalContainerServices optionalContainerServices)
Parameters:
optionalContainerServices - the optionalContainerServices to set

getChannelRegistryStore

public IChannelRegistryStore getChannelRegistryStore()
Returns:
the channelRegistryStore

setChannelRegistryStore

public void setChannelRegistryStore(IChannelRegistryStore channelRegistryStore)
Parameters:
channelRegistryStore - the channelRegistryStore to set

setServletContext

public void setServletContext(ServletContext servletContext)
Specified by:
setServletContext in interface ServletContextAware

createPortletDefinition

public IPortletDefinition createPortletDefinition(int channelPublishId)
Description copied from interface: IPortletDefinitionRegistry
Creates a new, persisted, portlet definition for the published channel. If the org.jasig.portal.ChannelDefinition for the channelPublishId can't be found or an definition already exists for the channel definition id an exception will be thrown.

Specified by:
createPortletDefinition in interface IPortletDefinitionRegistry
Parameters:
channelPublishId - The id of the org.jasig.portal.ChannelDefinition this portlet definition represents.
Returns:
A new definition for the parameters

getPortletDefinition

public IPortletDefinition getPortletDefinition(int channelPublishId)
Description copied from interface: IPortletDefinitionRegistry
Get an existing portlet definition for the channel publish id. If no definition exists for the id null will be returned.

Specified by:
getPortletDefinition in interface IPortletDefinitionRegistry
Parameters:
channelPublishId - The id of the org.jasig.portal.ChannelDefinition this portlet definition represents.
Returns:
The portlet definition for the channelPublishId, null if no definition exists for the id.

getOrCreatePortletDefinition

public IPortletDefinition getOrCreatePortletDefinition(int channelPublishId)
Description copied from interface: IPortletDefinitionRegistry
Convience for IPortletDefinitionRegistry.getPortletDefinition(int) and IPortletDefinitionRegistry.createPortletDefinition(int). If the get returns null the definition will be created and returned.

Specified by:
getOrCreatePortletDefinition in interface IPortletDefinitionRegistry
See Also:
IPortletDefinitionRegistry.getPortletDefinition(int), IPortletDefinitionRegistry.createPortletDefinition(int)

getPortletDefinition

public IPortletDefinition getPortletDefinition(IPortletDefinitionId portletDefinitionId)
Description copied from interface: IPortletDefinitionRegistry
Get an existing portlet definition for the definition id. If no definition exists for the id null will be returned.

Specified by:
getPortletDefinition in interface IPortletDefinitionRegistry
Parameters:
portletDefinitionId - The id of the definition to retrieve
Returns:
The portlet definition for the id, null if no definition exists for the id.

updatePortletDefinition

public void updatePortletDefinition(IPortletDefinition portletDefinition)
Description copied from interface: IPortletDefinitionRegistry
Persists changes to a IPortletDefinition.

Specified by:
updatePortletDefinition in interface IPortletDefinitionRegistry
Parameters:
portletDefinition - The IPortletDefinition to store changes to.

getParentPortletApplicationDescriptor

public org.apache.pluto.descriptors.portlet.PortletAppDD getParentPortletApplicationDescriptor(IPortletDefinitionId portletDefinitionId)
                                                                                        throws org.apache.pluto.PortletContainerException
Description copied from interface: IPortletDefinitionRegistry
Gets the parent portlet application descriptor for the entity specified by the definition id.

Specified by:
getParentPortletApplicationDescriptor in interface IPortletDefinitionRegistry
Parameters:
portletDefinitionId - The definition ID to get the parent application descriptor for.
Returns:
The parent portlet descriptor for the application definition, null if no definition exists for the id.
Throws:
org.apache.pluto.PortletContainerException

getParentPortletDescriptor

public org.apache.pluto.descriptors.portlet.PortletDD getParentPortletDescriptor(IPortletDefinitionId portletDefinitionId)
                                                                          throws org.apache.pluto.PortletContainerException
Description copied from interface: IPortletDefinitionRegistry
Gets the parent portlet descriptor for the entity specified by the definition id.

Specified by:
getParentPortletDescriptor in interface IPortletDefinitionRegistry
Parameters:
portletDefinitionId - The definition ID to get the parent descriptor for.
Returns:
The parent portlet descriptor for the definition, null if no definition exists for the id.
Throws:
org.apache.pluto.PortletContainerException

getPortletDescriptorKeys

public Tuple<String,String> getPortletDescriptorKeys(IPortletDefinition portletDefinition)
Get the portletApplicationId and portletName for the specified channel definition id. The portletApplicationId will be Tuple.first and the portletName will be Tuple.second

Specified by:
getPortletDescriptorKeys in interface IPortletDefinitionRegistry


Copyright © 2010 Jasig. All Rights Reserved.