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

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.sys.document.validation.impl.KfsMaintenanceDocumentRuleBase
              extended by org.kuali.kfs.coa.document.validation.impl.GlobalDocumentRuleBase
                  extended by org.kuali.kfs.coa.document.validation.impl.SubObjCdGlobalRule
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 SubObjCdGlobalRule
extends GlobalDocumentRuleBase

This class implements the business rules specific to the SubObjCdGlobal Maintenance Document.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.kuali.kfs.coa.document.validation.impl.GlobalDocumentRuleBase
GlobalDocumentRuleBase.CheckOnlyOneChartResult
 
Field Summary
protected  SubObjectCodeGlobal subObjCdGlobal
           
 
Fields inherited from class org.kuali.kfs.sys.document.validation.impl.KfsMaintenanceDocumentRuleBase
financialSystemUserService, personService
 
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, priorErrorPath, roleService, workflowDocumentService
 
Constructor Summary
SubObjCdGlobalRule()
           
 
Method Summary
 boolean checkAccountDetails(AccountGlobalDetail dtl)
          This checks that if the account and chart are entered that the account associated with the AccountGlobalDetail is valid
 boolean checkAccountDetails(List<AccountGlobalDetail> details)
          This calls the checkAccountDetails(AccountGlobalDetail) on each AccountGlobalDetail as well as calling GlobalDocumentRuleBase.checkOnlyOneChartErrorWrapper(List) to ensure there is just one chart
protected  boolean checkChartAllLines(SubObjectCodeGlobal socChangeDocument)
          This checks that the chart is the same on the document, SubObjCdGlobalDetails and AccountGlobalDetails
protected  boolean checkChartOnAccountDetails(SubObjectCodeGlobal socChangeDocument, AccountGlobalDetail acctDetail, int lineNum, boolean add)
          This checks that the chart of accounts on the AccountGlobalDetail is not empty and matches the document's chart matches the detail's chart
protected  boolean checkChartOnSubObjCodeDetails(SubObjectCodeGlobal socChangeDocument, SubObjectCodeGlobalDetail socChangeDetail, int lineNum, boolean add)
          This checks to make sure that the chart of accounts on the SubObjCdGlobalDetail is not empty and the document's chart matches the detail's chart
protected  boolean checkFiscalYear(SubObjectCodeGlobal socChangeDocument, SubObjectCodeGlobalDetail socChangeDetail, int lineNum, boolean add)
          This checks to make sure that the fiscal year on the SubObjCdGlobalDetail is not empty and the document's fiscal year matches the detail's fiscal year
protected  boolean checkFiscalYearAllLines(SubObjectCodeGlobal socChangeDocument)
          This checks that the fiscal year is the same on the doc and all SubObjCdGlobalDetails
protected  boolean checkForAccountGlobalDetails(List<AccountGlobalDetail> acctChangeDetails)
          This checks that the AccountGlobalDetail list isn't empty or null
protected  boolean checkForSubObjCdGlobalDetails(List<SubObjectCodeGlobalDetail> subObjCdGlobalDetails)
          This checks that the SubObjCdGlobalDetail list isn't empty or null
protected  boolean checkSimpleRulesAllLines()
          This method checks the simple rules for all lines at once and gets called on save, submit, etc.
 boolean checkSubObjectCodeDetails(SubObjectCodeGlobalDetail dtl)
          This checks that if the object code, chart code, and fiscal year are entered it is a valid Object Code, chart, and Fiscal Year associated with this SubObjectCode
 boolean processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document, String collectionName, org.kuali.rice.kns.bo.PersistableBusinessObject bo)
          Before adding either a AccountGlobalDetail or SubObjCdGlobalDetail this checks to make sure that the account and chart are filled in, in the case of SubObjCdGlobalDetail it also checks that the object code and fiscal year are filled in If any of these fail, it fails to add the new line to the collection
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
 void setupConvenienceObjects()
          This method sets the convenience objects like subObjCdGlobal and all the detail objects, so you have short and easy handles to the new and old objects contained in the maintenance document.
 
Methods inherited from class org.kuali.kfs.coa.document.validation.impl.GlobalDocumentRuleBase
checkOnlyOneChart, checkOnlyOneChartAddLine, checkOnlyOneChartAddLineErrorWrapper, checkOnlyOneChartErrorWrapper
 
Methods inherited from class org.kuali.kfs.sys.document.validation.impl.KfsMaintenanceDocumentRuleBase
getFinancialSystemUserService, getKfsUserService
 
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, 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

subObjCdGlobal

