org.kuali.kfs.module.cam.document.validation.impl
Class AssetRule

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

AssetRule for Asset edit.


Field Summary
protected  AssetComponentService assetComponentService
           
protected  AssetDateService assetDateService
           
protected  AssetLocationService assetLocationService
           
protected  AssetService assetService
           
protected  org.kuali.rice.kns.service.DateTimeService dateTimeService
           
protected  EquipmentLoanOrReturnService equipmentLoanOrReturnService
           
protected  boolean isFabrication
           
protected static Map<AssetLocationService.LocationField,String> LOCATION_FIELD_MAP
           
protected static org.apache.log4j.Logger LOG
           
protected  Asset newAsset
           
protected  Asset oldAsset
           
protected  org.kuali.rice.kns.service.ParameterService parameterService
           
protected  PaymentSummaryService paymentSummaryService
           
protected  RetirementInfoService retirementInfoService
           
protected  UniversityDateService universityDateService
           
 
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
AssetRule()
           
 
Method Summary
protected  boolean checkAcquisitionTypeCodeChange()
          Check if the Acquisition Type Code is valid or is inactive.
protected  boolean checkAssetDepreciationMethodChange()
          Check if the Asset Depreciation Method is valid or is inactive.
protected  boolean checkAssetLocked(org.kuali.rice.kns.document.MaintenanceDocument document)
          Check if asset is locked by other document.
protected  boolean checkAssetStatusCodeChange()
          Check if the Asset Status Code is valid or is inactive.
protected  boolean checkAssetTypeCodeChange()
          Check if the Asset Type Code is valid or is inactive.
protected  boolean checkConditionCodeChange()
          Check if the Asset Condition is valid or is inactive.
protected  boolean checkDuplicateIncidentDate(AssetRepairHistory assetRepairHistory, Set<Date> incidentDateSet)
          Check for duplicate incident dates within the Repair History section
protected  boolean checkFinancialObjectSubtypeCodeChange()
          Check if the Financial Object Sub-Type Code is valid or is inactive.
protected  CapitalAssetManagementModuleService getCapitalAssetManagementModuleService()
           
protected  void initializeAttributes(org.kuali.rice.kns.document.MaintenanceDocument document)
           
protected  boolean isOffCampusLocationChanged()
          Check if off campus fields has changed.
protected  boolean processAssetValidation(org.kuali.rice.kns.document.MaintenanceDocument document)
          Validates Asset document.
 boolean processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument documentCopy, String collectionName, org.kuali.rice.kns.bo.PersistableBusinessObject bo)
           
protected  boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
           
protected  boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
           
 org.kuali.rice.kns.util.TypedArrayList putError(String propertyName, String errorKey, String... errorParameters)
          Convenience method to append the path prefix
protected  List<Long> retrieveAssetNumberForLocking(Asset asset)
          Retrieve asset numbers need to be locked.
protected  void setAssetComponentNumbers(Asset asset)
          Set asset component numbers
protected  boolean setAssetLock(org.kuali.rice.kns.document.MaintenanceDocument document)
          Locking asset number
protected  boolean validateAccount()
          Validate account
protected  boolean validateDepreciationData(Asset asset)
          validates depreciation data
protected  boolean validateFabricationDetails()
          Validate fabrication details
protected  boolean validateInServiceDate()
          Check if the new In-service Date is a valid University Date
protected  boolean validateInventoryStatusCode(String oldInventoryStatusCode, String newInventoryStatusCode)
          Validate Inventory Status Code Change
protected  boolean validateLocation()
          Validate Asset Location fields
protected  boolean validateTagNumber()
          If the tag number has not been assigned, the departmental user will be able to update the tag number.
protected  boolean validateVendorName()
          The Vendor Name is required for capital equipment and not required for non-capital assets.
protected  boolean validateWarrantyInformation(Asset asset)
          Validate warranty information if user enters value
 
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, processCustomApproveDocumentBusinessRules, 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

LOCATION_FIELD_MAP

protected static final Map<AssetLocationService.LocationField,String> LOCATION_FIELD_MAP

assetService

protected AssetService assetService

parameterService

protected org.kuali.rice.kns.service.ParameterService parameterService

paymentSummaryService

protected PaymentSummaryService paymentSummaryService

retirementInfoService

protected RetirementInfoService retirementInfoService

equipmentLoanOrReturnService

protected EquipmentLoanOrReturnService equipmentLoanOrReturnService

assetDateService

protected AssetDateService assetDateService

assetComponentService

protected AssetComponentService assetComponentService

universityDateService

protected UniversityDateService universityDateService

assetLocationService

protected AssetLocationService assetLocationService

dateTimeService

protected org.kuali.rice.kns.service.DateTimeService dateTimeService

newAsset

protected Asset newAsset

oldAsset

protected Asset oldAsset

isFabrication

protected boolean isFabrication
Constructor Detail

AssetRule

public AssetRule()
Method Detail

