org.kuali.kfs.vnd.document.validation.impl
Class VendorRule

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

Business rules applicable to VendorDetail document.


Field Summary
 
Fields inherited from class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
boDictionaryService, boService, businessObjectAuthorizationService, configService, ddService, dictionaryValidationService, DOCUMENT_ERROR_PREFIX, documentHelperService, LOG, MAINTAINABLE_ERROR_PATH, MAINTAINABLE_ERROR_PREFIX, maintDocDictionaryService, persistenceService, persistenceStructureService, personService, priorErrorPath, roleService, workflowDocumentService
 
Constructor Summary
VendorRule()
           
 
Method Summary
 boolean processAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document, String collectionName, org.kuali.rice.kns.bo.PersistableBusinessObject bo)
          Overrides the method in MaintenanceDocumentRuleBase to give error message to the user when the user tries to add a vendor contract when the vendor type of the vendor does not allow contract.
 boolean processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document, String collectionName, org.kuali.rice.kns.bo.PersistableBusinessObject bo)
          Validates business rules for VendorDetail document collection add lines.
protected  boolean processCustomApproveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
           
protected  boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
           
protected  boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document)
           
 void setupBaseConvenienceObjects(org.kuali.rice.kns.document.MaintenanceDocument document)
          Overrides the setupBaseConvenienceObjects from the superclass because we cannot use the setupBaseConvenienceObjects from the superclass.
 void setupConvenienceObjects()
           
protected  boolean validateVendorNames(VendorDetail vendorDetail)
          Validates the vendorName, vendorFirstName and vendorLastName fields according to these business rules: 1.
protected  boolean validateVendorSoldToNumber(VendorDetail vendorDetail)
          Validates the vendorSoldToNumber field to ensure that it's a valid existing vendor number; and if so set vendorSoldToName accordingly.
 
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, processApproveDocument, 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, 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
 

Constructor Detail

VendorRule

public VendorRule()
Method Detail

setupBaseConvenienceObjects

public void setupBaseConvenienceObjects(org.kuali.rice.kns.document.MaintenanceDocument document)
Overrides the setupBaseConvenienceObjects from the superclass because we cannot use the setupBaseConvenienceObjects from the superclass. The reason we cannot use the superclass method is because it calls the updateNonUpdateableReferences for everything and we cannot do that for parent vendors, because we want to update vendor header information only on parent vendors, so the saving of the vendor header is done manually. If we call the updateNonUpdateableReferences, it is going to overwrite any changes that the user might have done in the vendor header with the existing values in the database.

Specified by:
setupBaseConvenienceObjects in interface org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRule
Overrides:
setupBaseConvenienceObjects in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.setupBaseConvenienceObjects(org.kuali.rice.kns.document.MaintenanceDocument)

setupConvenienceObjects

public void setupConvenienceObjects()
Specified by:
setupConvenienceObjects in interface org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRule
Overrides:
setupConvenienceObjects in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.setupConvenienceObjects()

processCustomApproveDocumentBusinessRules

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

processCustomRouteDocumentBusinessRules

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

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)

validateVendorNames

protected boolean validateVendorNames(VendorDetail vendorDetail)
Validates the vendorName, vendorFirstName and vendorLastName fields according to these business rules: 1. At least one of the three vendor name fields must be filled in. 2. Both of the two ways of entering vendor name (One vendor name field vs VendorFirstName/VendorLastName) cannot be used 3. If either the vendor first name or the vendor last name have been entered, the other must be entered.

Parameters:
vendorDetail - The VendorDetail object to be validated
Returns:
boolean true if the vendorDetail passes this validation and false otherwise.

validateVendorSoldToNumber

protected boolean validateVendorSoldToNumber(VendorDetail vendorDetail)
Validates the vendorSoldToNumber field to ensure that it's a valid existing vendor number; and if so set vendorSoldToName accordingly.

Parameters:
document - - the maintenanceDocument being evaluated
Returns:
boolean true if the vendorDetail in the document contains valid vendorSoldToNumber.

processCustomAddCollectionLineBusinessRules

public boolean processCustomAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document,
                                                           String collectionName,
                                                           org.kuali.rice.kns.bo.PersistableBusinessObject bo)
Validates business rules for VendorDetail document collection add lines. Add lines are the initial lines on a collections, i.e. the ones next to the "Add" button

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)

processAddCollectionLineBusinessRules

public boolean processAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument document,
                                                     String collectionName,
                                                     org.kuali.rice.kns.bo.PersistableBusinessObject bo)
Overrides the method in MaintenanceDocumentRuleBase to give error message to the user when the user tries to add a vendor contract when the vendor type of the vendor does not allow contract.

Specified by:
processAddCollectionLineBusinessRules in interface org.kuali.rice.kns.rule.AddCollectionLineRule
Overrides:
processAddCollectionLineBusinessRules in class org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase
See Also:
MaintenanceDocumentRuleBase.processAddCollectionLineBusinessRules(org.kuali.rice.kns.document.MaintenanceDocument, java.lang.String, org.kuali.rice.kns.bo.PersistableBusinessObject)


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