org.kuali.kfs.sys.document.service.impl
Class AccountingLineRuleHelperServiceImpl

java.lang.Object
  extended by org.kuali.kfs.sys.document.service.impl.AccountingLineRuleHelperServiceImpl
All Implemented Interfaces:
AccountingLineRuleHelperService
Direct Known Subclasses:
BudgetAdjustmentAccountingLineRuleHelperServiceImpl, PurapAccountingLineRuleHelperServiceImpl

public class AccountingLineRuleHelperServiceImpl
extends Object
implements AccountingLineRuleHelperService


Constructor Summary
AccountingLineRuleHelperServiceImpl()
           
 
Method Summary
protected  boolean checkExistence(Object toCheck, org.kuali.rice.kns.datadictionary.BusinessObjectEntry accountingLineEntry, String attributeName, String propertyName)
          Checks for the existence of the given Object.
 String getAccountLabel()
           
 String getChartLabel()
           
 org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
           
 FinancialSystemDocumentTypeService getFinancialSystemDocumentTypeService()
          Gets the financialSystemDocumentTypeService attribute.
 String getFundGroupCodeLabel()
           
 String getObjectCodeLabel()
           
 String getObjectSubTypeCodeLabel()
           
 String getObjectTypeCodeLabel()
           
 String getOrganizationCodeLabel()
           
 String getProjectCodeLabel()
           
 String getSubAccountLabel()
           
 String getSubFundGroupCodeLabel()
           
 String getSubObjectCodeLabel()
           
