org.kuali.kfs.module.endow.document.validation.impl
Class SecurityRule

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.module.endow.document.validation.impl.SecurityRule
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 SecurityRule
extends org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase


Field Summary
protected static org.apache.log4j.Logger LOG
           
protected  Security newSecurity
           
protected  Security oldSecurity
           
 
Fields inherited from class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
boDictionaryService, boService, businessObjectAuthorizationService, configService, ddService, dictionaryValidationService, DOCUMENT_ERROR_PREFIX, documentHelperService, MAINTAINABLE_ERROR_PATH, MAINTAINABLE_ERROR_PREFIX, maintDocDictionaryService, persistenceService, persistenceStructureService, personService, priorErrorPath, roleService, workflowDocumentService
 
Constructor Summary
SecurityRule()
           
 
Method Summary
protected  boolean checkClassCode()
          This method checks that the old and new Class Codes belong to the same Class Code Type.
protected  boolean checkCustomRequiredFields()
          Checks the required fields based on user input data.
protected  boolean checkDividendAmountChanged()
           
protected  boolean checkIncomeFrequencyCodeWhenPooledFundClassCodeUsed()
           
protected  boolean checkSecurityDividendPayDate()
           
protected  boolean checkUnitValue()
          This method checks if security unit value is valid.
protected  boolean checkValuesBasedOnValuationMethod()
          Checks the following two rules: 5.
protected  void initializeAttributes(org.kuali.rice.kns.document.MaintenanceDocument document)
          This method initializes the old and new security.
protected  boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument 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, processCustomAddCollectionLineBusinessRules, processCustomApproveDocumentBusinessRules, processCustomSaveDocumentBusinessRules, 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, setupConvenienceObjects, 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

LOG

protected static org.apache.log4j.Logger LOG

newSecurity

protected Security newSecurity

oldSecurity

protected Security oldSecurity
Constructor Detail

SecurityRule

public SecurityRule()
Method Detail

initializeAttributes

protected void initializeAttributes(org.kuali.rice.kns.document.MaintenanceDocument document)
This method initializes the old and new security.

Parameters:
document -

processCustomRouteDocumentBusinessRules

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

checkCustomRequiredFields

protected boolean checkCustomRequiredFields()
Checks the required fields based on user input data. If the Security Class Code for the new security record has a Security Accrual Method of 3,6,B,M or T the following fields are required input: 1. Issue Date 2. Maturity Date 3. Interest Rate or Amount 4. Income Pay Frequency. If the Class Code Type is an Alternative Investment, then the Commitment Amount field is required.

Parameters:
newSecurity -
Returns:
true if required fields entered, false otherwise

checkUnitValue

protected boolean checkUnitValue()
This method checks if security unit value is valid. The unit value must always be greater than or equal to zero EXCEPT for liabilities which must always be less than or equal to zero.

Returns:
true if valid, false otherwise

checkClassCode

protected boolean checkClassCode()
This method checks that the old and new Class Codes belong to the same Class Code Type.

Returns:
true if they belong to the same class code type, false otherwise.

checkValuesBasedOnValuationMethod

protected boolean checkValuesBasedOnValuationMethod()
Checks the following two rules: 5. If the class code for the security has a valuation method of U (Unit Value), the user can only enter a value in the SEC_UNIT_VAL. No entry is allowed in the SEC_VAL_BY_MKT field. 8. If the class code for the security has a valuation method of M (Market Value), the user can only enter a value in the SEC_ SEC_VAL_BY_MKT field. No entry is allowed in the SEC_UNIT_VAL field.

Returns:

checkIncomeFrequencyCodeWhenPooledFundClassCodeUsed

protected boolean checkIncomeFrequencyCodeWhenPooledFundClassCodeUsed()

checkSecurityDividendPayDate

protected boolean checkSecurityDividendPayDate()

checkDividendAmountChanged

protected boolean checkDividendAmountChanged()


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