View Javadoc
1   /*
2    * Copyright 2006 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.kuali.ole.module.cg.businessobject;
18  
19  import java.util.LinkedHashMap;
20  
21  import org.kuali.ole.coa.businessobject.Chart;
22  import org.kuali.ole.coa.businessobject.Organization;
23  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
24  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
25  
26  /**
27   * This class represents an association between an award and an organization. It's like a reference to the organization from the
28   * award. This way an award can maintain a collection of these references instead of owning organizations directly.
29   */
30  public class AwardOrganization extends PersistableBusinessObjectBase implements Primaryable, MutableInactivatable {
31  
32      private String chartOfAccountsCode;
33      private String organizationCode;
34      private Long proposalNumber;
35      private boolean awardPrimaryOrganizationIndicator;
36      private boolean active = true;
37  
38      private Chart chartOfAccounts;
39      private Organization organization;
40  
41      /**
42       * Default no-args constructor.
43       */
44      public AwardOrganization() {
45  
46      }
47  
48      /**
49       * Gets the chartOfAccountsCode attribute.
50       * 
51       * @return Returns the chartOfAccountsCode
52       */
53      public String getChartOfAccountsCode() {
54          return chartOfAccountsCode;
55      }
56  
57      /**
58       * Sets the chartOfAccountsCode attribute.
59       * 
60       * @param chartOfAccountsCode The chartOfAccountsCode to set.
61       */
62      public void setChartOfAccountsCode(String chartOfAccountsCode) {
63          this.chartOfAccountsCode = chartOfAccountsCode;
64      }
65  
66      /**
67       * Gets the organizationCode attribute.
68       * 
69       * @return Returns the organizationCode
70       */
71      public String getOrganizationCode() {
72          return organizationCode;
73      }
74  
75      /**
76       * Sets the organizationCode attribute.
77       * 
78       * @param organizationCode The organizationCode to set.
79       */
80      public void setOrganizationCode(String organizationCode) {
81          this.organizationCode = organizationCode;
82      }
83  
84      /**
85       * Gets the proposalNumber attribute.
86       * 
87       * @return Returns the proposalNumber
88       */
89      public Long getProposalNumber() {
90          return proposalNumber;
91      }
92  
93      /**
94       * Sets the proposalNumber attribute.
95       * 
96       * @param proposalNumber The proposalNumber to set.
97       */
98      public void setProposalNumber(Long proposalNumber) {
99          this.proposalNumber = proposalNumber;
100     }
101 
102     /**
103      * Gets the awardPrimaryOrganizationIndicator attribute.
104      * 
105      * @return Returns the awardPrimaryOrganizationIndicator
106      */
107     public boolean isAwardPrimaryOrganizationIndicator() {
108         return awardPrimaryOrganizationIndicator;
109     }
110 
111     /**
112      * Sets the awardPrimaryOrganizationIndicator attribute.
113      * 
114      * @param awardPrimaryOrganizationIndicator The awardPrimaryOrganizationIndicator to set.
115      */
116     public void setAwardPrimaryOrganizationIndicator(boolean awardPrimaryOrganizationIndicator) {
117         this.awardPrimaryOrganizationIndicator = awardPrimaryOrganizationIndicator;
118     }
119 
120     /**
121      * Gets the chartOfAccounts attribute.
122      * 
123      * @return Returns the chartOfAccounts
124      */
125     public Chart getChartOfAccounts() {
126         return chartOfAccounts;
127     }
128 
129     /**
130      * Sets the chartOfAccounts attribute.
131      * 
132      * @param chartOfAccounts The chartOfAccounts to set.
133      * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
134      *             creation of the object and should not be changed.
135      */
136     @Deprecated
137     public void setChartOfAccounts(Chart chartOfAccounts) {
138         this.chartOfAccounts = chartOfAccounts;
139     }
140 
141     /**
142      * Gets the organization attribute.
143      * 
144      * @return Returns the organization
145      */
146     public Organization getOrganization() {
147         return organization;
148     }
149 
150     /**
151      * Sets the organization attribute.
152      * 
153      * @param organization The organization to set.
154      * @deprecated Setter is required by OJB, but should not be used to modify this attribute. This attribute is set on the initial
155      *             creation of the object and should not be changed.
156      */
157     @Deprecated
158     public void setOrganization(Organization organization) {
159         this.organization = organization;
160     }
161 
162     /**
163      * @see Primaryable#isPrimary()
164      */
165     public boolean isPrimary() {
166         return isAwardPrimaryOrganizationIndicator();
167     }
168 
169     /**
170      * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable#isActive()
171      */
172     public boolean isActive() {
173         return active;
174     }
175 
176     /**
177      * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable#setActive(boolean)
178      */
179     public void setActive(boolean active) {
180         this.active = active;
181     }
182 
183     /**
184      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
185      */
186     @SuppressWarnings("unchecked")
187     
188     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
189         LinkedHashMap m = new LinkedHashMap();
190         m.put("chartOfAccountsCode", this.chartOfAccountsCode);
191         m.put("organizationCode", this.organizationCode);
192         if (this.proposalNumber != null) {
193             m.put("proposalNumber", this.proposalNumber.toString());
194         }
195         return m;
196     }
197 }