processCustomSaveDocumentBusinessRules

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

checkAssetLocked

protected boolean checkAssetLocked(org.kuali.rice.kns.document.MaintenanceDocument document)
Check if asset is locked by other document.

Parameters:
document -
valid -
Returns:

retrieveAssetNumberForLocking

protected List<Long> retrieveAssetNumberForLocking(Asset asset)
Retrieve asset numbers need to be locked.

Returns:

processCustomAddCollectionLineBusinessRules

public boolean processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument documentCopy,
                                                           String collectionName,
                                                           org.kuali.rice.kns.bo.PersistableBusinessObject bo)
Overrides:
processCustomAddCollectionLineBusinessRules in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument, java.lang.String, org.kuali.rice.kns.bo.PersistableBusinessObject)

checkDuplicateIncidentDate

protected boolean checkDuplicateIncidentDate(AssetRepairHistory assetRepairHistory,
                                             Set<Date> incidentDateSet)
Check for duplicate incident dates within the Repair History section

Parameters:
assetRepairHistory -
incidentDateSet -
Returns:
boolean

validateFabricationDetails

protected boolean validateFabricationDetails()
Validate fabrication details

Returns:
boolean

validateAccount

protected boolean validateAccount()
Validate account

Returns:
boolean

setAssetComponentNumbers

protected void setAssetComponentNumbers(Asset asset)
Set asset component numbers

Parameters:
asset -

processAssetValidation

protected boolean processAssetValidation(org.kuali.rice.kns.document.MaintenanceDocument document)
Validates Asset document.

Parameters:
document - MaintenanceDocument instance
Returns:
boolean false or true

validateInServiceDate

protected boolean validateInServiceDate()
Check if the new In-service Date is a valid University Date

Returns:

isOffCampusLocationChanged

protected boolean isOffCampusLocationChanged()
Check if off campus fields has changed.

Returns:

validateInventoryStatusCode

protected boolean validateInventoryStatusCode(String oldInventoryStatusCode,
                                              String newInventoryStatusCode)
Validate Inventory Status Code Change


initializeAttributes

protected void initializeAttributes(org.kuali.rice.kns.document.MaintenanceDocument document)

validateTagNumber

protected boolean validateTagNumber()
If the tag number has not been assigned, the departmental user will be able to update the tag number. The Tag Number shall be verified that the tag number does not exist on another asset.

Parameters:
asset -
Returns:

validateVendorName

protected boolean validateVendorName()
The Vendor Name is required for capital equipment and not required for non-capital assets.

Parameters:
asset -
Returns:

validateLocation

protected boolean validateLocation()
Validate Asset Location fields

Parameters:
asset -
Returns:

validateWarrantyInformation

protected boolean validateWarrantyInformation(Asset asset)
Validate warranty information if user enters value

Parameters:
asset - Asset
Returns:
validation result

validateDepreciationData

protected boolean validateDepreciationData(Asset asset)
validates depreciation data

Parameters:
asset -
Returns:
boolean

processCustomRouteDocumentBusinessRules

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

setAssetLock

protected boolean setAssetLock(org.kuali.rice.kns.document.MaintenanceDocument document)
Locking asset number

Parameters:
document -
Returns:

getCapitalAssetManagementModuleService

protected CapitalAssetManagementModuleService getCapitalAssetManagementModuleService()

putError

public org.kuali.rice.kns.util.TypedArrayList putError(String propertyName,
                                                       String errorKey,
                                                       String... errorParameters)
Convenience method to append the path prefix


checkAcquisitionTypeCodeChange

protected boolean checkAcquisitionTypeCodeChange()
Check if the Acquisition Type Code is valid or is inactive.

Parameters:
oldAcquisitionTypeCode -
newAcquisitionTypeCode -
Returns:
boolean

checkConditionCodeChange

protected boolean checkConditionCodeChange()
Check if the Asset Condition is valid or is inactive.

Parameters:
oldConditionCode -
newConditionCode -
Returns:
boolean

checkAssetDepreciationMethodChange

protected boolean checkAssetDepreciationMethodChange()
Check if the Asset Depreciation Method is valid or is inactive.

Parameters:
oldAssetDepreciationMethod -
newAssetDepreciationMethod -
Returns:
boolean

checkAssetStatusCodeChange

protected boolean checkAssetStatusCodeChange()
Check if the Asset Status Code is valid or is inactive.

Parameters:
oldAssetStatus -
newAssetStatus -
Returns:
boolean

checkAssetTypeCodeChange

protected boolean checkAssetTypeCodeChange()
Check if the Asset Type Code is valid or is inactive.

Parameters:
oldAssetType -
newAssetType -
Returns:
boolean

checkFinancialObjectSubtypeCodeChange

protected boolean checkFinancialObjectSubtypeCodeChange()
Check if the Financial Object Sub-Type Code is valid or is inactive.

Parameters:
oldObjectSubType -
newObjectSubType -
Returns:
boolean


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