org.kuali.kfs.module.cg.document.validation.impl
Class CGMaintenanceDocumentRuleBase

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.cg.document.validation.impl.CGMaintenanceDocumentRuleBase
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
Direct Known Subclasses:
AwardRule, ProposalRule

public class CGMaintenanceDocumentRuleBase
extends org.kuali.rice.kns.maintenance.rules.MaintenanceDocumentRuleBase

Rules for the Proposal/Award maintenance document.


Field Summary
protected static String AGENCY_TYPE_CODE_FEDERAL
           
protected static String PROJECT_DIRECTOR_DECEASED
           
protected static String[] PROJECT_DIRECTOR_INVALID_STATUSES
           
 
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
CGMaintenanceDocumentRuleBase()
           
 
Method Summary
protected  boolean checkAgencyNotEqualToFederalPassThroughAgency(Agency agency, Agency federalPassThroughAgency, String agencyPropertyName, String fedPassThroughAgencyPropertyName)
          This method checks to see if the two agency values passed in are the same Agency.
protected  boolean checkEndAfterBegin(Date begin, Date end, String propertyName)
          Checks to see if the end date is after the begin date
protected  boolean checkFederalPassThrough(boolean federalPassThroughIndicator, Agency primaryAgency, String federalPassThroughAgencyNumber, Class propertyClass, String federalPassThroughIndicatorFieldName)
          Checks if the required federal pass through fields are filled in if the federal pass through indicator is yes.
protected
<E extends Primaryable>
boolean
checkPrimary(Collection<E> primaryables, Class<E> elementClass, String collectionName, Class<? extends org.kuali.rice.kns.bo.BusinessObject> boClass)
           
protected
<T extends CGProjectDirector>
boolean
checkProjectDirectorsAreDirectors(List<T> projectDirectors, Class<T> elementClass, String collectionName)
           
protected
<T extends CGProjectDirector>
boolean
checkProjectDirectorsExist(List<T> projectDirectors, Class<T> elementClass, String collectionName)
           
protected
<T extends CGProjectDirector>
boolean
checkProjectDirectorsStatuses(List<T> projectDirectors, Class<T> elementClass, String propertyName)
          This method takes in a collection of ProjectDirectors and reviews them to see if any have invalid states for being added to a Proposal.
 
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, processCustomAddCollectionLineBusinessRules, processCustomApproveDocumentBusinessRules, processCustomRouteDocumentBusinessRules, processCustomSaveDocumentBusinessRules, 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

PROJECT_DIRECTOR_DECEASED

protected static final String PROJECT_DIRECTOR_DECEASED
See Also:
Constant Field Values

PROJECT_DIRECTOR_INVALID_STATUSES

protected static final String[] PROJECT_DIRECTOR_INVALID_STATUSES

AGENCY_TYPE_CODE_FEDERAL

protected static final String AGENCY_TYPE_CODE_FEDERAL
See Also:
Constant Field Values
Constructor Detail

CGMaintenanceDocumentRuleBase

public CGMaintenanceDocumentRuleBase()
Method Detail

checkEndAfterBegin

protected boolean checkEndAfterBegin(Date begin,
                                     Date end,
                                     String propertyName)
Checks to see if the end date is after the begin date

Parameters:
begin -
end -
propertyName -
Returns:
true if end is after begin, false otherwise

checkPrimary

protected <E extends Primaryable> boolean checkPrimary(Collection<E> primaryables,
                                                       Class<E> elementClass,
                                                       String collectionName,
                                                       Class<? extends org.kuali.rice.kns.bo.BusinessObject> boClass)
Type Parameters:
E -
Parameters:
primaryables -
elementClass -
collectionName -
boClass -
Returns:

checkProjectDirectorsExist

protected <T extends CGProjectDirector> boolean checkProjectDirectorsExist(List<T> projectDirectors,
                                                                           Class<T> elementClass,
                                                                           String collectionName)
Type Parameters:
T -
Parameters:
projectDirectors -
elementClass -
collectionName -
Returns:

checkProjectDirectorsAreDirectors

protected <T extends CGProjectDirector> boolean checkProjectDirectorsAreDirectors(List<T> projectDirectors,
                                                                                  Class<T> elementClass,
                                                                                  String collectionName)
Type Parameters:
T -
Parameters:
projectDirectors -
elementClass -
collectionName -
Returns:

checkProjectDirectorsStatuses

protected <T extends CGProjectDirector> boolean checkProjectDirectorsStatuses(List<T> projectDirectors,
                                                                              Class<T> elementClass,
                                                                              String propertyName)
This method takes in a collection of ProjectDirectors and reviews them to see if any have invalid states for being added to a Proposal. An example would be a status code of "D" which means "Deceased". Project Directors with a status of "D" cannot be added to a Proposal or Award.

Parameters:
projectDirectors - Collection of project directors to be reviewed.
elementClass - Type of object that the collection belongs to.
propertyName - Name of field that error will be attached to.
Returns:
True if all the project directors have valid statuses, false otherwise.

checkAgencyNotEqualToFederalPassThroughAgency

protected boolean checkAgencyNotEqualToFederalPassThroughAgency(Agency agency,
                                                                Agency federalPassThroughAgency,
                                                                String agencyPropertyName,
                                                                String fedPassThroughAgencyPropertyName)
This method checks to see if the two agency values passed in are the same Agency. The agency for a C&G document cannot be the same as the Federal Pass Through Agency for that same document.

Parameters:
agency -
federalPassThroughAgency -
agencyPropertyName -
Returns:
True if the agencies are not the same, false otherwise.

checkFederalPassThrough

protected boolean checkFederalPassThrough(boolean federalPassThroughIndicator,
                                          Agency primaryAgency,
                                          String federalPassThroughAgencyNumber,
                                          Class propertyClass,
                                          String federalPassThroughIndicatorFieldName)
Checks if the required federal pass through fields are filled in if the federal pass through indicator is yes.

Returns:
True if all the necessary rules regarding the federal pass through agency input fields are met, false otherwise.


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