org.kuali.rice.krad.service
Interface DocumentService

All Known Implementing Classes:
DocumentServiceImpl

public interface DocumentService

Defines various operations that support the Document framework.

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

Method Summary
 Document acknowledgeDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients)
          acknowledge this document, optionally providing an annotation for the acknowledgement which will show up in the route log for the document for this acknowledgement, additionally optionally provide a list of ad hoc recipients that should recieve this document.
 Document approveDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRoutingRecipients)
          approve this document, optionally providing an annotation which will show up in the route log for this document for this action taken, and optionally providing a list of ad hoc recipients for the document
 Document blanketApproveDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients)
          blanket approve this document which will approve the document and stand in for an approve for all typically generated approval actions requested for this document.
 Document cancelDocument(Document document, String annotation)
          cancel this document, optionally providing an annotation for the disapproval which will show up in the route log for the document for this action taken
 Document clearDocumentFyi(Document document, List<AdHocRouteRecipient> adHocRecipients)
          clear the fyi request for this document, optionally providing a list of ad hoc recipients for this document, which should be restricted to action requested of fyi as all other actions requested will be discarded
 Document completeDocument(Document document, String annotation, List adHocRecipients)
          Complete action for a document
 Note createNoteFromDocument(Document document, String text)
          This method creates a note from a given document and note text.
 Document disapproveDocument(Document document, String annotation)
          disapprove this document, optionally providing an annotation for the disapproval which will show up in the route log for the document for this action taken
 boolean documentExists(String documentHeaderId)
           
 Document getByDocumentHeaderId(String documentHeaderId)
          get a document based on the document header id which is the primary key for all document types
 Document getByDocumentHeaderIdSessionless(String documentHeaderId)
          get a document based on the document header id which is the primary key for all document types.
 List<Document> getDocumentsByListOfDocumentHeaderIds(Class<? extends Document> documentClass, List<String> documentHeaderIds)
          This method retrieves a list of fully-populated documents given a list of document header id values.
 Document getNewDocument(Class<? extends Document> documentClass)
          get a new blank document instance having the given Document class
 Document getNewDocument(String documentTypeName)
          get a new blank document instance based on the document type name
 Document getNewDocument(String documentTypeName, String initiatorPrincipalNm)
          get a new blank document instance based on the document type name.
 void prepareWorkflowDocument(Document document)
          Sets the title and app document id in the workflow document
 Document recallDocument(Document document, String annotation, boolean cancel)
          recall this document, optionally providing an annotation for the recall which will show up in the route log for the document for this action taken
 Document routeDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRoutingRecipients)
          start the route the document for approval, optionally providing a list of ad hoc recipients, and additionally provideing a annotation to show up in the route log for the document
 Document saveDocument(Document document)
          This is a helper method that performs the same as the saveDocument(Document, Class) method.
 Document saveDocument(Document document, Class<? extends KualiDocumentEvent> kualiDocumentEventClass)
          Saves the passed-in document.
 boolean saveDocumentNotes(Document document)
          Saves the notes associated with the given document if they are in a state where they can be saved.
 void sendAdHocRequests(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients)
           
 void sendNoteRouteNotification(Document document, Note note, Person sender)
          Builds an workflow notification request for the note and sends it to note recipient.
 Document superUserApproveDocument(Document document, String annotation)
          approve this document as super user, optionally providing an annotation which will show up in the route log for this document for this action taken
 Document superUserCancelDocument(Document document, String annotation)
          cancel this document as super user, optionally providing an annotation which will show up in the route log for this document for this action taken
 Document superUserDisapproveDocument(Document document, String annotation)
          disapprove this document as super user, optionally providing an annotation which will show up in the route log for this document for this action taken
 Document superUserDisapproveDocumentWithoutSaving(Document document, String annotation)
          disapprove this document as super user, without saving, optionally providing an annotation which will show up in the route log for this document for this action taken
 Document updateDocument(Document document)
          This method is to allow for documents to be updated which is currently used to update the document status as well as to allow for locked docs to be unlocked
 Document validateAndPersistDocument(Document document, KualiDocumentEvent event)
          Helper method used to save and validate a document
 

Method Detail

documentExists

boolean documentExists(String documentHeaderId)
Parameters:
documentHeaderId -
Returns:
true if a document with the given documentHeaderId exists

getNewDocument

Document getNewDocument(String documentTypeName)
                        throws WorkflowException
get a new blank document instance based on the document type name

Parameters:
documentTypeName -
Returns:
Throws:
WorkflowException

getNewDocument

Document getNewDocument(Class<? extends Document> documentClass)
                        throws WorkflowException
get a new blank document instance having the given Document class

Parameters:
documentClass -
Returns:
Throws:
WorkflowException

getNewDocument

