Package org.kuali.rice.krad.service.impl
Class DocumentServiceImpl
java.lang.Object
org.kuali.rice.krad.service.impl.DocumentServiceImpl
- All Implemented Interfaces:
DocumentService
Service implementation for the Document structure. It contains all of the document level type of
processing and calling back into documents for various centralization of functionality. This is the default,
Kuali delivered implementation which utilizes Workflow.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataDictionaryServiceprotected org.kuali.rice.core.api.datetime.DateTimeServiceprotected DocumentAdHocServiceprotected DocumentDictionaryServiceprotected DocumentHeaderServiceprotected org.kuali.rice.core.api.config.property.ConfigurationServiceprotected LegacyDataAdapterprotected NoteServiceprotected org.kuali.rice.kim.api.identity.PersonServiceprotected WorkflowDocumentService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacknowledgeDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) acknowledgeDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) approveDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) approveDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) blanketApproveDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) blanketApproveDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) cancelDocument(Document document, String annotation) protected voidcheckForNulls(Document document) clearDocumentFyi(Document document, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) clearDocumentFyi(Document document, List<AdHocRouteRecipient> adHocRecipients) completeDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) completeDocument(Document document, String annotation, List adHocRecipients) createNoteFromDocument(Document document, String text) disapproveDocument(Document document, String annotation) booleandocumentExists(String documentHeaderId) getByDocumentHeaderId(String documentHeaderId) This is temporary until workflow 2.0 and reads from a table to get documents whose status has changed to A (approved - no outstanding approval actions requested)getByDocumentHeaderIdSessionless(String documentHeaderId) protected DataDictionaryServiceprotected org.kuali.rice.core.api.datetime.DateTimeServiceprotected DocumentDictionaryServicegetDocumentsByListOfDocumentHeaderIds(Class<? extends Document> documentClass, List<String> documentHeaderIds) The default implementation - this retrieves all documents by a list of documentHeader for a given class.protected LegacyDataAdaptergetNewDocument(Class<? extends Document> documentClass) Creates a new document by class.getNewDocument(String documentTypeName) Creates a new document by document type name.getNewDocument(String documentTypeName, String initiatorPrincipalNm) Creates a new document by document type name.protected NoteServiceorg.kuali.rice.kim.api.identity.PersonServiceprotected WorkflowDocumentServiceprotected booleanisNoteTargetReady(Document document) Determines if the given document's note target is ready for notes to be attached and persisted against it.protected voidLoads the Notes for the note target on this Document.voidprepareWorkflowDocument(Document document) Sets the title and app document id in the flex documentrecallDocument(Document document, String annotation, boolean cancel) routeDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) routeDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) saveDocument(Document document) saveDocument(Document document, Class<? extends DocumentEvent> kualiDocumentEventClass) saveDocument(Document document, DocumentEvent event) saves the document with the custom document event passed inbooleansaveDocumentNotes(Document document) sendAdHocRequests(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) sendAdHocRequests(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) sendNoteRouteNotification(Document document, Note note, org.kuali.rice.kim.api.identity.Person sender) voidsetDataDictionaryService(DataDictionaryService dataDictionaryService) voidsetDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService) voidsetDocumentAdHocService(DocumentAdHocService documentAdHocService) voidsetDocumentDictionaryService(DocumentDictionaryService documentDictionaryService) voidsetDocumentHeaderService(DocumentHeaderService documentHeaderService) voidsetKualiConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService kualiConfigurationService) voidsetLegacyDataAdapter(LegacyDataAdapter legacyDataAdapter) voidsetNoteService(NoteService noteService) voidsetWorkflowDocumentService(WorkflowDocumentService workflowDocumentService) superUserApproveDocument(Document document, String annotation) superUserCancelDocument(Document document, String annotation) superUserDisapproveDocument(Document document, String annotation) superUserDisapproveDocumentWithoutSaving(Document document, String annotation) updateDocument(Document document) This is to allow for updates of document statuses and other related requirements for updates outside of the initial save and routevalidateAndPersistDocument(Document document, DocumentEvent event) Validates and persists a document.
-
Field Details
-
dateTimeService
protected org.kuali.rice.core.api.datetime.DateTimeService dateTimeService -
noteService
-
workflowDocumentService
-
legacyDataAdapter
-
dataDictionaryService
-
documentDictionaryService
-
personService
protected org.kuali.rice.kim.api.identity.PersonService personService -
kualiConfigurationService
protected org.kuali.rice.core.api.config.property.ConfigurationService kualiConfigurationService -
documentHeaderService
-
documentAdHocService
-
-
Constructor Details
-
DocumentServiceImpl
public DocumentServiceImpl()
-
-
Method Details
-
saveDocument
public Document saveDocument(Document document) throws org.kuali.rice.kew.api.exception.WorkflowException, ValidationException - Specified by:
saveDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowExceptionValidationException- See Also:
-
saveDocument
public Document saveDocument(Document document, DocumentEvent event) throws org.kuali.rice.kew.api.exception.WorkflowException saves the document with the custom document event passed in- Specified by:
saveDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException
-
saveDocument
public Document saveDocument(Document document, Class<? extends DocumentEvent> kualiDocumentEventClass) throws org.kuali.rice.kew.api.exception.WorkflowException, ValidationException - Specified by:
saveDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowExceptionValidationException
-
routeDocument
public Document routeDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) throws ValidationException, org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
routeDocumentin interfaceDocumentService- Throws:
ValidationExceptionorg.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
routeDocument
public Document routeDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) throws ValidationException, org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
routeDocumentin interfaceDocumentService- Throws:
ValidationExceptionorg.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
approveDocument
public Document approveDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) throws ValidationException, org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
approveDocumentin interfaceDocumentService- Throws:
ValidationExceptionorg.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
approveDocument
public Document approveDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) throws ValidationException, org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
approveDocumentin interfaceDocumentService- Throws:
ValidationExceptionorg.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
superUserApproveDocument
public Document superUserApproveDocument(Document document, String annotation) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
superUserApproveDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
superUserCancelDocument
public Document superUserCancelDocument(Document document, String annotation) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
superUserCancelDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
superUserDisapproveDocument
public Document superUserDisapproveDocument(Document document, String annotation) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
superUserDisapproveDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
superUserDisapproveDocumentWithoutSaving
public Document superUserDisapproveDocumentWithoutSaving(Document document, String annotation) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
superUserDisapproveDocumentWithoutSavingin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
disapproveDocument
- Specified by:
disapproveDocumentin interfaceDocumentService- Throws:
Exception- See Also:
-
cancelDocument
public Document cancelDocument(Document document, String annotation) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
cancelDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
recallDocument
public Document recallDocument(Document document, String annotation, boolean cancel) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
recallDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException
-
acknowledgeDocument
public Document acknowledgeDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
acknowledgeDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
acknowledgeDocument
public Document acknowledgeDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
acknowledgeDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException
-
blanketApproveDocument
public Document blanketApproveDocument(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) throws ValidationException, org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
blanketApproveDocumentin interfaceDocumentService- Throws:
ValidationExceptionorg.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
blanketApproveDocument
public Document blanketApproveDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) throws ValidationException, org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
blanketApproveDocumentin interfaceDocumentService- Throws:
ValidationExceptionorg.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
clearDocumentFyi
public Document clearDocumentFyi(Document document, List<AdHocRouteRecipient> adHocRecipients) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
clearDocumentFyiin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
clearDocumentFyi
public Document clearDocumentFyi(Document document, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
clearDocumentFyiin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException
-
completeDocument
public Document completeDocument(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
completeDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException
-
completeDocument
public Document completeDocument(Document document, String annotation, List adHocRecipients) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
completeDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
checkForNulls
-
documentExists
- Specified by:
documentExistsin interfaceDocumentService- See Also:
-
getNewDocument
public Document getNewDocument(Class<? extends Document> documentClass) throws org.kuali.rice.kew.api.exception.WorkflowException Creates a new document by class.- Specified by:
getNewDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
getNewDocument
public Document getNewDocument(String documentTypeName, String initiatorPrincipalNm) throws org.kuali.rice.kew.api.exception.WorkflowException Creates a new document by document type name. The principal name passed in will be used as the document initiator. If the initiatorPrincipalNm is null or blank, the current user will be used.- Specified by:
getNewDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
getNewDocument
public Document getNewDocument(String documentTypeName) throws org.kuali.rice.kew.api.exception.WorkflowException Creates a new document by document type name.- Specified by:
getNewDocumentin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
getByDocumentHeaderId
public Document getByDocumentHeaderId(String documentHeaderId) throws org.kuali.rice.kew.api.exception.WorkflowException This is temporary until workflow 2.0 and reads from a table to get documents whose status has changed to A (approved - no outstanding approval actions requested)- Specified by:
getByDocumentHeaderIdin interfaceDocumentService- Parameters:
documentHeaderId-- Returns:
- Document
- Throws:
org.kuali.rice.kew.api.exception.WorkflowException
-
getByDocumentHeaderIdSessionless
public Document getByDocumentHeaderIdSessionless(String documentHeaderId) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
getByDocumentHeaderIdSessionlessin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
loadNotes
Loads the Notes for the note target on this Document.- Parameters:
document- the document for which to load the notes
-
getDocumentsByListOfDocumentHeaderIds
public List<Document> getDocumentsByListOfDocumentHeaderIds(Class<? extends Document> documentClass, List<String> documentHeaderIds) throws org.kuali.rice.kew.api.exception.WorkflowException The default implementation - this retrieves all documents by a list of documentHeader for a given class.- Specified by:
getDocumentsByListOfDocumentHeaderIdsin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
validateAndPersistDocument
public Document validateAndPersistDocument(Document document, DocumentEvent event) throws ValidationException Validates and persists a document.- Specified by:
validateAndPersistDocumentin interfaceDocumentService- Throws:
ValidationException
-
prepareWorkflowDocument
public void prepareWorkflowDocument(Document document) throws org.kuali.rice.kew.api.exception.WorkflowException Sets the title and app document id in the flex document- Specified by:
prepareWorkflowDocumentin interfaceDocumentService- Parameters:
document-- Throws:
org.kuali.rice.kew.api.exception.WorkflowException
-
updateDocument
This is to allow for updates of document statuses and other related requirements for updates outside of the initial save and route- Specified by:
updateDocumentin interfaceDocumentService
-
createNoteFromDocument
- Specified by:
createNoteFromDocumentin interfaceDocumentService- See Also:
-
saveDocumentNotes
- Specified by:
saveDocumentNotesin interfaceDocumentService- See Also:
-
sendNoteRouteNotification
public Document sendNoteRouteNotification(Document document, Note note, org.kuali.rice.kim.api.identity.Person sender) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
sendNoteRouteNotificationin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
isNoteTargetReady
Determines if the given document's note target is ready for notes to be attached and persisted against it. This method verifies that the document's note target is non-null as well as checking that it has a non-empty object id.- Parameters:
document- the document on which to check for note target readiness- Returns:
- true if the note target is ready, false otherwise
-
sendAdHocRequests
public Document sendAdHocRequests(Document document, String annotation, List<AdHocRouteRecipient> adHocRecipients) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
sendAdHocRequestsin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException- See Also:
-
sendAdHocRequests
public Document sendAdHocRequests(Document document, String annotation, String adHocRouteNodeName, List<AdHocRouteRecipient> adHocRecipients) throws org.kuali.rice.kew.api.exception.WorkflowException - Specified by:
sendAdHocRequestsin interfaceDocumentService- Throws:
org.kuali.rice.kew.api.exception.WorkflowException
-
setDateTimeService
public void setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService) -
getDateTimeService
protected org.kuali.rice.core.api.datetime.DateTimeService getDateTimeService() -
setNoteService
-
getNoteService
-
setLegacyDataAdapter
-
getLegacyDataAdapter
-
setWorkflowDocumentService
-
getWorkflowDocumentService
-
setDataDictionaryService
-
getDataDictionaryService
-
getDocumentDictionaryService
-
setDocumentDictionaryService
-
getPersonService
public org.kuali.rice.kim.api.identity.PersonService getPersonService() -
setKualiConfigurationService
public void setKualiConfigurationService(org.kuali.rice.core.api.config.property.ConfigurationService kualiConfigurationService) -
getDocumentHeaderService
-
setDocumentHeaderService
-
setDocumentAdHocService
-