org.jasig.portal.portlet.dao
Interface IPortletEntityDao

All Known Implementing Classes:
JpaPortletEntityDao, TransientPortletEntityDao

public interface IPortletEntityDao

Provides APIs for creating, storing and retrieving IPortletEntity objects.

Version:
$Revision$
Author:
Eric Dalquist

Method Summary
 IPortletEntity createPortletEntity(IPortletDefinitionId portletDefinitionId, String channelSubscribeId, int userId)
          Creates, initializes and persists a new IPortletEntity based on the specified IPortletDefinitionId, channel subscribe id and user id.
 void deletePortletEntity(IPortletEntity portletEntity)
          Removes the specified IPortletEntity from the persistent store.
 Set<IPortletEntity> getPortletEntities(IPortletDefinitionId portletDefinitionId)
          Get all IPortletEntitys based on the specified IPortletDefinitionId.
 Set<IPortletEntity> getPortletEntitiesForUser(int userId)
          Get all IPortletEntitys that exist for the specified user id.
 IPortletEntity getPortletEntity(IPortletEntityId portletEntityId)
          Get a IPortletEntity for the specified IPortletEntityId.
 IPortletEntity getPortletEntity(String channelSubscribeId, int userId)
          Get a IPortletEntity for the specified channel subscribe id and user id.
 void updatePortletEntity(IPortletEntity portletEntity)
          Persists changes to a IPortletEntity.
 

Method Detail

createPortletEntity

IPortletEntity createPortletEntity(IPortletDefinitionId portletDefinitionId,
                                   String channelSubscribeId,
                                   int userId)
Creates, initializes and persists a new IPortletEntity based on the specified IPortletDefinitionId, channel subscribe id and user id.

Parameters:
portletDefinitionId - The id of the IPortletDefinition that is the parent of the new entity
channelSubscribeId - The subscription id for the channel the entity is based on in the user's layout.
userId - The id of the user the entity is for.
Returns:
A newly created, initialized and persisted entity.
Throws:
IllegalArgumentException - if portletDefinitionId or channelSubscribeId are null.
DataIntegrityViolationException - If an entity already exists for the channel subscribe id and userId pair
DataRetrievalFailureException - If no IPortletDefinition exists for the specified IPortletDefinitionId

updatePortletEntity

void updatePortletEntity(IPortletEntity portletEntity)
Persists changes to a IPortletEntity.

Parameters:
portletEntity - The portlet entity to store the changes for
Throws:
IllegalArgumentException - if portletEntity is null.

getPortletEntity

IPortletEntity getPortletEntity(IPortletEntityId portletEntityId)
Get a IPortletEntity for the specified IPortletEntityId.

Parameters:
portletEntityId - The id to get the entity for.
Returns:
The portlet entity for the id, null if no entity exists for the id.
Throws:
IllegalArgumentException - if portletEntityId is null.

getPortletEntity

IPortletEntity getPortletEntity(String channelSubscribeId,
                                int userId)
Get a IPortletEntity for the specified channel subscribe id and user id.

Parameters:
channelSubscribeId - The channel subscription id from the user's layout to get the entity for
userId - The user id to get the entity for
Returns:
The portlet entity for the id, null if no entity exists for the ids.
Throws:
IllegalArgumentException - if channelSubscribeId is null.

getPortletEntities

Set<IPortletEntity> getPortletEntities(IPortletDefinitionId portletDefinitionId)
Get all IPortletEntitys based on the specified IPortletDefinitionId.

Parameters:
portletDefinitionId - The ID of the parent portlet definition
Returns:
A set of all entities based on the specified portlet definition id, will be empty if no entities exist for the id, will never be null.
Throws:
IllegalArgumentException - if portletDefinitionId is null.

getPortletEntitiesForUser

Set<IPortletEntity> getPortletEntitiesForUser(int userId)
Get all IPortletEntitys that exist for the specified user id. (From IPerson.getID().

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.

deletePortletEntity

void deletePortletEntity(IPortletEntity portletEntity)
Removes the specified IPortletEntity from the persistent store.

Parameters:
portletEntity - The entity to remove.
Throws:
IllegalArgumentException - if portletEntity is null.


Copyright © 2010 Jasig. All Rights Reserved.