Package org.kuali.rice.krad.document
Interface Document
- All Superinterfaces:
org.kuali.rice.core.api.mo.common.GloballyUnique
- All Known Subinterfaces:
MaintenanceDocument,TransactionalDocument
- All Known Implementing Classes:
DocumentBase,MaintenanceDocumentBase,TransactionalDocumentBase
public interface Document
extends org.kuali.rice.core.api.mo.common.GloballyUnique
This is the Document interface. All entities that are regarded as "eDocs" in the system, including Maintenance documents and
Transaction Processing documents should implement this interface as it defines methods that are necessary to interact with the
underlying frameworks and components (i.e. notes, attachments, workflow, etc).
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddNote(org.kuali.rice.krad.bo.Note note) Adds the given Note to the document's list of Notes.voidaddPessimisticLock(org.kuali.rice.krad.document.authorization.PessimisticLock lock) This method adds a newPessimisticLockto the document NOTE: LOCKS ADDED VIA THIS METHOD WILL NOT BE SAVED WITH THE DOCUMENTvoidafterActionTaken(org.kuali.rice.kew.api.action.ActionType performed, org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent event) method to integrate with workflow where we will be able to perform logic after an action taken being performed on a documentvoidafterWorkflowEngineProcess(boolean successfullyProcessed) This method will be called after the Workflow engine has completely finished processing a document.voidThis method will be called before the Workflow engine has begun processing a document.voiddoActionTaken(org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent event) method to integrate with workflow where we will be able to perform logic for an action taken being performed on a documentvoiddoRouteLevelChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange levelChangeEvent) method to integrate with workflow, where we will actually handle the transitions of levels for documentsvoiddoRouteStatusChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange statusChangeEvent) Handle the doRouteStatusChange event from the post processorGenerate any necessary events required during the save event generationList<org.kuali.rice.kew.api.action.ActionRequest> This method gets a list of theActionRequestobjects associated with this document.Return the name of the node to route any adhoc requests to, or null to let the workflow engine choose.List<org.kuali.rice.krad.bo.AdHocRoutePerson> getter method to get the list of ad hoc route persons associated with a document at a point in time, this list is only valid for a given users version of a document as this state is only persisted in workflow itself when someone takes an action on a documentList<org.kuali.rice.krad.bo.AdHocRouteWorkgroup> getter method to get the list of ad hoc route workgroups associated with a document at a point in time, this list is only valid for a given users version of a document as this state is only persisted in workflow itself when someone takes an action on a documentbooleanThis method returns whether or not this document can be copied.Returns an evaluator object that determines whether a given property relative to the root object (wrapDocumentWithMetadataForXmlSerialization()is serializable during the document serialization process.getCustomLockDescriptor(org.kuali.rice.kim.api.identity.Person user) Generates a custom lock descriptor for pessimistic locking.org.kuali.rice.krad.bo.DocumentHeaderThis retrieves the standardDocumentHeaderobject, which contains standard meta-data about a document.All documents have a document header id.Returns an evaluator object that determines whether a given property relative to the root object (wrapDocumentWithMetadataForXmlSerialization()is serializable during the document serialization process.Getter method to get the document title as it will appear in and be searchable in workflow.Deprecated.Deprecated.org.kuali.rice.krad.bo.NotegetNote(int index) Retrieves the note at the given index.List<org.kuali.rice.krad.bo.Note> getNotes()Returns a mutable list of all notes on the document.org.kuali.rice.core.api.mo.common.GloballyUniqueReturn the target PersistableBusinessObject that notes associated with this document should be attached to.org.kuali.rice.krad.util.NoteTypeReturns the note type which should be used for notes associated with this document.List<org.kuali.rice.krad.document.authorization.PessimisticLock> This method gets a list of thePessimisticLockobjects associated with this documentThis method gets the annotation to be attached to a super user action.This method will be called before the Workflow engine has begun processing a document.This method is used to get the xml that should be used in a Route Report.voidThis is the method to integrate with workflow, where we will actually populate the workflow defined data structure(s) so that workflow can routed based on this data.voidpostProcessSave(DocumentEvent event) Do any work on the document after the save.voidThis method provides a hook that will be called before the document is saved.voidprepareForSave(DocumentEvent event) Do any work on the document that requires the DocumentEvent before the save.voidThis method provides a hook that will be called after a document is retrieved, but before it is returned from the DocumentService.voidThis method updates the list ofPessimisticLockobjects on the document if changes could have been madebooleanremoveNote(org.kuali.rice.krad.bo.Note note) Removes the given note from the document's list of notes.This is a method where we can get the xml of a document that the workflow system will use to base it's routing and search attributes on.voidsetAdHocRoutePersons(List<org.kuali.rice.krad.bo.AdHocRoutePerson> adHocRoutePersons) setter method to set the list of ad hoc route persons associated with a document at a point in time, this list is only valid for a given users version of a document as this state is only persisted in workflow itself when someone takes an action on a documentvoidsetAdHocRouteWorkgroups(List<org.kuali.rice.krad.bo.AdHocRouteWorkgroup> adHocRouteWorkgroups) setter method to set the list of ad hoc route workgroups associated with a document at a point in time, this list is only valid for a given users version of a document as this state is only persisted in workflow itself when someone takes an action on a documentvoidsetDocumentHeader(org.kuali.rice.krad.bo.DocumentHeader documentHeader) Sets the associatedDocumentHeaderfor this document.voidsetDocumentNumber(String documentHeaderId) setter for document header idvoidSets the document's list of notes to the given list.voidsetSuperUserAnnotation(String superUserAnnotation) This method sets the annotation to be attached to a super user action.booleanThis method returns whether or not this document supports custom lock descriptors for pessimistic locking.voidSends document off to the rules engine to verify business rules.This method will return the root object to be serialized for workflow routing.Methods inherited from interface org.kuali.rice.core.api.mo.common.GloballyUnique
getObjectId
-
Method Details
-
getDocumentHeader
org.kuali.rice.krad.bo.DocumentHeader getDocumentHeader()This retrieves the standardDocumentHeaderobject, which contains standard meta-data about a document.- Returns:
- document header since all docs will have a document header
-
setDocumentHeader
void setDocumentHeader(org.kuali.rice.krad.bo.DocumentHeader documentHeader) Sets the associatedDocumentHeaderfor this document.- Parameters:
documentHeader-
-
getDocumentNumber
String getDocumentNumber()All documents have a document header id. This is the quick accessor to that unique identifier and should return the same value as documentHeader.getDocumentHeaderId().- Returns:
- doc header id
-
setDocumentNumber
setter for document header id- Parameters:
documentHeaderId-
-
populateDocumentForRouting
void populateDocumentForRouting()This is the method to integrate with workflow, where we will actually populate the workflow defined data structure(s) so that workflow can routed based on this data. This method is responsible for passing over the proper Kuali (client system) data that will be used by workflow to determine how the document is actually routed. -
serializeDocumentToXml
String serializeDocumentToXml()This is a method where we can get the xml of a document that the workflow system will use to base it's routing and search attributes on.- Returns:
- the document serialized to an xml string
-
getXmlForRouteReport
String getXmlForRouteReport()This method is used to get the xml that should be used in a Route Report. In it's default implementation this will call the methods prepareForSave() and populateDocumentForRouting().- Returns:
- XML data for routing
-
doRouteLevelChange
void doRouteLevelChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange levelChangeEvent) method to integrate with workflow, where we will actually handle the transitions of levels for documents- Parameters:
levelChangeEvent- route level change event
-
doActionTaken
void doActionTaken(org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent event) method to integrate with workflow where we will be able to perform logic for an action taken being performed on a document- Parameters:
event- action taken event
-
afterActionTaken
void afterActionTaken(org.kuali.rice.kew.api.action.ActionType performed, org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent event) method to integrate with workflow where we will be able to perform logic after an action taken being performed on a document- Parameters:
performed- action type performedevent- action taken event- Since:
- 2.1
-
afterWorkflowEngineProcess
void afterWorkflowEngineProcess(boolean successfullyProcessed) This method will be called after the Workflow engine has completely finished processing a document.- Parameters:
successfullyProcessed- - true if the document was processed successfully, false otherwise
-
beforeWorkflowEngineProcess
void beforeWorkflowEngineProcess()This method will be called before the Workflow engine has begun processing a document. -
getWorkflowEngineDocumentIdsToLock
This method will be called before the Workflow engine has begun processing a document.- Returns:
- additional document IDs to lock prior to processing
-
getDocumentTitle
String getDocumentTitle()Getter method to get the document title as it will appear in and be searchable in workflow.- Returns:
- document title
-
getAdHocRoutePersons
List<org.kuali.rice.krad.bo.AdHocRoutePerson> getAdHocRoutePersons()getter method to get the list of ad hoc route persons associated with a document at a point in time, this list is only valid for a given users version of a document as this state is only persisted in workflow itself when someone takes an action on a document- Returns:
- list of ad hoc route persons
-
getAdHocRouteWorkgroups
List<org.kuali.rice.krad.bo.AdHocRouteWorkgroup> getAdHocRouteWorkgroups()getter method to get the list of ad hoc route workgroups associated with a document at a point in time, this list is only valid for a given users version of a document as this state is only persisted in workflow itself when someone takes an action on a document- Returns:
- list of ad hoc route workgroups
-
setAdHocRoutePersons
setter method to set the list of ad hoc route persons associated with a document at a point in time, this list is only valid for a given users version of a document as this state is only persisted in workflow itself when someone takes an action on a document- Parameters:
adHocRoutePersons-
-
setAdHocRouteWorkgroups
setter method to set the list of ad hoc route workgroups associated with a document at a point in time, this list is only valid for a given users version of a document as this state is only persisted in workflow itself when someone takes an action on a document- Parameters:
adHocRouteWorkgroups-
-
getAdHocRouteNodeName
String getAdHocRouteNodeName()Return the name of the node to route any adhoc requests to, or null to let the workflow engine choose.- Returns:
- the name of the node to route any adhoc requests to
-
prepareForSave
void prepareForSave()This method provides a hook that will be called before the document is saved. This method is useful for applying document level data to children. For example, if someone changes data at the document level, and that data needs to be propagated to child objects or child lists of objects, you can use this method to update the child object or iterate through the list of child objects and apply the document level data to them. Any document that follows this paradigm will need to make use of this method to apply all of those changes. -
validateBusinessRules
Sends document off to the rules engine to verify business rules.- Parameters:
event- - indicates which document event was requested- Throws:
org.kuali.rice.krad.exception.ValidationException- - containing the MessageMap from the validation session.
-
prepareForSave
Do any work on the document that requires the DocumentEvent before the save.- Parameters:
event- - indicates which document event was requested
-
postProcessSave
Do any work on the document after the save.- Parameters:
event- - indicates which document event was requested
-
processAfterRetrieve
void processAfterRetrieve()This method provides a hook that will be called after a document is retrieved, but before it is returned from the DocumentService. -
getAllowsCopy
boolean getAllowsCopy()This method returns whether or not this document can be copied.- Returns:
- True if it can be copied, false if not.
-
generateSaveEvents
List<DocumentEvent> generateSaveEvents()Generate any necessary events required during the save event generation- Returns:
- a list of document events that were triggered by the save event
-
doRouteStatusChange
void doRouteStatusChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange statusChangeEvent) Handle the doRouteStatusChange event from the post processor- Parameters:
statusChangeEvent- status change event
-
getNoteType
org.kuali.rice.krad.util.NoteType getNoteType()Returns the note type which should be used for notes associated with this document. This method should never return null.- Returns:
- the note type supported by this document, this value should never be null
-
getNoteTarget
org.kuali.rice.core.api.mo.common.GloballyUnique getNoteTarget()Return the target PersistableBusinessObject that notes associated with this document should be attached to. In general, this method should never return null. However, it is permissible that it will return a business object which has not been persisted yet (and therefore does not have it's unique object id established). This is only valid in cases where the note type isNoteType.BUSINESS_OBJECT. In these cases it's the responsibility for implementers of the Document interface to handle storing transient copies of the document notes (in XML or otherwise) until the underlying note target has been persisted and can be attached to the document's notes via it's object id.- Returns:
- the PersistableBusinessObject with which notes on this document should be associated
-
addNote
void addNote(org.kuali.rice.krad.bo.Note note) Adds the given Note to the document's list of Notes.- Parameters:
note- the Note to add, must be non-null
-
getNotes
List<org.kuali.rice.krad.bo.Note> getNotes()Returns a mutable list of all notes on the document.- Returns:
- the list of notes associated with this document, if this document has no notes then an empty list will be returned
-
setNotes
Sets the document's list of notes to the given list.- Parameters:
notes- the list of notes to set on the document, must be non-null
-
getNote
org.kuali.rice.krad.bo.Note getNote(int index) Retrieves the note at the given index.- Parameters:
index- the zero-based index of the note to retrieve- Returns:
- the note located at the given index
- Throws:
IndexOutOfBoundsException- if the index is out of range
-
removeNote
boolean removeNote(org.kuali.rice.krad.bo.Note note) Removes the given note from the document's list of notes.- Parameters:
note- the note to remove from the document's list of notes, must be non-null- Returns:
- true if the note was successfully removed, false if the list did not contain the given note
-
getActionRequests
List<org.kuali.rice.kew.api.action.ActionRequest> getActionRequests()This method gets a list of theActionRequestobjects associated with this document.- Returns:
- list of action requests
-
getSuperUserAnnotation
String getSuperUserAnnotation()This method gets the annotation to be attached to a super user action.- Returns:
- the super user annotation
-
setSuperUserAnnotation
This method sets the annotation to be attached to a super user action.- Parameters:
superUserAnnotation- the super user annotation
-
getPessimisticLocks
List<org.kuali.rice.krad.document.authorization.PessimisticLock> getPessimisticLocks()This method gets a list of thePessimisticLockobjects associated with this document- Returns:
- list of pessimistic locks
-
refreshPessimisticLocks
void refreshPessimisticLocks()This method updates the list ofPessimisticLockobjects on the document if changes could have been made -
addPessimisticLock
void addPessimisticLock(org.kuali.rice.krad.document.authorization.PessimisticLock lock) This method adds a newPessimisticLockto the document NOTE: LOCKS ADDED VIA THIS METHOD WILL NOT BE SAVED WITH THE DOCUMENT- Parameters:
lock- - the lock to add to the document
-
getLockClearningMethodNames
Deprecated.Renamed:- Returns:
- the list of method names of an action that should clear locks for the current user
- See Also:
-
getLockClearingMethodNames
Deprecated.Use thereleasePessimisticLocks methodin the transactional KRAD controllerThis is a method that is used by Kuali Pessimistic Locking to get the names (method to call values) of the KNS KualiDocumentActionBase methods that should release locks- Returns:
- the list of method names of an action that should clear locks for the current user
-
getBasePathToDocumentDuringSerialization
String getBasePathToDocumentDuringSerialization()Returns an evaluator object that determines whether a given property relative to the root object (wrapDocumentWithMetadataForXmlSerialization()is serializable during the document serialization process.- Returns:
- a fully initialized evaluator object, ready to be used for workflow routing
- See Also:
-
getDocumentPropertySerizabilityEvaluator
PropertySerializabilityEvaluator getDocumentPropertySerizabilityEvaluator()Returns an evaluator object that determines whether a given property relative to the root object (wrapDocumentWithMetadataForXmlSerialization()is serializable during the document serialization process.- Returns:
- a fully initialized evaluator object, ready to be used for workflow routing
- See Also:
-
wrapDocumentWithMetadataForXmlSerialization
Object wrapDocumentWithMetadataForXmlSerialization()This method will return the root object to be serialized for workflow routing. If necessary, this method will wrap this document object with a wrapper (i.e. contains a reference back to this document). This wrapper may also contain references to additional objects that provide metadata useful to the workflow engine. If no wrappers are necessary, then this object may return "this"- Returns:
- a wrapper object (most likely containing a reference to "this"), or "this" itself.
- See Also:
-
useCustomLockDescriptors
boolean useCustomLockDescriptors()This method returns whether or not this document supports custom lock descriptors for pessimistic locking.- Returns:
- True if the document can generate custom lock descriptors, false otherwise.
- See Also:
-
getCustomLockDescriptor
Generates a custom lock descriptor for pessimistic locking. This method should not be called unlessuseCustomLockDescriptors()returns true.- Parameters:
user- The user trying to establish the lock.- Returns:
- A String representing the lock descriptor.
- See Also:
-
releasePessimisticLocks methodin the transactional KRAD controller