001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016:
017: package org.kuali.module.cg.bo;
018:
019: import java.util.LinkedHashMap;
020:
021: import org.kuali.core.bo.Inactivateable;
022: import org.kuali.core.bo.PersistableBusinessObjectBase;
023:
024: /**
025: * This class represents an association between an award and a project director. It's like a reference to the project director from
026: * the award. This way an award can maintain a collection of these references instead of owning project directors directly.
027: */
028: public class AwardProjectDirector extends PersistableBusinessObjectBase
029: implements Primaryable, CGProjectDirector, Inactivateable {
030:
031: private String personUniversalIdentifier;
032: private Long proposalNumber;
033: private boolean awardPrimaryProjectDirectorIndicator;
034: private String awardProjectDirectorProjectTitle;
035: private boolean active = true;
036:
037: private ProjectDirector projectDirector;
038:
039: /**
040: * Default no-args constructor.
041: */
042: public AwardProjectDirector() {
043: // Struts needs this instance to populate the secondary key, personUserIdentifier.
044: projectDirector = new ProjectDirector();
045: }
046:
047: /**
048: * @see org.kuali.module.cg.bo.CGProjectDirector#getPersonUniversalIdentifier()
049: */
050: public String getPersonUniversalIdentifier() {
051: return personUniversalIdentifier;
052: }
053:
054: /**
055: * @see org.kuali.module.cg.bo.CGProjectDirector#setPersonUniversalIdentifier(java.lang.String)
056: */
057: public void setPersonUniversalIdentifier(
058: String personUniversalIdentifier) {
059: this .personUniversalIdentifier = personUniversalIdentifier;
060: }
061:
062: /**
063: * @see org.kuali.module.cg.bo.CGProjectDirector#getProposalNumber()
064: */
065: public Long getProposalNumber() {
066: return proposalNumber;
067: }
068:
069: /**
070: * @see org.kuali.module.cg.bo.CGProjectDirector#setProposalNumber(java.lang.Long)
071: */
072: public void setProposalNumber(Long proposalNumber) {
073: this .proposalNumber = proposalNumber;
074: }
075:
076: /**
077: * Gets the awardPrimaryProjectDirectorIndicator attribute.
078: *
079: * @return Returns the awardPrimaryProjectDirectorIndicator
080: */
081: public boolean isAwardPrimaryProjectDirectorIndicator() {
082: return awardPrimaryProjectDirectorIndicator;
083: }
084:
085: /**
086: * Sets the awardPrimaryProjectDirectorIndicator attribute.
087: *
088: * @param awardPrimaryProjectDirectorIndicator The awardPrimaryProjectDirectorIndicator to set.
089: */
090: public void setAwardPrimaryProjectDirectorIndicator(
091: boolean awardPrimaryProjectDirectorIndicator) {
092: this .awardPrimaryProjectDirectorIndicator = awardPrimaryProjectDirectorIndicator;
093: }
094:
095: /**
096: * Gets the awardProjectDirectorProjectTitle attribute.
097: *
098: * @return Returns the awardProjectDirectorProjectTitle
099: */
100: public String getAwardProjectDirectorProjectTitle() {
101: return awardProjectDirectorProjectTitle;
102: }
103:
104: /**
105: * Sets the awardProjectDirectorProjectTitle attribute.
106: *
107: * @param awardProjectDirectorProjectTitle The awardProjectDirectorProjectTitle to set.
108: */
109: public void setAwardProjectDirectorProjectTitle(
110: String awardProjectDirectorProjectTitle) {
111: this .awardProjectDirectorProjectTitle = awardProjectDirectorProjectTitle;
112: }
113:
114: /**
115: * @see org.kuali.module.cg.bo.CGProjectDirector#getProjectDirector()
116: */
117: public ProjectDirector getProjectDirector() {
118: return projectDirector;
119: }
120:
121: /**
122: * @see org.kuali.module.cg.bo.CGProjectDirector#setProjectDirector(org.kuali.module.cg.bo.ProjectDirector)
123: */
124: public void setProjectDirector(ProjectDirector projectDirector) {
125: this .projectDirector = projectDirector;
126: }
127:
128: /**
129: * @see Primaryable#isPrimary()
130: */
131: public boolean isPrimary() {
132: return isAwardPrimaryProjectDirectorIndicator();
133: }
134:
135: /**
136: * @see org.kuali.core.bo.Inactivateable#isActive()
137: */
138: public boolean isActive() {
139: return active;
140: }
141:
142: /**
143: * @see org.kuali.core.bo.Inactivateable#setActive(boolean)
144: */
145: public void setActive(boolean active) {
146: this .active = active;
147: }
148:
149: /**
150: * @see org.kuali.core.bo.BusinessObjectBase#toStringMapper()
151: */
152: @SuppressWarnings("unchecked")
153: @Override
154: protected LinkedHashMap toStringMapper() {
155: LinkedHashMap m = new LinkedHashMap();
156: m.put("personUniversalIdentifier",
157: this .personUniversalIdentifier);
158: if (this .proposalNumber != null) {
159: m.put("proposalNumber", this.proposalNumber.toString());
160: }
161: return m;
162: }
163:
164: }
|