org.kuali.rice.kew.actionlist.dao.impl
Class ActionListDAOJpaImpl

java.lang.Object
  extended by org.kuali.rice.kew.actionlist.dao.impl.ActionListDAOJpaImpl
All Implemented Interfaces:
ActionListDAO

public class ActionListDAOJpaImpl
extends Object
implements ActionListDAO

OJB implementation of the ActionListDAO.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
private static String ACTION_LIST_COUNT_QUERY
           
private  javax.persistence.EntityManager entityManager
           
private static org.apache.log4j.Logger LOG
           
 
Constructor Summary
ActionListDAOJpaImpl()
           
 
Method Summary
private  void addToFilterDescription(String filterDescription, String labelToAdd)
           
private  Date beginningOfDay(Date date)
           
private  void constructDocumentTypeCriteria(String entityName, Criteria criteria, DocumentType documentType)
           
private  Collection<ActionItem> createActionListForRouteHeader(Collection<ActionItem> actionItems)
          Creates an Action List from the given collection of Action Items.
private
<T extends ActionItem>
Collection<T>
createActionListForUser(Collection<T> actionItems)
          Creates an Action List from the given collection of Action Items.
private  Date endOfDay(Date date)
           
private
<T extends ActionItem>
Collection<ActionItem>
getActionItemsInActionList(Class<T> objectsToRetrieve, String principalId, ActionListFilter filter)
           
 Collection<ActionItem> getActionList(String principalId, ActionListFilter filter)
           
 Collection<ActionItem> getActionListForSingleDocument(Long routeHeaderId)
           
 int getCount(String workflowId)
           
 javax.persistence.EntityManager getEntityManager()
           
 Collection<ActionItem> getOutbox(String principalId, ActionListFilter filter)
          Retrieves OutboxItemActionListExtension items for the given user
 OutboxItemActionListExtension getOutboxByDocumentId(Long documentId)
          Gets the outbox item associated with the document id
 OutboxItemActionListExtension getOutboxByDocumentIdUserId(Long documentId, String userId)
          This overridden method ...
 void removeOutboxItems(String principalId, List<String> outboxItems)
          Deletes all outbox items specified by the list of ids
 void saveOutboxItem(OutboxItemActionListExtension outboxItem)
          Saves an outbox item
 void setEntityManager(javax.persistence.EntityManager entityManager)
           
private  Criteria setUpActionListCriteria(Class objectsToRetrieve, String principalId, ActionListFilter filter)
           
private  ActionItemActionListExtension toActionItemActionListExtension(ActionItem actionItem)
          This method ...
private  Collection<ActionItem> toActionItemActionListExtensions(Collection<ActionItem> actionItems)
          This method ...
private  DocumentRouteHeaderValueActionListExtension toDocumentRouteHeaderValueActionListExtension(DocumentRouteHeaderValue routeHeader)
          This method ...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG

entityManager

private javax.persistence.EntityManager entityManager

ACTION_LIST_COUNT_QUERY

private static final String ACTION_LIST_COUNT_QUERY
See Also:
Constant Field Values
Constructor Detail

ActionListDAOJpaImpl

public ActionListDAOJpaImpl()
Method Detail

getActionList

public Collection<ActionItem> getActionList(String principalId,
                                            ActionListFilter filter)
Specified by:
getActionList in interface ActionListDAO

toActionItemActionListExtensions

private Collection<ActionItem> toActionItemActionListExtensions(Collection<ActionItem> actionItems)
This method ...

Parameters:
actionItems -
Returns:
actionItemActionListExtensions

toActionItemActionListExtension

private ActionItemActionListExtension toActionItemActionListExtension(ActionItem actionItem)
This method ...

Parameters:
actionItem -
Returns:

toDocumentRouteHeaderValueActionListExtension

private DocumentRouteHeaderValueActionListExtension toDocumentRouteHeaderValueActionListExtension(DocumentRouteHeaderValue routeHeader)
This method ...

Parameters:
routeHeader -
Returns:

getActionListForSingleDocument

public Collection<ActionItem> getActionListForSingleDocument(Long routeHeaderId)
Specified by:
getActionListForSingleDocument in interface ActionListDAO

setUpActionListCriteria

private Criteria setUpActionListCriteria(Class objectsToRetrieve,
                                         String principalId,
                                         ActionListFilter filter)

constructDocumentTypeCriteria

private void constructDocumentTypeCriteria(String entityName,
                                           Criteria criteria,
                                           DocumentType documentType)

addToFilterDescription

private void addToFilterDescription(String filterDescription,
                                    String labelToAdd)

getCount

public int getCount(String workflowId)
Specified by:
getCount in interface ActionListDAO

createActionListForUser

private <T extends ActionItem> Collection<T> createActionListForUser(Collection<T> actionItems)
Creates an Action List from the given collection of Action Items. The Action List should contain only one action item per document. The action item chosen should be the most "critical" or "important" one on the document.

Returns:
the Action List as a Collection of ActionItems

createActionListForRouteHeader

private Collection<ActionItem> createActionListForRouteHeader(Collection<ActionItem> actionItems)
Creates an Action List from the given collection of Action Items. The Action List should contain only one action item per user. The action item chosen should be the most "critical" or "important" one on the document.

Returns:
the Action List as a Collection of ActionItems

getActionItemsInActionList

private <T extends ActionItem> Collection<ActionItem> getActionItemsInActionList(Class<T> objectsToRetrieve,
                                                                                 String principalId,
                                                                                 ActionListFilter filter)

getOutbox

public Collection<ActionItem> getOutbox(String principalId,
                                        ActionListFilter filter)
Description copied from interface: ActionListDAO
Retrieves OutboxItemActionListExtension items for the given user

Specified by:
getOutbox in interface ActionListDAO
Returns:

removeOutboxItems

public void removeOutboxItems(String principalId,
                              List<String> outboxItems)
Deletes all outbox items specified by the list of ids

Specified by:
removeOutboxItems in interface ActionListDAO
See Also:
ActionListDAO.removeOutboxItems(String, java.util.List)

saveOutboxItem

public void saveOutboxItem(OutboxItemActionListExtension outboxItem)
Saves an outbox item

Specified by:
saveOutboxItem in interface ActionListDAO
See Also:
ActionListDAO.saveOutboxItem(org.kuali.rice.kew.actionitem.OutboxItemActionListExtension)

getOutboxByDocumentId

public OutboxItemActionListExtension getOutboxByDocumentId(Long documentId)
Gets the outbox item associated with the document id

Specified by:
getOutboxByDocumentId in interface ActionListDAO
See Also:
ActionListDAO.getOutboxByDocumentId(java.lang.Long)

getOutboxByDocumentIdUserId

public OutboxItemActionListExtension getOutboxByDocumentIdUserId(Long documentId,
                                                                 String userId)
This overridden method ...

Specified by:
getOutboxByDocumentIdUserId in interface ActionListDAO
See Also:
ActionListDAO.getOutboxByDocumentIdUserId(Long, String)

beginningOfDay

private Date beginningOfDay(Date date)

endOfDay

private Date endOfDay(Date date)

getEntityManager

public javax.persistence.EntityManager getEntityManager()

setEntityManager

public void setEntityManager(javax.persistence.EntityManager entityManager)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.