org.kuali.kfs.sys.document.validation.impl
Class AccountingLineAccessibleValidation

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
All Implemented Interfaces:
Validation
Direct Known Subclasses:
DisbursementVoucherAccountingLineAccessibleValidation, PurchasingAccountsPayableAccountingLineAccessibleValidation

public class AccountingLineAccessibleValidation
extends GenericValidation

A validation that checks whether the given accounting line is accessible to the given user or not


Nested Class Summary
static class AccountingLineAccessibleValidation.AccountingLineAction
          Indicates what is being done to an accounting line.
 
Field Summary
protected  AccountingDocument accountingDocumentForValidation
           
protected  AccountingLine accountingLineForValidation
           
protected  org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService
           
 
Constructor Summary
AccountingLineAccessibleValidation()
           
 
Method Summary
protected  String convertEventToMessage(org.kuali.rice.kns.rule.event.KualiDocumentEvent event)
          Determines what error message should be shown based on the event that required this validation
 AccountingDocument getAccountingDocumentForValidation()
          Gets the accountingDocumentForValidation attribute.
protected  String getAccountingLineCollectionProperty()
          Determines the property of the accounting line collection from the error prefixes
 AccountingLine getAccountingLineForValidation()
          Gets the accountingLineForValidation attribute.
 org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
          Gets the dataDictionaryService attribute.
protected  String getGroupName()
          Returns the name of the accounting line group which holds the proper authorizer to do the KIM check
protected  AccountingLineAuthorizer lookupAccountingLineAuthorizer()
           
 void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)
          Sets the accountingDocumentForValidation attribute value.
 void setAccountingLineForValidation(AccountingLine accountingLineForValidation)
          Sets the accountingLineForValidation attribute value.
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
          Sets the dataDictionaryService 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.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

dataDictionaryService

protected org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService

accountingDocumentForValidation

protected AccountingDocument accountingDocumentForValidation

accountingLineForValidation

protected AccountingLine accountingLineForValidation
Constructor Detail

AccountingLineAccessibleValidation

public AccountingLineAccessibleValidation()
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

Returns:
true if validation should continue, false otherwise
See Also:
org.kuali.kfs.sys.document.validation.Validation#validate(java.lang.Object[])

getGroupName

protected String getGroupName()
Returns the name of the accounting line group which holds the proper authorizer to do the KIM check

Returns:
the name of the accouting line group to get the authorizer from

lookupAccountingLineAuthorizer

protected AccountingLineAuthorizer lookupAccountingLineAuthorizer()
Returns:
hopefully, the best accounting line authorizer implementation to do the KIM check for to see if lines are accessible

getAccountingLineCollectionProperty

protected String getAccountingLineCollectionProperty()
Determines the property of the accounting line collection from the error prefixes

Returns:
the accounting line collection property

convertEventToMessage

protected String convertEventToMessage(org.kuali.rice.kns.rule.event.KualiDocumentEvent event)
Determines what error message should be shown based on the event that required this validation

Parameters:
event - the event to use to determine the error message
Returns:
the key of the error message to display

getAccountingDocumentForValidation

public AccountingDocument getAccountingDocumentForValidation()
Gets the accountingDocumentForValidation attribute.

Returns:
Returns the accountingDocumentForValidation.

setAccountingDocumentForValidation

public void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)
Sets the accountingDocumentForValidation attribute value.

Parameters:
accountingDocumentForValidation - The accountingDocumentForValidation to set.

getAccountingLineForValidation

public AccountingLine getAccountingLineForValidation()
Gets the accountingLineForValidation attribute.

Returns:
Returns the accountingLineForValidation.

setAccountingLineForValidation

public void setAccountingLineForValidation(AccountingLine accountingLineForValidation)
Sets the accountingLineForValidation attribute value.

Parameters:
accountingLineForValidation - The accountingLineForValidation to set.

getDataDictionaryService

public org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
Gets the dataDictionaryService attribute.

Returns:
Returns the dataDictionaryService.

setDataDictionaryService

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

Parameters:
dataDictionaryService - The dataDictionaryService to set.


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