@Entity public class MaintenanceDocumentBase extends DocumentBase implements MaintenanceDocument, SessionDocument
Maintainable that is also used for various callbacks
The maintenance xml structure will be: <maintainableDocumentContents maintainableImplClass="className">
<oldMaintainableObject>... </oldMaintainableObject> <newMaintainableObject>... </newMaintainableObject>
</maintainableDocumentContents> Maintenance Document
| Modifier and Type | Field and Description |
|---|---|
protected DocumentAttachment |
attachment |
protected String |
attachmentCollectionName |
protected String |
attachmentListPropertyName |
protected String |
attachmentPropertyName |
protected List<MultiDocumentAttachment> |
attachments |
protected boolean |
displayTopicFieldInNotes |
protected boolean |
fieldsClearedOnCopy |
static String |
MAINTAINABLE_IMPL_CLASS |
static String |
MAINTENANCE_ACTION_TAG_NAME |
static String |
NEW_MAINTAINABLE_TAG_NAME |
protected Maintainable |
newMaintainableObject |
static String |
NOTES_TAG_NAME |
static String |
OLD_MAINTAINABLE_TAG_NAME |
protected Maintainable |
oldMaintainableObject |
protected static int |
SUB_OBJECT_MATERIALIZATION_DEPTH |
protected String |
xmlDocumentContents |
adHocRoutePersons, adHocRouteWorkgroups, documentHeader, documentNumber, notes, pessimisticLocksextension, newCollectionRecordobjectId, versionNumber| Constructor and Description |
|---|
MaintenanceDocumentBase() |
MaintenanceDocumentBase(String documentTypeName)
Initializies the maintainables.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkAllowsRecordDeletion() |
protected boolean |
checkDeletePermission(Object dataObject) |
protected void |
checkForLockingDocument(boolean throwExceptionIfLocked) |
protected boolean |
checkMaintenanceAction() |
void |
deleteDocumentAttachment()
Deprecated.
|
void |
deleteDocumentAttachmentList()
Deprecated.
|
void |
doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent)
Handle the doRouteStatusChange event from the post processor
|
boolean |
getAllowsCopy()
This method returns whether or not this document can be copied.
|
DocumentAttachment |
getAttachment() |
String |
getAttachmentCollectionName() |
String |
getAttachmentListPropertyName() |
String |
getAttachmentPropertyName() |
List<MultiDocumentAttachment> |
getAttachments() |
protected BusinessObjectSerializerService |
getBusinessObjectSerializerService() |
String |
getCustomLockDescriptor(Person user)
Returns the custom lock descriptor generated by the new maintainable object, if defined.
|
protected Object |
getDataObjectFromXML(String maintainableTagName)
Get data object from XML
|
Object |
getDocumentDataObject()
Return the data object that this MaintenanceDocument is maintaining
|
protected DocumentDictionaryService |
getDocumentDictionaryService() |
PropertySerializabilityEvaluator |
getDocumentPropertySerizabilityEvaluator()
If workflowProperties have been defined within the data dictionary for this document, then it returns an instance
of
BusinessObjectPropertySerializibilityEvaluator initialized with the properties. |
protected DocumentService |
getDocumentService() |
String |
getDocumentTitle()
Builds out the document title for maintenance documents
|
protected String |
getMaintenanceAction(Document xmlDocument,
String oldOrNewElementName)
This method is a lame containment of ugly DOM walking code.
|
protected MaintenanceDocumentService |
getMaintenanceDocumentService() |
Maintainable |
getNewMaintainableObject()
Get the new maintainable object
|
GloballyUnique |
getNoteTarget()
The Note target for maintenance documents is determined by whether or not the underlying
Maintainable
supports business object notes or not. |
NoteType |
getNoteType()
The
NoteType for maintenance documents is determined by whether or not the underlying Maintainable supports business object notes or not. |
Maintainable |
getOldMaintainableObject()
Get the old maintainable object
|
List<String> |
getWorkflowEngineDocumentIdsToLock()
The default implementation returns no additional ids for the workflow engine to lock prior to processing.
|
String |
getXmlDocumentContents()
Get the XML representation of the maintenance document
|
boolean |
isDisplayTopicFieldInNotes()
Check if the topic field should be displayed in the notes section
|
boolean |
isEdit()
Check if maintenance document is editing an existing Business Object
|
boolean |
isFieldsClearedOnCopy()
Check if fields are cleared on copy
|
boolean |
isNew()
Check if maintenance document is creating a new Business Object
|
boolean |
isNewWithExisting()
Check if maintenance document is creating a new Business Object out of an existing Business Object
|
boolean |
isOldDataObjectInDocument()
Check if maintenance document has old maintenance data
|
protected boolean |
isOldMaintainableInDocument(Document xmlDocument)
Check if oldMaintainable is specified in the XML of the maintenance document
|
boolean |
isSessionDocument()
This method to check whether the document class implements SessionDocument
TODO: move to KNS maintenance document base
|
void |
populateAttachmentBeforeSave()
Deprecated.
|
void |
populateAttachmentForBO()
Deprecated.
|
void |
populateAttachmentListForBO()
Deprecated.
|
void |
populateBoAttachmentListBeforeSave()
Deprecated.
|
void |
populateDocumentAttachment()
Deprecated.
|
void |
populateDocumentAttachmentList()
Deprecated.
|
void |
populateMaintainablesFromXmlDocumentContents()
Populates the old and new maintainables from the xml document contents string.
|
void |
populateXmlDocumentContentsFromMaintainables()
Populates the xml document contents from the maintainables.
|
void |
postProcessSave(DocumentEvent event)
this needs to happen after the document itself is saved, to preserve consistency of the ver_nbr and in the case
of initial save, because this can't be saved until the document is saved initially
|
void |
prepareForSave()
This method provides a hook that will be called before the document is saved.
|
void |
prepareForSave(DocumentEvent event)
Override this method with implementation specific prepareForSave logic
|
void |
processAfterRetrieve()
This method provides a hook that will be called after a document is retrieved, but before it is returned from the
DocumentService.
|
protected void |
refreshAttachment()
Deprecated.
|
protected void |
refreshAttachmentList()
Deprecated.
|
String |
serializeDocumentToXml()
Overridden to avoid serializing the xml twice, because of the xmlDocumentContents property of this object
|
void |
setAttachment(DocumentAttachment attachment) |
void |
setAttachmentCollectionName(String attachmentCollectionName) |
void |
setAttachmentListPropertyName(String attachmentListPropertyName) |
void |
setAttachmentPropertyName(String attachmentPropertyName) |
void |
setAttachments(List<MultiDocumentAttachment> attachments) |
void |
setDisplayTopicFieldInNotes(boolean displayTopicFieldInNotes)
Set the display topic field in notes flag
|
void |
setDocumentNumber(String documentNumber)
setter for document header id
|
void |
setFieldsClearedOnCopy(boolean fieldsClearedOnCopy)
Set the keys cleared on copy flag
|
void |
setNewMaintainableObject(Maintainable newMaintainableObject)
Set the new maintainable object
|
void |
setOldMaintainableObject(Maintainable oldMaintainableObject)
Set the old maintainable object
|
void |
setXmlDocumentContents(String xmlDocumentContents)
Sets the xml contents of the maintenance document
|
boolean |
useCustomLockDescriptors()
Returns whether or not the new maintainable object supports custom lock descriptors.
|
void |
validateBusinessRules(DocumentEvent event)
Explicitly NOT calling super here.
|
addCopyErrorDocumentNote, addNote, addPessimisticLock, afterActionTaken, afterWorkflowEngineProcess, beforeWorkflowEngineProcess, createPropertySerializabilityEvaluator, doActionTaken, doRouteLevelChange, generateSaveEvents, getActionRequests, getAdHocRoutePersons, getAdHocRouteWorkgroups, getAttachmentService, getBasePathToDocumentDuringSerialization, getDocumentHeader, getDocumentNumber, getLockClearingMethodNames, getLockClearningMethodNames, getNonLockingActionTakenCodes, getNote, getNotes, getNoteService, getPessimisticLocks, getSuperUserAnnotation, getXmlForRouteReport, logErrors, populateDocumentForRouting, postLoad, postRemove, prePersist, refreshPessimisticLocks, refreshReferenceObject, removeNote, setAdHocRoutePersons, setAdHocRouteWorkgroups, setDocumentHeader, setNewDocumentHeader, setNotes, setPessimisticLocks, setSuperUserAnnotation, toCopy, wrapDocumentWithMetadataForXmlSerializationbuildListOfDeletionAwareLists, getExtension, getLegacyDataAdapter, isNewCollectionRecord, linkEditableUserFields, refresh, refreshNonUpdateableReferences, setExtension, setNewCollectionRecordgenerateAndSetObjectIdIfNeeded, getExtensionObject, getObjectId, getVersionNumber, preUpdate, setExtensionObject, setObjectId, setVersionNumber, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddNote, addPessimisticLock, afterActionTaken, afterWorkflowEngineProcess, beforeWorkflowEngineProcess, doActionTaken, doRouteLevelChange, generateSaveEvents, getActionRequests, getAdHocRoutePersons, getAdHocRouteWorkgroups, getBasePathToDocumentDuringSerialization, getDocumentHeader, getDocumentNumber, getLockClearingMethodNames, getLockClearningMethodNames, getNote, getNotes, getPessimisticLocks, getSuperUserAnnotation, getXmlForRouteReport, populateDocumentForRouting, refreshPessimisticLocks, removeNote, setAdHocRoutePersons, setAdHocRouteWorkgroups, setDocumentHeader, setNotes, setSuperUserAnnotation, wrapDocumentWithMetadataForXmlSerializationgetObjectIdprotected static final int SUB_OBJECT_MATERIALIZATION_DEPTH
public static final String MAINTAINABLE_IMPL_CLASS
public static final String OLD_MAINTAINABLE_TAG_NAME
public static final String NEW_MAINTAINABLE_TAG_NAME
public static final String MAINTENANCE_ACTION_TAG_NAME
public static final String NOTES_TAG_NAME
protected Maintainable oldMaintainableObject
protected Maintainable newMaintainableObject
protected String xmlDocumentContents
protected boolean fieldsClearedOnCopy
protected boolean displayTopicFieldInNotes
protected String attachmentPropertyName
protected String attachmentListPropertyName
protected String attachmentCollectionName
protected DocumentAttachment attachment
protected List<MultiDocumentAttachment> attachments
public MaintenanceDocumentBase()
public MaintenanceDocumentBase(String documentTypeName)
public String getDocumentTitle()
This will get loaded into the flex doc and passed into workflow. It will be searchable.
getDocumentTitle in interface DocumentgetDocumentTitle in class DocumentBaseDocument.getDocumentTitle()protected boolean isOldMaintainableInDocument(Document xmlDocument)
xmlDocument - Maintenance document in XML formpublic boolean isOldDataObjectInDocument()
MaintenanceDocumentisOldDataObjectInDocument in interface MaintenanceDocumentMaintainable.isOldDataObjectInDocument()public boolean isNew()
MaintenanceDocumentisNew in interface MaintenanceDocumentMaintenanceDocument.isNew()public boolean isEdit()
MaintenanceDocumentisEdit in interface MaintenanceDocumentMaintenanceDocument.isEdit()public boolean isNewWithExisting()
MaintenanceDocumentFor example, a new division vendor out of an existing parent vendor.
isNewWithExisting in interface MaintenanceDocumentMaintenanceDocument.isNewWithExisting()public void populateMaintainablesFromXmlDocumentContents()
MaintenanceDocumentpopulateMaintainablesFromXmlDocumentContents in interface MaintenanceDocumentMaintenanceDocument.populateMaintainablesFromXmlDocumentContents()protected String getMaintenanceAction(Document xmlDocument, String oldOrNewElementName)
xmlDocument - oldOrNewElementName - - String oldMaintainableObject or newMaintainableObjectprotected Object getDataObjectFromXML(String maintainableTagName)
Retrieves substring of document contents from maintainable tag name. Then use xml service to translate xml into a business object.
maintainableTagName - the xml tag name of the maintainablepublic void populateXmlDocumentContentsFromMaintainables()
populateXmlDocumentContentsFromMaintainables in interface MaintenanceDocumentMaintenanceDocument.populateXmlDocumentContentsFromMaintainables()public void doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent)
DocumentdoRouteStatusChange in interface DocumentdoRouteStatusChange in class DocumentBasestatusChangeEvent - status change eventDocumentBase.doRouteStatusChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange)public List<String> getWorkflowEngineDocumentIdsToLock()
DocumentBasegetWorkflowEngineDocumentIdsToLock in interface DocumentgetWorkflowEngineDocumentIdsToLock in class DocumentBaseDocumentBase.getWorkflowEngineDocumentIdsToLock()public void prepareForSave()
DocumentprepareForSave in interface DocumentprepareForSave in class DocumentBaseDocument.prepareForSave()public void processAfterRetrieve()
DocumentprocessAfterRetrieve in interface DocumentprocessAfterRetrieve in class DocumentBaseDocumentBase.processAfterRetrieve()public Maintainable getNewMaintainableObject()
MaintenanceDocumentgetNewMaintainableObject in interface MaintenanceDocumentMaintenanceDocument.getNewMaintainableObject()public void setNewMaintainableObject(Maintainable newMaintainableObject)
MaintenanceDocumentsetNewMaintainableObject in interface MaintenanceDocumentnewMaintainableObject - maintainable with the new maintenance recordMaintenanceDocument.setNewMaintainableObject(Maintainable)public Maintainable getOldMaintainableObject()
MaintenanceDocumentgetOldMaintainableObject in interface MaintenanceDocumentMaintenanceDocument.getOldMaintainableObject()public void setOldMaintainableObject(Maintainable oldMaintainableObject)
MaintenanceDocumentsetOldMaintainableObject in interface MaintenanceDocumentoldMaintainableObject - maintainable with the old maintenance recordMaintenanceDocument.setOldMaintainableObject(Maintainable)public void setDocumentNumber(String documentNumber)
DocumentBasesetDocumentNumber in interface DocumentsetDocumentNumber in class DocumentBaseDocumentBase.setDocumentNumber(java.lang.String)public final boolean isFieldsClearedOnCopy()
MaintenanceDocumentFor copy action the primary keys need to be cleared. This flag indicates if the clearing has occurred.
isFieldsClearedOnCopy in interface MaintenanceDocumentMaintenanceDocument.isFieldsClearedOnCopy()public final void setFieldsClearedOnCopy(boolean fieldsClearedOnCopy)
MaintenanceDocumentsetFieldsClearedOnCopy in interface MaintenanceDocumentMaintenanceDocument.setFieldsClearedOnCopy(boolean)public String getXmlDocumentContents()
MaintenanceDocumentgetXmlDocumentContents in interface MaintenanceDocumentMaintenanceDocument.getXmlDocumentContents()public void setXmlDocumentContents(String xmlDocumentContents)
MaintenanceDocumentsetXmlDocumentContents in interface MaintenanceDocumentxmlDocumentContents - String xmlMaintenanceDocument.setXmlDocumentContents(String)public boolean getAllowsCopy()
DocumentgetAllowsCopy in interface DocumentgetAllowsCopy in class DocumentBaseDocument.getAllowsCopy()public boolean isDisplayTopicFieldInNotes()
MaintenanceDocumentisDisplayTopicFieldInNotes in interface MaintenanceDocumentMaintenanceDocument.isDisplayTopicFieldInNotes()public void setDisplayTopicFieldInNotes(boolean displayTopicFieldInNotes)
MaintenanceDocumentsetDisplayTopicFieldInNotes in interface MaintenanceDocumentMaintenanceDocument.setDisplayTopicFieldInNotes(boolean)public String serializeDocumentToXml()
serializeDocumentToXml in interface DocumentserializeDocumentToXml in class DocumentBaseDocument.serializeDocumentToXml()public void prepareForSave(DocumentEvent event)
DocumentBaseprepareForSave in interface DocumentprepareForSave in class DocumentBaseevent - - indicates which document event was requestedDocumentBase.prepareForSave(org.kuali.rice.krad.rules.rule.event.DocumentEvent)@Deprecated protected void refreshAttachment()
@Deprecated protected void refreshAttachmentList()
@Deprecated public void populateAttachmentForBO()
@Deprecated public void populateDocumentAttachment()
@Deprecated public void populateAttachmentListForBO()
@Deprecated public void populateAttachmentBeforeSave()
@Deprecated public void populateDocumentAttachmentList()
@Deprecated public void populateBoAttachmentListBeforeSave()
@Deprecated public void deleteDocumentAttachment()
@Deprecated public void deleteDocumentAttachmentList()
public void validateBusinessRules(DocumentEvent event)
validateBusinessRules in interface DocumentvalidateBusinessRules in class DocumentBaseevent - - indicates which document event was requestedDocumentBase.validateBusinessRules(org.kuali.rice.krad.rules.rule.event.DocumentEvent)protected void checkForLockingDocument(boolean throwExceptionIfLocked)
public void postProcessSave(DocumentEvent event)
postProcessSave in interface DocumentpostProcessSave in class DocumentBaseevent - - indicates which document event was requestedDocumentBase.postProcessSave(org.kuali.rice.krad.rules.rule.event.DocumentEvent)public Object getDocumentDataObject()
MaintenanceDocumentgetDocumentDataObject in interface MaintenanceDocumentMaintenanceDocument.getDocumentDataObject()public GloballyUnique getNoteTarget()
The Note target for maintenance documents is determined by whether or not the underlying Maintainable
supports business object notes or not. This is determined via a call to Maintainable.isNotesEnabled().
The note target is then derived as follows:
Maintainable supports business object
notes, delegate to getDocumentDataObject(). DocumentHeader. getNoteTarget in interface DocumentgetNoteTarget in class DocumentBaseDocument.getNoteTarget()public NoteType getNoteType()
NoteType for maintenance documents is determined by whether or not the underlying Maintainable supports business object notes or not. This is determined via a call to Maintainable.isNotesEnabled(). The NoteType is then derived as follows: Maintainable supports business object notes, return NoteType.BUSINESS_OBJECT. DocumentBase.getNoteType() getNoteType in interface DocumentgetNoteType in class DocumentBaseDocument.getNoteType(),
Document.getNoteTarget()public PropertySerializabilityEvaluator getDocumentPropertySerizabilityEvaluator()
DocumentBaseBusinessObjectPropertySerializibilityEvaluator initialized with the properties. If none have been
defined, then returns
AlwaysTruePropertySerializibilityEvaluator.getDocumentPropertySerizabilityEvaluator in interface DocumentgetDocumentPropertySerizabilityEvaluator in class DocumentBaseDocument.getDocumentPropertySerizabilityEvaluator()public DocumentAttachment getAttachment()
public void setAttachment(DocumentAttachment attachment)
public List<MultiDocumentAttachment> getAttachments()
public void setAttachments(List<MultiDocumentAttachment> attachments)
public String getAttachmentPropertyName()
public void setAttachmentPropertyName(String attachmentPropertyName)
public String getAttachmentListPropertyName()
public void setAttachmentListPropertyName(String attachmentListPropertyName)
public String getAttachmentCollectionName()
public void setAttachmentCollectionName(String attachmentCollectionName)
public boolean isSessionDocument()
public boolean useCustomLockDescriptors()
useCustomLockDescriptors in interface DocumentuseCustomLockDescriptors in class DocumentBaseDocument.useCustomLockDescriptors(),
Maintainable.useCustomLockDescriptors()public String getCustomLockDescriptor(Person user)
getCustomLockDescriptor in interface DocumentgetCustomLockDescriptor in class DocumentBaseuser - The user trying to establish the lock.Document.getCustomLockDescriptor(org.kuali.rice.kim.api.identity.Person),
Maintainable.getCustomLockDescriptor(org.kuali.rice.kim.api.identity.Person)protected DocumentDictionaryService getDocumentDictionaryService()
protected MaintenanceDocumentService getMaintenanceDocumentService()
protected DocumentService getDocumentService()
protected BusinessObjectSerializerService getBusinessObjectSerializerService()
protected boolean checkAllowsRecordDeletion()
protected boolean checkMaintenanceAction()
protected boolean checkDeletePermission(Object dataObject)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.