org.kuali.kfs.module.purap.document.validation.impl
Class PurchasingAddItemValidation

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.module.purap.document.validation.impl.PurchasingAccountsPayableAddItemValidation
              extended by org.kuali.kfs.module.purap.document.validation.impl.PurchasingAddItemValidation
All Implemented Interfaces:
Validation

public class PurchasingAddItemValidation
extends PurchasingAccountsPayableAddItemValidation


Constructor Summary
PurchasingAddItemValidation()
           
 
Method Summary
protected  boolean commodityCodeIsRequired()
          Predicate to do a parameter lookup and tell us whether a commodity code is required.
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
           
 org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
           
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
           
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
           
 boolean validate(AttributedDocumentEvent event)
          This method validates that certain parameters
protected  boolean validateCommodityCodes(PurApItem item, boolean commodityCodeRequired)
          Validates whether the commodity code existed on the item, and if existed, whether the commodity code on the item existed in the database, and if so, whether the commodity code is active.
 boolean validateItemDescription(PurApItem item)
          Checks that a description was entered for the item.
 boolean validateItemQuantity(PurApItem item)
          Validates that if the item type is quantity based, the item quantity is required and if the item type is amount based, the quantity is not allowed.
 boolean validateItemUnitPrice(PurApItem item)
          Validates the unit price for all applicable item types.
protected  boolean validateThatCommodityCodeIsActive(PurApItem item)
           
 boolean validateUnitOfMeasure(PurApItem item)
          Validates that if the item type is quantity based, the unit of measure is required.
 
Methods inherited from class org.kuali.kfs.module.purap.document.validation.impl.PurchasingAccountsPayableAddItemValidation
getDictionaryValidationService, getItemForValidation, setDictionaryValidationService, setItemForValidation
 
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
 

Constructor Detail

PurchasingAddItemValidation

public PurchasingAddItemValidation()
Method Detail

validate

public boolean validate(AttributedDocumentEvent event)
Description copied from interface: Validation
This method validates that certain parameters

Specified by:
validate in interface Validation
Overrides:
validate in class PurchasingAccountsPayableAddItemValidation
Returns:
true if validation should continue, false otherwise

validateCommodityCodes

protected boolean validateCommodityCodes(PurApItem item,
                                         boolean commodityCodeRequired)
Validates whether the commodity code existed on the item, and if existed, whether the commodity code on the item existed in the database, and if so, whether the commodity code is active. Display error if any of these 3 conditions are not met.

Parameters:
item - The PurApItem containing the commodity code to be validated.
Returns:
boolean false if the validation fails and true otherwise.

validateItemUnitPrice

public boolean validateItemUnitPrice(PurApItem item)
Validates the unit price for all applicable item types. It validates that the unit price field was entered on the item, and that the price is in the right range for the item type.

Parameters:
purDocument - the purchasing document to be validated
Returns:
boolean false if there is any validation that fails.

validateUnitOfMeasure

public boolean validateUnitOfMeasure(PurApItem item)
Validates that if the item type is quantity based, the unit of measure is required.

Parameters:
item - the item to be validated
Returns:
boolean false if the item type is quantity based and the unit of measure is empty.

validateItemDescription

public boolean validateItemDescription(PurApItem item)
Checks that a description was entered for the item.

Parameters:
item -
Returns:

validateItemQuantity

public boolean validateItemQuantity(PurApItem item)
Validates that if the item type is quantity based, the item quantity is required and if the item type is amount based, the quantity is not allowed.

Parameters:
item - the item to be validated
Returns:
boolean false if there's any validation that fails.

commodityCodeIsRequired

protected boolean commodityCodeIsRequired()
Predicate to do a parameter lookup and tell us whether a commodity code is required. Override in child classes.

Returns:
True if a commodity code is required.

validateThatCommodityCodeIsActive

protected boolean validateThatCommodityCodeIsActive(PurApItem item)

getBusinessObjectService

public org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)

getDataDictionaryService

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

setDataDictionaryService

public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)


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