org.kuali.rice.kew.impl.document
Class WorkflowDocumentServiceImpl

java.lang.Object
  extended by org.kuali.rice.kew.impl.document.WorkflowDocumentServiceImpl
All Implemented Interfaces:
WorkflowDocumentService

public class WorkflowDocumentServiceImpl
extends Object
implements WorkflowDocumentService

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

Constructor Summary
WorkflowDocumentServiceImpl()
           
 
Method Summary
protected  boolean actionRequestMatches(ActionRequestValue actionRequest, String nodeName, String principalId)
           
 DocumentLink addDocumentLink(DocumentLink documentLink)
          Saves the passed in DocumentLink.
 DocumentLink deleteDocumentLink(String documentLinkId)
          Removes the DocumentLink with the given documentLinkId.
 List<DocumentLink> deleteDocumentLinksByDocumentId(String originatingDocumentId)
          Removes all DocumentLinks for the given Document with the given originatingDocumentId.
 DocumentSearchResults documentSearch(String principalId, DocumentSearchCriteria criteria)
          Executes a search for workflow documents using the given criteria and as the principal with the given id.
 boolean doesDocumentExist(String documentId)
          Returns a boolean depending on if a Document exists with the specified documentId
 List<ActionRequest> getActionRequestsForPrincipalAtNode(String documentId, String nodeName, String principalId)
          Gets a list of ActionRequests for a given documentId, nodeName and principalId
 List<ActionTaken> getActionsTaken(String documentId)
          Gets a list of past ActionTaken of a Document with the given documentId
 List<RouteNodeInstance> getActiveRouteNodeInstances(String documentId)
          Gets a list of active RouteNodeInstance for a Document with the given documentId
 List<ActionTaken> getAllActionsTaken(String documentId)
          Gets a list of all ActionTaken of a Document with the given documentId
 String getApplicationDocumentId(String documentId)
          Gets a value application document id of a Document with the given documentId
 List<RouteNodeInstance> getCurrentRouteNodeInstances(String documentId)
          Gets a list of current RouteNodeInstances for a Document with the given documentId
 Document getDocument(String documentId)
          Gets a Document from a documentId.
 DocumentContent getDocumentContent(String documentId)
          Gets DocumentContent from a documentId.
 DocumentDetail getDocumentDetail(String documentId)
          Gets a DocumentDetail of a Document with the given documentId
 DocumentDetail getDocumentDetailByAppId(String documentTypeName, String appId)
          Gets a DocumentDetail of a Document with the given documentTypeName and appId
 String getDocumentInitiatorPrincipalId(String documentId)
          Gets the Document initiator's principalId with the given documentId
 DocumentLink getDocumentLink(String documentLinkId)
          Gets the DocumentLink for with the given documentLinkId.
 DocumentStatus getDocumentStatus(String documentId)
          Gets the status value for a Document with the given documentId
 List<DocumentStatusTransition> getDocumentStatusTransitionHistory(String documentId)
          Gets a list of DocumentStatusTransitions for the Document with the given documentId
 List<DocumentLink> getIncomingDocumentLinks(String destinationDocumentId)
          Gets a list of all DocumentLinks for incoming links from the Document with the given documentId.
 List<DocumentLink> getOutgoingDocumentLinks(String originatingDocumentId)
          Gets a list of all DocumentLinks for outgoing links from the Document with the given documentId.
 List<ActionRequest> getPendingActionRequests(String documentId)
          Gets a list of ActionRequests which are pending for a given documentId
 List<String> getPreviousRouteNodeNames(String documentId)
          Gets a list of all previous RouteNodeInstance's node names for a Document with the given documentId
 List<String> getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(String actionRequestedCd, String documentId)
          Gets a list of principalId values for a Document with the given documentId and action request code that have pending action requests
 List<ActionRequest> getRootActionRequests(String documentId)
          Gets a list of root ActionRequests for a given documentId
 String getRoutedByPrincipalIdByDocumentId(String documentId)
          Gets the Document's 'routed by' principalId with the given documentId Returns null if the document is not found
 RouteNodeInstance getRouteNodeInstance(String nodeInstanceId)
          Gets a RouteNodeInstance with the given nodeInstanceId
 List<RouteNodeInstance> getRouteNodeInstances(String documentId)
          Gets a list of all RouteNodeInstance for a Document with the given documentId
 List<org.joda.time.DateTime> getSearchableAttributeDateTimeValuesByKey(String documentId, String key)
          Does a direct search for searchableAttributes without going through the document search This returns a list of DateTime values for date/time searchableAttributes
 List<BigDecimal> getSearchableAttributeFloatValuesByKey(String documentId, String key)
          Does a direct search for searchableAttributes without going through the document search This returns a list of BigDecimal values for decimal searchableAttributes
 List<Long> getSearchableAttributeLongValuesByKey(String documentId, String key)
          Does a direct search for searchableAttributes without going through the document search This returns a list of Long values for long searchableAttributes
 List<String> getSearchableAttributeStringValuesByKey(String documentId, String key)
          Does a direct search for searchableAttributes without going through the document search This returns a list of String values for String searchableAttributes
 List<RouteNodeInstance> getTerminalRouteNodeInstances(String documentId)
          Gets a list of terminal RouteNodeInstances for a Document with the given documentId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkflowDocumentServiceImpl

