public class MaintenanceDocumentRuleBase extends DocumentRuleBase implements MaintenanceDocumentRule
| Modifier and Type | Field and Description | 
|---|---|
| static String | DOCUMENT_ERROR_PREFIX | 
| protected static org.apache.log4j.Logger | LOG | 
| static String | MAINTAINABLE_ERROR_PATH | 
| static String | MAINTAINABLE_ERROR_PREFIX | 
| protected List<String> | priorErrorPath | 
| 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 StringBuilder | consolidateFieldNames(List<String> 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)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 ConfigurationService | getConfigService() | 
| DataObjectAuthorizationService | getDataObjectAuthorizationService() | 
| DataObjectService | getDataObjectService() | 
| DateTimeService | getDateTimeService() | 
| protected DataDictionaryService | getDdService() | 
| protected DictionaryValidationService | getDictionaryValidationService() | 
| protected String | getFieldLabel(Class<?> dataObjectClass,
                          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<?> dataObjectClass)This method creates a human-readable string of the class' primary key field names, as designated by the
 DataDictionary. | 
| protected Object | getNewDataObject()Gets the newDataObject attribute. | 
| protected Object | getOldDataObject()Gets the oldDataObject attribute. | 
| PersonService | getPersonService() | 
| protected RoleService | getRoleService() | 
| WorkflowDocumentService | getWorkflowDocumentService() | 
| 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 | processAddCollectionLine(AddCollectionLineEvent addEvent)Run the rules associated with adding an object to a collection. | 
| boolean | processApproveDocument(ApproveDocumentEvent approveEvent)Runs all business rules needed prior to approving. | 
| protected boolean | processCustomAddCollectionLineBusinessRules(MaintenanceDocument document,
                                                                                      String collectionName,
                                                                                      Object line)This method should be overridden to provide custom rules for processing adding collection lines. | 
| 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 | setConfigService(ConfigurationService configService) | 
| void | setDataObjectAuthorizationService(DataObjectAuthorizationService dataObjectAuthorizationService) | 
| void | setDdService(DataDictionaryService ddService) | 
| void | setDictionaryValidationService(DictionaryValidationService dictionaryValidationService) | 
| protected void | setNewDataObject(Object newDataObject) | 
| 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) | 
| protected void | showErrorMap()This method is used during debugging to dump the contents of the error map, including the key names. | 
| protected boolean | validateBulkUpdateMaintenanceDocument(MaintenanceDocument maintenanceDocument)This method checks whether this maintenance document represents a bulk update maintenance document, and if so,
 whether the data object is in a persistable state. | 
| 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 | 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, processCustomAddCollectionLineBusinessRules, processCustomAddNoteBusinessRules, processCustomApproveDocumentBusinessRules, processCustomCompleteDocumentBusinessRules, processCustomRouteDocumentBusinessRules, processCustomSaveDocumentBusinessRules, processCustomSendAdHocRequests, processSendAdHocRequests, setDocumentDictionaryService, setMaxDictionaryValidationDepth, useKimPermission, validateSensitiveDataValueprotected 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 List<String> priorErrorPath
public MaintenanceDocumentRuleBase()
public boolean processSaveDocument(Document document)
DocumentRuleBaseprocessSaveDocument in interface MaintenanceDocumentRuleprocessSaveDocument in interface SaveDocumentRuleprocessSaveDocument in class DocumentRuleBaseMaintenanceDocumentRule.processSaveDocument(org.kuali.rice.krad.document.Document)public boolean processRouteDocument(Document document)
DocumentRuleBaseprocessRouteDocument in interface MaintenanceDocumentRuleprocessRouteDocument in interface RouteDocumentRuleprocessRouteDocument in class DocumentRuleBaseMaintenanceDocumentRule.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)
DocumentRuleBaseprocessApproveDocument in interface MaintenanceDocumentRuleprocessApproveDocument in interface ApproveDocumentRuleprocessApproveDocument in class DocumentRuleBaseapproveEvent - document approve eventMaintenanceDocumentRule.processApproveDocument(org.kuali.rice.krad.rules.rule.event.ApproveDocumentEvent)public boolean processAddCollectionLine(AddCollectionLineEvent addEvent)
processAddCollectionLine in interface MaintenanceDocumentRuleprocessAddCollectionLine in interface AddCollectionLineRuleprocessAddCollectionLine in class DocumentRuleBaseaddEvent - the event containing all of the object necessary to run the rulesAddCollectionLineRule.processAddCollectionLine(org.kuali.rice.krad.rules.rule.event.AddCollectionLineEvent)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<?> dataObjectClass)
dataObjectClass - 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 processCustomAddCollectionLineBusinessRules(MaintenanceDocument document, String collectionName, Object line)
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 testedValidationExceptionprotected boolean validateBulkUpdateMaintenanceDocument(MaintenanceDocument maintenanceDocument)
maintenanceDocument- - document to be testedprotected 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)
MaintenanceDocumentRulesetupBaseConvenienceObjects in interface MaintenanceDocumentRuledocument - - the maintenanceDocument being evaluatedMaintenanceDocumentRule.setupBaseConvenienceObjects(org.kuali.rice.krad.maintenance.MaintenanceDocument)public void setupConvenienceObjects()
MaintenanceDocumentRulesetupConvenienceObjects in interface MaintenanceDocumentRuleprotected boolean checkForPartiallyFilledOutReferenceForeignKeys(String referenceName)
referenceName - - The name of the reference object, whose foreign-key fields must be all-or-none filled
 out.protected StringBuilder consolidateFieldNames(List<String> 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<?> dataObjectClass, String fieldName)
dataObjectClass - The class to use in combination with the fieldName.fieldName - The fieldName you want a human-readable label for.protected final Object getNewDataObject()
protected void setNewDataObject(Object newDataObject)
protected final Object getOldDataObject()
protected final ConfigurationService getConfigService()
public final void setConfigService(ConfigurationService configService)
protected final DataDictionaryService getDdService()
public final void setDdService(DataDictionaryService ddService)
protected final DictionaryValidationService getDictionaryValidationService()
getDictionaryValidationService in class DocumentRuleBasepublic final void setDictionaryValidationService(DictionaryValidationService dictionaryValidationService)
public PersonService getPersonService()
getPersonService in class DocumentRuleBasepublic void setPersonService(PersonService personService)
public DateTimeService getDateTimeService()
protected RoleService getRoleService()
public WorkflowDocumentService getWorkflowDocumentService()
public void setWorkflowDocumentService(WorkflowDocumentService workflowDocumentService)
public DataObjectAuthorizationService getDataObjectAuthorizationService()
public void setDataObjectAuthorizationService(DataObjectAuthorizationService dataObjectAuthorizationService)
public DataObjectService getDataObjectService()
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.