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.cg.bo;
0018:
0019: import java.sql.Date;
0020: import java.sql.Timestamp;
0021: import java.util.LinkedHashMap;
0022: import java.util.List;
0023:
0024: import org.apache.ojb.broker.PersistenceBroker;
0025: import org.apache.ojb.broker.PersistenceBrokerException;
0026: import org.kuali.core.bo.PersistableBusinessObjectBase;
0027: import org.kuali.core.bo.user.KualiGroup;
0028: import org.kuali.core.bo.user.UniversalUser;
0029: import org.kuali.core.exceptions.UserNotFoundException;
0030: import org.kuali.core.service.UniversalUserService;
0031: import org.kuali.core.util.KualiDecimal;
0032: import org.kuali.core.util.ObjectUtils;
0033: import org.kuali.core.util.TypedArrayList;
0034: import org.kuali.kfs.context.SpringContext;
0035: import org.kuali.module.cg.service.AwardService;
0036: import org.kuali.workflow.attribute.AlternateOrgReviewRouting;
0037:
0038: /**
0039: * Defines a financial award object.
0040: */
0041: public class Award extends PersistableBusinessObjectBase implements
0042: AlternateOrgReviewRouting {
0043:
0044: private Long proposalNumber;
0045: private Date awardBeginningDate;
0046: private Date awardEndingDate;
0047:
0048: /**
0049: * This field is for write-only to the database via OJB, not the corresponding property of this BO. OJB uses reflection to read
0050: * it, so the compiler warns because it doesn't know.
0051: *
0052: * @see #getAwardTotalAmount
0053: * @see #setAwardTotalAmount
0054: */
0055: @SuppressWarnings("unused")
0056: private KualiDecimal awardTotalAmount;
0057:
0058: private String awardAddendumNumber;
0059: private KualiDecimal awardAllocatedUniversityComputingServicesAmount;
0060: private KualiDecimal federalPassThroughFundedAmount;
0061: private Date awardEntryDate;
0062: private KualiDecimal agencyFuture1Amount;
0063: private KualiDecimal agencyFuture2Amount;
0064: private KualiDecimal agencyFuture3Amount;
0065: private String awardDocumentNumber;
0066: private Date awardLastUpdateDate;
0067: private boolean federalPassThroughIndicator;
0068: private String oldProposalNumber;
0069: private KualiDecimal awardDirectCostAmount;
0070: private KualiDecimal awardIndirectCostAmount;
0071: private KualiDecimal federalFundedAmount;
0072: private Timestamp awardCreateTimestamp;
0073: private Date awardClosingDate;
0074: private String proposalAwardTypeCode;
0075: private String workgroupName;
0076: private String awardStatusCode;
0077: private String letterOfCreditFundGroupCode;
0078: private String grantDescriptionCode;
0079: private String agencyNumber;
0080: private String federalPassThroughAgencyNumber;
0081: private String agencyAnalystName;
0082: private String analystTelephoneNumber;
0083: private String awardProjectTitle;
0084: private String awardCommentText;
0085: private String awardPurposeCode;
0086: private boolean active;
0087: private String kualiGroupNames;
0088: private List<AwardProjectDirector> awardProjectDirectors;
0089: private List<AwardAccount> awardAccounts;
0090: private List<AwardSubcontractor> awardSubcontractors;
0091: private List<AwardOrganization> awardOrganizations;
0092: private Proposal proposal;
0093: private ProposalAwardType proposalAwardType;
0094: private AwardStatus awardStatus;
0095: private LetterOfCreditFundGroup letterOfCreditFundGroup;
0096: private GrantDescription grantDescription;
0097: private Agency agency;
0098: private Agency federalPassThroughAgency;
0099: private ProposalPurpose awardPurpose;
0100: private KualiGroup workgroup;
0101: private AwardOrganization primaryAwardOrganization;
0102: private String routingOrg;
0103: private String routingChart;
0104:
0105: /**
0106: * Default no-args constructor.
0107: */
0108: public Award() {
0109: // Must use TypedArrayList because its get() method automatically grows the array for Struts.
0110: awardProjectDirectors = new TypedArrayList(
0111: AwardProjectDirector.class);
0112: awardAccounts = new TypedArrayList(AwardAccount.class);
0113: awardSubcontractors = new TypedArrayList(
0114: AwardSubcontractor.class);
0115: awardOrganizations = new TypedArrayList(AwardOrganization.class);
0116: }
0117:
0118: /**
0119: * Creates a collection of lists within this award object that should be aware of when the deletion of one of their elements
0120: * occurs. This collection is used to refresh the display upon deletion of an element to ensure that the deleted element is not
0121: * longer visible on the interface.
0122: *
0123: * @see org.kuali.core.bo.PersistableBusinessObjectBase#buildListOfDeletionAwareLists()
0124: */
0125: @Override
0126: public List buildListOfDeletionAwareLists() {
0127: List<List> managedLists = super .buildListOfDeletionAwareLists();
0128: managedLists.add(getAwardAccounts());
0129: managedLists.add(getAwardOrganizations());
0130: managedLists.add(getAwardProjectDirectors());
0131: managedLists.add(getAwardSubcontractors());
0132: return managedLists;
0133: }
0134:
0135: /**
0136: * Constructs an Award.
0137: *
0138: * @param proposal The associated proposal that the award will be linked to.
0139: */
0140: public Award(Proposal proposal) {
0141: this ();
0142: populateFromProposal(proposal);
0143: }
0144:
0145: /**
0146: * This method takes all the applicable attributes from the associated proposal object and sets those attributes into their
0147: * corresponding award attributes.
0148: *
0149: * @param proposal The associated proposal that the award will be linked to.
0150: */
0151: public void populateFromProposal(Proposal proposal) {
0152: if (ObjectUtils.isNotNull(proposal)) {
0153: setProposalNumber(proposal.getProposalNumber());
0154: setAgencyNumber(proposal.getAgencyNumber());
0155: setAwardProjectTitle(proposal.getProposalProjectTitle());
0156: setAwardDirectCostAmount(proposal
0157: .getProposalDirectCostAmount());
0158: setAwardIndirectCostAmount(proposal
0159: .getProposalIndirectCostAmount());
0160: setProposalAwardTypeCode(proposal
0161: .getProposalAwardTypeCode());
0162: setFederalPassThroughIndicator(proposal
0163: .getProposalFederalPassThroughIndicator());
0164: setFederalPassThroughAgencyNumber(proposal
0165: .getFederalPassThroughAgencyNumber());
0166: setAwardPurposeCode(proposal.getProposalPurposeCode());
0167:
0168: // copy proposal organizations to award organizations
0169: getAwardOrganizations().clear();
0170: for (ProposalOrganization pOrg : proposal
0171: .getProposalOrganizations()) {
0172: AwardOrganization awardOrg = new AwardOrganization();
0173: // newCollectionRecord is set to true to allow deletion of this record after being populated from proposal
0174: awardOrg.setNewCollectionRecord(true);
0175: awardOrg.setProposalNumber(pOrg.getProposalNumber());
0176: awardOrg.setChartOfAccountsCode(pOrg
0177: .getChartOfAccountsCode());
0178: awardOrg
0179: .setOrganizationCode(pOrg.getOrganizationCode());
0180: awardOrg.setAwardPrimaryOrganizationIndicator(pOrg
0181: .isProposalPrimaryOrganizationIndicator());
0182: awardOrg.setActive(pOrg.isActive());
0183: getAwardOrganizations().add(awardOrg);
0184: }
0185:
0186: // copy proposal subcontractors to award subcontractors
0187: getAwardSubcontractors().clear();
0188: for (ProposalSubcontractor pSubcontractor : proposal
0189: .getProposalSubcontractors()) {
0190: AwardSubcontractor awardSubcontractor = new AwardSubcontractor();
0191: // newCollectionRecord is set to true to allow deletion of this record after being populated from proposal
0192: awardSubcontractor.setNewCollectionRecord(true);
0193: awardSubcontractor.setProposalNumber(pSubcontractor
0194: .getProposalNumber());
0195: awardSubcontractor
0196: .setAwardSubcontractorNumber(pSubcontractor
0197: .getProposalSubcontractorNumber());
0198: awardSubcontractor
0199: .setSubcontractorAmount(pSubcontractor
0200: .getProposalSubcontractorAmount());
0201: awardSubcontractor
0202: .setAwardSubcontractorDescription(pSubcontractor
0203: .getProposalSubcontractorDescription());
0204: awardSubcontractor
0205: .setSubcontractorNumber(pSubcontractor
0206: .getSubcontractorNumber());
0207: awardSubcontractor.setActive(pSubcontractor.isActive());
0208: getAwardSubcontractors().add(awardSubcontractor);
0209: }
0210:
0211: // copy proposal project directors to award propject directors
0212: getAwardProjectDirectors().clear();
0213: for (ProposalProjectDirector pDirector : proposal
0214: .getProposalProjectDirectors()) {
0215: AwardProjectDirector awardDirector = new AwardProjectDirector();
0216: // newCollectionRecord is set to true to allow deletion of this record after being populated from proposal
0217: awardDirector.setNewCollectionRecord(true);
0218: awardDirector.setProposalNumber(pDirector
0219: .getProposalNumber());
0220: awardDirector
0221: .setAwardPrimaryProjectDirectorIndicator(pDirector
0222: .isProposalPrimaryProjectDirectorIndicator());
0223: awardDirector
0224: .setAwardProjectDirectorProjectTitle(pDirector
0225: .getProposalProjectDirectorProjectTitle());
0226: awardDirector.setPersonUniversalIdentifier(pDirector
0227: .getPersonUniversalIdentifier());
0228: awardDirector.setActive(pDirector.isActive());
0229: getAwardProjectDirectors().add(awardDirector);
0230: }
0231: }
0232: }
0233:
0234: /**
0235: * Gets the proposalNumber attribute.
0236: *
0237: * @return Returns the proposalNumber
0238: */
0239: public Long getProposalNumber() {
0240: return proposalNumber;
0241: }
0242:
0243: /**
0244: * Sets the proposalNumber attribute.
0245: *
0246: * @param proposalNumber The proposalNumber to set.
0247: */
0248: public void setProposalNumber(Long proposalNumber) {
0249: this .proposalNumber = proposalNumber;
0250: }
0251:
0252: /**
0253: * Gets the awardBeginningDate attribute.
0254: *
0255: * @return Returns the awardBeginningDate
0256: */
0257: public Date getAwardBeginningDate() {
0258: return awardBeginningDate;
0259: }
0260:
0261: /**
0262: * Sets the awardBeginningDate attribute.
0263: *
0264: * @param awardBeginningDate The awardBeginningDate to set.
0265: */
0266: public void setAwardBeginningDate(Date awardBeginningDate) {
0267: this .awardBeginningDate = awardBeginningDate;
0268: }
0269:
0270: /**
0271: * Gets the awardEndingDate attribute.
0272: *
0273: * @return Returns the awardEndingDate
0274: */
0275: public Date getAwardEndingDate() {
0276: return awardEndingDate;
0277: }
0278:
0279: /**
0280: * Sets the awardEndingDate attribute.
0281: *
0282: * @param awardEndingDate The awardEndingDate to set.
0283: */
0284: public void setAwardEndingDate(Date awardEndingDate) {
0285: this .awardEndingDate = awardEndingDate;
0286: }
0287:
0288: /**
0289: * Gets the awardTotalAmount attribute.
0290: *
0291: * @return Returns the awardTotalAmount
0292: */
0293: public KualiDecimal getAwardTotalAmount() {
0294: KualiDecimal direct = getAwardDirectCostAmount();
0295: KualiDecimal indirect = getAwardIndirectCostAmount();
0296: return ObjectUtils.isNull(direct)
0297: || ObjectUtils.isNull(indirect) ? null : direct
0298: .add(indirect);
0299: }
0300:
0301: /**
0302: * Does nothing. This property is determined by the direct and indirect cost amounts. This setter is here only because without
0303: * it, the maintenance framework won't display this attribute.
0304: *
0305: * @param awardTotalAmount The awardTotalAmount to set.
0306: * @deprecated Should not be used. See method description above.
0307: */
0308: @Deprecated
0309: public void setAwardTotalAmount(KualiDecimal awardTotalAmount) {
0310: // do nothing
0311: }
0312:
0313: /**
0314: * OJB calls this method as the first operation before this BO is inserted into the database. The database contains
0315: * CGAWD_TOT_AMT, a denormalized column that Kuali does not use but needs to maintain with this method because OJB bypasses the
0316: * getter.
0317: *
0318: * @param persistenceBroker from OJB
0319: * @throws PersistenceBrokerException Thrown by call to super.beforeInsert();
0320: * @see org.kuali.core.bo.PersistableBusinessObjectBase#beforeInsert(org.apache.ojb.broker.PersistenceBroker)
0321: */
0322: @Override
0323: public void beforeInsert(PersistenceBroker persistenceBroker)
0324: throws PersistenceBrokerException {
0325: super .beforeInsert(persistenceBroker);
0326: awardTotalAmount = getAwardTotalAmount();
0327: }
0328:
0329: /**
0330: * OJB calls this method as the first operation before this BO is updated to the database. The database contains CGAWD_TOT_AMT,
0331: * a denormalized column that Kuali does not use but needs to maintain with this method because OJB bypasses the getter.
0332: *
0333: * @param persistenceBroker from OJB
0334: * @throws PersistenceBrokerException Thrown by call to super.beforeUpdate();
0335: * @see org.kuali.core.bo.PersistableBusinessObjectBase#beforeUpdate(org.apache.ojb.broker.PersistenceBroker)
0336: */
0337: @Override
0338: public void beforeUpdate(PersistenceBroker persistenceBroker)
0339: throws PersistenceBrokerException {
0340: super .beforeUpdate(persistenceBroker);
0341: awardTotalAmount = getAwardTotalAmount();
0342: }
0343:
0344: /**
0345: * Gets the awardAddendumNumber attribute.
0346: *
0347: * @return Returns the awardAddendumNumber
0348: */
0349: public String getAwardAddendumNumber() {
0350: return awardAddendumNumber;
0351: }
0352:
0353: /**
0354: * Sets the awardAddendumNumber attribute.
0355: *
0356: * @param awardAddendumNumber The awardAddendumNumber to set.
0357: */
0358: public void setAwardAddendumNumber(String awardAddendumNumber) {
0359: this .awardAddendumNumber = awardAddendumNumber;
0360: }
0361:
0362: /**
0363: * Gets the awardAllocatedUniversityComputingServicesAmount attribute.
0364: *
0365: * @return Returns the awardAllocatedUniversityComputingServicesAmount
0366: */
0367: public KualiDecimal getAwardAllocatedUniversityComputingServicesAmount() {
0368: return awardAllocatedUniversityComputingServicesAmount;
0369: }
0370:
0371: /**
0372: * Sets the awardAllocatedUniversityComputingServicesAmount attribute.
0373: *
0374: * @param awardAllocatedUniversityComputingServicesAmount The awardAllocatedUniversityComputingServicesAmount to set.
0375: */
0376: public void setAwardAllocatedUniversityComputingServicesAmount(
0377: KualiDecimal awardAllocatedUniversityComputingServicesAmount) {
0378: this .awardAllocatedUniversityComputingServicesAmount = awardAllocatedUniversityComputingServicesAmount;
0379: }
0380:
0381: /**
0382: * Gets the federalPassThroughFundedAmount attribute.
0383: *
0384: * @return Returns the federalPassThroughFundedAmount
0385: */
0386: public KualiDecimal getFederalPassThroughFundedAmount() {
0387: return federalPassThroughFundedAmount;
0388: }
0389:
0390: /**
0391: * Sets the federalPassThroughFundedAmount attribute.
0392: *
0393: * @param federalPassThroughFundedAmount The federalPassThroughFundedAmount to set.
0394: */
0395: public void setFederalPassThroughFundedAmount(
0396: KualiDecimal federalPassThroughFundedAmount) {
0397: this .federalPassThroughFundedAmount = federalPassThroughFundedAmount;
0398: }
0399:
0400: /**
0401: * Gets the awardEntryDate attribute.
0402: *
0403: * @return Returns the awardEntryDate
0404: */
0405: public Date getAwardEntryDate() {
0406: return awardEntryDate;
0407: }
0408:
0409: /**
0410: * Sets the awardEntryDate attribute.
0411: *
0412: * @param awardEntryDate The awardEntryDate to set.
0413: */
0414: public void setAwardEntryDate(Date awardEntryDate) {
0415: this .awardEntryDate = awardEntryDate;
0416: }
0417:
0418: /**
0419: * Gets the agencyFuture1Amount attribute.
0420: *
0421: * @return Returns the agencyFuture1Amount
0422: */
0423: public KualiDecimal getAgencyFuture1Amount() {
0424: return agencyFuture1Amount;
0425: }
0426:
0427: /**
0428: * Sets the agencyFuture1Amount attribute.
0429: *
0430: * @param agencyFuture1Amount The agencyFuture1Amount to set.
0431: */
0432: public void setAgencyFuture1Amount(KualiDecimal agencyFuture1Amount) {
0433: this .agencyFuture1Amount = agencyFuture1Amount;
0434: }
0435:
0436: /**
0437: * Gets the agencyFuture2Amount attribute.
0438: *
0439: * @return Returns the agencyFuture2Amount
0440: */
0441: public KualiDecimal getAgencyFuture2Amount() {
0442: return agencyFuture2Amount;
0443: }
0444:
0445: /**
0446: * Sets the agencyFuture2Amount attribute.
0447: *
0448: * @param agencyFuture2Amount The agencyFuture2Amount to set.
0449: */
0450: public void setAgencyFuture2Amount(KualiDecimal agencyFuture2Amount) {
0451: this .agencyFuture2Amount = agencyFuture2Amount;
0452: }
0453:
0454: /**
0455: * Gets the agencyFuture3Amount attribute.
0456: *
0457: * @return Returns the agencyFuture3Amount
0458: */
0459: public KualiDecimal getAgencyFuture3Amount() {
0460: return agencyFuture3Amount;
0461: }
0462:
0463: /**
0464: * Sets the agencyFuture3Amount attribute.
0465: *
0466: * @param agencyFuture3Amount The agencyFuture3Amount to set.
0467: */
0468: public void setAgencyFuture3Amount(KualiDecimal agencyFuture3Amount) {
0469: this .agencyFuture3Amount = agencyFuture3Amount;
0470: }
0471:
0472: /**
0473: * Gets the awardDocumentNumber attribute.
0474: *
0475: * @return Returns the awardDocumentNumber
0476: */
0477: public String getAwardDocumentNumber() {
0478: return awardDocumentNumber;
0479: }
0480:
0481: /**
0482: * Sets the awardDocumentNumber attribute.
0483: *
0484: * @param awardDocumentNumber The awardDocumentNumber to set.
0485: */
0486: public void setAwardDocumentNumber(String awardDocumentNumber) {
0487: this .awardDocumentNumber = awardDocumentNumber;
0488: }
0489:
0490: /**
0491: * Gets the awardLastUpdateDate attribute.
0492: *
0493: * @return Returns the awardLastUpdateDate
0494: */
0495: public Date getAwardLastUpdateDate() {
0496: return awardLastUpdateDate;
0497: }
0498:
0499: /**
0500: * Sets the awardLastUpdateDate attribute.
0501: *
0502: * @param awardLastUpdateDate The awardLastUpdateDate to set.
0503: */
0504: public void setAwardLastUpdateDate(Date awardLastUpdateDate) {
0505: this .awardLastUpdateDate = awardLastUpdateDate;
0506: }
0507:
0508: /**
0509: * Gets the federalPassThroughIndicator attribute.
0510: *
0511: * @return Returns the federalPassThroughIndicator
0512: */
0513: public boolean getFederalPassThroughIndicator() {
0514: return federalPassThroughIndicator;
0515: }
0516:
0517: /**
0518: * Sets the federalPassThroughIndicator attribute.
0519: *
0520: * @param federalPassThroughIndicator The federalPassThroughIndicator to set.
0521: */
0522: public void setFederalPassThroughIndicator(
0523: boolean federalPassThroughIndicator) {
0524: this .federalPassThroughIndicator = federalPassThroughIndicator;
0525: }
0526:
0527: /**
0528: * Gets the oldProposalNumber attribute.
0529: *
0530: * @return Returns the oldProposalNumber
0531: */
0532: public String getOldProposalNumber() {
0533: return oldProposalNumber;
0534: }
0535:
0536: /**
0537: * Sets the oldProposalNumber attribute.
0538: *
0539: * @param oldProposalNumber The oldProposalNumber to set.
0540: */
0541: public void setOldProposalNumber(String oldProposalNumber) {
0542: this .oldProposalNumber = oldProposalNumber;
0543: }
0544:
0545: /**
0546: * Gets the awardDirectCostAmount attribute.
0547: *
0548: * @return Returns the awardDirectCostAmount
0549: */
0550: public KualiDecimal getAwardDirectCostAmount() {
0551: return awardDirectCostAmount;
0552: }
0553:
0554: /**
0555: * Sets the awardDirectCostAmount attribute.
0556: *
0557: * @param awardDirectCostAmount The awardDirectCostAmount to set.
0558: */
0559: public void setAwardDirectCostAmount(
0560: KualiDecimal awardDirectCostAmount) {
0561: this .awardDirectCostAmount = awardDirectCostAmount;
0562: }
0563:
0564: /**
0565: * Gets the awardIndirectCostAmount attribute.
0566: *
0567: * @return Returns the awardIndirectCostAmount
0568: */
0569: public KualiDecimal getAwardIndirectCostAmount() {
0570: return awardIndirectCostAmount;
0571: }
0572:
0573: /**
0574: * Sets the awardIndirectCostAmount attribute.
0575: *
0576: * @param awardIndirectCostAmount The awardIndirectCostAmount to set.
0577: */
0578: public void setAwardIndirectCostAmount(
0579: KualiDecimal awardIndirectCostAmount) {
0580: this .awardIndirectCostAmount = awardIndirectCostAmount;
0581: }
0582:
0583: /**
0584: * Gets the federalFundedAmount attribute.
0585: *
0586: * @return Returns the federalFundedAmount
0587: */
0588: public KualiDecimal getFederalFundedAmount() {
0589: return federalFundedAmount;
0590: }
0591:
0592: /**
0593: * Sets the federalFundedAmount attribute.
0594: *
0595: * @param federalFundedAmount The federalFundedAmount to set.
0596: */
0597: public void setFederalFundedAmount(KualiDecimal federalFundedAmount) {
0598: this .federalFundedAmount = federalFundedAmount;
0599: }
0600:
0601: /**
0602: * Gets the awardCreateTimestamp attribute.
0603: *
0604: * @return Returns the awardCreateTimestamp
0605: */
0606: public Timestamp getAwardCreateTimestamp() {
0607: return awardCreateTimestamp;
0608: }
0609:
0610: /**
0611: * Sets the awardCreateTimestamp attribute.
0612: *
0613: * @param awardCreateTimestamp The awardCreateTimestamp to set.
0614: */
0615: public void setAwardCreateTimestamp(Timestamp awardCreateTimestamp) {
0616: this .awardCreateTimestamp = awardCreateTimestamp;
0617: }
0618:
0619: /**
0620: * Gets the awardClosingDate attribute.
0621: *
0622: * @return Returns the awardClosingDate
0623: */
0624: public Date getAwardClosingDate() {
0625: return awardClosingDate;
0626: }
0627:
0628: /**
0629: * Sets the awardClosingDate attribute.
0630: *
0631: * @param awardClosingDate The awardClosingDate to set.
0632: */
0633: public void setAwardClosingDate(Date awardClosingDate) {
0634: this .awardClosingDate = awardClosingDate;
0635: }
0636:
0637: /**
0638: * Gets the proposalAwardTypeCode attribute.
0639: *
0640: * @return Returns the proposalAwardTypeCode
0641: */
0642: public String getProposalAwardTypeCode() {
0643: return proposalAwardTypeCode;
0644: }
0645:
0646: /**
0647: * Sets the proposalAwardTypeCode attribute.
0648: *
0649: * @param proposalAwardTypeCode The proposalAwardTypeCode to set.
0650: */
0651: public void setProposalAwardTypeCode(String proposalAwardTypeCode) {
0652: this .proposalAwardTypeCode = proposalAwardTypeCode;
0653: }
0654:
0655: /**
0656: * Gets the workgroupName attribute.
0657: *
0658: * @return Returns the workgroupName
0659: */
0660: public String getWorkgroupName() {
0661: return workgroupName;
0662: }
0663:
0664: /**
0665: * Sets the workgroupName attribute.
0666: *
0667: * @param workgroupName The workgroupName to set.
0668: */
0669: public void setWorkgroupName(String workgroupName) {
0670: this .workgroupName = workgroupName;
0671: }
0672:
0673: /**
0674: * Gets the awardStatusCode attribute.
0675: *
0676: * @return Returns the awardStatusCode
0677: */
0678: public String getAwardStatusCode() {
0679: return awardStatusCode;
0680: }
0681:
0682: /**
0683: * Sets the awardStatusCode attribute.
0684: *
0685: * @param awardStatusCode The awardStatusCode to set.
0686: */
0687: public void setAwardStatusCode(String awardStatusCode) {
0688: this .awardStatusCode = awardStatusCode;
0689: }
0690:
0691: /**
0692: * Gets the letterOfCreditFundGroupCode attribute.
0693: *
0694: * @return Returns the letterOfCreditFundGroupCode
0695: */
0696: public String getLetterOfCreditFundGroupCode() {
0697: return letterOfCreditFundGroupCode;
0698: }
0699:
0700: /**
0701: * Sets the letterOfCreditFundGroupCode attribute.
0702: *
0703: * @param letterOfCreditFundGroupCode The letterOfCreditFundGroupCode to set.
0704: */
0705: public void setLetterOfCreditFundGroupCode(
0706: String letterOfCreditFundGroupCode) {
0707: this .letterOfCreditFundGroupCode = letterOfCreditFundGroupCode;
0708: }
0709:
0710: /**
0711: * Gets the grantDescriptionCode attribute.
0712: *
0713: * @return Returns the grantDescriptionCode
0714: */
0715: public String getGrantDescriptionCode() {
0716: return grantDescriptionCode;
0717: }
0718:
0719: /**
0720: * Sets the grantDescriptionCode attribute.
0721: *
0722: * @param grantDescriptionCode The grantDescriptionCode to set.
0723: */
0724: public void setGrantDescriptionCode(String grantDescriptionCode) {
0725: this .grantDescriptionCode = grantDescriptionCode;
0726: }
0727:
0728: /**
0729: * Gets the agencyNumber attribute.
0730: *
0731: * @return Returns the agencyNumber
0732: */
0733: public String getAgencyNumber() {
0734: return agencyNumber;
0735: }
0736:
0737: /**
0738: * Sets the agencyNumber attribute.
0739: *
0740: * @param agencyNumber The agencyNumber to set.
0741: */
0742: public void setAgencyNumber(String agencyNumber) {
0743: this .agencyNumber = agencyNumber;
0744: }
0745:
0746: /**
0747: * Gets the federalPassThroughAgencyNumber attribute.
0748: *
0749: * @return Returns the federalPassThroughAgencyNumber
0750: */
0751: public String getFederalPassThroughAgencyNumber() {
0752: return federalPassThroughAgencyNumber;
0753: }
0754:
0755: /**
0756: * Sets the federalPassThroughAgencyNumber attribute.
0757: *
0758: * @param federalPassThroughAgencyNumber The federalPassThroughAgencyNumber to set.
0759: */
0760: public void setFederalPassThroughAgencyNumber(
0761: String federalPassThroughAgencyNumber) {
0762: this .federalPassThroughAgencyNumber = federalPassThroughAgencyNumber;
0763: }
0764:
0765: /**
0766: * Gets the agencyAnalystName attribute.
0767: *
0768: * @return Returns the agencyAnalystName
0769: */
0770: public String getAgencyAnalystName() {
0771: return agencyAnalystName;
0772: }
0773:
0774: /**
0775: * Sets the agencyAnalystName attribute.
0776: *
0777: * @param agencyAnalystName The agencyAnalystName to set.
0778: */
0779: public void setAgencyAnalystName(String agencyAnalystName) {
0780: this .agencyAnalystName = agencyAnalystName;
0781: }
0782:
0783: /**
0784: * Gets the analystTelephoneNumber attribute.
0785: *
0786: * @return Returns the analystTelephoneNumber
0787: */
0788: public String getAnalystTelephoneNumber() {
0789: return analystTelephoneNumber;
0790: }
0791:
0792: /**
0793: * Sets the analystTelephoneNumber attribute.
0794: *
0795: * @param analystTelephoneNumber The analystTelephoneNumber to set.
0796: */
0797: public void setAnalystTelephoneNumber(String analystTelephoneNumber) {
0798: this .analystTelephoneNumber = analystTelephoneNumber;
0799: }
0800:
0801: /**
0802: * Gets the awardProjectTitle attribute.
0803: *
0804: * @return Returns the awardProjectTitle
0805: */
0806: public String getAwardProjectTitle() {
0807: return awardProjectTitle;
0808: }
0809:
0810: /**
0811: * Sets the awardProjectTitle attribute.
0812: *
0813: * @param awardProjectTitle The awardProjectTitle to set.
0814: */
0815: public void setAwardProjectTitle(String awardProjectTitle) {
0816: this .awardProjectTitle = awardProjectTitle;
0817: }
0818:
0819: /**
0820: * Gets the awardCommentText attribute.
0821: *
0822: * @return Returns the awardCommentText
0823: */
0824: public String getAwardCommentText() {
0825: return awardCommentText;
0826: }
0827:
0828: /**
0829: * Sets the awardCommentText attribute.
0830: *
0831: * @param awardCommentText The awardCommentText to set.
0832: */
0833: public void setAwardCommentText(String awardCommentText) {
0834: this .awardCommentText = awardCommentText;
0835: }
0836:
0837: /**
0838: * Gets the awardPurposeCode attribute.
0839: *
0840: * @return Returns the awardPurposeCode
0841: */
0842: public String getAwardPurposeCode() {
0843: return awardPurposeCode;
0844: }
0845:
0846: /**
0847: * Sets the awardPurposeCode attribute.
0848: *
0849: * @param awardPurposeCode The awardPurposeCode to set.
0850: */
0851: public void setAwardPurposeCode(String awardPurposeCode) {
0852: this .awardPurposeCode = awardPurposeCode;
0853: }
0854:
0855: /**
0856: * Gets the active attribute.
0857: *
0858: * @return Returns the active.
0859: */
0860: public boolean isActive() {
0861: return active;
0862: }
0863:
0864: /**
0865: * Sets the active attribute value.
0866: *
0867: * @param active The active to set.
0868: */
0869: public void setActive(boolean active) {
0870: this .active = active;
0871: }
0872:
0873: /**
0874: * Gets the proposal attribute.
0875: *
0876: * @return Returns the proposal
0877: */
0878: public Proposal getProposal() {
0879: return proposal;
0880: }
0881:
0882: /**
0883: * Sets the proposal attribute.
0884: *
0885: * @param proposal The proposal to set.
0886: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
0887: * creation of the object and should not be changed.
0888: */
0889: @Deprecated
0890: public void setProposal(Proposal proposal) {
0891: this .proposal = proposal;
0892: }
0893:
0894: /**
0895: * Gets the proposalAwardType attribute.
0896: *
0897: * @return Returns the proposalAwardType
0898: */
0899: public ProposalAwardType getProposalAwardType() {
0900: return proposalAwardType;
0901: }
0902:
0903: /**
0904: * Sets the proposalAwardType attribute.
0905: *
0906: * @param proposalAwardType The proposalAwardType to set.
0907: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
0908: * creation of the object and should not be changed.
0909: */
0910: @Deprecated
0911: public void setProposalAwardType(ProposalAwardType proposalAwardType) {
0912: this .proposalAwardType = proposalAwardType;
0913: }
0914:
0915: /**
0916: * Gets the awardStatus attribute.
0917: *
0918: * @return Returns the awardStatus
0919: */
0920: public AwardStatus getAwardStatus() {
0921: return awardStatus;
0922: }
0923:
0924: /**
0925: * Sets the awardStatus attribute.
0926: *
0927: * @param awardStatus The awardStatus to set.
0928: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
0929: * creation of the object and should not be changed.
0930: */
0931: @Deprecated
0932: public void setAwardStatus(AwardStatus awardStatus) {
0933: this .awardStatus = awardStatus;
0934: }
0935:
0936: /**
0937: * Gets the letterOfCreditFundGroup attribute.
0938: *
0939: * @return Returns the letterOfCreditFundGroup
0940: */
0941: public LetterOfCreditFundGroup getLetterOfCreditFundGroup() {
0942: return letterOfCreditFundGroup;
0943: }
0944:
0945: /**
0946: * Sets the letterOfCreditFundGroup attribute.
0947: *
0948: * @param letterOfCreditFundGroup The letterOfCreditFundGroup to set.
0949: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
0950: * creation of the object and should not be changed.
0951: */
0952: @Deprecated
0953: public void setLetterOfCreditFundGroup(
0954: LetterOfCreditFundGroup letterOfCreditFundGroup) {
0955: this .letterOfCreditFundGroup = letterOfCreditFundGroup;
0956: }
0957:
0958: /**
0959: * Gets the grantDescription attribute.
0960: *
0961: * @return Returns the grantDescription
0962: */
0963: public GrantDescription getGrantDescription() {
0964: return grantDescription;
0965: }
0966:
0967: /**
0968: * Sets the grantDescription attribute.
0969: *
0970: * @param grantDescription The grantDescription to set.
0971: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
0972: * creation of the object and should not be changed.
0973: */
0974: @Deprecated
0975: public void setGrantDescription(GrantDescription grantDescription) {
0976: this .grantDescription = grantDescription;
0977: }
0978:
0979: /**
0980: * Gets the agency attribute.
0981: *
0982: * @return Returns the agency
0983: */
0984: public Agency getAgency() {
0985: return agency;
0986: }
0987:
0988: /**
0989: * Sets the agency attribute.
0990: *
0991: * @param agency The agency to set.
0992: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
0993: * creation of the object and should not be changed.
0994: */
0995: @Deprecated
0996: public void setAgency(Agency agency) {
0997: this .agency = agency;
0998: }
0999:
1000: /**
1001: * Gets the federalPassThroughAgency attribute.
1002: *
1003: * @return Returns the federalPassThroughAgency
1004: */
1005: public Agency getFederalPassThroughAgency() {
1006: return federalPassThroughAgency;
1007: }
1008:
1009: /**
1010: * Sets the federalPassThroughAgency attribute.
1011: *
1012: * @param federalPassThroughAgency The federalPassThroughAgency to set.
1013: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
1014: * creation of the object and should not be changed.
1015: */
1016: @Deprecated
1017: public void setFederalPassThroughAgency(
1018: Agency federalPassThroughAgency) {
1019: this .federalPassThroughAgency = federalPassThroughAgency;
1020: }
1021:
1022: /**
1023: * Gets the awardPurpose attribute.
1024: *
1025: * @return Returns the awardPurpose
1026: */
1027: public ProposalPurpose getAwardPurpose() {
1028: return awardPurpose;
1029: }
1030:
1031: /**
1032: * Sets the awardPurpose attribute.
1033: *
1034: * @param awardPurpose The awardPurpose to set.
1035: * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
1036: * creation of the object and should not be changed.
1037: */
1038: @Deprecated
1039: public void setAwardPurpose(ProposalPurpose awardPurpose) {
1040: this .awardPurpose = awardPurpose;
1041: }
1042:
1043: /**
1044: * Gets the awardProjectDirectors list.
1045: *
1046: * @return Returns the awardProjectDirectors list
1047: */
1048: public List<AwardProjectDirector> getAwardProjectDirectors() {
1049: return awardProjectDirectors;
1050: }
1051:
1052: /**
1053: * Sets the awardProjectDirectors list.
1054: *
1055: * @param awardProjectDirectors The awardProjectDirectors list to set.
1056: */
1057: public void setAwardProjectDirectors(
1058: List<AwardProjectDirector> awardProjectDirectors) {
1059: this .awardProjectDirectors = awardProjectDirectors;
1060: }
1061:
1062: /**
1063: * Gets the awardAccounts list.
1064: *
1065: * @return Returns the awardAccounts.
1066: */
1067: public List<AwardAccount> getAwardAccounts() {
1068: return awardAccounts;
1069: }
1070:
1071: /**
1072: * Sets the awardAccounts list.
1073: *
1074: * @param awardAccounts The awardAccounts to set.
1075: */
1076: public void setAwardAccounts(List<AwardAccount> awardAccounts) {
1077: this .awardAccounts = awardAccounts;
1078: }
1079:
1080: /**
1081: * Gets the awardOrganizations list.
1082: *
1083: * @return Returns the awardOrganizations.
1084: */
1085: public List<AwardOrganization> getAwardOrganizations() {
1086: return awardOrganizations;
1087: }
1088:
1089: /**
1090: * Sets the awardOrganizations list.
1091: *
1092: * @param awardOrganizations The awardOrganizations to set.
1093: */
1094: public void setAwardOrganizations(
1095: List<AwardOrganization> awardOrganizations) {
1096: this .awardOrganizations = awardOrganizations;
1097: }
1098:
1099: /**
1100: * Gets the awardSubcontractors list.
1101: *
1102: * @return Returns the awardSubcontractors.
1103: */
1104: public List<AwardSubcontractor> getAwardSubcontractors() {
1105: return awardSubcontractors;
1106: }
1107:
1108: /**
1109: * Sets the awardSubcontractors list.
1110: *
1111: * @param awardSubcontractors The awardSubcontractors to set.
1112: */
1113: public void setAwardSubcontractors(
1114: List<AwardSubcontractor> awardSubcontractors) {
1115: this .awardSubcontractors = awardSubcontractors;
1116: }
1117:
1118: /**
1119: * Returns a KualiGroup object whose name is defined by workgroupName.
1120: *
1121: * @return KualiGroup defined by workgroupName
1122: */
1123: public KualiGroup getWorkgroup() {
1124: return SpringContext.getBean(AwardService.class).getKualiGroup(
1125: workgroupName);
1126: }
1127:
1128: /**
1129: * Sets the local workgroupName attribute to the name of the passed in workgroup object.
1130: *
1131: * @param workgroup KualiGroup object to use to set the local workgroupName attribute.
1132: */
1133: public void setWorkgroup(KualiGroup workgroup) {
1134: this .workgroupName = workgroup.getGroupName();
1135: }
1136:
1137: /**
1138: * This method gets the primary award organization.
1139: *
1140: * @return The award organization object marked as primary in the award organizations collection.
1141: */
1142: public AwardOrganization getPrimaryAwardOrganization() {
1143: for (AwardOrganization ao : awardOrganizations) {
1144: if (ao != null && ao.isAwardPrimaryOrganizationIndicator()) {
1145: setPrimaryAwardOrganization(ao);
1146: break;
1147: }
1148: }
1149:
1150: return primaryAwardOrganization;
1151: }
1152:
1153: /**
1154: * This method sets the primary award organization.
1155: *
1156: * @param primaryAwardOrganization
1157: */
1158: public void setPrimaryAwardOrganization(
1159: AwardOrganization primaryAwardOrganization) {
1160: this .primaryAwardOrganization = primaryAwardOrganization;
1161: this .routingChart = primaryAwardOrganization
1162: .getChartOfAccountsCode();
1163: this .routingOrg = primaryAwardOrganization
1164: .getOrganizationCode();
1165: }
1166:
1167: /**
1168: * Retrieves the list of users assigned to the associated workgroup and builds out a string representation of these users for
1169: * display purposes. NOTE: This method is used by the Account and Award Inquiry screens to display users of the associated
1170: * workgroup. NOTE: This method currently has not other use outside of the Account Inquiry screen.
1171: *
1172: * @return String representation of the users assigned to the associated workgroup.
1173: */
1174: public String getKualiGroupNames() {
1175: StringBuffer names = new StringBuffer(20);
1176:
1177: KualiGroup finSysWorkgroup = getWorkgroup();
1178:
1179: if (finSysWorkgroup == null) {
1180: return "";
1181: } else {
1182: List<String> users = finSysWorkgroup.getGroupUsers();
1183: if (users.isEmpty()) {
1184: names.append("Workgroup user list is empty");
1185: } else {
1186: int i = 0;
1187: for (String userName : users) {
1188: try {
1189: UniversalUser user = SpringContext
1190: .getBean(UniversalUserService.class)
1191: .getUniversalUserByAuthenticationUserId(
1192: userName);
1193: names.append(user.getPersonName());
1194: } catch (UserNotFoundException unfe) {
1195: names.append("No User Name Found (" + userName
1196: + ")");
1197: }
1198: if (users.size() > 1) {
1199: names.append("; ");
1200: }
1201: i++;
1202: }
1203: }
1204: }
1205:
1206: kualiGroupNames = names.toString();
1207:
1208: return kualiGroupNames;
1209: }
1210:
1211: /**
1212: * Simple method that simply sets the kualiGroupNames attribute by calling the getter, which performs all the necessary parsing
1213: * to retrieve the names.
1214: *
1215: * @param kualiGroupNames Value to be assigned to the kualiGroupNames attribute. This value is never actually set.
1216: */
1217: public void setKualiGroupNames(String kualiGroupNames) {
1218: this .kualiGroupNames = getKualiGroupNames();
1219: }
1220:
1221: /**
1222: * This method maps the proposal number into a hash map with "proposalNumber" as the identifier.
1223: *
1224: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
1225: */
1226: @Override
1227: @SuppressWarnings("unchecked")
1228: protected LinkedHashMap toStringMapper() {
1229: LinkedHashMap<String, String> m = new LinkedHashMap<String, String>();
1230: if (this .proposalNumber != null) {
1231: m.put("proposalNumber", this .proposalNumber.toString());
1232: }
1233: return m;
1234: }
1235:
1236: /**
1237: * Sums the total for all award subcontractors
1238: *
1239: * @return Returns the total of all the award subcontractor's amounts
1240: */
1241: public KualiDecimal getAwardSubcontractorsTotalAmount() {
1242: KualiDecimal total = KualiDecimal.ZERO;
1243: for (AwardSubcontractor subcontractor : getAwardSubcontractors()) {
1244: KualiDecimal amount = subcontractor
1245: .getSubcontractorAmount();
1246: if (ObjectUtils.isNotNull(amount)) {
1247: total = total.add(amount);
1248: }
1249: }
1250: return total;
1251: }
1252:
1253: /**
1254: * @see org.kuali.workflow.attribute.AlternateOrgReviewRouting#getRoutingChart()
1255: */
1256: public String getRoutingChart() {
1257: return routingChart;
1258: }
1259:
1260: /**
1261: * @see org.kuali.workflow.attribute.AlternateOrgReviewRouting#setRoutingChart(java.lang.String)
1262: */
1263: public void setRoutingChart(String routingChart) {
1264: this .routingChart = routingChart;
1265: }
1266:
1267: /**
1268: * @see org.kuali.workflow.attribute.AlternateOrgReviewRouting#getRoutingOrg()
1269: */
1270: public String getRoutingOrg() {
1271: return routingOrg;
1272: }
1273:
1274: /**
1275: * @see org.kuali.workflow.attribute.AlternateOrgReviewRouting#setRoutingOrg(java.lang.String)
1276: */
1277: public void setRoutingOrg(String routingOrg) {
1278: this.routingOrg = routingOrg;
1279: }
1280:
1281: }
|