org.kuali.kfs.coa.document.validation.impl
Class ObjectCodeGlobalRule

java.lang.Object
  extended by org.kuali.rice.kns.rules.DocumentRuleBase
      extended by org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
          extended by org.kuali.kfs.coa.document.validation.impl.ObjectCodeGlobalRule
All Implemented Interfaces:
org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRule, org.kuali.rice.kns.rule.AddAdHocRoutePersonRule, org.kuali.rice.kns.rule.AddAdHocRouteWorkgroupRule, org.kuali.rice.kns.rule.AddCollectionLineRule, org.kuali.rice.kns.rule.AddNoteRule, org.kuali.rice.kns.rule.ApproveDocumentRule, org.kuali.rice.kns.rule.BusinessRule, org.kuali.rice.kns.rule.RouteDocumentRule, org.kuali.rice.kns.rule.SaveDocumentRule, org.kuali.rice.kns.rule.SendAdHocRequestsRule

public class ObjectCodeGlobalRule
extends org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase

This class represents the business rules for the maintenance of ObjectCodeGlobal business objects


Field Summary
protected  ObjectCodeGlobal objectCodeGlobal
           
protected  ObjectCodeService objectCodeService
           
protected  ObjectLevelService objectLevelService
           
 
Fields inherited from class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
boDictionaryService, boService, businessObjectAuthorizationService, configService, ddService, dictionaryValidationService, DOCUMENT_ERROR_PREFIX, documentHelperService, LOG, MAINTAINABLE_ERROR_PATH, MAINTAINABLE_ERROR_PREFIX, maintDocDictionaryService, persistenceService, persistenceStructureService, personService, priorErrorPath, roleService, workflowDocumentService
 
Constructor Summary
ObjectCodeGlobalRule()
           
 
Method Summary
protected  Collection<org.kuali.rice.kns.bo.BusinessObject> addAdditionalBlockingBusinessObjects(Collection<org.kuali.rice.kns.bo.BusinessObject> blockingBusinessObjects, ObjectCode objectCode)
          Retrieves any additional blocking objects not handled by the inactivation framework
