org.jasig.portal.portlet.registry
Interface IPortletDefinitionRegistry

All Known Implementing Classes:
PortletDefinitionRegistryImpl

public interface IPortletDefinitionRegistry

Provides methods for creating and accessing IPortletDefinition and related objects.

Version:
$Revision$
Author:
Eric Dalquist

Method Summary
 IPortletDefinition createPortletDefinition(int channelPublishId)
          Creates a new, persisted, portlet definition for the published channel.
 IPortletDefinition getOrCreatePortletDefinition(int channelPublishId)
          Convience for getPortletDefinition(int) and 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.
 Tuple<String,String> getPortletDescriptorKeys(IPortletDefinition portletDefinition)
          Get the portletApplicationId and portletName for the specified portlet definition.
 void updatePortletDefinition(IPortletDefinition portletDefinition)
          Persists changes to a IPortletDefinition.
 

Method Detail

getPortletDefinition

IPortletDefinition getPortletDefinition(IPortletDefinitionId portletDefinitionId)
Get an existing portlet definition for the definition id. If no definition exists for the id null will be returned.

Parameters:
portletDefinitionId - The id of the definition to retrieve
Returns:
The portlet definition for the id, null if no definition exists for the id.
Throws:
IllegalArgumentException - If portletDefinitionId is null.

getPortletDefinition

IPortletDefinition getPortletDefinition(int channelPublishId)
Get an existing portlet definition for the channel publish id. If no definition exists for the id null will be returned.

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.
Throws:
IllegalArgumentException - If channelPublishId is null.

createPortletDefinition

IPortletDefinition createPortletDefinition(int channelPublishId)
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.

Parameters:
channelPublishId - The id of the org.jasig.portal.ChannelDefinition this portlet definition represents.
Returns:
A new definition for the parameters
Throws:
DataIntegrityViolationException - If a definition already exists for the specified channelPublishId
DataRetrievalFailureException - If no org.jasig.portal.ChannelDefinition can be found for the publish ID or the channel definition does not have the required channel parameters IPortletAdaptor.CHANNEL_PARAM__PORTLET_APPLICATION_ID and IPortletAdaptor.CHANNEL_PARAM__PORTLET_NAME.

getOrCreatePortletDefinition

IPortletDefinition getOrCreatePortletDefinition(int channelPublishId)
Convience for getPortletDefinition(int) and createPortletDefinition(int). If the get returns null the definition will be created and returned.

See Also:
getPortletDefinition(int), createPortletDefinition(int)

updatePortletDefinition

void updatePortletDefinition(IPortletDefinition portletDefinition)
Persists changes to a IPortletDefinition.

Parameters:
portletDefinition - The IPortletDefinition to store changes to.
Throws:
IllegalArgumentException - If portletDefinition is null

getParentPortletDescriptor

org.apache.pluto.descriptors.portlet.PortletDD getParentPortletDescriptor(IPortletDefinitionId portletDefinitionId)
                                                                          throws org.apache.pluto.PortletContainerException
Gets the parent portlet descriptor for the entity specified by the definition id.

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:
IllegalArgumentException - if portletDefinitionId is null
org.apache.pluto.PortletContainerException

getParentPortletApplicationDescriptor

org.apache.pluto.descriptors.portlet.PortletAppDD getParentPortletApplicationDescriptor(IPortletDefinitionId portletDefinitionId)
                                                                                        throws org.apache.pluto.PortletContainerException
Gets the parent portlet application descriptor for the entity specified by the definition id.

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:
IllegalArgumentException - if portletDefinitionId is null
org.apache.pluto.PortletContainerException

getPortletDescriptorKeys

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



Copyright © 2010 Jasig. All Rights Reserved.