protected SubObjectCodeGlobal subObjCdGlobal
Constructor Detail

SubObjCdGlobalRule

public SubObjCdGlobalRule()
Method Detail

setupConvenienceObjects

public void setupConvenienceObjects()
This method sets the convenience objects like subObjCdGlobal and all the detail objects, 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. This also loops through each detail item (SubObjCdGlobalDetail and AccountGlobalDetail) are refreshed

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)

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)
Before adding either a AccountGlobalDetail or SubObjCdGlobalDetail this checks to make sure that the account and chart are filled in, in the case of SubObjCdGlobalDetail it also checks that the object code and fiscal year are filled in If any of these fail, it fails to add the new line to the collection

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)

checkAccountDetails

public boolean checkAccountDetails(List<AccountGlobalDetail> details)
This calls the checkAccountDetails(AccountGlobalDetail) on each AccountGlobalDetail as well as calling GlobalDocumentRuleBase.checkOnlyOneChartErrorWrapper(List) to ensure there is just one chart

Parameters:
details -
Returns:
false if any of the detail objects fail they're sub-rule

checkAccountDetails

public boolean checkAccountDetails(AccountGlobalDetail dtl)
This checks that if the account and chart are entered that the account associated with the AccountGlobalDetail is valid

Parameters:
dtl - - the AccountGlobalDetail we are dealing with
Returns:
false if any of the fields are found to be invalid

checkSubObjectCodeDetails

public boolean checkSubObjectCodeDetails(SubObjectCodeGlobalDetail dtl)
This checks that if the object code, chart code, and fiscal year are entered it is a valid Object Code, chart, and Fiscal Year associated with this SubObjectCode

Parameters:
dtl - - the SubObjCdGlobalDetail we are checking
Returns:
false if any of the fields are found to be invalid

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:

checkForSubObjCdGlobalDetails

protected boolean checkForSubObjCdGlobalDetails(List<SubObjectCodeGlobalDetail> subObjCdGlobalDetails)
This checks that the SubObjCdGlobalDetail list isn't empty or null

Parameters:
subObjCdGlobalDetails -
Returns:
false if the list is null or empty

checkForAccountGlobalDetails

protected boolean checkForAccountGlobalDetails(List<AccountGlobalDetail> acctChangeDetails)
This checks that the AccountGlobalDetail list isn't empty or null

Parameters:
acctChangeDetails -
Returns:
false if the list is null or empty

checkFiscalYearAllLines

protected boolean checkFiscalYearAllLines(SubObjectCodeGlobal socChangeDocument)
This checks that the fiscal year is the same on the doc and all SubObjCdGlobalDetails

Parameters:
socChangeDocument -
Returns:
false if the fiscal year is not the same on the doc and any of the SubObjCdGlobalDetails

checkChartAllLines

protected boolean checkChartAllLines(SubObjectCodeGlobal socChangeDocument)
This checks that the chart is the same on the document, SubObjCdGlobalDetails and AccountGlobalDetails

Parameters:
socChangeDocument -
Returns:
false if the chart is missing or not the same on the doc, or the detail lists

checkFiscalYear

protected boolean checkFiscalYear(SubObjectCodeGlobal socChangeDocument,
                                  SubObjectCodeGlobalDetail socChangeDetail,
                                  int lineNum,
                                  boolean add)
This checks to make sure that the fiscal year on the SubObjCdGlobalDetail is not empty and the document's fiscal year matches the detail's fiscal year

Parameters:
socChangeDocument -
Returns:
false if the fiscal year is missing or is not the same between the doc and the detail

checkChartOnSubObjCodeDetails

protected boolean checkChartOnSubObjCodeDetails(SubObjectCodeGlobal socChangeDocument,
                                                SubObjectCodeGlobalDetail socChangeDetail,
                                                int lineNum,
                                                boolean add)
This checks to make sure that the chart of accounts on the SubObjCdGlobalDetail is not empty and the document's chart matches the detail's chart

Parameters:
socChangeDocument -
socChangeDetail -
lineNum -
add -
Returns:
false if the chart is missing or is not the same between the doc and the detail

checkChartOnAccountDetails

protected boolean checkChartOnAccountDetails(SubObjectCodeGlobal socChangeDocument,
                                             AccountGlobalDetail acctDetail,
                                             int lineNum,
                                             boolean add)
This checks that the chart of accounts on the AccountGlobalDetail is not empty and matches the document's chart matches the detail's chart

Parameters:
socChangeDocument -
acctDetail -
lineNum -
add -
Returns:
false if the chart is missing or is not the same between the doc and the detail


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