protected  boolean checkChartAllLines(ObjectCodeGlobal ocChangeDocument)
          This method calls checkChartOnObjCodeDetails(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object
protected  boolean checkChartOnObjCodeDetails(ObjectCodeGlobal objectCodeGlobal, ObjectCodeGlobalDetail objectCodeGlobalDetail, int lineNum, boolean add)
          This checks to make sure that the chart of accounts for the detail object has been filled in
protected  boolean checkFiscalYear(ObjectCodeGlobal objectCodeGlobal, ObjectCodeGlobalDetail objectCodeGlobalDetail, int lineNum, boolean add)
          This checks to make sure that the fiscal year has been entered
protected  boolean checkFiscalYearAllLines(ObjectCodeGlobal objectCodeGlobal)
          This method calls checkFiscalYear(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object
protected  boolean checkForObjectCodeGlobalDetails(List<ObjectCodeGlobalDetail> objectCodeGlobalDetails)
          This checks to make sure that there is at least one ObjectCodeGlobalDetail in the collection
protected  boolean checkNextYearObjectCode(ObjectCodeGlobal objectCodeGlobal, ObjectCodeGlobalDetail dtl, int lineNum, boolean add)
          This method checks that the next year object code specified in the change document is a valid object code for a given chart and year
protected  boolean checkNextYearObjectCodeAllLines(ObjectCodeGlobal objectCodeGlobalDocument2)
          This method calls checkNextYearObjectCode(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object
 boolean checkObjectCodeDetails(ObjectCodeGlobalDetail dtl)
          This checks the following conditions: checkObjectLevelCode(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) checkNextYearObjectCode(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) checkReportsToObjectCode(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean)
protected  boolean checkObjectLevelCode(ObjectCodeGlobal objectCodeGlobal, ObjectCodeGlobalDetail dtl, int lineNum, boolean add)
          This method checks that the object level code from the object code change document actually exists for the chart object specified in the detail
protected  boolean checkObjectLevelCodeAllLines(ObjectCodeGlobal objectCodeGlobalDocument2)
          This method calls checkObjectLevelCode(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object
protected  boolean checkReportsToObjectCode(ObjectCodeGlobal objectCodeGlobal, ObjectCodeGlobalDetail dtl, int lineNum, boolean add)
          This method checks that the reports to object code input on the top level of the global document is valid for a given chart's reportToChart in the detail section
protected  boolean checkReportsToObjectCodeAllLines(ObjectCodeGlobal objectCodeGlobalDocument2)
          This method calls checkReportsToObjectCode(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object
protected  boolean checkSimpleRulesAllLines()
          This method checks the simple rules for all lines at once and gets called on save, submit, etc.
protected  boolean checkUniqueIdentifiers(ObjectCodeGlobalDetail dtl)
          This method (will)put an error about unique identifier fields must not exist more than once.
protected  boolean isEqualObjectCode(ObjectCode castor, ObjectCode pollux)
          Determines if the two given object codes are roughly equal
protected  boolean isObjectCodeInPersistingChanges(List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistingChanges, ObjectCode objectCode)
          Determines if the given object code is within the list of persisting changes
protected  boolean isOnlyPersistingChangesInBlockingBusinessObjects(Collection<org.kuali.rice.kns.bo.BusinessObject> blockingBusinessObjects, List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistingChanges)
          Determines if all of the given blocking business objects are among the persisting changes
 boolean processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document, String collectionName, org.kuali.rice.kns.bo.PersistableBusinessObject bo)
          This method checks to make sure that each new ObjectCodeGlobalDetail has: valid chart of accounts code valid fiscal year unique identifiers (not currently implemented)
protected  boolean processCustomApproveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
          This performs rules checks on document approve checkSimpleRulesAllLines() This rule fails on business rule failures
protected  boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
          This performs rules checks on document route checkSimpleRulesAllLines() This rule fails on business rule failures
protected  boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
          This performs rules checks on document save checkSimpleRulesAllLines() This rule does not fail on business rule failures
protected  boolean processInactivationBlockChecking(org.kuali.rice.kns.maintenance.Maintainable maintainable, ObjectCode objectCode, int index)
           
protected  boolean processInactivationBlockChecking(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
           
protected  void putInactivationBlockingErrorOnPage(ObjectCode objectCode, org.kuali.rice.kns.datadictionary.InactivationBlockingMetadata inactivationBlockingMetadata, int index)
           
protected  void retrieveBlockingIndirectCostRecoveryExclusionAccounts(ObjectCode objectCode, List<org.kuali.rice.kns.bo.BusinessObject> additionalBlockingObjects)
          Retrieves all Indirect Cost Recovery Exclusion by Account records blocking the given object code and puts them in the List of additional blocking objects
protected  void retrieveBlockingOffsetDefinitions(ObjectCode objectCode, List<org.kuali.rice.kns.bo.BusinessObject> additionalBlockingObjects)
          Retrieves all Offset Definitions blocking the given object code and puts them in the List of additional blocking objects
protected  void setObjectCodeService(ObjectCodeService objectCodeService)
           
protected  void setObjectLevelService(ObjectLevelService objectLevelService)
           
 void setupConvenienceObjects()
          This method sets the convenience objects like objectCodeGlobal, so you have short and easy handles to the new and old objects contained in the maintenance document.
 
Methods inherited from class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
apcRuleFails, applyApcRule, checkEmptyBOField, checkEmptyDocumentField, checkEmptyValue, checkForPartiallyFilledOutReferenceForeignKeys, clearErrorPath, consolidateFieldNames, dataDictionaryValidate, errorAlreadyExists, getBoDictionaryService, getBoService, getBusinessObjectAuthorizationService, getConfigService, getDateTimeService, getDdService, getDictionaryValidationService, getDocumentHelperService, getFieldLabel, getFieldLabel, getHumanReadablePrimaryKeyFieldNames, getMaintDocDictionaryService, getNewBo, getOldBo, getPersistenceService, getPersistenceStructureService, getPersonService, getRoleService, getWorkflowDocumentService, isCorrectMaintenanceClass, isDocumentInactivatingBusinessObject, isDocumentValidForSave, primaryKeyCheck, processAddCollectionLineBusinessRules, processApproveDocument, processGlobalApproveDocumentBusinessRules, processGlobalRouteDocumentBusinessRules, processGlobalSaveDocumentBusinessRules, processInactivationBlockChecking, processRouteDocument, processSaveDocument, putDocumentError, putDocumentError, putFieldError, putFieldError, putFieldError, putFieldErrorWithShortLabel, putGlobalError, putGlobalError, putGlobalError, putGlobalsError, putGlobalsError, putInactivationBlockingErrorOnPage, resumeErrorPath, setBoDictionaryService, setBoService, setBusinessObjectAuthorizationService, setConfigService, setDdService, setDictionaryValidationService, setDocumentHelperService, setMaintDocDictionaryService, setNewBo, setPersistenceService, setPersistenceStructureService, setPersonService, setupBaseConvenienceObjects, setWorkflowDocumentService, showErrorMap, validateDocumentStructure, validateDuplicateIdentifierInDataDictionary, validateGlobalBusinessObjectPersistable, validateMaintenanceDocument
 
Methods inherited from class org.kuali.rice.kns.rules.DocumentRuleBase
getDataDictionaryService, getIdentityManagementService, getKualiConfigurationService, getMaxDictionaryValidationDepth, getWorkflowInfoService, isAddHocRoutePersonValid, isAddHocRouteWorkgroupValid, isAdHocRouteRecipientsValid, isDocumentAttributesValid, isDocumentOverviewValid, isNoteValid, processAddAdHocRoutePerson, processAddAdHocRouteWorkgroup, processAddNote, processCustomAddAdHocRoutePersonBusinessRules, processCustomAddAdHocRouteWorkgroupBusinessRules, processCustomAddNoteBusinessRules, processCustomApproveDocumentBusinessRules, processCustomRouteDocumentBusinessRules, processCustomSaveDocumentBusinessRules, processCustomSendAdHocRequests, processSendAdHocRequests, setMaxDictionaryValidationDepth, validateSensitiveDataValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectCodeGlobal

protected ObjectCodeGlobal objectCodeGlobal

objectCodeService

protected ObjectCodeService objectCodeService

objectLevelService

protected ObjectLevelService objectLevelService
Constructor Detail

ObjectCodeGlobalRule

public ObjectCodeGlobalRule()
Method Detail

setupConvenienceObjects

public void setupConvenienceObjects()
This method sets the convenience objects like objectCodeGlobal, so you have short and easy handles to the new and old objects contained in the maintenance document. It also calls the BusinessObjectBase.refresh(), which will attempt to load all sub-objects from the DB by their primary keys, if available.

Specified by:
setupConvenienceObjects in interface org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRule
Overrides:
setupConvenienceObjects in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
Parameters:
document - - the maintenanceDocument being evaluated

processCustomApproveDocumentBusinessRules

protected boolean processCustomApproveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
This performs rules checks on document approve This rule fails on business rule failures

Overrides:
processCustomApproveDocumentBusinessRules in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.processCustomApproveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)

processCustomRouteDocumentBusinessRules

protected boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
This performs rules checks on document route This rule fails on business rule failures

Overrides:
processCustomRouteDocumentBusinessRules in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)

processInactivationBlockChecking

protected boolean processInactivationBlockChecking(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
Overrides:
processInactivationBlockChecking in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase

processInactivationBlockChecking

protected boolean processInactivationBlockChecking(org.kuali.rice.kns.maintenance.Maintainable maintainable,
                                                   ObjectCode objectCode,
                                                   int index)

putInactivationBlockingErrorOnPage

protected void putInactivationBlockingErrorOnPage(ObjectCode objectCode,
                                                  org.kuali.rice.kns.datadictionary.InactivationBlockingMetadata inactivationBlockingMetadata,
                                                  int index)

isOnlyPersistingChangesInBlockingBusinessObjects

protected boolean isOnlyPersistingChangesInBlockingBusinessObjects(Collection<org.kuali.rice.kns.bo.BusinessObject> blockingBusinessObjects,
                                                                   List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistingChanges)
Determines if all of the given blocking business objects are among the persisting changes

Parameters:
blockingBusinessObjects - the Collection of blocking business objects
persistingChanges - the List of Object Codes which will be persisted by this document
Returns:
true if all the blocking business objects are persisting changes

isObjectCodeInPersistingChanges

protected boolean isObjectCodeInPersistingChanges(List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistingChanges,
                                                  ObjectCode objectCode)
Determines if the given object code is within the list of persisting changes

Parameters:
persistingChanges - the changes to persist
objectCode - the blocking object code to look for in the persisting changes
Returns:
true if the object code was found in the list of persisting changes, false otherwise

isEqualObjectCode

protected boolean isEqualObjectCode(ObjectCode castor,
                                    ObjectCode pollux)
Determines if the two given object codes are roughly equal

Parameters:
castor - an object code
pollux - another, though perhaps very similar, object code
Returns:
true if the two object codes share primary key values, false otherwise

addAdditionalBlockingBusinessObjects

protected Collection<org.kuali.rice.kns.bo.BusinessObject> addAdditionalBlockingBusinessObjects(Collection<org.kuali.rice.kns.bo.BusinessObject> blockingBusinessObjects,
                                                                                                ObjectCode objectCode)
Retrieves any additional blocking objects not handled by the inactivation framework

Parameters:
blockingBusinessObjects - the current list of blocking business objects
objectCode - the object code to find additional blocking objects for
Returns:
the perhaps fuller Collection of blocking business objects

retrieveBlockingOffsetDefinitions

protected void retrieveBlockingOffsetDefinitions(ObjectCode objectCode,
                                                 List<org.kuali.rice.kns.bo.BusinessObject> additionalBlockingObjects)
Retrieves all Offset Definitions blocking the given object code and puts them in the List of additional blocking objects

Parameters:
objectCode - the object code to find additional blocking objects for
additionalBlockingObjects - the List of additional blocking objects to populate

retrieveBlockingIndirectCostRecoveryExclusionAccounts

protected void retrieveBlockingIndirectCostRecoveryExclusionAccounts(ObjectCode objectCode,
                                                                     List<org.kuali.rice.kns.bo.BusinessObject> additionalBlockingObjects)
Retrieves all Indirect Cost Recovery Exclusion by Account records blocking the given object code and puts them in the List of additional blocking objects

Parameters:
objectCode - the object code to find additional blocking objects for
additionalBlockingObjects - the List of additional blocking objects to populate

processCustomSaveDocumentBusinessRules

protected boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
This performs rules checks on document save This rule does not fail on business rule failures

Overrides:
processCustomSaveDocumentBusinessRules in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument)

processCustomAddCollectionLineBusinessRules

public boolean processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document,
                                                           String collectionName,
                                                           org.kuali.rice.kns.bo.PersistableBusinessObject bo)
This method checks to make sure that each new ObjectCodeGlobalDetail has:

Overrides:
processCustomAddCollectionLineBusinessRules in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument, java.lang.String, org.kuali.rice.kns.bo.PersistableBusinessObject)

checkUniqueIdentifiers

protected boolean checkUniqueIdentifiers(ObjectCodeGlobalDetail dtl)
This method (will)put an error about unique identifier fields must not exist more than once.

Parameters:
dtl -
Returns:
true (not currently implemented fully)

checkObjectCodeDetails

public boolean checkObjectCodeDetails(ObjectCodeGlobalDetail dtl)
This checks the following conditions:

Parameters:
dtl -
Returns:
true if sub-rules succeed

checkReportsToObjectCode

protected boolean checkReportsToObjectCode(ObjectCodeGlobal objectCodeGlobal,
                                           ObjectCodeGlobalDetail dtl,
                                           int lineNum,
                                           boolean add)
This method checks that the reports to object code input on the top level of the global document is valid for a given chart's reportToChart in the detail section

Parameters:
dtl -
Returns:
true if the reports to object is valid for the given reports to chart

checkNextYearObjectCode

protected boolean checkNextYearObjectCode(ObjectCodeGlobal objectCodeGlobal,
                                          ObjectCodeGlobalDetail dtl,
                                          int lineNum,
                                          boolean add)
This method checks that the next year object code specified in the change document is a valid object code for a given chart and year

Parameters:
dtl -
Returns:
false if this object code doesn't exist in the next fiscal year

checkObjectLevelCode

protected boolean checkObjectLevelCode(ObjectCodeGlobal objectCodeGlobal,
                                       ObjectCodeGlobalDetail dtl,
                                       int lineNum,
                                       boolean add)
This method checks that the object level code from the object code change document actually exists for the chart object specified in the detail

Parameters:
dtl -
Returns:
false if object level doesn't exist for the chart, and level code filled in

checkSimpleRulesAllLines

protected boolean checkSimpleRulesAllLines()
This method checks the simple rules for all lines at once and gets called on save, submit, etc. but not on add

Returns:

checkForObjectCodeGlobalDetails

protected boolean checkForObjectCodeGlobalDetails(List<ObjectCodeGlobalDetail> objectCodeGlobalDetails)
This checks to make sure that there is at least one ObjectCodeGlobalDetail in the collection

Parameters:
objectCodeGlobalDetails -
Returns:
false if the collection is empty or null

checkFiscalYearAllLines

protected boolean checkFiscalYearAllLines(ObjectCodeGlobal objectCodeGlobal)
This method calls checkFiscalYear(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object

Parameters:
objectCodeGlobal -
Returns:
true if all lines pass

checkChartAllLines

protected boolean checkChartAllLines(ObjectCodeGlobal ocChangeDocument)
This method calls checkChartOnObjCodeDetails(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object

Parameters:
ocChangeDocument -
Returns:
true if all lines pass

checkReportsToObjectCodeAllLines

protected boolean checkReportsToObjectCodeAllLines(ObjectCodeGlobal objectCodeGlobalDocument2)
This method calls checkReportsToObjectCode(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object

Parameters:
objectCodeGlobalDocument2 -
Returns:
true if all lines pass

checkNextYearObjectCodeAllLines

protected boolean checkNextYearObjectCodeAllLines(ObjectCodeGlobal objectCodeGlobalDocument2)
This method calls checkNextYearObjectCode(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object

Parameters:
objectCodeGlobalDocument2 -
Returns:
true if all lines pass

checkObjectLevelCodeAllLines

protected boolean checkObjectLevelCodeAllLines(ObjectCodeGlobal objectCodeGlobalDocument2)
This method calls checkObjectLevelCode(ObjectCodeGlobal, ObjectCodeGlobalDetail, int, boolean) on each detail object

Parameters:
objectCodeGlobalDocument2 -
Returns:
true if all lines pass

checkFiscalYear

protected boolean checkFiscalYear(ObjectCodeGlobal objectCodeGlobal,
                                  ObjectCodeGlobalDetail objectCodeGlobalDetail,
                                  int lineNum,
                                  boolean add)
This checks to make sure that the fiscal year has been entered

Parameters:
objectCodeGlobal -
objectCodeGlobalDetail -
lineNum -
add -
Returns:
false if no fiscal year value

checkChartOnObjCodeDetails

protected boolean checkChartOnObjCodeDetails(ObjectCodeGlobal objectCodeGlobal,
                                             ObjectCodeGlobalDetail objectCodeGlobalDetail,
                                             int lineNum,
                                             boolean add)
This checks to make sure that the chart of accounts for the detail object has been filled in

Parameters:
objectCodeGlobal -
objectCodeGlobalDetail -
lineNum -
add -
Returns:
false if chart of accounts code null

setObjectCodeService

protected void setObjectCodeService(ObjectCodeService objectCodeService)

setObjectLevelService

protected void setObjectLevelService(ObjectLevelService objectLevelService)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.