org.jasig.portal.portlet.registry
Class PortletEntityRegistryImpl

java.lang.Object
  extended by org.jasig.portal.portlet.registry.PortletEntityRegistryImpl
All Implemented Interfaces:
IPortletEntityRegistry

public class PortletEntityRegistryImpl
extends Object
implements IPortletEntityRegistry

Provides access to IPortletEntity objects and convenience methods for creating and converting them and related objects. The portlet adaptor channel will be responsible for listenting to unsubscribe events and cleaning up entity objects

Version:
$Revision$
Author:
Eric Dalquist

Field Summary
static String INTERIM_PORTLET_ENTITY_MAP_ATTRIBUTE
           
protected  org.apache.commons.logging.Log logger
           
static String PORTLET_ENTITY_ID_MAP_ATTRIBUTE
           
 
Constructor Summary
PortletEntityRegistryImpl()
           
 
Method Summary
 IPortletEntity createPortletEntity(IPortletDefinitionId portletDefinitionId, String channelSubscribeId, int userId)
          Creates a new, persisted, portlet entity for the published and subscribed to channel.
 void deletePortletEntity(IPortletEntity portletEntity)
          Removes a portlet entity and all related data from the persistent store.
protected  Set<org.jasig.portal.portlet.registry.InterimPortletEntityImpl> getInterimPortletEntities(int userId)
           
protected  org.jasig.portal.portlet.registry.InterimPortletEntityImpl getInterimPortletEntity(IPortletEntityId portletEntityId)
           
protected  org.jasig.portal.portlet.registry.InterimPortletEntityImpl getInterimPortletEntity(String channelSubscribeId, int userId)
           
protected  org.jasig.portal.portlet.registry.PortletEntityRegistryImpl.InterimPortletEntityCache getInterimPortletEntityCache()
           
 IPortletEntity getOrCreatePortletEntity(IPortletDefinitionId portletDefinitionId, String channelSubscribeId, int userId)
          Convience for IPortletEntityRegistry.getPortletEntity(String, int) and IPortletEntityRegistry.createPortletEntity(IPortletDefinitionId, String, int).
 IPortletDefinition getParentPortletDefinition(IPortletEntityId portletEntityId)
          Gets the parent portlet definition for the entity specified by the entity id.
protected  IPortletEntityId getPersistentId(IPortletEntityId wrapperId)
           
protected  Map<IPortletEntityId,IPortletEntityId> getPersistentIdMap()
           
 IPortletDefinitionRegistry getPortletDefinitionRegistry()
           
 Set<IPortletEntity> getPortletEntitiesForUser(int userId)
          Get all IPortletEntitys that exist for the specified user id.
 IPortletEntity getPortletEntity(IPortletEntityId portletEntityId)
          Get an existing portlet entity for the entity id.
 IPortletEntity getPortletEntity(String portletEntityIdString)
          Get an existing portlet entity for the String version of the entity id.
 IPortletEntity getPortletEntity(String channelSubscribeId, int userId)
          Get an existing portlet entity for the channel subscribe id and person.
 IPortletEntityDao getPortletEntityDao()
           
protected  HttpSession getSession()
           
protected  void removeInterimPortletEntity(IPortletEntityId portletEntityId)
           
protected  void removePersistentId(IPortletEntityId wrapperId)
           
protected  void setPersistentIdMapping(IPortletEntityId wrapperId, IPortletEntityId persistentId)
           
 void setPortalRequestUtils(IPortalRequestUtils portalRequestUtils)
           
 void setPortletDefinitionRegistry(IPortletDefinitionRegistry portletDefinitionRegistry)
           
 void setPortletEntityDao(IPortletEntityDao portletEntityDao)
           
protected  void storeInterimPortletEntity(org.jasig.portal.portlet.registry.InterimPortletEntityImpl interimPortletEntity)
           
 void storePortletEntity(IPortletEntity portletEntity)
          Stores changes made to an existing portlet entity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERIM_PORTLET_ENTITY_MAP_ATTRIBUTE

public static final String INTERIM_PORTLET_ENTITY_MAP_ATTRIBUTE

PORTLET_ENTITY_ID_MAP_ATTRIBUTE

public static final String PORTLET_ENTITY_ID_MAP_ATTRIBUTE

logger

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

PortletEntityRegistryImpl

public PortletEntityRegistryImpl()
Method Detail

getPortletEntityDao

public IPortletEntityDao getPortletEntityDao()
Returns:
the portletEntityDao

setPortletEntityDao

public void setPortletEntityDao(IPortletEntityDao portletEntityDao)
Parameters:
portletEntityDao - the portletEntityDao to set

getPortletDefinitionRegistry

public IPortletDefinitionRegistry getPortletDefinitionRegistry()
Returns:
the portletDefinitionRegistry

setPortletDefinitionRegistry

public void setPortletDefinitionRegistry(IPortletDefinitionRegistry portletDefinitionRegistry)
Parameters:
portletDefinitionRegistry - the portletDefinitionRegistry to set

setPortalRequestUtils

public void setPortalRequestUtils(IPortalRequestUtils portalRequestUtils)

createPortletEntity

public IPortletEntity createPortletEntity(IPortletDefinitionId portletDefinitionId,
                                          String channelSubscribeId,
                                          int userId)
Description copied from interface: IPortletEntityRegistry
Creates a new, persisted, portlet entity for the published and subscribed to channel. If an existing IPortletDefinition can't be found for the portletDefinitionId or an entity already exists for the channel subscribe id and person an exception will be thrown.

