org.kuali.rice.kew.actionlist.service.impl
Class ActionListServiceImpl

java.lang.Object
  extended by org.kuali.rice.kew.actionlist.service.impl.ActionListServiceImpl
All Implemented Interfaces:
ActionListService

public class ActionListServiceImpl
extends Object
implements ActionListService

Default implementation of the ActionListService.

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

Field Summary
protected  ActionListDAO actionListDAO
           
protected  ActionRequestService actionRequestService
           
protected  DataObjectService dataObjectService
           
protected  DateTimeService dateTimeService
           
protected  DocumentTypeService documentTypeService
           
protected  NotificationService notificationService
           
protected  RouteHeaderService routeHeaderService
           
protected  UserOptionsService userOptionsService
           
 
Constructor Summary
ActionListServiceImpl()
           
 
Method Summary
protected  void applyPrimaryDelegationCriteria(String actionListUserPrincipalId, ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
           
protected  Timestamp beginningOfDay(Date date)
           
 ActionItem createActionItemForActionRequest(ActionRequestValue actionRequest)
           
protected  Collection<ActionItem> createActionListForRouteHeader(Collection<ActionItem> actionItems)
          Creates an Action List from the given collection of Action Items.
 void deleteActionItem(ActionItem actionItem)
           
 void deleteActionItem(ActionItem actionItem, boolean forceIntoOutbox)
           
 void deleteByDocumentId(String documentId)
           
protected  Timestamp endOfDay(Date date)
           
 ActionItem findByActionItemId(String actionItemId)
           
 Collection<ActionItem> findByActionRequestId(String actionRequestId)
           
 Collection<ActionItem> findByDocumentId(String documentId)
           
 Collection<ActionItem> findByDocumentTypeName(String documentTypeName)
           
 Collection<ActionItem> findByPrincipalId(String principalId)
           
 Collection<ActionItem> findByWorkflowUserDocumentId(String workflowUserId, String documentId)
           
 Collection<Recipient> findUserPrimaryDelegations(String principalId)
          Retruns a list of recipients which are primary-delegated to by the source principalId
 Collection<Recipient> findUserSecondaryDelegators(String principalId)
          Returns a list of recipients which secondary-delegate to the target principalId
 Collection<ActionItem> getActionList(String principalId, ActionListFilter filter)
           
 Collection<ActionItem> getActionListForSingleDocument(String documentId)
          
protected  Collection<DocumentType> getAllChildDocumentTypes(DocumentType docType)
           
 int getCount(String principalId)
          Retrieves the number of Action List items in the given user's primary Action List (does not include secondary delegations)
 GroupService getGroupService()
           
 List<Object> getMaxActionItemDateAssignedAndCountForUser(String principalId)
          Retrieves the max action item Id and the total number of action items for the given user's primary Action List (does not include secondary delegations)
 DocumentRouteHeaderValue getMinimalRouteHeader(String documentId)
          Pulls a proxied version of the document route header with only the properties needed by the action list display.
 Collection<OutboxItem> getOutbox(String principalId, ActionListFilter filter)
          This overridden method ...
protected  OutboxItem getOutboxItemByDocumentIdUserId(String documentId, String principalId)
           
 Collection<OutboxItem> getOutboxItemsByDocumentType(String documentTypeName)
           
protected  List<Predicate> handleActionItemCriteria(String principalId, ActionListFilter filter, List<String> filteredByItems)
           
protected  void handleActionRequestedCriteria(ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
           
protected  void handleAssignedDateCriteria(ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
           
protected  void handleDateCriteria(String propertyPath, String filterLabel, Date fromDate, Date toDate, boolean excludeDates, Collection<Predicate> crit, List<String> filteredByItems)
           
protected  void handleDocumentCreateDateCriteria(ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
           
protected  void handleDocumentTitleCriteria(ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
           
protected  void handleDocumentTypeCriteria(ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
           
protected  boolean handlePrimaryDelegation(String actionListUserPrincipalId, ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
          Apply criteria related to primary delegations.
protected  void handleRecipientCriteria(String actionListUserPrincipalId, ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
          Handle the general recipient criteria (user, delegate)
protected  void handleRouteStatusCriteria(ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
           
protected  boolean handleSecondaryDelegation(String actionListUserPrincipalId, ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
          Apply criteria related to secondary delegations.
protected  void handleWorkgroupCriteria(ActionListFilter filter, Collection<Predicate> crit, List<String> filteredByItems)
           
 void removeOutboxItems(String principalId, List<String> outboxItems)
          This overridden method ...
 ActionItem saveActionItem(ActionItem actionItem)
           
 void saveOutboxItem(ActionItem actionItem)
           
 void saveOutboxItem(ActionItem actionItem, boolean forceIntoOutbox)
          save the ouboxitem unless the document is saved or the user already has the item in their outbox.
 void setActionListDAO(ActionListDAO actionListDAO)
           
 void setActionRequestService(ActionRequestService actionRequestService)
           
 void setDataObjectService(DataObjectService dataObjectService)
           
 void setDateTimeService(DateTimeService dateTimeService)
           
 void setDocumentTypeService(DocumentTypeService documentTypeService)
           
 void setNotificationService(NotificationService notificationService)
           
 void setRouteHeaderService(RouteHeaderService routeHeaderService)
           
 void setUserOptionsService(UserOptionsService userOptionsService)
           
 void updateActionItemsForTitleChange(String documentId, String newTitle)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataObjectService

protected DataObjectService dataObjectService

notificationService

protected NotificationService notificationService

dateTimeService

protected DateTimeService dateTimeService

actionRequestService

protected ActionRequestService actionRequestService

documentTypeService

protected DocumentTypeService documentTypeService

userOptionsService

protected UserOptionsService userOptionsService

routeHeaderService

protected RouteHeaderService routeHeaderService

actionListDAO

protected ActionListDAO actionListDAO
Constructor Detail

ActionListServiceImpl

public ActionListServiceImpl()
Method Detail

findUserSecondaryDelegators

public Collection<Recipient> findUserSecondaryDelegators(String principalId)
Description copied from interface: ActionListService
Returns a list of recipients which secondary-delegate to the target principalId

Specified by:
findUserSecondaryDelegators in interface ActionListService
Parameters:
principalId - the target principalId/delegate
Returns:
a list of recipients which secondary-delegate to the target principalId

findUserPrimaryDelegations

public Collection<Recipient> findUserPrimaryDelegations(String principalId)
Description copied from interface: ActionListService
Retruns a list of recipients which are primary-delegated to by the source principalId

Specified by:
findUserPrimaryDelegations in interface ActionListService
Parameters:
principalId - the source principalId to query for primary delegates
Returns:
a list of recipients which are primary-delegated to by the source principalId

getActionList

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

handleActionItemCriteria

protected List<Predicate> handleActionItemCriteria(String principalId,
                                                   ActionListFilter filter,
                                                   List<String> filteredByItems)

handleActionRequestedCriteria

protected void handleActionRequestedCriteria(ActionListFilter filter,
                                             Collection<Predicate> crit,
                                             List<String> filteredByItems)

handleDateCriteria

protected void handleDateCriteria(String propertyPath,
                                  String filterLabel,
                                  Date fromDate,
                                  Date toDate,
                                  boolean excludeDates,
                                  Collection<Predicate> crit,
                                  List<String> filteredByItems)

handleDocumentCreateDateCriteria

protected void handleDocumentCreateDateCriteria(ActionListFilter filter,
                                                Collection<Predicate> crit,
                                                List<String> filteredByItems)

handleAssignedDateCriteria

protected void handleAssignedDateCriteria(ActionListFilter filter,
                                          Collection<Predicate> crit,
                                          List<String> filteredByItems)

handleRouteStatusCriteria

protected void handleRouteStatusCriteria(ActionListFilter filter,
                                         Collection<Predicate> crit,
                                         List<String> filteredByItems)

handleDocumentTitleCriteria

protected void handleDocumentTitleCriteria(ActionListFilter filter,
                                           Collection<Predicate> crit,
                                           List<String> filteredByItems)

handleDocumentTypeCriteria

protected void handleDocumentTypeCriteria(ActionListFilter filter,
                                          Collection<Predicate> crit,
                                          List<String> filteredByItems)

getAllChildDocumentTypes

protected Collection<DocumentType> getAllChildDocumentTypes(DocumentType docType)

handleWorkgroupCriteria

protected void handleWorkgroupCriteria(ActionListFilter filter,
                                       Collection<Predicate> crit,
                                       List<String> filteredByItems)

applyPrimaryDelegationCriteria

protected void applyPrimaryDelegationCriteria(String actionListUserPrincipalId,
                                              ActionListFilter filter,
                                              Collection<Predicate> crit,
                                              List<String> filteredByItems)

handlePrimaryDelegation

protected boolean handlePrimaryDelegation(String actionListUserPrincipalId,
                                          ActionListFilter filter,
                                          Collection<Predicate> crit,
                                          List<String> filteredByItems)
Apply criteria related to primary delegations. Called only after detecting that the user is filtering on primary validations.

Returns:
true if any criteria were applied, false otherwise

handleSecondaryDelegation

protected boolean handleSecondaryDelegation(String actionListUserPrincipalId,
                                            ActionListFilter filter,
                                            Collection<Predicate> crit,
                                            List<String> filteredByItems)
Apply criteria related to secondary delegations. Called only after detecting that the user is filtering on secondary validations.

Returns:
true if any criteria were applied, false otherwise

handleRecipientCriteria

protected void handleRecipientCriteria(String actionListUserPrincipalId,
                                       ActionListFilter filter,
                                       Collection<Predicate> crit,
                                       List<String> filteredByItems)
Handle the general recipient criteria (user, delegate)

Parameters:
actionListUserPrincipalId -
filter -
crit -
filteredByItems -

getActionListForSingleDocument

public Collection<ActionItem> getActionListForSingleDocument(String documentId)

Specified by:
getActionListForSingleDocument in interface ActionListService

createActionListForRouteHeader

protected 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

setActionListDAO

public void setActionListDAO(ActionListDAO actionListDAO)

deleteActionItem

public void deleteActionItem(ActionItem actionItem)
Specified by:
deleteActionItem in interface ActionListService

deleteActionItem

public void deleteActionItem(ActionItem actionItem,
                             boolean forceIntoOutbox)
Specified by:
deleteActionItem in interface ActionListService

deleteByDocumentId

public void deleteByDocumentId(String documentId)
Specified by:
deleteByDocumentId in interface ActionListService

findByDocumentId

public Collection<ActionItem> findByDocumentId(String documentId)
Specified by:
findByDocumentId in interface ActionListService

findByActionRequestId

public Collection<ActionItem> findByActionRequestId(String actionRequestId)
Specified by:
findByActionRequestId in interface ActionListService

findByWorkflowUserDocumentId

public Collection<ActionItem> findByWorkflowUserDocumentId(String workflowUserId,
                                                           String documentId)
Specified by:
findByWorkflowUserDocumentId in interface ActionListService

findByDocumentTypeName

public Collection<ActionItem> findByDocumentTypeName(String documentTypeName)
Specified by:
findByDocumentTypeName in interface ActionListService

createActionItemForActionRequest

public ActionItem createActionItemForActionRequest(ActionRequestValue actionRequest)
Specified by:
createActionItemForActionRequest in interface ActionListService

updateActionItemsForTitleChange

public void updateActionItemsForTitleChange(String documentId,
                                            String newTitle)
Specified by:
updateActionItemsForTitleChange in interface ActionListService

saveActionItem

public ActionItem saveActionItem(ActionItem actionItem)
Specified by:
saveActionItem in interface ActionListService

getGroupService

public GroupService getGroupService()

findByActionItemId

public ActionItem findByActionItemId(String actionItemId)
Specified by:
findByActionItemId in interface ActionListService

getCount

public int getCount(String principalId)
Description copied from interface: ActionListService
Retrieves the number of Action List items in the given user's primary Action List (does not include secondary delegations)

Specified by:
getCount in interface ActionListService

getMaxActionItemDateAssignedAndCountForUser

public List<Object> getMaxActionItemDateAssignedAndCountForUser(String principalId)
Description copied from interface: ActionListService
Retrieves the max action item Id and the total number of action items for the given user's primary Action List (does not include secondary delegations)

Specified by:
getMaxActionItemDateAssignedAndCountForUser in interface ActionListService

getOutbox

public Collection<OutboxItem> getOutbox(String principalId,
                                        ActionListFilter filter)
This overridden method ...

Specified by:
getOutbox in interface ActionListService
Returns:
See Also:
ActionListService.getOutbox(java.lang.String, org.kuali.rice.kew.actionlist.ActionListFilter)

getOutboxItemsByDocumentType

public Collection<OutboxItem> getOutboxItemsByDocumentType(String documentTypeName)
Specified by:
getOutboxItemsByDocumentType in interface ActionListService

removeOutboxItems

public void removeOutboxItems(String principalId,
                              List<String> outboxItems)
This overridden method ...

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

saveOutboxItem

public void saveOutboxItem(ActionItem actionItem)
Specified by:
saveOutboxItem in interface ActionListService

saveOutboxItem

public void saveOutboxItem(ActionItem actionItem,
                           boolean forceIntoOutbox)
save the ouboxitem unless the document is saved or the user already has the item in their outbox.

Specified by:
saveOutboxItem in interface ActionListService
See Also:
ActionListService.saveOutboxItem(org.kuali.rice.kew.actionitem.ActionItem, boolean)

getOutboxItemByDocumentIdUserId

protected OutboxItem getOutboxItemByDocumentIdUserId(String documentId,
                                                     String principalId)

findByPrincipalId

public Collection<ActionItem> findByPrincipalId(String principalId)
Specified by:
findByPrincipalId in interface ActionListService

getMinimalRouteHeader

public DocumentRouteHeaderValue getMinimalRouteHeader(String documentId)
Pulls a proxied version of the document route header with only the properties needed by the action list display.

Specified by:
getMinimalRouteHeader in interface ActionListService

beginningOfDay

protected Timestamp beginningOfDay(Date date)

endOfDay

protected Timestamp endOfDay(Date date)

setDataObjectService

public void setDataObjectService(DataObjectService dataObjectService)

setNotificationService

public void setNotificationService(NotificationService notificationService)

setDateTimeService

public void setDateTimeService(DateTimeService dateTimeService)

setActionRequestService

public void setActionRequestService(ActionRequestService actionRequestService)

setDocumentTypeService

public void setDocumentTypeService(DocumentTypeService documentTypeService)

setUserOptionsService

public void setUserOptionsService(UserOptionsService userOptionsService)

setRouteHeaderService

public void setRouteHeaderService(RouteHeaderService routeHeaderService)


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.