org.kuali.kfs.fp.document.validation.impl
Class DisbursementVoucherAccountingLineAccessibleValidation

java.lang.Object
  extended by org.kuali.kfs.sys.document.validation.ParameterizedValidation
      extended by org.kuali.kfs.sys.document.validation.GenericValidation
          extended by org.kuali.kfs.sys.document.validation.impl.AccountingLineAccessibleValidation
              extended by org.kuali.kfs.fp.document.validation.impl.DisbursementVoucherAccountingLineAccessibleValidation
All Implemented Interfaces:
Validation

public class DisbursementVoucherAccountingLineAccessibleValidation
extends AccountingLineAccessibleValidation


Nested Class Summary
 
Nested classes/interfaces inherited from class org.kuali.kfs.sys.document.validation.impl.AccountingLineAccessibleValidation
AccountingLineAccessibleValidation.AccountingLineAction
 
Field Summary
protected static org.apache.log4j.Logger LOG
           
protected  AccountingLine oldAccountingLineForValidation
           
 
Fields inherited from class org.kuali.kfs.sys.document.validation.impl.AccountingLineAccessibleValidation
accountingDocumentForValidation, accountingLineForValidation, dataDictionaryService
 
Constructor Summary
DisbursementVoucherAccountingLineAccessibleValidation()
           
 
Method Summary
protected  boolean accountUnchanged(AccountingLine pollux, AccountingLine castor)
          Determines if the two given accounting lines have not have their account changed
protected  List<String> getCandidateEditModes()
          define the possibly desired edit modes
protected  boolean hasRequiredEditMode(AccountingDocument accountingDocument, org.kuali.rice.kim.bo.Person financialSystemUser, List<String> candidateEditModes)
          determine whether the give user has permission to any edit mode defined in the given candidate edit modes
 void setOldAccountingLineForValidation(AccountingLine oldAccountingLineForValidation)
          Sets the oldAccountingLineForValidation attribute value.
 boolean validate(AttributedDocumentEvent event)
          Validates that the given accounting line is accessible for editing by the current user.
 
Methods inherited from class org.kuali.kfs.sys.document.validation.impl.AccountingLineAccessibleValidation
convertEventToMessage, getAccountingDocumentForValidation, getAccountingLineCollectionProperty, getAccountingLineForValidation, getDataDictionaryService, getGroupName, lookupAccountingLineAuthorizer, setAccountingDocumentForValidation, setAccountingLineForValidation, setDataDictionaryService
 
Methods inherited from class org.kuali.kfs.sys.document.validation.GenericValidation
setQuitOnFail, shouldQuitOnFail, stageValidation
 
Methods inherited from class org.kuali.kfs.sys.document.validation.ParameterizedValidation
getParameterProperties, populateParameterFromEvent, populateParametersFromEvent, setParameterProperties
 
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

oldAccountingLineForValidation

protected AccountingLine oldAccountingLineForValidation
Constructor Detail

DisbursementVoucherAccountingLineAccessibleValidation

public DisbursementVoucherAccountingLineAccessibleValidation()
Method Detail

validate

public boolean validate(AttributedDocumentEvent event)
Validates that the given accounting line is accessible for editing by the current user. This method expects a document as the first parameter and an accounting line as the second

Specified by:
validate in interface Validation
Overrides:
validate in class AccountingLineAccessibleValidation
Returns:
true if validation should continue, false otherwise
See Also:
AccountingLineAccessibleValidation.validate(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)

hasRequiredEditMode

protected boolean hasRequiredEditMode(AccountingDocument accountingDocument,
                                      org.kuali.rice.kim.bo.Person financialSystemUser,
                                      List<String> candidateEditModes)
determine whether the give user has permission to any edit mode defined in the given candidate edit modes

Parameters:
accountingDocument - the given accounting document
financialSystemUser - the given user
candidateEditEditModes - the given candidate edit modes
Returns:
true if the give user has permission to any edit mode defined in the given candidate edit modes; otherwise, false

getCandidateEditModes

protected List<String> getCandidateEditModes()
define the possibly desired edit modes

Returns:
the possibly desired edit modes

accountUnchanged

protected boolean accountUnchanged(AccountingLine pollux,
                                   AccountingLine castor)
Determines if the two given accounting lines have not have their account changed

Parameters:
pollux - the first accounting line to check
castor - the second accounting line to check
Returns:
true if the account is the same for the two, false otherwise

setOldAccountingLineForValidation

public void setOldAccountingLineForValidation(AccountingLine oldAccountingLineForValidation)
Sets the oldAccountingLineForValidation attribute value.

Parameters:
oldAccountingLineForValidation - The oldAccountingLineForValidation to set.


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