Document getNewDocument(String documentTypeName,
                        String initiatorPrincipalNm)
                        throws WorkflowException
get a new blank document instance based on the document type name. The principal name passed in will be used as the document initiator.

Parameters:
documentTypeName -
initiatorPrincipalNm -
Returns:
Throws:
WorkflowException

getByDocumentHeaderId

Document getByDocumentHeaderId(String documentHeaderId)
                               throws WorkflowException
get a document based on the document header id which is the primary key for all document types

Parameters:
documentHeaderId -
Returns:
Throws:
WorkflowException

getByDocumentHeaderIdSessionless

Document getByDocumentHeaderIdSessionless(String documentHeaderId)
                                          throws WorkflowException
get a document based on the document header id which is the primary key for all document types. Using this method does not require that GlobalVariables.getUserSession() be populated. Therefore, this method can be used when a HTTP request is not being processed (e.g. during workflow indexing/post-processing).

Parameters:
documentHeaderId -
Returns:
Throws:
WorkflowException

getDocumentsByListOfDocumentHeaderIds

List<Document> getDocumentsByListOfDocumentHeaderIds(Class<? extends Document> documentClass,
                                                     List<String> documentHeaderIds)
                                                     throws WorkflowException
This method retrieves a list of fully-populated documents given a list of document header id values.

Parameters:
clazz -
documentHeaderIds -
Returns:
List of fully-populated documents
Throws:
WorkflowException

updateDocument

Document updateDocument(Document document)
This method is to allow for documents to be updated which is currently used to update the document status as well as to allow for locked docs to be unlocked

Parameters:
document -

saveDocument

Document saveDocument(Document document)
                      throws WorkflowException
This is a helper method that performs the same as the saveDocument(Document, Class) method. The convenience of this method is that the event being used is the standard SaveDocumentEvent.

Throws:
WorkflowException
See Also:
saveDocument(Document, Class)

saveDocument

Document saveDocument(Document document,
                      Class<? extends KualiDocumentEvent> kualiDocumentEventClass)
                      throws WorkflowException
Saves the passed-in document. This will persist it both to the Kuali database, and also initiate it (if necessary) within workflow, so its available in the initiator's action list. This method uses the passed in KualiDocumentEvent class when saving the document. The KualiDocumentEvent class must implement the SaveEvent interface. Note that the system does not support passing in Workflow Annotations or AdHoc Route Recipients on a SaveDocument call. These are sent to workflow on a routeDocument action, or any of the others which actually causes a routing action to happen in workflow. NOTE: This method will not check the document action flags to check if a save is valid

Parameters:
document - The document to be saved
kualiDocumentEventClass - The event class to use when saving (class must implement the SaveEvent interface)
Returns:
the document that was passed in
Throws:
WorkflowException

routeDocument

Document routeDocument(Document document,
                       String annotation,
                       List<AdHocRouteRecipient> adHocRoutingRecipients)
                       throws WorkflowException
start the route the document for approval, optionally providing a list of ad hoc recipients, and additionally provideing a annotation to show up in the route log for the document

Parameters:
document -
annotation -
adHocRoutingRecipients -
Returns:
Throws:
ValidationErrorList
WorkflowException

approveDocument

Document approveDocument(Document document,
                         String annotation,
                         List<AdHocRouteRecipient> adHocRoutingRecipients)
                         throws WorkflowException
approve this document, optionally providing an annotation which will show up in the route log for this document for this action taken, and optionally providing a list of ad hoc recipients for the document

Parameters:
document -
annotation -
adHocRoutingRecipients -
Returns:
Throws:
ValidationErrorList
WorkflowException

superUserApproveDocument

Document superUserApproveDocument(Document document,
                                  String annotation)
                                  throws WorkflowException
approve this document as super user, optionally providing an annotation which will show up in the route log for this document for this action taken

Parameters:
document -
annotation -
Returns:
Throws:
ValidationErrorList
WorkflowException

superUserCancelDocument

Document superUserCancelDocument(Document document,
                                 String annotation)
                                 throws WorkflowException
cancel this document as super user, optionally providing an annotation which will show up in the route log for this document for this action taken

Parameters:
document -
annotation -
Returns:
Throws:
WorkflowException

superUserDisapproveDocument

Document superUserDisapproveDocument(Document document,
                                     String annotation)
                                     throws WorkflowException
disapprove this document as super user, optionally providing an annotation which will show up in the route log for this document for this action taken

Parameters:
document -
annotation -
Returns:
Throws:
WorkflowException

superUserDisapproveDocumentWithoutSaving

Document superUserDisapproveDocumentWithoutSaving(Document document,
                                                  String annotation)
                                                  throws WorkflowException
disapprove this document as super user, without saving, optionally providing an annotation which will show up in the route log for this document for this action taken