public WorkflowDocumentServiceImpl()
Method Detail

getDocument

public Document getDocument(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a Document from a documentId.

This method will return null if the Document does not exist.

Specified by:
getDocument in interface WorkflowDocumentService
Parameters:
documentId - the unique id of the document to return
Returns:
the document with the passed in id value

doesDocumentExist

public boolean doesDocumentExist(String documentId)
Description copied from interface: WorkflowDocumentService
Returns a boolean depending on if a Document exists with the specified documentId

This method will return false if the responsibility does not exist.

Specified by:
doesDocumentExist in interface WorkflowDocumentService
Parameters:
documentId - the unique id of the document to check for existence
Returns:
boolean value representative of whether the document exists

getDocumentDetailByAppId

public DocumentDetail getDocumentDetailByAppId(String documentTypeName,
                                               String appId)
Description copied from interface: WorkflowDocumentService
Gets a DocumentDetail of a Document with the given documentTypeName and appId

Specified by:
getDocumentDetailByAppId in interface WorkflowDocumentService
Parameters:
documentTypeName - the name of the DocumentType
appId - the unique id of the application
Returns:
a DocumentDetail for with the given documentTypeName and appId

getRouteNodeInstance

public RouteNodeInstance getRouteNodeInstance(String nodeInstanceId)
Description copied from interface: WorkflowDocumentService
Gets a RouteNodeInstance with the given nodeInstanceId

Specified by:
getRouteNodeInstance in interface WorkflowDocumentService
Parameters:
nodeInstanceId - the unique id of the RouteNodeInstance
Returns:
a DocumentDetail for with the given documentId

getDocumentStatus

public DocumentStatus getDocumentStatus(String documentId)
Description copied from interface: WorkflowDocumentService
Gets the status value for a Document with the given documentId

Specified by:
getDocumentStatus in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
Returns:
the current status of the Document with the given documentId

getApplicationDocumentId

public String getApplicationDocumentId(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a value application document id of a Document with the given documentId

Specified by:
getApplicationDocumentId in interface WorkflowDocumentService
Parameters:
documentId - the unique id of the Document
Returns:
the value of the applicationDocumentId for the Document with the given documentId

documentSearch

public DocumentSearchResults documentSearch(String principalId,
                                            DocumentSearchCriteria criteria)
Description copied from interface: WorkflowDocumentService
Executes a search for workflow documents using the given criteria and as the principal with the given id. Since documents can define security which permits access to view certain search results, the given principal id will be used when evaluating which documents should be filtered from the results because of lack of access.

Specified by:
documentSearch in interface WorkflowDocumentService
Parameters:
principalId - the id of the principal to execute the search as, if this value is non-null then security filtering will be executed against the results, if it is null then no filtering will be performed
criteria - the criteria to use when executing the search
Returns:
the results of the search, this will never be null but may contain an empty list of results

getSearchableAttributeStringValuesByKey

public List<String> getSearchableAttributeStringValuesByKey(String documentId,
                                                            String key)
Description copied from interface: WorkflowDocumentService
Does a direct search for searchableAttributes without going through the document search This returns a list of String values for String searchableAttributes

Specified by:
getSearchableAttributeStringValuesByKey in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
key - the searchableAttributes key value
Returns:
a list of String values for the Document with the given documentId and searchable attribute key

getSearchableAttributeDateTimeValuesByKey

public List<org.joda.time.DateTime> getSearchableAttributeDateTimeValuesByKey(String documentId,
                                                                              String key)
Description copied from interface: WorkflowDocumentService
Does a direct search for searchableAttributes without going through the document search This returns a list of DateTime values for date/time searchableAttributes

Specified by:
getSearchableAttributeDateTimeValuesByKey in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
key - the searchableAttributes key value
Returns:
a list of DateTime values for the Document with the given documentId and searchable attribute key

getSearchableAttributeFloatValuesByKey

public List<BigDecimal> getSearchableAttributeFloatValuesByKey(String documentId,
                                                               String key)
Description copied from interface: WorkflowDocumentService
Does a direct search for searchableAttributes without going through the document search This returns a list of BigDecimal values for decimal searchableAttributes

Specified by:
getSearchableAttributeFloatValuesByKey in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
key - the searchableAttributes key value
Returns:
a list of BigDecimal values for the Document with the given documentId and searchable attribute key

getSearchableAttributeLongValuesByKey

public List<Long> getSearchableAttributeLongValuesByKey(String documentId,
                                                        String key)
Description copied from interface: WorkflowDocumentService
Does a direct search for searchableAttributes without going through the document search This returns a list of Long values for long searchableAttributes

Specified by:
getSearchableAttributeLongValuesByKey in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
key - the searchableAttributes key value
Returns:
a list of BigDecimal values for the Document with the given documentId and searchable attribute key

getDocumentContent

public DocumentContent getDocumentContent(String documentId)
Description copied from interface: WorkflowDocumentService
Gets DocumentContent from a documentId.

This method will return null if the document does not exist.

Specified by:
getDocumentContent in interface WorkflowDocumentService
Parameters:
documentId - the unique id of the document content to return
Returns:
the documentContent with the passed in id value

getRootActionRequests

public List<ActionRequest> getRootActionRequests(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of root ActionRequests for a given documentId

Specified by:
getRootActionRequests in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a document
Returns:
the list of root ActionRequests for a given documentId

getPendingActionRequests

public List<ActionRequest> getPendingActionRequests(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of ActionRequests which are pending for a given documentId

Specified by:
getPendingActionRequests in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a document
Returns:
the list of pending ActionRequests for a given documentId

getActionRequestsForPrincipalAtNode

public List<ActionRequest> getActionRequestsForPrincipalAtNode(String documentId,
                                                               String nodeName,
                                                               String principalId)
Description copied from interface: WorkflowDocumentService
Gets a list of ActionRequests for a given documentId, nodeName and principalId

Specified by:
getActionRequestsForPrincipalAtNode in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a document
nodeName - the name of a RouteNode
principalId - the unique id of a principal
Returns:
the list of ActionRequests for a given documentId, nodeName, and principalId

actionRequestMatches

protected boolean actionRequestMatches(ActionRequestValue actionRequest,
                                       String nodeName,
                                       String principalId)

getActionsTaken

public List<ActionTaken> getActionsTaken(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of past ActionTaken of a Document with the given documentId

Specified by:
getActionsTaken in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a document
Returns:
the list of past ActionTakens for a given documentId

getAllActionsTaken

public List<ActionTaken> getAllActionsTaken(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of all ActionTaken of a Document with the given documentId

Specified by:
getAllActionsTaken in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a document
Returns:
the list of ActionTakens (both current and not) for a given documentId

getDocumentDetail

public DocumentDetail getDocumentDetail(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a DocumentDetail of a Document with the given documentId

Specified by:
getDocumentDetail in interface WorkflowDocumentService
Parameters:
documentId - the unique id of the Document
Returns:
a DocumentDetail for with the given documentId

getDocumentStatusTransitionHistory

public List<DocumentStatusTransition> getDocumentStatusTransitionHistory(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of DocumentStatusTransitions for the Document with the given documentId

Specified by:
getDocumentStatusTransitionHistory in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
Returns:
a list of DocumentStatusTransitions for the Document with the given documentId

getRouteNodeInstances

public List<RouteNodeInstance> getRouteNodeInstances(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of all RouteNodeInstance for a Document with the given documentId

Specified by:
getRouteNodeInstances in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
Returns:
the list of RouteNodeInstances for the Document with the given documentId

getActiveRouteNodeInstances

public List<RouteNodeInstance> getActiveRouteNodeInstances(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of active RouteNodeInstance for a Document with the given documentId

Specified by:
getActiveRouteNodeInstances in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
Returns:
the list of active RouteNodeInstances for the Document with the given documentId

getTerminalRouteNodeInstances

public List<RouteNodeInstance> getTerminalRouteNodeInstances(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of terminal RouteNodeInstances for a Document with the given documentId

Specified by:
getTerminalRouteNodeInstances in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
Returns:
the list of terminal RouteNodeInstances for the Document with the given documentId

getCurrentRouteNodeInstances

public List<RouteNodeInstance> getCurrentRouteNodeInstances(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of current RouteNodeInstances for a Document with the given documentId

Specified by:
getCurrentRouteNodeInstances in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
Returns:
the list of current RouteNodeInstances for the Document with the given documentId

getPreviousRouteNodeNames

public List<String> getPreviousRouteNodeNames(String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of all previous RouteNodeInstance's node names for a Document with the given documentId

Specified by:
getPreviousRouteNodeNames in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
Returns:
the list of all previous RouteNodeInstance's node names for the Document with the given documentId

getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId

public List<String> getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(String actionRequestedCd,
                                                                                     String documentId)
Description copied from interface: WorkflowDocumentService
Gets a list of principalId values for a Document with the given documentId and action request code that have pending action requests

Specified by:
getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId in interface WorkflowDocumentService
Parameters:
actionRequestedCd - code for the pending action requested
documentId - the unique id of a Document
Returns:
a list of principalIds for the Document with the given parameters and have a pending action request

getDocumentInitiatorPrincipalId

public String getDocumentInitiatorPrincipalId(String documentId)
Description copied from interface: WorkflowDocumentService
Gets the Document initiator's principalId with the given documentId

Specified by:
getDocumentInitiatorPrincipalId in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
Returns:
the Document initiator's principalId

getRoutedByPrincipalIdByDocumentId

public String getRoutedByPrincipalIdByDocumentId(String documentId)
Description copied from interface: WorkflowDocumentService
Gets the Document's 'routed by' principalId with the given documentId Returns null if the document is not found

Specified by:
getRoutedByPrincipalIdByDocumentId in interface WorkflowDocumentService
Parameters:
documentId - the unique id of a Document
Returns:
the Document's 'routed by' principalId

addDocumentLink

public DocumentLink addDocumentLink(DocumentLink documentLink)
                             throws RiceIllegalArgumentException
Description copied from interface: WorkflowDocumentService
Saves the passed in DocumentLink. If the DocumentLink's id field is created. This method actually creates two different links in the database (one from the document being linked to the target and vice-versa). If the links already exist, then the call is ignored.

Specified by:
addDocumentLink in interface WorkflowDocumentService
Parameters:
documentLink - the unique id of a Document
Returns:
the newly saved DocumentLink
Throws:
RiceIllegalArgumentException - if documentLink is null

deleteDocumentLink

public DocumentLink deleteDocumentLink(String documentLinkId)
                                throws RiceIllegalArgumentException
Description copied from interface: WorkflowDocumentService
Removes the DocumentLink with the given documentLinkId.

Specified by:
deleteDocumentLink in interface WorkflowDocumentService
Parameters:
documentLinkId - the unique id of a Document
Returns:
the deleted DocumentLink
Throws:
RiceIllegalArgumentException - if documentLink is null

deleteDocumentLinksByDocumentId

public List<DocumentLink> deleteDocumentLinksByDocumentId(String originatingDocumentId)
                                                   throws RiceIllegalArgumentException
Description copied from interface: WorkflowDocumentService
Removes all DocumentLinks for the given Document with the given originatingDocumentId.

Specified by:
deleteDocumentLinksByDocumentId in interface WorkflowDocumentService
Parameters:
originatingDocumentId - the unique id of the originating Document of the document links to delete
Returns:
a list of the deleted DocumentLinks
Throws:
RiceIllegalArgumentException - if documentLink is null

getOutgoingDocumentLinks

public List<DocumentLink> getOutgoingDocumentLinks(String originatingDocumentId)
                                            throws RiceIllegalArgumentException
Description copied from interface: WorkflowDocumentService
Gets a list of all DocumentLinks for outgoing links from the Document with the given documentId.

Specified by:
getOutgoingDocumentLinks in interface WorkflowDocumentService
Parameters:
originatingDocumentId - the unique id of the originating Document of the document links to retrieve
Returns:
a list of the outgoing DocumentLinks for the originating document
Throws:
RiceIllegalArgumentException - if originatingDocumentId is null

getIncomingDocumentLinks

public List<DocumentLink> getIncomingDocumentLinks(String destinationDocumentId)
                                            throws RiceIllegalArgumentException
Description copied from interface: WorkflowDocumentService
Gets a list of all DocumentLinks for incoming links from the Document with the given documentId.

Specified by:
getIncomingDocumentLinks in interface WorkflowDocumentService
Parameters:
destinationDocumentId - the unique id of the incoming Document of the document links to retrieve
Returns:
a list of the outgoing DocumentLinks for the incoming document
Throws:
RiceIllegalArgumentException - if originatingDocumentId is null

getDocumentLink

public DocumentLink getDocumentLink(String documentLinkId)
                             throws RiceIllegalArgumentException
Description copied from interface: WorkflowDocumentService
Gets the DocumentLink for with the given documentLinkId.

Specified by:
getDocumentLink in interface WorkflowDocumentService
Parameters:
documentLinkId - the unique id of the DocumentLink to retrieve
Returns:
a DocumentLink with the passed in documentLinkId
Throws:
RiceIllegalArgumentException - if documentLinkId is null


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