protected  Account getUnexpiredContinuationAccountOrNull(Account account)
           
 boolean hasAccountRequiredOverrides(AccountingLine line, String overrideCode)
           
 boolean hasObjectBudgetRequiredOverrides(AccountingLine line, String overrideCode)
           
 boolean hasRequiredOverrides(AccountingLine line, String overrideCode)
          Checks that the given overrideCode is sufficient for the given BO, adding errors to the global map if not.
 boolean isValidAccount(Account account, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
          This method validates that the account is active for use in the system.
 boolean isValidAccount(Account account, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary, String errorPropertyName)
          This method validates that the account is active for use in the system.
 boolean isValidChart(Chart chart, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
          This method validates that the chart is active for use in the system.
 boolean isValidChart(Chart chart, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary, String errorPropertyName)
          This method validates that the chart is active for use in the system.
 boolean isValidObjectCode(ObjectCode objectCode, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
          This method validates that an object code is active.
 boolean isValidObjectCode(ObjectCode objectCode, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary, String errorPropertyName)
          This method validates that an object code is active.
 boolean isValidObjectTypeCode(ObjectType objectTypeCode, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
          For the most part, object type codes aren't required on an accounting line; however, in some situations (e.g.
 boolean isValidObjectTypeCode(ObjectType objectTypeCode, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary, String errorPropertyName)
          For the most part, object type codes aren't required on an accounting line; however, in some situations (e.g.
 boolean isValidProjectCode(ProjectCode projectCode, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
          This method validates that a project code is active.
 boolean isValidProjectCode(ProjectCode projectCode, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary, String errorPropertyName)
          This method validates that a project code is active.
protected  boolean isValidReferenceOriginCode(OriginationCode referenceOriginCode, org.kuali.rice.kns.datadictionary.BusinessObjectEntry accountingLineEntry)
          This method will check the reference origin code for existence in the system and whether it can actively be used.
protected  boolean isValidReferenceTypeCode(String documentTypeCode, org.kuali.rice.kew.doctype.bo.DocumentTypeEBO referenceType, org.kuali.rice.kns.datadictionary.BusinessObjectEntry accountingLineEntry)
          This method will check the reference type code for existence in the system and whether it can actively be used.
 boolean isValidSubAccount(SubAccount subAccount, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
          This method validates that a sub account is active.
 boolean isValidSubAccount(SubAccount subAccount, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary, String errorPropertyName)
          This method validates that a sub account is active.
 boolean isValidSubObjectCode(SubObjectCode subObjectCode, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
          This method validates that a sub object code is active.
 boolean isValidSubObjectCode(SubObjectCode subObjectCode, org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary, String errorPropertyName)
          This method validates that a sub object code is active.
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
          Sets the dataDictionaryService attribute value.
 void setFinancialSystemDocumentTypeService(FinancialSystemDocumentTypeService financialSystemDocumentTypeService)
          Sets the financialSystemDocumentTypeService attribute value.
 boolean validateAccountingLine(AccountingLine accountingLine)
          This method validates that an accounting line object contains values that actually exist in the DB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountingLineRuleHelperServiceImpl

public AccountingLineRuleHelperServiceImpl()
Method Detail

getAccountLabel

public String getAccountLabel()
Specified by:
getAccountLabel in interface AccountingLineRuleHelperService
Returns:
short label for account number defined in data dictionary
See Also:
AccountingLineRuleHelperService.getAccountLabel()

getChartLabel

public String getChartLabel()
Specified by:
getChartLabel in interface AccountingLineRuleHelperService
Returns:
short label for chart code defined in data dictionary
See Also:
AccountingLineRuleHelperService.getChartLabel()

getFundGroupCodeLabel

public String getFundGroupCodeLabel()
Specified by:
getFundGroupCodeLabel in interface AccountingLineRuleHelperService
Returns:
short label for fund group code defined in data dictionary
See Also:
AccountingLineRuleHelperService.getFundGroupCodeLabel()

getObjectCodeLabel

public String getObjectCodeLabel()
Specified by:
getObjectCodeLabel in interface AccountingLineRuleHelperService
Returns:
short label for object code defined in data dictionary
See Also:
AccountingLineRuleHelperService.getObjectCodeLabel()

getObjectSubTypeCodeLabel

public String getObjectSubTypeCodeLabel()
Specified by:
getObjectSubTypeCodeLabel in interface AccountingLineRuleHelperService
Returns:
short label for object sub type code defined in data dictionary
See Also:
AccountingLineRuleHelperService.getObjectSubTypeCodeLabel()

getObjectTypeCodeLabel

public String getObjectTypeCodeLabel()
Specified by:
getObjectTypeCodeLabel in interface AccountingLineRuleHelperService
Returns:
short label for object type code defined in data dictionary
See Also:
AccountingLineRuleHelperService.getObjectTypeCodeLabel()

getOrganizationCodeLabel

public String getOrganizationCodeLabel()
Specified by:
getOrganizationCodeLabel in interface AccountingLineRuleHelperService
Returns:
short label for organization code defined in data dictionary
See Also:
AccountingLineRuleHelperService.getOrganizationCodeLabel()

getProjectCodeLabel

public String getProjectCodeLabel()
Specified by:
getProjectCodeLabel in interface AccountingLineRuleHelperService
Returns:
short label for project code defined in data dictionary
See Also:
AccountingLineRuleHelperService.getProjectCodeLabel()

getSubAccountLabel

public String getSubAccountLabel()
Specified by:
getSubAccountLabel in interface AccountingLineRuleHelperService
Returns:
short label for sub account number defined in data dictionary
See Also:
AccountingLineRuleHelperService.getSubAccountLabel()

getSubFundGroupCodeLabel

public String getSubFundGroupCodeLabel()
Specified by:
getSubFundGroupCodeLabel in interface AccountingLineRuleHelperService
Returns:
short label for sub fund group code defined in data dictionary
See Also:
AccountingLineRuleHelperService.getSubFundGroupCodeLabel()

getSubObjectCodeLabel

public String getSubObjectCodeLabel()
Specified by:
getSubObjectCodeLabel in interface AccountingLineRuleHelperService
Returns:
short label for sub object code defined in data dictionary
See Also:
AccountingLineRuleHelperService.getSubObjectCodeLabel()

hasRequiredOverrides

public boolean hasRequiredOverrides(AccountingLine line,
                                    String overrideCode)
Description copied from interface: AccountingLineRuleHelperService
Checks that the given overrideCode is sufficient for the given BO, adding errors to the global map if not.

Specified by:
hasRequiredOverrides in interface AccountingLineRuleHelperService
Returns:
whether the given overrideCode is sufficient for the given BO.
See Also:
AccountingLineRuleHelperService.hasRequiredOverrides(org.kuali.kfs.sys.businessobject.AccountingLine, java.lang.String)

hasAccountRequiredOverrides

public boolean hasAccountRequiredOverrides(AccountingLine line,
                                           String overrideCode)

hasObjectBudgetRequiredOverrides

public boolean hasObjectBudgetRequiredOverrides(AccountingLine line,
                                                String overrideCode)

getUnexpiredContinuationAccountOrNull

protected Account getUnexpiredContinuationAccountOrNull(Account account)
Parameters:
account -
Returns:
an unexpired continuation account for the given account, or, if one cannot be found, null

isValidAccount

public boolean isValidAccount(Account account,
                              org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
Description copied from interface: AccountingLineRuleHelperService
This method validates that the account is active for use in the system.

Specified by:
isValidAccount in interface AccountingLineRuleHelperService
Returns:
boolean True if it is valid.
See Also:
AccountingLineRuleHelperService.isValidAccount(org.kuali.kfs.coa.businessobject.Account, org.kuali.rice.kns.datadictionary.DataDictionary)

isValidAccount

public boolean isValidAccount(Account account,
                              org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary,
                              String errorPropertyName)
Description copied from interface: AccountingLineRuleHelperService
This method validates that the account is active for use in the system.

Specified by:
isValidAccount in interface AccountingLineRuleHelperService
Returns:
boolean True if it is valid.
See Also:
AccountingLineRuleHelperService.isValidAccount(org.kuali.kfs.coa.businessobject.Account, org.kuali.rice.kns.datadictionary.DataDictionary, java.lang.String)

isValidChart

public boolean isValidChart(Chart chart,
                            org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
Description copied from interface: AccountingLineRuleHelperService
This method validates that the chart is active for use in the system.

Specified by:
isValidChart in interface AccountingLineRuleHelperService
Returns:
boolean True if the Chart is valid.
See Also:
AccountingLineRuleHelperService.isValidChart(org.kuali.kfs.coa.businessobject.Chart, org.kuali.rice.kns.datadictionary.DataDictionary)

isValidChart

public boolean isValidChart(Chart chart,
                            org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary,
                            String errorPropertyName)
Description copied from interface: AccountingLineRuleHelperService
This method validates that the chart is active for use in the system.

Specified by:
isValidChart in interface AccountingLineRuleHelperService
Returns:
boolean True if the Chart is valid.
See Also:
AccountingLineRuleHelperService.isValidChart(org.kuali.kfs.coa.businessobject.Chart, org.kuali.rice.kns.datadictionary.DataDictionary, java.lang.String)

isValidObjectCode

public boolean isValidObjectCode(ObjectCode objectCode,
                                 org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
Description copied from interface: AccountingLineRuleHelperService
This method validates that an object code is active.

Specified by:
isValidObjectCode in interface AccountingLineRuleHelperService
Returns:
boolean True if the object code is valid.
See Also:
AccountingLineRuleHelperService.isValidObjectCode(org.kuali.kfs.coa.businessobject.ObjectCode, org.kuali.rice.kns.datadictionary.DataDictionary)

isValidObjectCode

public boolean isValidObjectCode(ObjectCode objectCode,
                                 org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary,
                                 String errorPropertyName)
Description copied from interface: AccountingLineRuleHelperService
This method validates that an object code is active.

Specified by:
isValidObjectCode in interface AccountingLineRuleHelperService
Returns:
boolean True if the object code is valid.
See Also:
AccountingLineRuleHelperService.isValidObjectCode(org.kuali.kfs.coa.businessobject.ObjectCode, org.kuali.rice.kns.datadictionary.DataDictionary, java.lang.String)

isValidObjectTypeCode

public boolean isValidObjectTypeCode(ObjectType objectTypeCode,
                                     org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
Description copied from interface: AccountingLineRuleHelperService
For the most part, object type codes aren't required on an accounting line; however, in some situations (e.g. Journal Voucher) they are entered directly into the accounting line and must be validated. In those cases, they must be validated for activeness.

Specified by:
isValidObjectTypeCode in interface AccountingLineRuleHelperService
Returns:
boolean True if the object type code is valid, false otherwise.
See Also:
AccountingLineRuleHelperService.isValidObjectTypeCode(org.kuali.kfs.coa.businessobject.ObjectType, org.kuali.rice.kns.datadictionary.DataDictionary)

isValidObjectTypeCode

public boolean isValidObjectTypeCode(ObjectType objectTypeCode,
                                     org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary,
                                     String errorPropertyName)
Description copied from interface: AccountingLineRuleHelperService
For the most part, object type codes aren't required on an accounting line; however, in some situations (e.g. Journal Voucher) they are entered directly into the accounting line and must be validated. In those cases, they must be validated for activeness.

Specified by:
isValidObjectTypeCode in interface AccountingLineRuleHelperService
Returns:
boolean True if the object type code is valid, false otherwise.
See Also:
AccountingLineRuleHelperService.isValidObjectTypeCode(org.kuali.kfs.coa.businessobject.ObjectType, org.kuali.rice.kns.datadictionary.DataDictionary, java.lang.String)

isValidProjectCode

public boolean isValidProjectCode(ProjectCode projectCode,
                                  org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
Description copied from interface: AccountingLineRuleHelperService
This method validates that a project code is active.

Specified by:
isValidProjectCode in interface AccountingLineRuleHelperService
Returns:
boolean True if it is valid.
See Also:
AccountingLineRuleHelperService.isValidProjectCode(org.kuali.kfs.coa.businessobject.ProjectCode, org.kuali.rice.kns.datadictionary.DataDictionary)

isValidProjectCode

public boolean isValidProjectCode(ProjectCode projectCode,
                                  org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary,
                                  String errorPropertyName)
Description copied from interface: AccountingLineRuleHelperService
This method validates that a project code is active.

Specified by:
isValidProjectCode in interface AccountingLineRuleHelperService
Returns:
boolean True if it is valid.
See Also:
AccountingLineRuleHelperService.isValidProjectCode(org.kuali.kfs.coa.businessobject.ProjectCode, org.kuali.rice.kns.datadictionary.DataDictionary, java.lang.String)

isValidSubAccount

public boolean isValidSubAccount(SubAccount subAccount,
                                 org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
Description copied from interface: AccountingLineRuleHelperService
This method validates that a sub account is active.

Specified by:
isValidSubAccount in interface AccountingLineRuleHelperService
Returns:
true if it exists
See Also:
AccountingLineRuleHelperService.isValidSubAccount(org.kuali.kfs.coa.businessobject.SubAccount, org.kuali.rice.kns.datadictionary.DataDictionary)

isValidSubAccount

public boolean isValidSubAccount(SubAccount subAccount,
                                 org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary,
                                 String errorPropertyName)
Description copied from interface: AccountingLineRuleHelperService
This method validates that a sub account is active.

Specified by:
isValidSubAccount in interface AccountingLineRuleHelperService
Returns:
true if it exists
See Also:
AccountingLineRuleHelperService.isValidSubAccount(org.kuali.kfs.coa.businessobject.SubAccount, org.kuali.rice.kns.datadictionary.DataDictionary, java.lang.String)

isValidSubObjectCode

public boolean isValidSubObjectCode(SubObjectCode subObjectCode,
                                    org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary)
Description copied from interface: AccountingLineRuleHelperService
This method validates that a sub object code is active.

Specified by:
isValidSubObjectCode in interface AccountingLineRuleHelperService
Returns:
boolean True if it is valid.
See Also:
org.kuali.kfs.sys.document.service.AccountingLineRuleHelperService#isValidSubObjectCode(org.kuali.kfs.coa.businessobject.SubObjCd, org.kuali.rice.kns.datadictionary.DataDictionary)

isValidSubObjectCode

public boolean isValidSubObjectCode(SubObjectCode subObjectCode,
                                    org.kuali.rice.kns.datadictionary.DataDictionary dataDictionary,
                                    String errorPropertyName)
Description copied from interface: AccountingLineRuleHelperService
This method validates that a sub object code is active.

Specified by:
isValidSubObjectCode in interface AccountingLineRuleHelperService
Returns:
boolean True if it is valid.
See Also:
org.kuali.kfs.sys.document.service.AccountingLineRuleHelperService#isValidSubObjectCode(org.kuali.kfs.coa.businessobject.SubObjCd, org.kuali.rice.kns.datadictionary.DataDictionary, java.lang.String)

validateAccountingLine

public boolean validateAccountingLine(AccountingLine accountingLine)
Description copied from interface: AccountingLineRuleHelperService
This method validates that an accounting line object contains values that actually exist in the DB. SubAccount and SubObject are only checked if there are values in them. The others throw errors if they area null.

Specified by:
validateAccountingLine in interface AccountingLineRuleHelperService
Returns:
success or failure of validating the AccountingLine
See Also:
AccountingLineRuleHelperService.validateAccountingLine(org.kuali.kfs.sys.businessobject.AccountingLine)

isValidReferenceOriginCode

protected boolean isValidReferenceOriginCode(OriginationCode referenceOriginCode,
                                             org.kuali.rice.kns.datadictionary.BusinessObjectEntry accountingLineEntry)
This method will check the reference origin code for existence in the system and whether it can actively be used.

Parameters:
referenceOriginCode -
accountingLineEntry -
Returns:
boolean True if the object is valid; false otherwise.

isValidReferenceTypeCode

protected boolean isValidReferenceTypeCode(String documentTypeCode,
                                           org.kuali.rice.kew.doctype.bo.DocumentTypeEBO referenceType,
                                           org.kuali.rice.kns.datadictionary.BusinessObjectEntry accountingLineEntry)
This method will check the reference type code for existence in the system and whether it can actively be used.

Parameters:
documentTypeCode - the document type name of the reference document type
referenceType -
accountingLineEntry -
Returns:
boolean True if the object is valid; false otherwise.

checkExistence

protected boolean checkExistence(Object toCheck,
                                 org.kuali.rice.kns.datadictionary.BusinessObjectEntry accountingLineEntry,
                                 String attributeName,
                                 String propertyName)
Checks for the existence of the given Object. This is doing an OJB-proxy-smart check, so assuming the given Object is not in need of a refresh(), this method adds an ERROR_EXISTENCE to the global error map if the given Object is not in the database.

Parameters:
toCheck - the Object to check for existence
accountingLineEntry - to get the property's label for the error message parameter.
attributeName - the name of the SourceAccountingLine attribute in the DataDictionary accountingLineEntry
propertyName - the name of the property within the global error path.
Returns:
whether the given Object exists or not

setDataDictionaryService

public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
Sets the dataDictionaryService attribute value.

Parameters:
dataDictionaryService - The dataDictionaryService to set.

getDataDictionaryService

public org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()

getFinancialSystemDocumentTypeService

public FinancialSystemDocumentTypeService getFinancialSystemDocumentTypeService()
Gets the financialSystemDocumentTypeService attribute.

Returns:
Returns the financialSystemDocumentTypeService.

setFinancialSystemDocumentTypeService

public void setFinancialSystemDocumentTypeService(FinancialSystemDocumentTypeService financialSystemDocumentTypeService)
Sets the financialSystemDocumentTypeService attribute value.

Parameters:
financialSystemDocumentTypeService - The financialSystemDocumentTypeService to set.


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