Interface Document

All Superinterfaces:
GloballyUnique
All Known Subinterfaces:
MaintenanceDocument, TransactionalDocument
All Known Implementing Classes:
DocumentBase, MaintenanceDocumentBase, TransactionalDocumentBase

public interface Document extends 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 Details

    • getDocumentHeader

      DocumentHeader getDocumentHeader()
      This retrieves the standard DocumentHeader object, which contains standard meta-data about a document.
      Returns:
      document header since all docs will have a document header
    • setDocumentHeader

      void setDocumentHeader(DocumentHeader documentHeader)
      Sets the associated DocumentHeader for 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

      void setDocumentNumber(String documentHeaderId)
      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(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(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, 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 performed
      event - 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

      List<String> 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<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<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

      void setAdHocRoutePersons(List<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 document
      Parameters:
      adHocRoutePersons -
    • setAdHocRouteWorkgroups

      void setAdHocRouteWorkgroups(List<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 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

      void validateBusinessRules(DocumentEvent event)
      Sends document off to the rules engine to verify business rules.
      Parameters:
      event - - indicates which document event was requested
      Throws:
      ValidationException - - containing the MessageMap from the validation session.
    • prepareForSave

      void prepareForSave(DocumentEvent event)
      Do any work on the document that requires the DocumentEvent before the save.
      Parameters:
      event - - indicates which document event was requested
    • postProcessSave

      void postProcessSave(DocumentEvent event)
      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(DocumentRouteStatusChange statusChangeEvent)
      Handle the doRouteStatusChange event from the post processor
      Parameters:
      statusChangeEvent - status change event
    • getNoteType

      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

      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 is NoteType.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(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<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

      void setNotes(List<Note> notes)
      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

      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(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 the ActionRequest objects 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

      void setSuperUserAnnotation(String superUserAnnotation)
      This method sets the annotation to be attached to a super user action.
      Parameters:
      superUserAnnotation - the super user annotation
    • getPessimisticLocks

      List<PessimisticLock> getPessimisticLocks()
      This method gets a list of the PessimisticLock objects associated with this document
      Returns:
      list of pessimistic locks
    • refreshPessimisticLocks

      void refreshPessimisticLocks()
      This method updates the list of PessimisticLock objects on the document if changes could have been made
    • addPessimisticLock

      void addPessimisticLock(PessimisticLock lock)
      This method adds a new PessimisticLock to 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 List<String> getLockClearningMethodNames()
      Deprecated.
      Renamed:
      Returns:
      the list of method names of an action that should clear locks for the current user
      See Also:
    • getLockClearingMethodNames

      @Deprecated List<String> getLockClearingMethodNames()
      Deprecated.
      Use the releasePessimisticLocks method in the transactional KRAD controller
      This 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

      String getCustomLockDescriptor(Person user)
      Generates a custom lock descriptor for pessimistic locking. This method should not be called unless useCustomLockDescriptors() returns true.
      Parameters:
      user - The user trying to establish the lock.
      Returns:
      A String representing the lock descriptor.
      See Also: