0001: /*
0002: * Copyright 2006-2007 The Kuali Foundation.
0003: *
0004: * Licensed under the Educational Community License, Version 1.0 (the "License");
0005: * you may not use this file except in compliance with the License.
0006: * You may obtain a copy of the License at
0007: *
0008: * http://www.opensource.org/licenses/ecl1.php
0009: *
0010: * Unless required by applicable law or agreed to in writing, software
0011: * distributed under the License is distributed on an "AS IS" BASIS,
0012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013: * See the License for the specific language governing permissions and
0014: * limitations under the License.
0015: */
0016:
0017: package org.kuali.module.kra.routingform.document;
0018:
0019: import java.sql.Date;
0020: import java.util.ArrayList;
0021: import java.util.LinkedHashMap;
0022: import java.util.List;
0023:
0024: import org.apache.commons.lang.StringUtils;
0025: import org.kuali.core.bo.Campus;
0026: import org.kuali.core.bo.user.AuthenticationUserId;
0027: import org.kuali.core.bo.user.UniversalUser;
0028: import org.kuali.core.exceptions.UserNotFoundException;
0029: import org.kuali.core.service.BusinessObjectService;
0030: import org.kuali.core.service.DateTimeService;
0031: import org.kuali.core.service.PersistenceService;
0032: import org.kuali.core.service.UniversalUserService;
0033: import org.kuali.core.util.KualiInteger;
0034: import org.kuali.core.util.ObjectUtils;
0035: import org.kuali.core.util.TypedArrayList;
0036: import org.kuali.core.workflow.DocumentInitiator;
0037: import org.kuali.core.workflow.KualiDocumentXmlMaterializer;
0038: import org.kuali.core.workflow.KualiTransactionalDocumentInformation;
0039: import org.kuali.kfs.KFSPropertyConstants;
0040: import org.kuali.kfs.context.SpringContext;
0041: import org.kuali.kfs.service.ParameterService;
0042: import org.kuali.module.cg.bo.Agency;
0043: import org.kuali.module.cg.bo.Cfda;
0044: import org.kuali.module.chart.service.ChartUserService;
0045: import org.kuali.module.kra.KraConstants;
0046: import org.kuali.module.kra.bo.AdhocOrg;
0047: import org.kuali.module.kra.bo.AdhocPerson;
0048: import org.kuali.module.kra.budget.bo.Budget;
0049: import org.kuali.module.kra.document.ResearchDocumentBase;
0050: import org.kuali.module.kra.routingform.bo.ContractGrantProposal;
0051: import org.kuali.module.kra.routingform.bo.Purpose;
0052: import org.kuali.module.kra.routingform.bo.ResearchTypeCode;
0053: import org.kuali.module.kra.routingform.bo.RoutingFormAgency;
0054: import org.kuali.module.kra.routingform.bo.RoutingFormBudget;
0055: import org.kuali.module.kra.routingform.bo.RoutingFormInstitutionCostShare;
0056: import org.kuali.module.kra.routingform.bo.RoutingFormKeyword;
0057: import org.kuali.module.kra.routingform.bo.RoutingFormOrganization;
0058: import org.kuali.module.kra.routingform.bo.RoutingFormOrganizationCreditPercent;
0059: import org.kuali.module.kra.routingform.bo.RoutingFormOtherCostShare;
0060: import org.kuali.module.kra.routingform.bo.RoutingFormPersonRole;
0061: import org.kuali.module.kra.routingform.bo.RoutingFormPersonnel;
0062: import org.kuali.module.kra.routingform.bo.RoutingFormProjectType;
0063: import org.kuali.module.kra.routingform.bo.RoutingFormPurpose;
0064: import org.kuali.module.kra.routingform.bo.RoutingFormQuestion;
0065: import org.kuali.module.kra.routingform.bo.RoutingFormResearchRisk;
0066: import org.kuali.module.kra.routingform.bo.RoutingFormResearchTypeCode;
0067: import org.kuali.module.kra.routingform.bo.RoutingFormStatus;
0068: import org.kuali.module.kra.routingform.bo.RoutingFormSubcontractor;
0069: import org.kuali.module.kra.routingform.bo.RoutingFormSubmissionType;
0070: import org.kuali.module.kra.routingform.bo.SubmissionType;
0071: import org.kuali.module.kra.routingform.service.RoutingFormMainPageService;
0072: import org.kuali.module.kra.routingform.service.RoutingFormProjectDetailsService;
0073: import org.kuali.module.kra.routingform.service.RoutingFormResearchRiskService;
0074: import org.kuali.module.kra.routingform.service.RoutingFormService;
0075:
0076: /**
0077: *
0078: */
0079: public class RoutingFormDocument extends ResearchDocumentBase {
0080:
0081: private boolean agencyAdditionalShippingInstructionsIndicator;
0082: private boolean agencyFederalPassThroughNotAvailableIndicator;
0083: private String agencyFederalPassThroughNumber;
0084: private String grantNumber;
0085: private String routingFormAnnouncementNumber;
0086: private String routingFormBudgetNumber;
0087: private boolean routingFormConflictOfInterestCurrentIndicator;
0088: private boolean routingFormConflictOfInterestExistsIndicator;
0089: private boolean routingFormCoProjectDirectorIndicator;
0090: private boolean routingFormCreditPercentIndicator;
0091: private Date routingFormCreateDate;
0092: private boolean routingFormCostShareIndicator;
0093: private boolean routingFormFederalPassThroughIndicator;
0094: private String routingFormFellowFirstName;
0095: private String routingFormFellowEmailAddress;
0096: private String routingFormFellowFullName;
0097: private String routingFormFellowLastName;
0098: private String routingFormLayDescription;
0099: private Date routingFormLastUpdateDate;
0100: private Long routingFormLastUpdateUniversalIdentifier;
0101: private boolean routingFormOtherOrganizationIndicator;
0102: private String routingFormOtherPurposeDescription;
0103: private String routingFormOtherTypeDescription;
0104: private String routingFormParentNumber;
0105: private String routingFormPhysicalCampusCode;
0106: private String routingFormPriorGrantNumber;
0107: private String routingFormProjectTitle;
0108: private String routingFormPurposeCode;
0109: private String routingFormSpaceRequiredDescription;
0110: private boolean routingFormSpaceRequiredIndicator;
0111: private String routingFormStatusCode;
0112: private boolean routingFormSubcontractorIndicator;
0113: private String institutionAccountNumber;
0114: private String researchTypeCode;
0115: private String submissionTypeCode;
0116: private String previousFederalIdentifier;
0117: private String federalIdentifier;
0118: private String grantsGovernmentConfirmationNumber;
0119: private boolean grantsGovernmentSubmissionIndicator;
0120: private String projectAbstract;
0121: private Integer creditPercentNextSequenceNumber;
0122: private Integer institutionCostShareNextSequenceNumber;
0123: private Integer otherCostShareNextSequenceNumber;
0124: private Integer projectDirectorNextSequenceNumber;
0125: private Integer subcontractorNextSequenceNumber;
0126: private Integer personnelNextSequenceNumber;
0127: private boolean routingFormAgencyToBeNamedIndicator;
0128: private String routingFormCatalogOfFederalDomesticAssistanceNumber;
0129: private String projectTypeOtherDescription;
0130:
0131: private Campus routingFormPhysicalCampus;
0132: private RoutingFormStatus routingFormStatus;
0133: private Purpose purpose;
0134: private RoutingFormAgency routingFormAgency;
0135: private Cfda cfda;
0136: private List<RoutingFormResearchRisk> routingFormResearchRisks;
0137: private List<RoutingFormKeyword> routingFormKeywords;
0138: private RoutingFormBudget routingFormBudget;
0139: private ResearchTypeCode researchType;
0140: private SubmissionType submissionType;
0141: private ContractGrantProposal contractGrantProposal;
0142: private List<RoutingFormInstitutionCostShare> routingFormInstitutionCostShares;
0143: private List<RoutingFormOtherCostShare> routingFormOtherCostShares;
0144: private List<RoutingFormSubcontractor> routingFormSubcontractors;
0145: private Agency federalPassThroughAgency;
0146: private List<RoutingFormPersonnel> routingFormPersonnel;
0147: private List<RoutingFormOrganizationCreditPercent> routingFormOrganizationCreditPercents;
0148: private List<RoutingFormQuestion> routingFormQuestions;
0149: private List<RoutingFormOrganization> routingFormOrganizations;
0150: private List<RoutingFormSubmissionType> routingFormSubmissionTypes;
0151: private List<RoutingFormResearchTypeCode> routingFormResearchTypeCodes;
0152: private List<RoutingFormPurpose> routingFormPurposes;
0153: private List<RoutingFormProjectType> routingFormProjectTypes;
0154: private List<RoutingFormPersonRole> routingFormPersonRoles;
0155: // for budget document number ajax
0156: private Budget budget;
0157:
0158: /**
0159: * Default constructor.
0160: */
0161: public RoutingFormDocument() {
0162: super ();
0163:
0164: creditPercentNextSequenceNumber = new Integer(1);
0165: institutionCostShareNextSequenceNumber = new Integer(1);
0166: otherCostShareNextSequenceNumber = new Integer(1);
0167: projectDirectorNextSequenceNumber = new Integer(1);
0168: subcontractorNextSequenceNumber = new Integer(1);
0169: personnelNextSequenceNumber = new Integer(1);
0170:
0171: routingFormResearchRisks = new ArrayList<RoutingFormResearchRisk>();
0172: routingFormKeywords = new TypedArrayList(
0173: RoutingFormKeyword.class);
0174: routingFormInstitutionCostShares = new ArrayList<RoutingFormInstitutionCostShare>();
0175: routingFormOtherCostShares = new ArrayList<RoutingFormOtherCostShare>();
0176: routingFormSubcontractors = new ArrayList<RoutingFormSubcontractor>();
0177: routingFormPersonnel = new TypedArrayList(
0178: RoutingFormPersonnel.class);
0179: routingFormOrganizationCreditPercents = new TypedArrayList(
0180: RoutingFormOrganizationCreditPercent.class);
0181: routingFormQuestions = new ArrayList<RoutingFormQuestion>();
0182: routingFormOrganizations = new ArrayList<RoutingFormOrganization>();
0183: routingFormSubmissionTypes = new TypedArrayList(
0184: RoutingFormSubmissionType.class);
0185: routingFormResearchTypeCodes = new TypedArrayList(
0186: RoutingFormResearchTypeCode.class);
0187: routingFormPurposes = new TypedArrayList(
0188: RoutingFormPurpose.class);
0189: routingFormProjectTypes = new TypedArrayList(
0190: RoutingFormProjectType.class);
0191: routingFormPersonRoles = new TypedArrayList(
0192: RoutingFormPersonRole.class);
0193: }
0194:
0195: public void initialize() {
0196: this .setRoutingFormCreateDate(SpringContext.getBean(
0197: DateTimeService.class).getCurrentSqlDate());
0198:
0199: SpringContext.getBean(RoutingFormMainPageService.class)
0200: .setupMainPageMaintainables(this );
0201: }
0202:
0203: @Override
0204: public void handleRouteStatusChange() {
0205: super .handleRouteStatusChange();
0206:
0207: if (super .getDocumentHeader().getWorkflowDocument()
0208: .stateIsProcessed()) {
0209: this .refreshReferenceObject("contractGrantProposal");
0210: if (this .getContractGrantProposal().getProposalNumber() == null) {
0211: boolean createProposal = false;
0212: for (RoutingFormProjectType routingFormProjectType : this
0213: .getRoutingFormProjectTypes()) {
0214: if (routingFormProjectType
0215: .isProjectTypeSelectedIndicator()
0216: && SpringContext
0217: .getBean(ParameterService.class)
0218: .getParameterEvaluator(
0219: getClass(),
0220: KraConstants.CREATE_PROPOSAL_PROJECT_TYPES,
0221: routingFormProjectType
0222: .getProjectTypeCode())
0223: .evaluationSucceeds()) {
0224: createProposal = true;
0225: break;
0226: }
0227: }
0228:
0229: if (createProposal) {
0230: Long newProposalNumber = SpringContext.getBean(
0231: RoutingFormService.class)
0232: .createAndRouteProposalMaintenanceDocument(
0233: this );
0234:
0235: this .getContractGrantProposal().setProposalNumber(
0236: newProposalNumber);
0237: SpringContext.getBean(BusinessObjectService.class)
0238: .save(this .getContractGrantProposal());
0239: }
0240:
0241: }
0242: }
0243: }
0244:
0245: /**
0246: * Ensures required fields for supporting objects are properly set since we don't use transient objects.
0247: */
0248: @Override
0249: public void prepareForSave() {
0250: super .prepareForSave();
0251:
0252: String documentNumber = this .getDocumentHeader()
0253: .getDocumentNumber();
0254:
0255: this .getContractGrantProposal().setDocumentNumber(
0256: documentNumber);
0257: this .getRoutingFormAgency().setDocumentNumber(documentNumber);
0258: this .getRoutingFormBudget().setDocumentNumber(documentNumber);
0259:
0260: // Setup research risks if this is the first save
0261: if (this .routingFormResearchRisks.isEmpty()) {
0262: SpringContext.getBean(RoutingFormResearchRiskService.class)
0263: .setupResearchRisks(this );
0264: }
0265:
0266: // Setup project details questions if this is the first save
0267: if (this .routingFormQuestions.isEmpty()) {
0268: SpringContext.getBean(
0269: RoutingFormProjectDetailsService.class)
0270: .setupOtherProjectDetailsQuestions(this );
0271: }
0272: }
0273:
0274: /**
0275: * Gets the agencyAdditionalShippingInstructionsIndicator attribute.
0276: *
0277: * @return Returns the agencyAdditionalShippingInstructionsIndicator
0278: */
0279: public boolean getAgencyAdditionalShippingInstructionsIndicator() {
0280: return agencyAdditionalShippingInstructionsIndicator;
0281: }
0282:
0283: /**
0284: * Sets the agencyAdditionalShippingInstructionsIndicator attribute.
0285: *
0286: * @param agencyAdditionalShippingInstructionsIndicator The agencyAdditionalShippingInstructionsIndicator to set.
0287: */
0288: public void setAgencyAdditionalShippingInstructionsIndicator(
0289: boolean agencyAdditionalShippingInstructionsIndicator) {
0290: this .agencyAdditionalShippingInstructionsIndicator = agencyAdditionalShippingInstructionsIndicator;
0291: }
0292:
0293: /**
0294: * Gets the agencyFederalPassThroughNotAvailableIndicator attribute.
0295: *
0296: * @return Returns the agencyFederalPassThroughNotAvailableIndicator
0297: */
0298: public boolean getAgencyFederalPassThroughNotAvailableIndicator() {
0299: return agencyFederalPassThroughNotAvailableIndicator;
0300: }
0301:
0302: /**
0303: * Sets the agencyFederalPassThroughNotAvailableIndicator attribute.
0304: *
0305: * @param agencyFederalPassThroughNotAvailableIndicator The agencyFederalPassThroughNotAvailableIndicator to set.
0306: */
0307: public void setAgencyFederalPassThroughNotAvailableIndicator(
0308: boolean agencyFederalPassThroughNotAvailableIndicator) {
0309: this .agencyFederalPassThroughNotAvailableIndicator = agencyFederalPassThroughNotAvailableIndicator;
0310: }
0311:
0312: /**
0313: * Gets the agencyFederalPassThroughNumber attribute.
0314: *
0315: * @return Returns the agencyFederalPassThroughNumber
0316: */
0317: public String getAgencyFederalPassThroughNumber() {
0318: return agencyFederalPassThroughNumber;
0319: }
0320:
0321: /**
0322: * Sets the agencyFederalPassThroughNumber attribute.
0323: *
0324: * @param agencyFederalPassThroughNumber The agencyFederalPassThroughNumber to set.
0325: */
0326: public void setAgencyFederalPassThroughNumber(
0327: String agencyFederalPassThroughNumber) {
0328: this .agencyFederalPassThroughNumber = agencyFederalPassThroughNumber;
0329: }
0330:
0331: /**
0332: * Gets the grantNumber attribute.
0333: *
0334: * @return Returns the grantNumber
0335: */
0336: public String getGrantNumber() {
0337: return grantNumber;
0338: }
0339:
0340: /**
0341: * Sets the grantNumber attribute.
0342: *
0343: * @param grantNumber The grantNumber to set.
0344: */
0345: public void setGrantNumber(String grantNumber) {
0346: this .grantNumber = grantNumber;
0347: }
0348:
0349: /**
0350: * Gets the routingFormAnnouncementNumber attribute.
0351: *
0352: * @return Returns the routingFormAnnouncementNumber
0353: */
0354: public String getRoutingFormAnnouncementNumber() {
0355: return routingFormAnnouncementNumber;
0356: }
0357:
0358: /**
0359: * Sets the routingFormAnnouncementNumber attribute.
0360: *
0361: * @param routingFormAnnouncementNumber The routingFormAnnouncementNumber to set.
0362: */
0363: public void setRoutingFormAnnouncementNumber(
0364: String routingFormAnnouncementNumber) {
0365: this .routingFormAnnouncementNumber = routingFormAnnouncementNumber;
0366: }
0367:
0368: /**
0369: * Gets the routingFormBudgetNumber attribute.
0370: *
0371: * @return Returns the routingFormBudgetNumber
0372: */
0373: public String getRoutingFormBudgetNumber() {
0374: return routingFormBudgetNumber;
0375: }
0376:
0377: /**
0378: * Sets the routingFormBudgetNumber attribute.
0379: *
0380: * @param routingFormBudgetNumber The routingFormBudgetNumber to set.
0381: */
0382: public void setRoutingFormBudgetNumber(
0383: String routingFormBudgetNumber) {
0384: this .routingFormBudgetNumber = routingFormBudgetNumber;
0385: }
0386:
0387: /**
0388: * Gets the routingFormConflictOfInterestCurrentIndicator attribute.
0389: *
0390: * @return Returns the routingFormConflictOfInterestCurrentIndicator
0391: */
0392: public boolean getRoutingFormConflictOfInterestCurrentIndicator() {
0393: return routingFormConflictOfInterestCurrentIndicator;
0394: }
0395:
0396: /**
0397: * Sets the routingFormConflictOfInterestCurrentIndicator attribute.
0398: *
0399: * @param routingFormConflictOfInterestCurrentIndicator The routingFormConflictOfInterestCurrentIndicator to set.
0400: */
0401: public void setRoutingFormConflictOfInterestCurrentIndicator(
0402: boolean routingFormConflictOfInterestCurrentIndicator) {
0403: this .routingFormConflictOfInterestCurrentIndicator = routingFormConflictOfInterestCurrentIndicator;
0404: }
0405:
0406: /**
0407: * Gets the routingFormConflictOfInterestExistsIndicator attribute.
0408: *
0409: * @return Returns the routingFormConflictOfInterestExistsIndicator
0410: */
0411: public boolean getRoutingFormConflictOfInterestExistsIndicator() {
0412: return routingFormConflictOfInterestExistsIndicator;
0413: }
0414:
0415: /**
0416: * Sets the routingFormConflictOfInterestExistsIndicator attribute.
0417: *
0418: * @param routingFormConflictOfInterestExistsIndicator The routingFormConflictOfInterestExistsIndicator to set.
0419: */
0420: public void setRoutingFormConflictOfInterestExistsIndicator(
0421: boolean routingFormConflictOfInterestExistsIndicator) {
0422: this .routingFormConflictOfInterestExistsIndicator = routingFormConflictOfInterestExistsIndicator;
0423: }
0424:
0425: /**
0426: * Gets the routingFormCoProjectDirectorIndicator attribute.
0427: *
0428: * @return Returns the routingFormCoProjectDirectorIndicator
0429: */
0430: public boolean getRoutingFormCoProjectDirectorIndicator() {
0431: return routingFormCoProjectDirectorIndicator;
0432: }
0433:
0434: /**
0435: * Sets the routingFormCoProjectDirectorIndicator attribute.
0436: *
0437: * @param routingFormCoProjectDirectorIndicator The routingFormCoProjectDirectorIndicator to set.
0438: */
0439: public void setRoutingFormCoProjectDirectorIndicator(
0440: boolean routingFormCoProjectDirectorIndicator) {
0441: this .routingFormCoProjectDirectorIndicator = routingFormCoProjectDirectorIndicator;
0442: }
0443:
0444: /**
0445: * Gets the routingFormCreditPercentIndicator attribute.
0446: *
0447: * @return Returns the routingFormCreditPercentIndicator
0448: */
0449: public boolean getRoutingFormCreditPercentIndicator() {
0450: return routingFormCreditPercentIndicator;
0451: }
0452:
0453: /**
0454: * Sets the routingFormCreditPercentIndicator attribute.
0455: *
0456: * @param routingFormCreditPercentIndicator The routingFormCreditPercentIndicator to set.
0457: */
0458: public void setRoutingFormCreditPercentIndicator(
0459: boolean routingFormCreditPercentIndicator) {
0460: this .routingFormCreditPercentIndicator = routingFormCreditPercentIndicator;
0461: }
0462:
0463: /**
0464: * Gets the routingFormCreateDate attribute.
0465: *
0466: * @return Returns the routingFormCreateDate
0467: */
0468: public Date getRoutingFormCreateDate() {
0469: return routingFormCreateDate;
0470: }
0471:
0472: /**
0473: * Sets the routingFormCreateDate attribute.
0474: *
0475: * @param routingFormCreateDate The routingFormCreateDate to set.
0476: */
0477: public void setRoutingFormCreateDate(Date routingFormCreateDate) {
0478: this .routingFormCreateDate = routingFormCreateDate;
0479: }
0480:
0481: /**
0482: * Gets the routingFormCostShareIndicator attribute.
0483: *
0484: * @return Returns the routingFormCostShareIndicator
0485: */
0486: public boolean getRoutingFormCostShareIndicator() {
0487: return routingFormCostShareIndicator;
0488: }
0489:
0490: /**
0491: * Sets the routingFormCostShareIndicator attribute.
0492: *
0493: * @param routingFormCostShareIndicator The routingFormCostShareIndicator to set.
0494: */
0495: public void setRoutingFormCostShareIndicator(
0496: boolean routingFormCostShareIndicator) {
0497: this .routingFormCostShareIndicator = routingFormCostShareIndicator;
0498: }
0499:
0500: /**
0501: * Gets the routingFormFederalPassThroughIndicator attribute.
0502: *
0503: * @return Returns the routingFormFederalPassThroughIndicator
0504: */
0505: public boolean getRoutingFormFederalPassThroughIndicator() {
0506: return routingFormFederalPassThroughIndicator;
0507: }
0508:
0509: /**
0510: * Sets the routingFormFederalPassThroughIndicator attribute.
0511: *
0512: * @param routingFormFederalPassThroughIndicator The routingFormFederalPassThroughIndicator to set.
0513: */
0514: public void setRoutingFormFederalPassThroughIndicator(
0515: boolean routingFormFederalPassThroughIndicator) {
0516: this .routingFormFederalPassThroughIndicator = routingFormFederalPassThroughIndicator;
0517: }
0518:
0519: /**
0520: * Gets the routingFormFellowFirstName attribute.
0521: *
0522: * @return Returns the routingFormFellowFirstName
0523: */
0524: public String getRoutingFormFellowFirstName() {
0525: return routingFormFellowFirstName;
0526: }
0527:
0528: /**
0529: * Sets the routingFormFellowFirstName attribute.
0530: *
0531: * @param routingFormFellowFirstName The routingFormFellowFirstName to set.
0532: */
0533: public void setRoutingFormFellowFirstName(
0534: String routingFormFellowFirstName) {
0535: this .routingFormFellowFirstName = routingFormFellowFirstName;
0536: }
0537:
0538: /**
0539: * Gets the routingFormFellowEmailAddress attribute.
0540: *
0541: * @return Returns the routingFormFellowEmailAddress
0542: */
0543: public String getRoutingFormFellowEmailAddress() {
0544: return routingFormFellowEmailAddress;
0545: }
0546:
0547: /**
0548: * Sets the routingFormFellowEmailAddress attribute.
0549: *
0550: * @param routingFormFellowEmailAddress The routingFormFellowEmailAddress to set.
0551: */
0552: public void setRoutingFormFellowEmailAddress(
0553: String routingFormFellowEmailAddress) {
0554: this .routingFormFellowEmailAddress = routingFormFellowEmailAddress;
0555: }
0556:
0557: /**
0558: * Gets the routingFormFellowFullName attribute.
0559: *
0560: * @return Returns the routingFormFellowFullName
0561: */
0562: public String getRoutingFormFellowFullName() {
0563: return routingFormFellowFullName;
0564: }
0565:
0566: /**
0567: * Sets the routingFormFellowFullName attribute.
0568: *
0569: * @param routingFormFellowFullName The routingFormFellowFullName to set.
0570: */
0571: public void setRoutingFormFellowFullName(
0572: String routingFormFellowFullName) {
0573: this .routingFormFellowFullName = routingFormFellowFullName;
0574: }
0575:
0576: /**
0577: * Gets the routingFormFellowLastName attribute.
0578: *
0579: * @return Returns the routingFormFellowLastName
0580: */
0581: public String getRoutingFormFellowLastName() {
0582: return routingFormFellowLastName;
0583: }
0584:
0585: /**
0586: * Sets the routingFormFellowLastName attribute.
0587: *
0588: * @param routingFormFellowLastName The routingFormFellowLastName to set.
0589: */
0590: public void setRoutingFormFellowLastName(
0591: String routingFormFellowLastName) {
0592: this .routingFormFellowLastName = routingFormFellowLastName;
0593: }
0594:
0595: /**
0596: * Gets the routingFormLayDescription attribute.
0597: *
0598: * @return Returns the routingFormLayDescription
0599: */
0600: public String getRoutingFormLayDescription() {
0601: return routingFormLayDescription;
0602: }
0603:
0604: /**
0605: * Sets the routingFormLayDescription attribute.
0606: *
0607: * @param routingFormLayDescription The routingFormLayDescription to set.
0608: */
0609: public void setRoutingFormLayDescription(
0610: String routingFormLayDescription) {
0611: this .routingFormLayDescription = routingFormLayDescription;
0612: }
0613:
0614: /**
0615: * Gets the routingFormLastUpdateDate attribute.
0616: *
0617: * @return Returns the routingFormLastUpdateDate
0618: */
0619: public Date getRoutingFormLastUpdateDate() {
0620: return routingFormLastUpdateDate;
0621: }
0622:
0623: /**
0624: * Sets the routingFormLastUpdateDate attribute.
0625: *
0626: * @param routingFormLastUpdateDate The routingFormLastUpdateDate to set.
0627: */
0628: public void setRoutingFormLastUpdateDate(
0629: Date routingFormLastUpdateDate) {
0630: this .routingFormLastUpdateDate = routingFormLastUpdateDate;
0631: }
0632:
0633: /**
0634: * Gets the routingFormLastUpdateUniversalIdentifier attribute.
0635: *
0636: * @return Returns the routingFormLastUpdateUniversalIdentifier
0637: */
0638: public Long getRoutingFormLastUpdateUniversalIdentifier() {
0639: return routingFormLastUpdateUniversalIdentifier;
0640: }
0641:
0642: /**
0643: * Sets the routingFormLastUpdateUniversalIdentifier attribute.
0644: *
0645: * @param routingFormLastUpdateUniversalIdentifier The routingFormLastUpdateUniversalIdentifier to set.
0646: */
0647: public void setRoutingFormLastUpdateUniversalIdentifier(
0648: Long routingFormLastUpdateUniversalIdentifier) {
0649: this .routingFormLastUpdateUniversalIdentifier = routingFormLastUpdateUniversalIdentifier;
0650: }
0651:
0652: /**
0653: * Gets the routingFormOtherOrganizationIndicator attribute.
0654: *
0655: * @return Returns the routingFormOtherOrganizationIndicator
0656: */
0657: public boolean getRoutingFormOtherOrganizationIndicator() {
0658: return routingFormOtherOrganizationIndicator;
0659: }
0660:
0661: /**
0662: * Sets the routingFormOtherOrganizationIndicator attribute.
0663: *
0664: * @param routingFormOtherOrganizationIndicator The routingFormOtherOrganizationIndicator to set.
0665: */
0666: public void setRoutingFormOtherOrganizationIndicator(
0667: boolean routingFormOtherOrganizationIndicator) {
0668: this .routingFormOtherOrganizationIndicator = routingFormOtherOrganizationIndicator;
0669: }
0670:
0671: /**
0672: * Gets the routingFormOtherPurposeDescription attribute.
0673: *
0674: * @return Returns the routingFormOtherPurposeDescription
0675: */
0676: public String getRoutingFormOtherPurposeDescription() {
0677: return routingFormOtherPurposeDescription;
0678: }
0679:
0680: /**
0681: * Sets the routingFormOtherPurposeDescription attribute.
0682: *
0683: * @param routingFormOtherPurposeDescription The routingFormOtherPurposeDescription to set.
0684: */
0685: public void setRoutingFormOtherPurposeDescription(
0686: String routingFormOtherPurposeDescription) {
0687: this .routingFormOtherPurposeDescription = routingFormOtherPurposeDescription;
0688: }
0689:
0690: /**
0691: * Gets the routingFormOtherTypeDescription attribute.
0692: *
0693: * @return Returns the routingFormOtherTypeDescription
0694: */
0695: public String getRoutingFormOtherTypeDescription() {
0696: return routingFormOtherTypeDescription;
0697: }
0698:
0699: /**
0700: * Sets the routingFormOtherTypeDescription attribute.
0701: *
0702: * @param routingFormOtherTypeDescription The routingFormOtherTypeDescription to set.
0703: */
0704: public void setRoutingFormOtherTypeDescription(
0705: String routingFormOtherTypeDescription) {
0706: this .routingFormOtherTypeDescription = routingFormOtherTypeDescription;
0707: }
0708:
0709: /**
0710: * Gets the routingFormParentNumber attribute.
0711: *
0712: * @return Returns the routingFormParentNumber
0713: */
0714: public String getRoutingFormParentNumber() {
0715: return routingFormParentNumber;
0716: }
0717:
0718: /**
0719: * Sets the routingFormParentNumber attribute.
0720: *
0721: * @param routingFormParentNumber The routingFormParentNumber to set.
0722: */
0723: public void setRoutingFormParentNumber(
0724: String routingFormParentNumber) {
0725: this .routingFormParentNumber = routingFormParentNumber;
0726: }
0727:
0728: /**
0729: * Gets the routingFormPhysicalCampusCode attribute.
0730: *
0731: * @return Returns the routingFormPhysicalCampusCode
0732: */
0733: public String getRoutingFormPhysicalCampusCode() {
0734: return routingFormPhysicalCampusCode;
0735: }
0736:
0737: /**
0738: * Sets the routingFormPhysicalCampusCode attribute.
0739: *
0740: * @param routingFormPhysicalCampusCode The routingFormPhysicalCampusCode to set.
0741: */
0742: public void setRoutingFormPhysicalCampusCode(
0743: String routingFormPhysicalCampusCode) {
0744: this .routingFormPhysicalCampusCode = routingFormPhysicalCampusCode;
0745: }
0746:
0747: /**
0748: * Gets the routingFormPriorGrantNumber attribute.
0749: *
0750: * @return Returns the routingFormPriorGrantNumber
0751: */
0752: public String getRoutingFormPriorGrantNumber() {
0753: return routingFormPriorGrantNumber;
0754: }
0755:
0756: /**
0757: * Sets the routingFormPriorGrantNumber attribute.
0758: *
0759: * @param routingFormPriorGrantNumber The routingFormPriorGrantNumber to set.
0760: */
0761: public void setRoutingFormPriorGrantNumber(
0762: String routingFormPriorGrantNumber) {
0763: this .routingFormPriorGrantNumber = routingFormPriorGrantNumber;
0764: }
0765:
0766: /**
0767: * Gets the routingFormProjectTitle attribute.
0768: *
0769: * @return Returns the routingFormProjectTitle
0770: */
0771: public String getRoutingFormProjectTitle() {
0772: return routingFormProjectTitle;
0773: }
0774:
0775: /**
0776: * Sets the routingFormProjectTitle attribute.
0777: *
0778: * @param routingFormProjectTitle The routingFormProjectTitle to set.
0779: */
0780: public void setRoutingFormProjectTitle(
0781: String routingFormProjectTitle) {
0782: this .routingFormProjectTitle = routingFormProjectTitle;
0783: }
0784:
0785: /**
0786: * Gets the routingFormPurposeCode attribute.
0787: *
0788: * @return Returns the routingFormPurposeCode
0789: */
0790: public String getRoutingFormPurposeCode() {
0791: return routingFormPurposeCode;
0792: }
0793:
0794: /**
0795: * Sets the routingFormPurposeCode attribute.
0796: *
0797: * @param routingFormPurposeCode The routingFormPurposeCode to set.
0798: */
0799: public void setRoutingFormPurposeCode(String routingFormPurposeCode) {
0800: this .routingFormPurposeCode = routingFormPurposeCode;
0801: }
0802:
0803: /**
0804: * Gets the routingFormSpaceRequiredDescription attribute.
0805: *
0806: * @return Returns the routingFormSpaceRequiredDescription
0807: */
0808: public String getRoutingFormSpaceRequiredDescription() {
0809: return routingFormSpaceRequiredDescription;
0810: }
0811:
0812: /**
0813: * Sets the routingFormSpaceRequiredDescription attribute.
0814: *
0815: * @param routingFormSpaceRequiredDescription The routingFormSpaceRequiredDescription to set.
0816: */
0817: public void setRoutingFormSpaceRequiredDescription(
0818: String routingFormSpaceRequiredDescription) {
0819: this .routingFormSpaceRequiredDescription = routingFormSpaceRequiredDescription;
0820: }
0821:
0822: /**
0823: * Gets the routingFormSpaceRequiredIndicator attribute.
0824: *
0825: * @return Returns the routingFormSpaceRequiredIndicator
0826: */
0827: public boolean getRoutingFormSpaceRequiredIndicator() {
0828: return routingFormSpaceRequiredIndicator;
0829: }
0830:
0831: /**
0832: * Sets the routingFormSpaceRequiredIndicator attribute.
0833: *
0834: * @param routingFormSpaceRequiredIndicator The routingFormSpaceRequiredIndicator to set.
0835: */
0836: public void setRoutingFormSpaceRequiredIndicator(
0837: boolean routingFormSpaceRequiredIndicator) {
0838: this .routingFormSpaceRequiredIndicator = routingFormSpaceRequiredIndicator;
0839: }
0840:
0841: /**
0842: * Gets the routingFormStatusCode attribute.
0843: *
0844: * @return Returns the routingFormStatusCode
0845: */
0846: public String getRoutingFormStatusCode() {
0847: return routingFormStatusCode;
0848: }
0849:
0850: /**
0851: * Sets the routingFormStatusCode attribute.
0852: *
0853: * @param routingFormStatusCode The routingFormStatusCode to set.
0854: */
0855: public void setRoutingFormStatusCode(String routingFormStatusCode) {
0856: this .routingFormStatusCode = routingFormStatusCode;
0857: }
0858:
0859: /**
0860: * Gets the routingFormSubcontractorIndicator attribute.
0861: *
0862: * @return Returns the routingFormSubcontractorIndicator
0863: */
0864: public boolean getRoutingFormSubcontractorIndicator() {
0865: return routingFormSubcontractorIndicator;
0866: }
0867:
0868: /**
0869: * Sets the routingFormSubcontractorIndicator attribute.
0870: *
0871: * @param routingFormSubcontractorIndicator The routingFormSubcontractorIndicator to set.
0872: */
0873: public void setRoutingFormSubcontractorIndicator(
0874: boolean routingFormSubcontractorIndicator) {
0875: this .routingFormSubcontractorIndicator = routingFormSubcontractorIndicator;
0876: }
0877:
0878: /**
0879: * Gets the institutionAccountNumber attribute.
0880: *
0881: * @return Returns the institutionAccountNumber
0882: */
0883: public String getInstitutionAccountNumber() {
0884: return institutionAccountNumber;
0885: }
0886:
0887: /**
0888: * Sets the institutionAccountNumber attribute.
0889: *
0890: * @param institutionAccountNumber The institutionAccountNumber to set.
0891: */
0892: public void setInstitutionAccountNumber(
0893: String institutionAccountNumber) {
0894: this .institutionAccountNumber = institutionAccountNumber;
0895: }
0896:
0897: /**
0898: * Gets the researchTypeCode attribute.
0899: *
0900: * @return Returns the researchTypeCode
0901: */
0902: public String getResearchTypeCode() {
0903: return researchTypeCode;
0904: }
0905:
0906: /**
0907: * Sets the researchTypeCode attribute.
0908: *
0909: * @param researchTypeCode The researchTypeCode to set.
0910: */
0911: public void setResearchTypeCode(String researchTypeCode) {
0912: this .researchTypeCode = researchTypeCode;
0913: }
0914:
0915: /**
0916: * Gets the submissionTypeCode attribute.
0917: *
0918: * @return Returns the submissionTypeCode
0919: */
0920: public String getSubmissionTypeCode() {
0921: return submissionTypeCode;
0922: }
0923:
0924: /**
0925: * Sets the submissionTypeCode attribute.
0926: *
0927: * @param submissionTypeCode The submissionTypeCode to set.
0928: */
0929: public void setSubmissionTypeCode(String submissionTypeCode) {
0930: this .submissionTypeCode = submissionTypeCode;
0931: }
0932:
0933: /**
0934: * Gets the previousFederalIdentifier attribute.
0935: *
0936: * @return Returns the previousFederalIdentifier
0937: */
0938: public String getPreviousFederalIdentifier() {
0939: return previousFederalIdentifier;
0940: }
0941:
0942: /**
0943: * Sets the previousFederalIdentifier attribute.
0944: *
0945: * @param previousFederalIdentifier The previousFederalIdentifier to set.
0946: */
0947: public void setPreviousFederalIdentifier(
0948: String previousFederalIdentifier) {
0949: this .previousFederalIdentifier = previousFederalIdentifier;
0950: }
0951:
0952: /**
0953: * Gets the routingFormPhysicalCampus attribute.
0954: *
0955: * @return Returns the routingFormPhysicalCampus
0956: */
0957: public Campus getRoutingFormPhysicalCampus() {
0958: return routingFormPhysicalCampus;
0959: }
0960:
0961: /**
0962: * Sets the routingFormPhysicalCampus attribute.
0963: *
0964: * @param routingFormPhysicalCampus The routingFormPhysicalCampus to set.
0965: * @deprecated
0966: */
0967: public void setRoutingFormPhysicalCampus(
0968: Campus routingFormPhysicalCampus) {
0969: this .routingFormPhysicalCampus = routingFormPhysicalCampus;
0970: }
0971:
0972: /**
0973: * Gets the routingFormStatus attribute.
0974: *
0975: * @return Returns the routingFormStatus.
0976: */
0977: public RoutingFormStatus getRoutingFormStatus() {
0978: return routingFormStatus;
0979: }
0980:
0981: /**
0982: * Sets the routingFormStatus attribute value.
0983: *
0984: * @param routingFormStatus The routingFormStatus to set.
0985: * @deprecated
0986: */
0987: public void setRoutingFormStatus(RoutingFormStatus routingFormStatus) {
0988: this .routingFormStatus = routingFormStatus;
0989: }
0990:
0991: /**
0992: * Gets the purpose attribute.
0993: *
0994: * @return Returns the purpose.
0995: */
0996: public Purpose getPurpose() {
0997: return purpose;
0998: }
0999:
1000: /**
1001: * Sets the purpose attribute value.
1002: *
1003: * @param purpose The purpose to set.
1004: * @deprecated
1005: */
1006: public void setPurpose(Purpose purpose) {
1007: this .purpose = purpose;
1008: }
1009:
1010: /**
1011: * Gets the creditPercentNextSequenceNumber attribute.
1012: *
1013: * @return Returns the creditPercentNextSequenceNumber.
1014: */
1015: public Integer getCreditPercentNextSequenceNumber() {
1016: return creditPercentNextSequenceNumber;
1017: }
1018:
1019: /**
1020: * Sets the creditPercentNextSequenceNumber attribute value.
1021: *
1022: * @param creditPercentNextSequenceNumber The creditPercentNextSequenceNumber to set.
1023: */
1024: public void setCreditPercentNextSequenceNumber(
1025: Integer creditPercentNextSequenceNumber) {
1026: this .creditPercentNextSequenceNumber = creditPercentNextSequenceNumber;
1027: }
1028:
1029: /**
1030: * Gets the institutionCostShareNextSequenceNumber attribute.
1031: *
1032: * @return Returns the institutionCostShareNextSequenceNumber.
1033: */
1034: public Integer getInstitutionCostShareNextSequenceNumber() {
1035: return institutionCostShareNextSequenceNumber;
1036: }
1037:
1038: /**
1039: * Sets the institutionCostShareNextSequenceNumber attribute value.
1040: *
1041: * @param institutionCostShareNextSequenceNumber The institutionCostShareNextSequenceNumber to set.
1042: */
1043: public void setInstitutionCostShareNextSequenceNumber(
1044: Integer institutionCostShareNextSequenceNumber) {
1045: this .institutionCostShareNextSequenceNumber = institutionCostShareNextSequenceNumber;
1046: }
1047:
1048: /**
1049: * Gets the otherCostShareNextSequenceNumber attribute.
1050: *
1051: * @return Returns the otherCostShareNextSequenceNumber.
1052: */
1053: public Integer getOtherCostShareNextSequenceNumber() {
1054: return otherCostShareNextSequenceNumber;
1055: }
1056:
1057: /**
1058: * Sets the otherCostShareNextSequenceNumber attribute value.
1059: *
1060: * @param otherCostShareNextSequenceNumber The otherCostShareNextSequenceNumber to set.
1061: */
1062: public void setOtherCostShareNextSequenceNumber(
1063: Integer otherCostShareNextSequenceNumber) {
1064: this .otherCostShareNextSequenceNumber = otherCostShareNextSequenceNumber;
1065: }
1066:
1067: /**
1068: * Gets the projectDirectorNextSequenceNumber attribute.
1069: *
1070: * @return Returns the projectDirectorNextSequenceNumber.
1071: */
1072: public Integer getProjectDirectorNextSequenceNumber() {
1073: return projectDirectorNextSequenceNumber;
1074: }
1075:
1076: /**
1077: * Sets the projectDirectorNextSequenceNumber attribute value.
1078: *
1079: * @param projectDirectorNextSequenceNumber The projectDirectorNextSequenceNumber to set.
1080: */
1081: public void setProjectDirectorNextSequenceNumber(
1082: Integer projectDirectorNextSequenceNumber) {
1083: this .projectDirectorNextSequenceNumber = projectDirectorNextSequenceNumber;
1084: }
1085:
1086: /**
1087: * Gets the subcontractorNextSequenceNumber attribute.
1088: *
1089: * @return Returns the subcontractorNextSequenceNumber.
1090: */
1091: public Integer getSubcontractorNextSequenceNumber() {
1092: return subcontractorNextSequenceNumber;
1093: }
1094:
1095: /**
1096: * Sets the subcontractorNextSequenceNumber attribute value.
1097: *
1098: * @param subcontractorNextSequenceNumber The subcontractorNextSequenceNumber to set.
1099: */
1100: public void setSubcontractorNextSequenceNumber(
1101: Integer subcontractorNextSequenceNumber) {
1102: this .subcontractorNextSequenceNumber = subcontractorNextSequenceNumber;
1103: }
1104:
1105: /**
1106: * Gets the federalIdentifier attribute.
1107: *
1108: * @return Returns the federalIdentifier
1109: */
1110: public String getFederalIdentifier() {
1111: return federalIdentifier;
1112: }
1113:
1114: /**
1115: * Sets the federalIdentifier attribute.
1116: *
1117: * @param federalIdentifier The federalIdentifier to set.
1118: */
1119: public void setFederalIdentifier(String federalIdentifier) {
1120: this .federalIdentifier = federalIdentifier;
1121: }
1122:
1123: /**
1124: * Gets the grantsGovernmentConfirmationNumber attribute.
1125: *
1126: * @return Returns the grantsGovernmentConfirmationNumber
1127: */
1128: public String getGrantsGovernmentConfirmationNumber() {
1129: return grantsGovernmentConfirmationNumber;
1130: }
1131:
1132: /**
1133: * Sets the grantsGovernmentConfirmationNumber attribute.
1134: *
1135: * @param grantsGovernmentConfirmationNumber The grantsGovernmentConfirmationNumber to set.
1136: */
1137: public void setGrantsGovernmentConfirmationNumber(
1138: String grantsGovernmentConfirmationNumber) {
1139: this .grantsGovernmentConfirmationNumber = grantsGovernmentConfirmationNumber;
1140: }
1141:
1142: /**
1143: * Gets the grantsGovernmentSubmissionIndicator attribute.
1144: *
1145: * @return Returns the grantsGovernmentSubmissionIndicator
1146: */
1147: public boolean isGrantsGovernmentSubmissionIndicator() {
1148: return grantsGovernmentSubmissionIndicator;
1149: }
1150:
1151: /**
1152: * Sets the grantsGovernmentSubmissionIndicator attribute.
1153: *
1154: * @param grantsGovernmentSubmissionIndicator The grantsGovernmentSubmissionIndicator to set.
1155: */
1156: public void setGrantsGovernmentSubmissionIndicator(
1157: boolean grantsGovernmentSubmissionIndicator) {
1158: this .grantsGovernmentSubmissionIndicator = grantsGovernmentSubmissionIndicator;
1159: }
1160:
1161: /**
1162: * Gets the projectAbstract attribute.
1163: *
1164: * @return Returns the projectAbstract
1165: */
1166: public String getProjectAbstract() {
1167: return projectAbstract;
1168: }
1169:
1170: /**
1171: * Sets the projectAbstract attribute.
1172: *
1173: * @param projectAbstract The projectAbstract to set.
1174: */
1175: public void setProjectAbstract(String projectAbstract) {
1176: this .projectAbstract = projectAbstract;
1177: }
1178:
1179: /**
1180: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
1181: */
1182: protected LinkedHashMap toStringMapper() {
1183: LinkedHashMap m = new LinkedHashMap();
1184: m
1185: .put(KFSPropertyConstants.DOCUMENT_NUMBER,
1186: this .documentNumber);
1187: return m;
1188: }
1189:
1190: public RoutingFormAgency getRoutingFormAgency() {
1191: return routingFormAgency;
1192: }
1193:
1194: public void setRoutingFormAgency(RoutingFormAgency routingFormAgency) {
1195: this .routingFormAgency = routingFormAgency;
1196: }
1197:
1198: public Cfda getCfda() {
1199: return cfda;
1200: }
1201:
1202: public void setCfda(Cfda cfda) {
1203: this .cfda = cfda;
1204: }
1205:
1206: public List<RoutingFormResearchRisk> getRoutingFormResearchRisks() {
1207: return routingFormResearchRisks;
1208: }
1209:
1210: public void setRoutingFormResearchRisks(
1211: List<RoutingFormResearchRisk> routingFormResearchRisks) {
1212: this .routingFormResearchRisks = routingFormResearchRisks;
1213: }
1214:
1215: public RoutingFormResearchRisk getRoutingFormResearchRisk(int index) {
1216: while (getRoutingFormResearchRisks().size() <= index) {
1217: getRoutingFormResearchRisks().add(
1218: new RoutingFormResearchRisk());
1219: }
1220: return (RoutingFormResearchRisk) getRoutingFormResearchRisks()
1221: .get(index);
1222: }
1223:
1224: private List getAllRoutingFormResearchRiskStudies() {
1225: List allStudies = new ArrayList();
1226:
1227: for (RoutingFormResearchRisk researchRisk : this .routingFormResearchRisks) {
1228: allStudies.addAll(researchRisk.getResearchRiskStudies());
1229: }
1230:
1231: return allStudies;
1232: }
1233:
1234: public void addRoutingFormResearchRisk(
1235: RoutingFormResearchRisk routingFormResearchRisk) {
1236: getRoutingFormResearchRisks().add(routingFormResearchRisk);
1237: }
1238:
1239: public RoutingFormBudget getRoutingFormBudget() {
1240: return routingFormBudget;
1241: }
1242:
1243: public void setRoutingFormBudget(RoutingFormBudget routingFormBudget) {
1244: this .routingFormBudget = routingFormBudget;
1245: }
1246:
1247: public List<RoutingFormKeyword> getRoutingFormKeywords() {
1248: return routingFormKeywords;
1249: }
1250:
1251: public void setRoutingFormKeywords(
1252: List<RoutingFormKeyword> routingFormKeywords) {
1253: this .routingFormKeywords = routingFormKeywords;
1254: }
1255:
1256: public void addRoutingFormKeyword(
1257: RoutingFormKeyword routingFormKeyword) {
1258: getRoutingFormKeywords().add(routingFormKeyword);
1259: }
1260:
1261: /**
1262: * Gets the researchType attribute.
1263: *
1264: * @return Returns the researchType.
1265: */
1266: public ResearchTypeCode getResearchType() {
1267: return researchType;
1268: }
1269:
1270: /**
1271: * Sets the researchType attribute value.
1272: *
1273: * @param researchType The researchType to set.
1274: * @deprecated
1275: */
1276: public void setResearchType(ResearchTypeCode researchType) {
1277: this .researchType = researchType;
1278: }
1279:
1280: /**
1281: * Gets the submissionType attribute.
1282: *
1283: * @return Returns the submissionType.
1284: */
1285: public SubmissionType getSubmissionType() {
1286: return submissionType;
1287: }
1288:
1289: /**
1290: * Sets the submissionType attribute value.
1291: *
1292: * @param submissionType The submissionType to set.
1293: * @deprecated
1294: */
1295: public void setSubmissionType(SubmissionType submissionType) {
1296: this .submissionType = submissionType;
1297: }
1298:
1299: public ContractGrantProposal getContractGrantProposal() {
1300: return contractGrantProposal;
1301: }
1302:
1303: public void setContractGrantProposal(
1304: ContractGrantProposal contractGrantProposal) {
1305: this .contractGrantProposal = contractGrantProposal;
1306: }
1307:
1308: public List<RoutingFormInstitutionCostShare> getRoutingFormInstitutionCostShares() {
1309: return routingFormInstitutionCostShares;
1310: }
1311:
1312: public RoutingFormInstitutionCostShare getRoutingFormInstitutionCostShare(
1313: int index) {
1314: while (getRoutingFormInstitutionCostShares().size() <= index) {
1315: getRoutingFormInstitutionCostShares().add(
1316: new RoutingFormInstitutionCostShare());
1317: }
1318: return (RoutingFormInstitutionCostShare) getRoutingFormInstitutionCostShares()
1319: .get(index);
1320: }
1321:
1322: public void setRoutingFormInstitutionCostShares(
1323: List<RoutingFormInstitutionCostShare> routingFormInstitutionCostShares) {
1324: this .routingFormInstitutionCostShares = routingFormInstitutionCostShares;
1325: }
1326:
1327: /**
1328: * This method...
1329: *
1330: * @param routingFormInstitutionCostShare
1331: */
1332: public void addRoutingFormInstitutionCostShare(
1333: RoutingFormInstitutionCostShare routingFormInstitutionCostShare,
1334: boolean aggregateExisting) {
1335: if (aggregateExisting) {
1336: for (RoutingFormInstitutionCostShare institutionCostShare : this
1337: .getRoutingFormInstitutionCostShares()) {
1338: if (institutionCostShare.getChartOfAccountsCode()
1339: .equals(
1340: routingFormInstitutionCostShare
1341: .getChartOfAccountsCode())
1342: && institutionCostShare.getOrganizationCode()
1343: .equals(
1344: routingFormInstitutionCostShare
1345: .getOrganizationCode())) {
1346:
1347: institutionCostShare
1348: .setRoutingFormCostShareAmount(institutionCostShare
1349: .getRoutingFormCostShareAmount()
1350: .add(
1351: routingFormInstitutionCostShare
1352: .getRoutingFormCostShareAmount()));
1353:
1354: return;
1355: }
1356: }
1357: }
1358:
1359: routingFormInstitutionCostShare.setDocumentNumber(this
1360: .getDocumentNumber());
1361: Integer nextSequenceNumber = this
1362: .getInstitutionCostShareNextSequenceNumber();
1363: routingFormInstitutionCostShare
1364: .setRoutingFormCostShareSequenceNumber(nextSequenceNumber);
1365: this
1366: .setInstitutionCostShareNextSequenceNumber(++nextSequenceNumber);
1367: getRoutingFormInstitutionCostShares().add(
1368: routingFormInstitutionCostShare);
1369: }
1370:
1371: /**
1372: * This method...
1373: *
1374: * @return
1375: */
1376: public List<RoutingFormOtherCostShare> getRoutingFormOtherCostShares() {
1377: return routingFormOtherCostShares;
1378: }
1379:
1380: /**
1381: * This method...
1382: *
1383: * @param index
1384: * @return
1385: */
1386: public RoutingFormOtherCostShare getRoutingFormOtherCostShare(
1387: int index) {
1388: while (getRoutingFormOtherCostShares().size() <= index) {
1389: getRoutingFormOtherCostShares().add(
1390: new RoutingFormOtherCostShare());
1391: }
1392: return (RoutingFormOtherCostShare) getRoutingFormOtherCostShares()
1393: .get(index);
1394: }
1395:
1396: /**
1397: * This method...
1398: *
1399: * @param routingFormOtherCostShares
1400: */
1401: public void setRoutingFormOtherCostShares(
1402: List<RoutingFormOtherCostShare> routingFormOtherCostShares) {
1403: this .routingFormOtherCostShares = routingFormOtherCostShares;
1404: }
1405:
1406: /**
1407: * This method...
1408: *
1409: * @param routingFormOtherCostShare
1410: */
1411: public void addRoutingFormOtherCostShare(
1412: RoutingFormOtherCostShare routingFormOtherCostShare) {
1413: routingFormOtherCostShare.setDocumentNumber(this
1414: .getDocumentNumber());
1415: Integer nextSequenceNumber = this
1416: .getOtherCostShareNextSequenceNumber();
1417: routingFormOtherCostShare
1418: .setRoutingFormCostShareSequenceNumber(nextSequenceNumber);
1419: this .setOtherCostShareNextSequenceNumber(++nextSequenceNumber);
1420: getRoutingFormOtherCostShares().add(routingFormOtherCostShare);
1421: }
1422:
1423: /**
1424: * This method...
1425: *
1426: * @return
1427: */
1428: public List<RoutingFormSubcontractor> getRoutingFormSubcontractors() {
1429: return routingFormSubcontractors;
1430: }
1431:
1432: /**
1433: * This method...
1434: *
1435: * @param index
1436: * @return
1437: */
1438: public RoutingFormSubcontractor getRoutingFormSubcontractor(
1439: int index) {
1440: while (getRoutingFormSubcontractors().size() <= index) {
1441: getRoutingFormSubcontractors().add(
1442: new RoutingFormSubcontractor());
1443: }
1444: return (RoutingFormSubcontractor) getRoutingFormSubcontractors()
1445: .get(index);
1446: }
1447:
1448: /**
1449: * This method...
1450: *
1451: * @param routingFormSubcontractors
1452: */
1453: public void setRoutingFormSubcontractors(
1454: List<RoutingFormSubcontractor> routingFormSubcontractors) {
1455: this .routingFormSubcontractors = routingFormSubcontractors;
1456: }
1457:
1458: /**
1459: * This method...
1460: *
1461: * @param routingFormSubcontractor
1462: */
1463: public void addRoutingFormSubcontractor(
1464: RoutingFormSubcontractor routingFormSubcontractor) {
1465: routingFormSubcontractor.setDocumentNumber(this
1466: .getDocumentNumber());
1467: Integer nextSequenceNumber = this
1468: .getSubcontractorNextSequenceNumber();
1469: routingFormSubcontractor
1470: .setRoutingFormSubcontractorSequenceNumber(nextSequenceNumber);
1471: this .setSubcontractorNextSequenceNumber(++nextSequenceNumber);
1472: getRoutingFormSubcontractors().add(routingFormSubcontractor);
1473:
1474: }
1475:
1476: /**
1477: * Adds a RoutingFormPersonnel item to the routingFormPersonnel list.
1478: *
1479: * @param routingFormPersonnel
1480: */
1481: public void addPerson(RoutingFormPersonnel routingFormPersonnel) {
1482: routingFormPersonnel
1483: .setDocumentNumber(this .getDocumentNumber());
1484:
1485: Integer nextSequenceNumber = this
1486: .getPersonnelNextSequenceNumber();
1487: routingFormPersonnel
1488: .setRoutingFormPersonSequenceNumber(nextSequenceNumber);
1489: this .setPersonnelNextSequenceNumber(++nextSequenceNumber);
1490:
1491: getRoutingFormPersonnel().add(routingFormPersonnel);
1492: }
1493:
1494: /**
1495: * Adds a RoutingFormOrganizationCreditPercent item to the routingFormOrganizationCreditPercent list.
1496: *
1497: * @param routingFormOrganizationCreditPercent
1498: */
1499: public void addOrganizationCreditPercent(
1500: RoutingFormOrganizationCreditPercent routingFormOrganizationCreditPercent) {
1501: routingFormOrganizationCreditPercent.setDocumentNumber(this
1502: .getDocumentNumber());
1503:
1504: getRoutingFormOrganizationCreditPercents().add(
1505: routingFormOrganizationCreditPercent);
1506: }
1507:
1508: /**
1509: * This method...
1510: *
1511: * @return
1512: */
1513: public KualiInteger getTotalInstitutionCostShareAmount() {
1514: KualiInteger total = KualiInteger.ZERO;
1515: for (RoutingFormInstitutionCostShare institutionCostShare : this
1516: .getRoutingFormInstitutionCostShares()) {
1517: if (institutionCostShare.getRoutingFormCostShareAmount() != null)
1518: total = total.add(institutionCostShare
1519: .getRoutingFormCostShareAmount());
1520: }
1521: return total;
1522: }
1523:
1524: /**
1525: * This method...
1526: *
1527: * @return
1528: */
1529: public KualiInteger getTotalOtherCostShareAmount() {
1530: KualiInteger total = KualiInteger.ZERO;
1531: for (RoutingFormOtherCostShare otherCostShare : getRoutingFormOtherCostShares()) {
1532: if (otherCostShare.getRoutingFormCostShareAmount() != null)
1533: total = total.add(otherCostShare
1534: .getRoutingFormCostShareAmount());
1535: }
1536: return total;
1537: }
1538:
1539: /**
1540: * This method...
1541: *
1542: * @return
1543: */
1544: public KualiInteger getTotalSubcontractorAmount() {
1545: KualiInteger total = KualiInteger.ZERO;
1546: for (RoutingFormSubcontractor subcontractor : getRoutingFormSubcontractors()) {
1547: if (subcontractor.getRoutingFormSubcontractorAmount() != null)
1548: total = total.add(subcontractor
1549: .getRoutingFormSubcontractorAmount());
1550: }
1551: return total;
1552: }
1553:
1554: /**
1555: * Gets the federalPassThroughAgency attribute.
1556: *
1557: * @return Returns the federalPassThroughAgency.
1558: */
1559: public Agency getFederalPassThroughAgency() {
1560: return federalPassThroughAgency;
1561: }
1562:
1563: /**
1564: * Sets the federalPassThroughAgency attribute value.
1565: *
1566: * @param federalPassThroughAgency The federalPassThroughAgency to set.
1567: * @deprecated
1568: */
1569: public void setFederalPassThroughAgency(
1570: Agency federalPassThroughAgency) {
1571: this .federalPassThroughAgency = federalPassThroughAgency;
1572: }
1573:
1574: @Override
1575: public List buildListOfDeletionAwareLists() {
1576: List list = new ArrayList();
1577:
1578: list.add(this .getRoutingFormSubcontractors());
1579: list.add(this .getRoutingFormInstitutionCostShares());
1580: list.add(this .getRoutingFormOtherCostShares());
1581: list.add(this .getRoutingFormPersonnel());
1582: list.add(this .getRoutingFormKeywords());
1583: list.add(this .getRoutingFormResearchRisks());
1584: list.add(this .getAllRoutingFormResearchRiskStudies());
1585: list.add(this .getRoutingFormOrganizations());
1586: list.add(this .getRoutingFormOrganizationCreditPercents());
1587: list.add(this .getRoutingFormProjectTypes());
1588: list.add(this .getAdhocOrgs());
1589: list.add(this .getAdhocPersons());
1590: list.add(this .getAdhocWorkgroups());
1591:
1592: return list;
1593: }
1594:
1595: /**
1596: * Gets the routingFormAgencyToBeNamedIndicator attribute.
1597: *
1598: * @return Returns the routingFormAgencyToBeNamedIndicator.
1599: */
1600: public boolean isRoutingFormAgencyToBeNamedIndicator() {
1601: return routingFormAgencyToBeNamedIndicator;
1602: }
1603:
1604: /**
1605: * Sets the routingFormAgencyToBeNamedIndicator attribute value.
1606: *
1607: * @param routingFormAgencyToBeNamedIndicator The routingFormAgencyToBeNamedIndicator to set.
1608: */
1609: public void setRoutingFormAgencyToBeNamedIndicator(
1610: boolean routingFormAgencyToBeNamedIndicator) {
1611: this .routingFormAgencyToBeNamedIndicator = routingFormAgencyToBeNamedIndicator;
1612: }
1613:
1614: /**
1615: * Gets the routingFormPersonnel attribute.
1616: *
1617: * @return Returns the routingFormPersonnel.
1618: */
1619: public List<RoutingFormPersonnel> getRoutingFormPersonnel() {
1620: return routingFormPersonnel;
1621: }
1622:
1623: /**
1624: * Sets the routingFormPersonnel attribute value.
1625: *
1626: * @param routingFormPersonnel The routingFormPersonnel to set.
1627: */
1628: public void setRoutingFormPersonnel(
1629: List<RoutingFormPersonnel> routingFormPersonnel) {
1630: this .routingFormPersonnel = routingFormPersonnel;
1631: }
1632:
1633: /**
1634: * Gets the routingFormOrganizationCreditPercents attribute.
1635: *
1636: * @return Returns the routingFormOrganizationCreditPercents.
1637: */
1638: public List<RoutingFormOrganizationCreditPercent> getRoutingFormOrganizationCreditPercents() {
1639: return routingFormOrganizationCreditPercents;
1640: }
1641:
1642: /**
1643: * Sets the routingFormOrganizationCreditPercents attribute value.
1644: *
1645: * @param routingFormOrganizationCreditPercents The routingFormOrganizationCreditPercents to set.
1646: */
1647: public void setRoutingFormOrganizationCreditPercents(
1648: List<RoutingFormOrganizationCreditPercent> routingFormOrganizationCreditPercents) {
1649: this .routingFormOrganizationCreditPercents = routingFormOrganizationCreditPercents;
1650: }
1651:
1652: /**
1653: * Gets the routingFormQuestions attribute.
1654: *
1655: * @return Returns the routingFormQuestions.
1656: */
1657: public List<RoutingFormQuestion> getRoutingFormQuestions() {
1658: return routingFormQuestions;
1659: }
1660:
1661: /**
1662: * Sets the routingFormQuestions attribute value.
1663: *
1664: * @param routingFormQuestions The routingFormQuestions to set.
1665: */
1666: public void setRoutingFormQuestions(
1667: List<RoutingFormQuestion> routingFormQuestions) {
1668: this .routingFormQuestions = routingFormQuestions;
1669: }
1670:
1671: /**
1672: * Gets index i from the routingFormQuestions list.
1673: *
1674: * @param index
1675: * @return Question at index i
1676: */
1677: public RoutingFormQuestion getRoutingFormQuestion(int index) {
1678: while (getRoutingFormQuestions().size() <= index) {
1679: getRoutingFormQuestions().add(new RoutingFormQuestion());
1680: }
1681: return (RoutingFormQuestion) getRoutingFormQuestions().get(
1682: index);
1683: }
1684:
1685: /**
1686: * Gets the routingFormCatalogOfFederalDomesticAssistanceNumber attribute.
1687: *
1688: * @return Returns the routingFormCatalogOfFederalDomesticAssistanceNumber.
1689: */
1690: public String getRoutingFormCatalogOfFederalDomesticAssistanceNumber() {
1691: return routingFormCatalogOfFederalDomesticAssistanceNumber;
1692: }
1693:
1694: /**
1695: * Sets the routingFormCatalogOfFederalDomesticAssistanceNumber attribute value.
1696: *
1697: * @param routingFormCatalogOfFederalDomesticAssistanceNumber The routingFormCatalogOfFederalDomesticAssistanceNumber to set.
1698: */
1699: public void setRoutingFormCatalogOfFederalDomesticAssistanceNumber(
1700: String routingFormCatalogOfFederalDomesticAssistanceNumber) {
1701: this .routingFormCatalogOfFederalDomesticAssistanceNumber = routingFormCatalogOfFederalDomesticAssistanceNumber;
1702: }
1703:
1704: /**
1705: * Gets the projectTypeOtherDescription attribute.
1706: *
1707: * @return Returns the projectTypeOtherDescription
1708: */
1709: public String getProjectTypeOtherDescription() {
1710: return projectTypeOtherDescription;
1711: }
1712:
1713: /**
1714: * Sets the projectTypeOtherDescription attribute.
1715: *
1716: * @param projectTypeOtherDescription The projectTypeOtherDescription to set.
1717: */
1718: public void setProjectTypeOtherDescription(
1719: String projectTypeOtherDescription) {
1720: this .projectTypeOtherDescription = projectTypeOtherDescription;
1721: }
1722:
1723: /**
1724: * Gets the personnelNextSequenceNumber attribute.
1725: *
1726: * @return Returns the personnelNextSequenceNumber.
1727: */
1728: public Integer getPersonnelNextSequenceNumber() {
1729: return personnelNextSequenceNumber;
1730: }
1731:
1732: /**
1733: * Sets the personnelNextSequenceNumber attribute value.
1734: *
1735: * @param personnelNextSequenceNumber The personnelNextSequenceNumber to set.
1736: */
1737: public void setPersonnelNextSequenceNumber(
1738: Integer personnelNextSequenceNumber) {
1739: this .personnelNextSequenceNumber = personnelNextSequenceNumber;
1740: }
1741:
1742: public List<RoutingFormOrganization> getRoutingFormOrganizations() {
1743: return routingFormOrganizations;
1744: }
1745:
1746: public void setRoutingFormOrganizations(
1747: List<RoutingFormOrganization> routingFormOrganizations) {
1748: this .routingFormOrganizations = routingFormOrganizations;
1749: }
1750:
1751: /**
1752: * Gets the routingFormPurposes attribute.
1753: *
1754: * @return Returns the routingFormPurposes.
1755: */
1756: public List<RoutingFormPurpose> getRoutingFormPurposes() {
1757: return routingFormPurposes;
1758: }
1759:
1760: /**
1761: * Sets the routingFormPurposes attribute value.
1762: *
1763: * @param routingFormPurposes The routingFormPurposes to set.
1764: */
1765: public void setRoutingFormPurposes(
1766: List<RoutingFormPurpose> routingFormPurposes) {
1767: this .routingFormPurposes = routingFormPurposes;
1768: }
1769:
1770: /**
1771: * Gets the routingFormResearchTypeCodes attribute.
1772: *
1773: * @return Returns the routingFormResearchTypeCodes.
1774: */
1775: public List<RoutingFormResearchTypeCode> getRoutingFormResearchTypeCodes() {
1776: return routingFormResearchTypeCodes;
1777: }
1778:
1779: /**
1780: * Sets the routingFormResearchTypeCodes attribute value.
1781: *
1782: * @param routingFormResearchTypeCodes The routingFormResearchTypeCodes to set.
1783: */
1784: public void setRoutingFormResearchTypeCodes(
1785: List<RoutingFormResearchTypeCode> routingFormResearchTypeCodes) {
1786: this .routingFormResearchTypeCodes = routingFormResearchTypeCodes;
1787: }
1788:
1789: /**
1790: * Gets the routingFormSubmissionTypes attribute.
1791: *
1792: * @return Returns the routingFormSubmissionTypes.
1793: */
1794: public List<RoutingFormSubmissionType> getRoutingFormSubmissionTypes() {
1795: return routingFormSubmissionTypes;
1796: }
1797:
1798: /**
1799: * Sets the routingFormSubmissionTypes attribute value.
1800: *
1801: * @param routingFormSubmissionTypes The routingFormSubmissionTypes to set.
1802: */
1803: public void setRoutingFormSubmissionTypes(
1804: List<RoutingFormSubmissionType> routingFormSubmissionTypes) {
1805: this .routingFormSubmissionTypes = routingFormSubmissionTypes;
1806: }
1807:
1808: /**
1809: * Gets the routingFormProjectTypes attribute.
1810: *
1811: * @return Returns the routingFormProjectTypes.
1812: */
1813: public List<RoutingFormProjectType> getRoutingFormProjectTypes() {
1814: return routingFormProjectTypes;
1815: }
1816:
1817: /**
1818: * Sets the routingFormProjectTypes attribute value.
1819: *
1820: * @param routingFormProjectTypes The routingFormProjectTypes to set.
1821: */
1822: public void setRoutingFormProjectTypes(
1823: List<RoutingFormProjectType> routingFormProjectTypes) {
1824: this .routingFormProjectTypes = routingFormProjectTypes;
1825: }
1826:
1827: /**
1828: * Gets the routingFormPersonRoles attribute.
1829: *
1830: * @return Returns the routingFormPersonRoles.
1831: */
1832: public List<RoutingFormPersonRole> getRoutingFormPersonRoles() {
1833: return routingFormPersonRoles;
1834: }
1835:
1836: /**
1837: * Sets the routingFormPersonRoles attribute value.
1838: *
1839: * @param routingFormPersonRoles The routingFormPersonRoles to set.
1840: */
1841: public void setRoutingFormPersonRoles(
1842: List<RoutingFormPersonRole> routingFormPersonRoles) {
1843: this .routingFormPersonRoles = routingFormPersonRoles;
1844: }
1845:
1846: public List<RoutingFormPersonRole> getRoutingFormProjectDirectorRoles() {
1847: List<RoutingFormPersonRole> projectDirectorRoles = new ArrayList();
1848:
1849: for (RoutingFormPersonRole routingFormPersonRole : getRoutingFormPersonRoles()) {
1850: if (routingFormPersonRole
1851: .getPersonRoleCode()
1852: .equals(
1853: SpringContext
1854: .getBean(ParameterService.class)
1855: .getParameterValue(
1856: getClass(),
1857: KraConstants.CO_PROJECT_DIRECTOR_PARAM))
1858: || routingFormPersonRole
1859: .getPersonRoleCode()
1860: .equals(
1861: SpringContext
1862: .getBean(
1863: ParameterService.class)
1864: .getParameterValue(
1865: getClass(),
1866: KraConstants.PROJECT_DIRECTOR_PARAM))) {
1867: projectDirectorRoles.add(routingFormPersonRole);
1868: }
1869: }
1870:
1871: return projectDirectorRoles;
1872: }
1873:
1874: public List<RoutingFormPersonRole> getRoutingFormOtherPersonRoles() {
1875: List<RoutingFormPersonRole> otherPersonRoles = new ArrayList();
1876:
1877: for (RoutingFormPersonRole routingFormPersonRole : getRoutingFormPersonRoles()) {
1878: if (!routingFormPersonRole
1879: .getPersonRoleCode()
1880: .equals(
1881: SpringContext
1882: .getBean(ParameterService.class)
1883: .getParameterValue(
1884: getClass(),
1885: KraConstants.CO_PROJECT_DIRECTOR_PARAM))
1886: && !routingFormPersonRole
1887: .getPersonRoleCode()
1888: .equals(
1889: SpringContext
1890: .getBean(
1891: ParameterService.class)
1892: .getParameterValue(
1893: getClass(),
1894: KraConstants.PROJECT_DIRECTOR_PARAM))) {
1895: otherPersonRoles.add(routingFormPersonRole);
1896: }
1897: }
1898:
1899: return otherPersonRoles;
1900: }
1901:
1902: public boolean isUserProjectDirector(
1903: String personUniversalIdentifier) {
1904: for (RoutingFormPersonnel person : this .routingFormPersonnel) {
1905: if (person.isProjectDirector()) {
1906: return personUniversalIdentifier.equals(person
1907: .getPersonUniversalIdentifier());
1908: }
1909: }
1910: return false;
1911: }
1912:
1913: /**
1914: * Sums percent financial aid from all personnel and organizations.
1915: *
1916: * @return total financial aid for summary display
1917: */
1918: public KualiInteger getTotalFinancialAidPercent() {
1919: KualiInteger total = KualiInteger.ZERO;
1920: for (RoutingFormPersonnel routingFormPerson : this
1921: .getRoutingFormPersonnel()) {
1922: if (routingFormPerson.getPersonFinancialAidPercent() != null)
1923: total = total.add(routingFormPerson
1924: .getPersonFinancialAidPercent());
1925: }
1926: for (RoutingFormOrganizationCreditPercent routingFormOrganizationCreditPercent : this
1927: .getRoutingFormOrganizationCreditPercents()) {
1928: if (routingFormOrganizationCreditPercent
1929: .getOrganizationFinancialAidPercent() != null)
1930: total = total.add(routingFormOrganizationCreditPercent
1931: .getOrganizationFinancialAidPercent());
1932: }
1933: return total;
1934: }
1935:
1936: /**
1937: * Sums percent credit from all personnel and organizations.
1938: *
1939: * @return total percent credit for summary display
1940: */
1941: public KualiInteger getTotalCreditPercent() {
1942: KualiInteger total = KualiInteger.ZERO;
1943: for (RoutingFormPersonnel routingFormPerson : this
1944: .getRoutingFormPersonnel()) {
1945: if (routingFormPerson.getPersonCreditPercent() != null)
1946: total = total.add(routingFormPerson
1947: .getPersonCreditPercent());
1948: }
1949: for (RoutingFormOrganizationCreditPercent routingFormOrganizationCreditPercent : this
1950: .getRoutingFormOrganizationCreditPercents()) {
1951: if (routingFormOrganizationCreditPercent
1952: .getOrganizationCreditPercent() != null)
1953: total = total.add(routingFormOrganizationCreditPercent
1954: .getOrganizationCreditPercent());
1955: }
1956: return total;
1957: }
1958:
1959: /**
1960: * Gets index i from the routingFormPersonnel list.
1961: *
1962: * @param index
1963: * @return Person at index i
1964: */
1965: public RoutingFormOrganization getRoutingFormOrganization(int index) {
1966: while (getRoutingFormOrganizations().size() <= index) {
1967: getRoutingFormOrganizations().add(
1968: new RoutingFormOrganization());
1969: }
1970: return (RoutingFormOrganization) getRoutingFormOrganizations()
1971: .get(index);
1972: }
1973:
1974: public void addRoutingFormOrganization(
1975: RoutingFormOrganization routingFormOrganization) {
1976: routingFormOrganization.setDocumentNumber(this
1977: .getDocumentNumber());
1978:
1979: getRoutingFormOrganizations().add(routingFormOrganization);
1980: }
1981:
1982: @Override
1983: public void populateDocumentForRouting() {
1984: KualiTransactionalDocumentInformation transInfo = new KualiTransactionalDocumentInformation();
1985: DocumentInitiator initiator = new DocumentInitiator();
1986: String initiatorNetworkId = documentHeader
1987: .getWorkflowDocument().getInitiatorNetworkId();
1988: try {
1989: UniversalUser initiatorUser = SpringContext.getBean(
1990: UniversalUserService.class).getUniversalUser(
1991: new AuthenticationUserId(initiatorNetworkId));
1992: initiator.setUniversalUser(initiatorUser);
1993: } catch (UserNotFoundException e) {
1994: throw new RuntimeException(e);
1995: }
1996: transInfo.setDocumentInitiator(initiator);
1997: KualiDocumentXmlMaterializer xmlWrapper = new KualiDocumentXmlMaterializer();
1998: xmlWrapper.setDocument(this );
1999: xmlWrapper.setKualiTransactionalDocumentInformation(transInfo);
2000: documentHeader.getWorkflowDocument().setApplicationContent(
2001: generateDocumentContent());
2002: }
2003:
2004: public String generateDocumentContent() {
2005: List referenceObjects = new ArrayList();
2006: referenceObjects.add("adhocPersons");
2007: referenceObjects.add("adhocOrgs");
2008: referenceObjects.add("adhocWorkgroups");
2009: referenceObjects.add("routingFormInstitutionCostShares");
2010: SpringContext.getBean(PersistenceService.class)
2011: .retrieveReferenceObjects(this , referenceObjects);
2012:
2013: StringBuffer xml = new StringBuffer("<documentContent>");
2014: xml.append(buildProjectDirectorReportXml(false));
2015: xml.append(buildAdhocApproverReportXml());
2016: xml.append(buildCostShareOrgReportXml(false));
2017: xml.append(buildOtherOrgReportXml(false));
2018: xml.append(buildAdhocOrgReportXml(false));
2019: xml.append("</documentContent>");
2020:
2021: return xml.toString();
2022: }
2023:
2024: /**
2025: * Build the xml to use when generating the workflow routing report.
2026: *
2027: * @param boolean encloseContent - whether the generated xml should be enclosed within a <documentContent> tag
2028: * @return String
2029: */
2030: public String buildProjectDirectorReportXml(boolean encloseContent) {
2031: StringBuffer xml = new StringBuffer();
2032: if (encloseContent) {
2033: xml.append("<documentContent>");
2034: }
2035: RoutingFormPersonnel projectDirector = null;
2036:
2037: SpringContext.getBean(PersistenceService.class)
2038: .retrieveReferenceObject(this , "routingFormPersonnel");
2039: for (RoutingFormPersonnel user : this .getRoutingFormPersonnel()) {
2040: if (ObjectUtils.isNotNull(user.getPersonRoleCode())
2041: && user.isProjectDirector()) {
2042: projectDirector = user;
2043: } else if (ObjectUtils.isNotNull(user.getPersonRoleCode())
2044: && user.getPersonRoleCode().equals(
2045: KraConstants.CO_PROJECT_DIRECTOR_CODE)) {
2046: if (!StringUtils.isBlank(user.getChartOfAccountsCode())) {
2047: xml.append("<chartOrg><chartOfAccountsCode>");
2048: xml.append(user.getChartOfAccountsCode());
2049: xml
2050: .append("</chartOfAccountsCode><organizationCode>");
2051: xml.append(user.getOrganizationCode());
2052: xml.append("</organizationCode></chartOrg>");
2053: }
2054: }
2055: }
2056:
2057: if (ObjectUtils.isNotNull(projectDirector)
2058: && ObjectUtils.isNotNull(projectDirector.getUser())) {
2059: xml.append("<projectDirector>");
2060: xml.append(projectDirector.getPersonUniversalIdentifier());
2061: xml.append("</projectDirector>");
2062: if (!StringUtils.isBlank(projectDirector
2063: .getChartOfAccountsCode())) {
2064: xml.append("<chartOrg><chartOfAccountsCode>");
2065: xml.append(projectDirector.getChartOfAccountsCode());
2066: xml.append("</chartOfAccountsCode><organizationCode>");
2067: if (StringUtils.isBlank(projectDirector
2068: .getOrganizationCode())) {
2069: xml.append(SpringContext.getBean(
2070: ChartUserService.class)
2071: .getDefaultOrganizationCode(
2072: projectDirector.getUser()));
2073: } else {
2074: xml.append(projectDirector.getOrganizationCode());
2075: }
2076: xml.append("</organizationCode></chartOrg>");
2077: }
2078: }
2079: if (encloseContent) {
2080: xml.append("</documentContent>");
2081: }
2082: return xml.toString();
2083: }
2084:
2085: public String buildAdhocApproverReportXml() {
2086: StringBuffer xml = new StringBuffer();
2087: List<AdhocPerson> people = this .getAdhocPersons();
2088: for (AdhocPerson person : people) {
2089: xml.append("<adhocApprover>");
2090: xml.append(person.getPersonUniversalIdentifier());
2091: xml.append("</adhocApprover>");
2092: }
2093: return xml.toString();
2094: }
2095:
2096: /**
2097: * Build the xml to use when generating the workflow org routing report.
2098: *
2099: * @param boolean encloseContent - whether the generated xml should be enclosed within a <documentContent> tag
2100: * @return String
2101: */
2102: public String buildCostShareOrgReportXml(boolean encloseContent) {
2103:
2104: String costSharePermissionCode = SpringContext.getBean(
2105: ParameterService.class).getParameterValue(getClass(),
2106: KraConstants.ROUTING_FORM_COST_SHARE_PERMISSION_CODE);
2107:
2108: StringBuffer xml = new StringBuffer();
2109: if (encloseContent) {
2110: xml.append("<documentContent>");
2111: }
2112:
2113: if ("Y".equals(costSharePermissionCode)) {
2114: for (RoutingFormInstitutionCostShare costShare : this
2115: .getRoutingFormInstitutionCostShares()) {
2116: xml.append("<chartOrg><chartOfAccountsCode>");
2117: if (costShare.getChartOfAccountsCode() != null) {
2118: xml.append(costShare.getChartOfAccountsCode());
2119: }
2120: xml.append("</chartOfAccountsCode><organizationCode>");
2121: if (costShare.getOrganizationCode() != null) {
2122: xml.append(costShare.getOrganizationCode());
2123: }
2124: xml.append("</organizationCode></chartOrg>");
2125: }
2126: }
2127:
2128: if (encloseContent) {
2129: xml.append("</documentContent>");
2130: }
2131:
2132: return xml.toString();
2133: }
2134:
2135: /**
2136: * Build the xml to use when generating the workflow org routing report.
2137: *
2138: * @param boolean encloseContent - whether the generated xml should be enclosed within a <documentContent> tag
2139: * @return String
2140: */
2141: public String buildOtherOrgReportXml(boolean encloseContent) {
2142:
2143: StringBuffer xml = new StringBuffer();
2144: if (encloseContent) {
2145: xml.append("<documentContent>");
2146: }
2147:
2148: for (RoutingFormOrganization otherOrg : this
2149: .getRoutingFormOrganizations()) {
2150: xml.append("<chartOrg><chartOfAccountsCode>");
2151: if (otherOrg.getChartOfAccountsCode() != null) {
2152: xml.append(otherOrg.getChartOfAccountsCode());
2153: }
2154: xml.append("</chartOfAccountsCode><organizationCode>");
2155: if (otherOrg.getOrganizationCode() != null) {
2156: xml.append(otherOrg.getOrganizationCode());
2157: }
2158: xml.append("</organizationCode></chartOrg>");
2159: }
2160:
2161: if (encloseContent) {
2162: xml.append("</documentContent>");
2163: }
2164:
2165: return xml.toString();
2166: }
2167:
2168: /**
2169: * Build the xml to use when generating the workflow org routing report.
2170: *
2171: * @param List<BudgetAdHocOrg> orgs
2172: * @param boolean encloseContent - whether the generated xml should be enclosed within a <documentContent> tag
2173: * @return String
2174: */
2175: public String buildAdhocOrgReportXml(boolean encloseContent) {
2176: StringBuffer xml = new StringBuffer();
2177: if (encloseContent) {
2178: xml.append("<documentContent>");
2179: }
2180: List<AdhocOrg> orgs = this .getAdhocOrgs();
2181: for (AdhocOrg org : orgs) {
2182: xml.append("<chartOrg><chartOfAccountsCode>");
2183: xml.append(org.getFiscalCampusCode());
2184: xml.append("</chartOfAccountsCode><organizationCode>");
2185: xml.append(org.getPrimaryDepartmentCode());
2186: xml.append("</organizationCode></chartOrg>");
2187: }
2188: if (encloseContent) {
2189: xml.append("</documentContent>");
2190: }
2191: return xml.toString();
2192: }
2193:
2194: public Budget getBudget() {
2195: return budget;
2196: }
2197:
2198: public void setBudget(Budget budget) {
2199: this.budget = budget;
2200: }
2201: }
|