Specified by:
createPortletEntity in interface IPortletEntityRegistry
Parameters:
portletDefinitionId - The definition id of the underlying IPortletDefinition
channelSubscribeId - The layout subscription id for the underlying channel.
userId - The id of the person the entity is for.
Returns:
A new entity for the parameters

getPortletEntity

public IPortletEntity getPortletEntity(IPortletEntityId portletEntityId)
Description copied from interface: IPortletEntityRegistry
Get an existing portlet entity for the entity id. If no entity exists for the id null will be returned.

Specified by:
getPortletEntity in interface IPortletEntityRegistry
Parameters:
portletEntityId - The id of the entity to retrieve
Returns:
The portlet entity for the id, null if no entity exists for the id.

getPortletEntity

public IPortletEntity getPortletEntity(String portletEntityIdString)
Description copied from interface: IPortletEntityRegistry
Get an existing portlet entity for the String version of the entity id. If an exception occurs while parsing the String into an IPortletEntityId an IllegalArgumentException will be thrown. If no entity exists for the id null will be returned.

Specified by:
getPortletEntity in interface IPortletEntityRegistry
Parameters:
portletEntityIdString - The id of the entity to retrieve
Returns:
The portlet entity for the id, null if no entity exists for the id.

getPortletEntity

public IPortletEntity getPortletEntity(String channelSubscribeId,
                                       int userId)
Description copied from interface: IPortletEntityRegistry
Get an existing portlet entity for the channel subscribe id and person. If no entity exists for the parameters null will be returned.

Specified by:
getPortletEntity in interface IPortletEntityRegistry
Parameters:
channelSubscribeId - The layout subscription id for the underlying channel.
userId - The if of the person the entity is for.
Returns:
The portlet entity for the subscribe id and person, null if no entity exists for the parameters.

getPortletEntitiesForUser

public Set<IPortletEntity> getPortletEntitiesForUser(int userId)
Description copied from interface: IPortletEntityRegistry
Get all IPortletEntitys that exist for the specified user id. (From IPerson.getID().

Specified by:
getPortletEntitiesForUser in interface IPortletEntityRegistry
Parameters:
userId - The id of the user to get the entities for.
Returns:
A set of all entities base on the specified user id, will be empty if no entities exist for the id, will never be null.

getOrCreatePortletEntity

public IPortletEntity getOrCreatePortletEntity(IPortletDefinitionId portletDefinitionId,
                                               String channelSubscribeId,
                                               int userId)
Description copied from interface: IPortletEntityRegistry
Convience for IPortletEntityRegistry.getPortletEntity(String, int) and IPortletEntityRegistry.createPortletEntity(IPortletDefinitionId, String, int). If the get returns null the entity will be created and returned.

Specified by:
getOrCreatePortletEntity in interface IPortletEntityRegistry
See Also:
IPortletEntityRegistry.getPortletEntity(String, int), IPortletEntityRegistry.createPortletEntity(IPortletDefinitionId, String, int)

storePortletEntity

public void storePortletEntity(IPortletEntity portletEntity)
Description copied from interface: IPortletEntityRegistry
Stores changes made to an existing portlet entity

Specified by:
storePortletEntity in interface IPortletEntityRegistry
Parameters:
portletEntity - The entity to update the persistent store for

deletePortletEntity

public void deletePortletEntity(IPortletEntity portletEntity)
Description copied from interface: IPortletEntityRegistry
Removes a portlet entity and all related data from the persistent store.

Specified by:
deletePortletEntity in interface IPortletEntityRegistry
Parameters:
portletEntity - The the entity to delete.

getParentPortletDefinition

public IPortletDefinition getParentPortletDefinition(IPortletEntityId portletEntityId)
Description copied from interface: IPortletEntityRegistry
Gets the parent portlet definition for the entity specified by the entity id.

Specified by:
getParentPortletDefinition in interface IPortletEntityRegistry
Parameters:
portletEntityId - The entity ID to get the parent definition for.
Returns:
The parent portlet definition for the entity, null if no entity exists for the id.

setPersistentIdMapping

protected void setPersistentIdMapping(IPortletEntityId wrapperId,
                                      IPortletEntityId persistentId)

getPersistentId

protected IPortletEntityId getPersistentId(IPortletEntityId wrapperId)

removePersistentId

protected void removePersistentId(IPortletEntityId wrapperId)

getPersistentIdMap

protected Map<IPortletEntityId,IPortletEntityId> getPersistentIdMap()

removeInterimPortletEntity

protected void removeInterimPortletEntity(IPortletEntityId portletEntityId)

getInterimPortletEntity

protected org.jasig.portal.portlet.registry.InterimPortletEntityImpl getInterimPortletEntity(IPortletEntityId portletEntityId)

getInterimPortletEntity

protected org.jasig.portal.portlet.registry.InterimPortletEntityImpl getInterimPortletEntity(String channelSubscribeId,
                                                                                             int userId)

getInterimPortletEntities

protected Set<org.jasig.portal.portlet.registry.InterimPortletEntityImpl> getInterimPortletEntities(int userId)

storeInterimPortletEntity

protected void storeInterimPortletEntity(org.jasig.portal.portlet.registry.InterimPortletEntityImpl interimPortletEntity)

getInterimPortletEntityCache

protected org.jasig.portal.portlet.registry.PortletEntityRegistryImpl.InterimPortletEntityCache getInterimPortletEntityCache()

getSession

protected HttpSession getSession()
Returns:
The session for the current request, will return null if not in request


Copyright © 2010 Jasig. All Rights Reserved.