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

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

public class PurchasingImportItemValidation
extends PurchasingAccountsPayableImportItemValidation


Constructor Summary
PurchasingImportItemValidation()
           
 
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 validateItemUnitPrice(PurApItem item)
          Validates the unit price for all applicable item types.
protected  boolean validateThatCommodityCodeIsActive(PurApItem item)
           
protected  boolean validateUnitOfMeasureCodeExists(PurApItem item)
          Validates that if the item type is quantity based, that the unit of measure code is valid.
 
Methods inherited from class org.kuali.kfs.module.purap.document.validation.impl.PurchasingAccountsPayableImportItemValidation
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

PurchasingImportItemValidation

public PurchasingImportItemValidation()
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 PurchasingAccountsPayableImportItemValidation
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.

validateItemDescription

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

Parameters:
item -
Returns:

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.

validateUnitOfMeasureCodeExists

protected boolean validateUnitOfMeasureCodeExists(PurApItem item)
Validates that if the item type is quantity based, that the unit of measure code is valid. Looks for the UOM Code in the table. If it is not there, the code is invalid. This checking is needed only for imported items, since items added from new line could only choose an existing UOM from the drop-down list.

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

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.