public class MaintenanceDocumentRuleBase extends DocumentRuleBase implements MaintenanceDocumentRule, AddCollectionLineRule
Constructor and Description |
---|
MaintenanceDocumentRuleBase()
Default constructor a MaintenanceDocumentRuleBase.java.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkEmptyBOField(String propertyName,
Object valueToTest,
String parameter)
This method accepts an object, and attempts to determine whether it is empty by this method's definition.
|
protected boolean |
checkEmptyDocumentField(String propertyName,
Object valueToTest,
String parameter)
This method accepts document field (such as , and attempts to determine whether it is empty by this method's
definition.
|
protected boolean |
checkEmptyValue(Object valueToTest)
This method accepts document field (such as , and attempts to determine whether it is empty by this method's
definition.
|
protected boolean |
checkForPartiallyFilledOutReferenceForeignKeys(String referenceName)
This method checks to make sure that if the foreign-key fields for the given reference attributes have any fields
filled out,
that all fields are filled out.
|
protected void |
clearErrorPath()
This method is used to deal with error paths that are not what we expect them to be.
|
protected StringBuffer |
consolidateFieldNames(List fieldNames,
String delimiter)
This method turns a list of field property names, into a delimited string of the human-readable names.
|
protected boolean |
dataDictionaryValidate(MaintenanceDocument document)
This method executes the DataDictionary Validation against the document.
|
protected boolean |
errorAlreadyExists(String propertyName,
String errorConstant)
Convenience method to determine whether the field already has the message indicated.
|
protected BusinessObjectService |
getBoService()
Gets the boService attribute.
|
protected ConfigurationService |
getConfigService()
Gets the configService attribute.
|
protected DataObjectMetaDataService |
getDataObjectMetaDataService() |
DateTimeService |
getDateTimeService() |
protected DataDictionaryService |
getDdService()
Gets the ddService attribute.
|
protected DictionaryValidationService |
getDictionaryValidationService()
Gets the dictionaryValidationService attribute.
|
DocumentHelperService |
getDocumentHelperService() |
protected String |
getFieldLabel(Class boClass,
String fieldName)
This method translates the passed in field name into a human-readable attribute label.
|
protected String |
getFieldLabel(String fieldName)
This method translates the passed in field name into a human-readable attribute label.
|
protected String |
getHumanReadablePrimaryKeyFieldNames(Class<?> boClass)
This method creates a human-readable string of the class' primary key field names, as designated by the
DataDictionary.
|
protected MaintenanceDocumentDictionaryService |
getMaintDocDictionaryService()
Gets the maintDocDictionaryService attribute.
|
protected Object |
getNewBo()
Gets the newBo attribute.
|
protected Object |
getOldBo()
Gets the oldBo attribute.
|
protected PersistenceStructureService |
getPersistenceStructureService()
Gets the persistenceStructureService attribute.
|
PersonService |
getPersonService() |
protected RoleService |
getRoleService() |
WorkflowDocumentService |
getWorkflowDocumentService()
Gets the workflowDocumentService attribute.
|
protected boolean |
isCorrectMaintenanceClass(MaintenanceDocument document,
Class clazz)
This method tests to make sure the MaintenanceDocument passed in is based on the class you are expecting.
|
protected boolean |
isDocumentInactivatingBusinessObject(MaintenanceDocument maintenanceDocument)
Determines whether a document is inactivating the record being maintained
|
protected boolean |
isDocumentValidForSave(MaintenanceDocument maintenanceDocument)
This method checks to see if the document is in a state that it can be saved without causing exceptions.
|
protected boolean |
primaryKeyCheck(MaintenanceDocument document)
This method checks the two major cases that may violate primary key integrity.
|
boolean |
processAddCollectionLineBusinessRules(MaintenanceDocument document,
String collectionName,
PersistableBusinessObject bo)
This method allows business rules to be called whenever a new object is added to a maintainable collection in
the UI layer.
|
boolean |
processApproveDocument(ApproveDocumentEvent approveEvent)
Runs all business rules needed prior to approving.
|
boolean |
processCustomAddCollectionLineBusinessRules(MaintenanceDocument document,
String collectionName,
PersistableBusinessObject line) |
protected boolean |
processCustomApproveDocumentBusinessRules(MaintenanceDocument document)
This method should be overridden to provide custom rules for processing document approval.
|
protected boolean |
processCustomRouteDocumentBusinessRules(MaintenanceDocument document)
This method should be overridden to provide custom rules for processing document routing
|
protected boolean |
processCustomSaveDocumentBusinessRules(MaintenanceDocument document)
This method should be overridden to provide custom rules for processing document saving
|
protected boolean |
processGlobalApproveDocumentBusinessRules(MaintenanceDocument document)
This method enforces all business rules that are common to all maintenance documents which must be tested before
doing an
approval.
|
protected boolean |
processGlobalRouteDocumentBusinessRules(MaintenanceDocument document)
This method enforces all business rules that are common to all maintenance documents which must be tested before
doing a
route.
|
protected boolean |
processGlobalSaveDocumentBusinessRules(MaintenanceDocument document)
This method enforces all business rules that are common to all maintenance documents which must be tested before
doing a
save.
|
protected boolean |
processInactivationBlockChecking(MaintenanceDocument maintenanceDocument)
Determines whether this document has been inactivation blocked
|
protected boolean |
processInactivationBlockChecking(MaintenanceDocument maintenanceDocument,
InactivationBlockingMetadata inactivationBlockingMetadata)
Given a InactivationBlockingMetadata, which represents a relationship that may block inactivation of a BO, it
determines whether there
is a record that violates the blocking definition
|
boolean |
processRouteDocument(Document document)
Runs all business rules needed prior to routing.
|
boolean |
processSaveDocument(Document document)
Runs all business rules needed prior to saving.
|
protected void |
putDocumentError(String propertyName,
String errorConstant,
String parameter)
This method is a convenience method to add a property-specific document error to the global errors list.
|
protected void |
putDocumentError(String propertyName,
String errorConstant,
String[] parameters)
This method is a convenience method to add a property-specific document error to the global errors list.
|
protected void |
putFieldError(String propertyName,
String errorConstant)
This method is a convenience method to add a property-specific error to the global errors list.
|
protected void |
putFieldError(String propertyName,
String errorConstant,
String parameter)
This method is a convenience method to add a property-specific error to the global errors list.
|
protected void |
putFieldError(String propertyName,
String errorConstant,
String[] parameters)
This method is a convenience method to add a property-specific error to the global errors list.
|
protected void |
putFieldErrorWithShortLabel(String propertyName,
String errorConstant)
Adds a property-specific error to the global errors list, with the DD short label as the single argument.
|
protected void |
putGlobalError(String errorConstant)
This method is a convenience method to easily add a Document level error (ie, one not tied to a specific field,
but
applicable to the whole document).
|
protected void |
putGlobalError(String errorConstant,
String parameter)
This method is a convenience method to easily add a Document level error (ie, one not tied to a specific field,
but
applicable to the whole document).
|
protected void |
putGlobalError(String errorConstant,
String[] parameters)
This method is a convenience method to easily add a Document level error (ie, one not tied to a specific field,
but
applicable to the whole document).
|
protected void |
putGlobalsError(String propertyName,
String errorConstant)
This method specifically doesn't put any prefixes before the error so that the developer can do things specific
to the
globals errors (like newDelegateChangeDocument errors)
|
protected void |
putGlobalsError(String propertyName,
String errorConstant,
String parameter)
This method specifically doesn't put any prefixes before the error so that the developer can do things specific
to the
globals errors (like newDelegateChangeDocument errors)
|
protected void |
putInactivationBlockingErrorOnPage(MaintenanceDocument document,
InactivationBlockingMetadata inactivationBlockingMetadata)
If there is a violation of an InactivationBlockingMetadata, it prints out an appropriate error into the error
map
|
protected void |
resumeErrorPath()
This method is used to deal with error paths that are not what we expect them to be.
|
void |
setBoDictionaryService(BusinessObjectDictionaryService boDictionaryService) |
void |
setBoService(BusinessObjectService boService)
Sets the boService attribute value.
|
void |
setBusinessObjectAuthorizationService(BusinessObjectAuthorizationService businessObjectAuthorizationService) |
void |
setBusinessObjectMetaDataService(BusinessObjectMetaDataService businessObjectMetaDataService) |
void |
setConfigService(ConfigurationService configService)
Sets the configService attribute value.
|
void |
setDataObjectMetaDataService(DataObjectMetaDataService dataObjectMetaDataService) |
void |
setDdService(DataDictionaryService ddService)
Sets the ddService attribute value.
|
void |
setDictionaryValidationService(DictionaryValidationService dictionaryValidationService)
Sets the dictionaryValidationService attribute value.
|
void |
setDocumentHelperService(DocumentHelperService documentHelperService) |
void |
setMaintDocDictionaryService(MaintenanceDocumentDictionaryService maintDocDictionaryService)
Sets the maintDocDictionaryService attribute value.
|
protected void |
setNewBo(Object newBo) |
void |
setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
Sets the persistenceStructureService attribute value.
|
void |
setPersonService(PersonService personService) |
void |
setupBaseConvenienceObjects(MaintenanceDocument document)
Sets the convenience objects like newAccount and oldAccount, so you have short and easy handles to the new and
old objects contained in the maintenance document.
|
void |
setupConvenienceObjects()
Should always be overriden if a subclass is created.
|
void |
setWorkflowDocumentService(WorkflowDocumentService workflowDocumentService)
Sets the workflowDocumentService attribute value.
|
protected void |
showErrorMap()
This method is used during debugging to dump the contents of the error map, including the key names.
|
protected boolean |
validateDocumentStructure(Document document)
This method makes sure the document itself is valid, and has the necessary fields populated to be routable.
|
protected boolean |
validateDuplicateIdentifierInDataDictionary(MaintenanceDocument document,
String collectionName,
PersistableBusinessObject bo)
This method validates that there should only exist one entry in the collection whose
fields match the fields specified within the duplicateIdentificationFields in the
maintenance document data dictionary.
|
protected boolean |
validateGlobalBusinessObjectPersistable(MaintenanceDocument document)
This method checks whether this maint doc contains Global Business Objects, and if so, whether the GBOs are in a
persistable
state.
|
protected boolean |
validateMaintenanceDocument(MaintenanceDocument maintenanceDocument)
This method checks to make sure the document is a valid maintenanceDocument, and has the necessary values
populated such that
it will not cause exceptions in later routing or business rules testing.
|
buildDocumentTypeActionRequestPermissionDetails, buildDocumentTypePermissionDetails, getDataDictionaryService, getDocumentDictionaryService, getGroupService, getKualiConfigurationService, getMaxDictionaryValidationDepth, getPermissionService, hasAdHocRouteCompletion, isAddHocRoutePersonValid, isAddHocRouteWorkgroupValid, isAdHocRouteCompletionToInitiator, isAdHocRouteRecipientsValid, isDocumentAttributesValid, isDocumentOverviewValid, isNoteValid, processAddAdHocRoutePerson, processAddAdHocRouteWorkgroup, processAddNote, processCompleteDocument, processCustomAddAdHocRoutePersonBusinessRules, processCustomAddAdHocRouteWorkgroupBusinessRules, processCustomAddNoteBusinessRules, processCustomApproveDocumentBusinessRules, processCustomCompleteDocumentBusinessRules, processCustomRouteDocumentBusinessRules, processCustomSaveDocumentBusinessRules, processCustomSendAdHocRequests, processSendAdHocRequests, setDocumentDictionaryService, setMaxDictionaryValidationDepth, useKimPermission, validateSensitiveDataValue
protected static org.apache.log4j.Logger LOG
public static final String MAINTAINABLE_ERROR_PREFIX
public static final String DOCUMENT_ERROR_PREFIX
public static final String MAINTAINABLE_ERROR_PATH
protected PersistenceStructureService persistenceStructureService
protected DataDictionaryService ddService
protected DocumentHelperService documentHelperService
protected BusinessObjectService boService
protected DictionaryValidationService dictionaryValidationService
protected ConfigurationService configService
protected MaintenanceDocumentDictionaryService maintDocDictionaryService
protected WorkflowDocumentService workflowDocumentService
protected PersonService personService
protected RoleService roleService
protected DataObjectMetaDataService dataObjectMetaDataService
protected BusinessObjectAuthorizationService businessObjectAuthorizationService
protected BusinessObjectMetaDataService businessObjectMetaDataService
protected BusinessObjectDictionaryService boDictionaryService
protected List priorErrorPath
public MaintenanceDocumentRuleBase()
public boolean processSaveDocument(Document document)
DocumentRuleBase
processSaveDocument
in interface MaintenanceDocumentRule
processSaveDocument
in interface SaveDocumentRule
processSaveDocument
in class DocumentRuleBase
MaintenanceDocumentRule.processSaveDocument(org.kuali.rice.krad.document.Document)
public boolean processRouteDocument(Document document)
DocumentRuleBase
processRouteDocument
in interface MaintenanceDocumentRule
processRouteDocument
in interface RouteDocumentRule
processRouteDocument
in class DocumentRuleBase
MaintenanceDocumentRule.processRouteDocument(org.kuali.rice.krad.document.Document)
protected boolean isDocumentInactivatingBusinessObject(MaintenanceDocument maintenanceDocument)
maintenanceDocument
- protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument)
maintenanceDocument
- protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument, InactivationBlockingMetadata inactivationBlockingMetadata)
maintenanceDocument
- inactivationBlockingMetadata
- protected void putInactivationBlockingErrorOnPage(MaintenanceDocument document, InactivationBlockingMetadata inactivationBlockingMetadata)
document
- inactivationBlockingMetadata
- public boolean processApproveDocument(ApproveDocumentEvent approveEvent)
DocumentRuleBase
processApproveDocument
in interface MaintenanceDocumentRule
processApproveDocument
in interface ApproveDocumentRule
processApproveDocument
in class DocumentRuleBase
MaintenanceDocumentRule.processApproveDocument(org.kuali.rice.krad.rules.rule.event.ApproveDocumentEvent)
protected void putGlobalError(String errorConstant)
errorConstant
- - Error Constant that can be mapped to a resource for the actual text message.protected void putGlobalError(String errorConstant, String parameter)
errorConstant
- - Error Constant that can be mapped to a resource for the actual text message.parameter
- - Replacement value for part of the error message.protected void putGlobalError(String errorConstant, String[] parameters)
errorConstant
- - Error Constant that can be mapped to a resource for the actual text message.parameters
- - Array of replacement values for part of the error message.protected void putFieldError(String propertyName, String errorConstant)
propertyName
- - Property name of the element that is associated with the error. Used to mark the field as
errored in
the UI.errorConstant
- - Error Constant that can be mapped to a resource for the actual text message.protected void putFieldError(String propertyName, String errorConstant, String parameter)
propertyName
- - Property name of the element that is associated with the error. Used to mark the field as
errored in
the UI.errorConstant
- - Error Constant that can be mapped to a resource for the actual text message.parameter
- - Single parameter value that can be used in the message so that you can display specific values
to the
user.protected void putFieldError(String propertyName, String errorConstant, String[] parameters)
propertyName
- - Property name of the element that is associated with the error. Used to mark the field as
errored in
the UI.errorConstant
- - Error Constant that can be mapped to a resource for the actual text message.parameters
- - Array of strings holding values that can be used in the message so that you can display
specific values
to the user.protected void putFieldErrorWithShortLabel(String propertyName, String errorConstant)
propertyName
- - Property name of the element that is associated with the error. Used to mark the field as
errored in
the UI.errorConstant
- - Error Constant that can be mapped to a resource for the actual text message.protected void putDocumentError(String propertyName, String errorConstant, String parameter)
propertyName
- - Property name of the element that is associated with the error. Used to mark the field as
errored in
the UI.errorConstant
- - Error Constant that can be mapped to a resource for the actual text message.parameter
- - Single parameter value that can be used in the message so that you can display specific values
to the
user.protected void putDocumentError(String propertyName, String errorConstant, String[] parameters)
propertyName
- - Property name of the element that is associated with the error. Used to mark the field as
errored in
the UI.errorConstant
- - Error Constant that can be mapped to a resource for the actual text message.parameters
- - Array of String parameters that can be used in the message so that you can display specific
values to the
user.protected boolean errorAlreadyExists(String propertyName, String errorConstant)
propertyName
- - propertyName you want to test onerrorConstant
- - errorConstant you want to testprotected void putGlobalsError(String propertyName, String errorConstant)
propertyName
- errorConstant
- protected void putGlobalsError(String propertyName, String errorConstant, String parameter)
propertyName
- errorConstant
- parameter
- protected void clearErrorPath()
protected void resumeErrorPath()
protected boolean dataDictionaryValidate(MaintenanceDocument document)
document
- protected boolean primaryKeyCheck(MaintenanceDocument document)
document
- - The Maintenance Document being tested.protected String getHumanReadablePrimaryKeyFieldNames(Class<?> boClass)
boClass
- protected boolean processGlobalApproveDocumentBusinessRules(MaintenanceDocument document)
document
- - a populated MaintenanceDocument instanceprotected boolean processGlobalRouteDocumentBusinessRules(MaintenanceDocument document)
document
- - a populated MaintenanceDocument instanceprotected boolean processGlobalSaveDocumentBusinessRules(MaintenanceDocument document)
document
- - a populated MaintenanceDocument instanceprotected boolean processCustomSaveDocumentBusinessRules(MaintenanceDocument document)
document
- protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document)
document
- protected boolean processCustomApproveDocumentBusinessRules(MaintenanceDocument document)
document
- protected boolean isDocumentValidForSave(MaintenanceDocument maintenanceDocument)
maintenanceDocument
- - a populated MaintenaceDocument instance.protected boolean validateDocumentStructure(Document document)
document
- - document to be testedprotected boolean validateMaintenanceDocument(MaintenanceDocument maintenanceDocument)
maintenanceDocument
- - document to be testedValidationException
protected boolean validateGlobalBusinessObjectPersistable(MaintenanceDocument document)
document
- protected boolean isCorrectMaintenanceClass(MaintenanceDocument document, Class clazz)
document
- - MaintenanceDocument instance you want to testclazz
- - class you are expecting the MaintenanceDocument to be based onprotected boolean checkEmptyBOField(String propertyName, Object valueToTest, String parameter)
valueToTest
- - any object to test, usually a StringpropertyName
- - the name of the property being testedprotected boolean checkEmptyDocumentField(String propertyName, Object valueToTest, String parameter)
valueToTest
- - any object to test, usually a StringpropertyName
- - the name of the property being testedprotected boolean checkEmptyValue(Object valueToTest)
valueToTest
- - any object to test, usually a Stringprotected void showErrorMap()
public void setupBaseConvenienceObjects(MaintenanceDocument document)
MaintenanceDocumentRule
setupBaseConvenienceObjects
in interface MaintenanceDocumentRule
document
- - the maintenanceDocument being evaluatedMaintenanceDocumentRule.setupBaseConvenienceObjects(org.kuali.rice.krad.maintenance.MaintenanceDocument)
public void setupConvenienceObjects()
MaintenanceDocumentRule
setupConvenienceObjects
in interface MaintenanceDocumentRule
protected boolean checkForPartiallyFilledOutReferenceForeignKeys(String referenceName)
referenceName
- - The name of the reference object, whose foreign-key fields must be all-or-none filled
out.protected StringBuffer consolidateFieldNames(List fieldNames, String delimiter)
fieldNames
- - List of fieldNamesprotected String getFieldLabel(String fieldName)
fieldName
- The fieldName you want a human-readable label for.protected String getFieldLabel(Class boClass, String fieldName)
boClass
- The class to use in combination with the fieldName.fieldName
- The fieldName you want a human-readable label for.protected final BusinessObjectService getBoService()
public final void setBoService(BusinessObjectService boService)
boService
- The boService to set.protected final ConfigurationService getConfigService()
public final void setConfigService(ConfigurationService configService)
configService
- The configService to set.protected final DataDictionaryService getDdService()
public final void setDdService(DataDictionaryService ddService)
ddService
- The ddService to set.protected final DictionaryValidationService getDictionaryValidationService()
getDictionaryValidationService
in class DocumentRuleBase
public final void setDictionaryValidationService(DictionaryValidationService dictionaryValidationService)
dictionaryValidationService
- The dictionaryValidationService to set.protected final MaintenanceDocumentDictionaryService getMaintDocDictionaryService()
public final void setMaintDocDictionaryService(MaintenanceDocumentDictionaryService maintDocDictionaryService)
maintDocDictionaryService
- The maintDocDictionaryService to set.protected final PersistenceStructureService getPersistenceStructureService()
public final void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
persistenceStructureService
- The persistenceStructureService to set.public WorkflowDocumentService getWorkflowDocumentService()
public void setWorkflowDocumentService(WorkflowDocumentService workflowDocumentService)
workflowDocumentService
- The workflowDocumentService to set.public boolean processAddCollectionLineBusinessRules(MaintenanceDocument document, String collectionName, PersistableBusinessObject bo)
AddCollectionLineRule
processAddCollectionLineBusinessRules
in interface AddCollectionLineRule
protected boolean validateDuplicateIdentifierInDataDictionary(MaintenanceDocument document, String collectionName, PersistableBusinessObject bo)
document
- collectionName
- bo
- public boolean processCustomAddCollectionLineBusinessRules(MaintenanceDocument document, String collectionName, PersistableBusinessObject line)
public PersonService getPersonService()
getPersonService
in class DocumentRuleBase
public void setPersonService(PersonService personService)
public DateTimeService getDateTimeService()
public DocumentHelperService getDocumentHelperService()
public void setDocumentHelperService(DocumentHelperService documentHelperService)
documentHelperService
- the documentHelperService to setprotected RoleService getRoleService()
protected DataObjectMetaDataService getDataObjectMetaDataService()
public void setDataObjectMetaDataService(DataObjectMetaDataService dataObjectMetaDataService)
public void setBusinessObjectAuthorizationService(BusinessObjectAuthorizationService businessObjectAuthorizationService)
public void setBusinessObjectMetaDataService(BusinessObjectMetaDataService businessObjectMetaDataService)
public void setBoDictionaryService(BusinessObjectDictionaryService boDictionaryService)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.