Parameters:
document -
annotation -
Returns:
Throws:
WorkflowException

disapproveDocument

Document disapproveDocument(Document document,
                            String annotation)
                            throws Exception
disapprove this document, optionally providing an annotation for the disapproval which will show up in the route log for the document for this action taken

Parameters:
document -
annotation -
Returns:
Document
Throws:
Exception

cancelDocument

Document cancelDocument(Document document,
                        String annotation)
                        throws WorkflowException
cancel this document, optionally providing an annotation for the disapproval which will show up in the route log for the document for this action taken

Parameters:
document -
annotation -
Returns:
Throws:
WorkflowException

acknowledgeDocument

Document acknowledgeDocument(Document document,
                             String annotation,
                             List<AdHocRouteRecipient> adHocRecipients)
                             throws WorkflowException
acknowledge this document, optionally providing an annotation for the acknowledgement which will show up in the route log for the document for this acknowledgement, additionally optionally provide a list of ad hoc recipients that should recieve this document. The list of ad hoc recipients for this document should have an action requested of acknowledge or fyi as all other actions requested will be discarded as invalid based on the action being taken being an acknowledgement.

Parameters:
document -
annotation -
adHocRecipients -
Returns:
Throws:
WorkflowException

blanketApproveDocument

Document blanketApproveDocument(Document document,
                                String annotation,
                                List<AdHocRouteRecipient> adHocRecipients)
                                throws WorkflowException
blanket approve this document which will approve the document and stand in for an approve for all typically generated approval actions requested for this document. The user must have blanket approval authority for this document by being registered as a user in the blanket approval workgroup that is associated with this document type. Optionally an annotation can be provided which will show up for this action taken on the document in the route log. Additionally optionally provide a list of ad hoc recipients for this document, which should be restricted to actions requested of acknowledge and fyi as all other actions requested will be discarded

Parameters:
document -
annotation -
adHocRecipients -
Returns:
Throws:
ValidationErrorList
WorkflowException

clearDocumentFyi

Document clearDocumentFyi(Document document,
                          List<AdHocRouteRecipient> adHocRecipients)
                          throws WorkflowException
clear the fyi request for this document, optionally providing a list of ad hoc recipients for this document, which should be restricted to action requested of fyi as all other actions requested will be discarded

Parameters:
document -
adHocRecipients -
Returns:
Throws:
WorkflowException

prepareWorkflowDocument

void prepareWorkflowDocument(Document document)
                             throws WorkflowException
Sets the title and app document id in the workflow document

Parameters:
document -
Throws:
WorkflowException

createNoteFromDocument

Note createNoteFromDocument(Document document,
                            String text)
This method creates a note from a given document and note text. The resulting Note will have it's note type set to the value of Document.getNoteType(). Additionally, it's remoteObjectId will be set to the object id of the document's note target.

Parameters:
document - the document from which to use the note type and note target when creating the note
text - the text value to include in the resulting note
Returns:
the note that was created

saveDocumentNotes

boolean saveDocumentNotes(Document document)
Saves the notes associated with the given document if they are in a state where they can be saved. In certain cases they may not be ready to be saved. For example, in maintenance documents where the notes are associated with the business object instead of the document header, the notes cannot be saved until the business object itself has been persisted.

Parameters:
document - the document for which to save notes
Returns:
true if the notes were saved, false if they were not

sendAdHocRequests

void sendAdHocRequests(Document document,
                       String annotation,
                       List<AdHocRouteRecipient> adHocRecipients)
                       throws WorkflowException
Throws:
WorkflowException

sendNoteRouteNotification

void sendNoteRouteNotification(Document document,
                               Note note,
                               Person sender)
                               throws WorkflowException
Builds an workflow notification request for the note and sends it to note recipient.

Parameters:
document - - document that contains the note
note - - note to notify
sender - - user who is sending the notification
Throws:
WorkflowException

recallDocument

Document recallDocument(Document document,
                        String annotation,
                        boolean cancel)
                        throws WorkflowException
recall this document, optionally providing an annotation for the recall which will show up in the route log for the document for this action taken

Parameters:
document -
annotation -
Returns:
Throws:
WorkflowException
Since:
2.1

completeDocument

Document completeDocument(Document document,
                          String annotation,
                          List adHocRecipients)
                          throws WorkflowException
Complete action for a document

Parameters:
document - Document
annotation - Annotation text
adHocRecipients - list of adhoc recipients
Throws:
WorkflowException

validateAndPersistDocument

Document validateAndPersistDocument(Document document,
                                    KualiDocumentEvent event)
                                    throws ValidationException
Helper method used to save and validate a document

Parameters:
document - Document
event - KualiDocumentEvent
Throws:
ValidationException


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