View Javadoc
1   /*
2    * Copyright 2007 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  package org.kuali.ole.gl.businessobject;
17  
18  import java.sql.Date;
19  import java.util.HashMap;
20  import java.util.LinkedHashMap;
21  import java.util.Map;
22  
23  import org.kuali.ole.coa.businessobject.Chart;
24  import org.kuali.ole.coa.businessobject.Organization;
25  import org.kuali.ole.sys.OLEPropertyConstants;
26  import org.kuali.ole.sys.context.SpringContext;
27  import org.kuali.rice.core.api.util.type.KualiDecimal;
28  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
29  import org.kuali.rice.krad.util.KRADPropertyConstants;
30  import org.kuali.rice.location.api.campus.Campus;
31  import org.kuali.rice.location.api.campus.CampusService;
32  
33  /**
34   * This class represents a unique header for use with a CollectorBatch class
35   */
36  public class CollectorHeader extends PersistableBusinessObjectBase {
37  
38      private String chartOfAccountsCode;
39      private String organizationCode;
40      private Date processTransmissionDate;
41      private Integer processBatchSequenceNumber;
42      private Integer processTotalRecordCount;
43      private KualiDecimal processTotalAmount;
44      private String campusCode;
45      private String contactPersonPhoneNumber;
46      private String contactMailingAddress;
47      private String contactDepartmentName;
48  
49      private Organization organization;
50      private Chart chartOfAccounts;
51      private Campus campus;
52  
53      /**
54       * Default constructor.
55       */
56      public CollectorHeader() {
57  
58      }
59  
60      /**
61       * Gets the chartOfAccountsCode attribute.
62       * 
63       * @return Returns the chartOfAccountsCode
64       */
65      public String getChartOfAccountsCode() {
66          return chartOfAccountsCode;
67      }
68  
69      /**
70       * Sets the chartOfAccountsCode attribute.
71       * 
72       * @param chartOfAccountsCode The chartOfAccountsCode to set.
73       */
74      public void setChartOfAccountsCode(String chartOfAccountsCode) {
75          this.chartOfAccountsCode = chartOfAccountsCode;
76      }
77  
78  
79      /**
80       * Gets the organizationCode attribute.
81       * 
82       * @return Returns the organizationCode
83       */
84      public String getOrganizationCode() {
85          return organizationCode;
86      }
87  
88      /**
89       * Sets the organizationCode attribute.
90       * 
91       * @param organizationCode The organizationCode to set.
92       */
93      public void setOrganizationCode(String organizationCode) {
94          this.organizationCode = organizationCode;
95      }
96  
97  
98      /**
99       * Gets the processTransmissionDate attribute.
100      * 
101      * @return Returns the processTransmissionDate
102      */
103     public Date getProcessTransmissionDate() {
104         return processTransmissionDate;
105     }
106 
107     /**
108      * Sets the processTransmissionDate attribute.
109      * 
110      * @param processTransmissionDate The processTransmissionDate to set.
111      */
112     public void setProcessTransmissionDate(Date processTransmissionDate) {
113         this.processTransmissionDate = processTransmissionDate;
114     }
115 
116 
117     /**
118      * Gets the processBatchSequenceNumber attribute.
119      * 
120      * @return Returns the processBatchSequenceNumber
121      */
122     public Integer getProcessBatchSequenceNumber() {
123         return processBatchSequenceNumber;
124     }
125 
126     /**
127      * Sets the processBatchSequenceNumber attribute.
128      * 
129      * @param processBatchSequenceNumber The processBatchSequenceNumber to set.
130      */
131     public void setProcessBatchSequenceNumber(Integer processBatchSequenceNumber) {
132         this.processBatchSequenceNumber = processBatchSequenceNumber;
133     }
134 
135 
136     /**
137      * Gets the processTotalRecordCount attribute.
138      * 
139      * @return Returns the processTotalRecordCount
140      */
141     public Integer getProcessTotalRecordCount() {
142         return processTotalRecordCount;
143     }
144 
145     /**
146      * Sets the processTotalRecordCount attribute.
147      * 
148      * @param processTotalRecordCount The processTotalRecordCount to set.
149      */
150     public void setProcessTotalRecordCount(Integer processTotalRecordCount) {
151         this.processTotalRecordCount = processTotalRecordCount;
152     }
153 
154 
155     /**
156      * Gets the processTotalAmount attribute.
157      * 
158      * @return Returns the processTotalAmount
159      */
160     public KualiDecimal getProcessTotalAmount() {
161         return processTotalAmount;
162     }
163 
164     /**
165      * Sets the processTotalAmount attribute.
166      * 
167      * @param processTotalAmount The processTotalAmount to set.
168      */
169     public void setProcessTotalAmount(KualiDecimal processTotalAmount) {
170         this.processTotalAmount = processTotalAmount;
171     }
172 
173 
174     /**
175      * Gets the organization attribute.
176      * 
177      * @return Returns the organization
178      */
179     public Organization getOrganization() {
180         return organization;
181     }
182 
183     /**
184      * Sets the organization attribute.
185      * 
186      * @param organization The organization to set.
187      * @deprecated
188      */
189     public void setOrganization(Organization organization) {
190         this.organization = organization;
191     }
192 
193     /**
194      * Gets the chartOfAccounts attribute.
195      * 
196      * @return Returns the chartOfAccounts
197      */
198     public Chart getChartOfAccounts() {
199         return chartOfAccounts;
200     }
201 
202     /**
203      * Sets the chartOfAccounts attribute.
204      * 
205      * @param chartOfAccounts The chartOfAccounts to set.
206      * @deprecated
207      */
208     public void setChartOfAccounts(Chart chartOfAccounts) {
209         this.chartOfAccounts = chartOfAccounts;
210     }
211 
212     /**
213      * @see org.kuali.rice.krad.bo.BusinessObjectBase#toStringMapper()
214      */
215     protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
216         LinkedHashMap<String, String> m = new LinkedHashMap();
217         m.put(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE, this.chartOfAccountsCode);
218         m.put(OLEPropertyConstants.ORGANIZATION_CODE, this.organizationCode);
219         if (this.processTransmissionDate != null) {
220             m.put(OLEPropertyConstants.PROCESS_TRANSMISSION_DATE, this.processTransmissionDate.toString());
221         }
222         if (this.processBatchSequenceNumber != null) {
223             m.put(OLEPropertyConstants.PROCESS_BATCH_SEQUENCE_NUMBER, this.processBatchSequenceNumber.toString());
224         }
225         if (this.processTotalRecordCount != null) {
226             m.put(OLEPropertyConstants.PROCESS_TOTAL_RECORD_COUNT, this.processTotalRecordCount.toString());
227         }
228         if (this.processTotalAmount != null) {
229             m.put(OLEPropertyConstants.PROCESS_TOTAL_AMOUNT, this.processTotalAmount.toString());
230         }
231         return m;
232     }
233 
234     /**
235      * Gets the campusCode attribute.
236      * 
237      * @return Returns the campusCode.
238      */
239     public String getCampusCode() {
240         return campusCode;
241     }
242 
243     /**
244      * Sets the campusCode attribute value.
245      * 
246      * @param campusCode The campusCode to set.
247      */
248     public void setContactCampusCode(String campusCode) {
249         this.campusCode = campusCode;
250     }
251 
252     /**
253      * Gets the departmentName attribute.
254      * 
255      * @return Returns the departmentName.
256      */
257     public String getContactDepartmentName() {
258         return contactDepartmentName;
259     }
260 
261     /**
262      * Sets the departmentName attribute value.
263      * 
264      * @param departmentName The departmentName to set.
265      */
266     public void setContactDepartmentName(String contactDepartmentName) {
267         this.contactDepartmentName = contactDepartmentName;
268     }
269 
270     /**
271      * Gets the mailingAddress attribute.
272      * 
273      * @return Returns the mailingAddress.
274      */
275     public String getContactMailingAddress() {
276         return contactMailingAddress;
277     }
278 
279     /**
280      * Sets the mailingAddress attribute value.
281      * 
282      * @param mailingAddress The mailingAddress to set.
283      */
284     public void setContactMailingAddress(String contactMailingAddress) {
285         this.contactMailingAddress = contactMailingAddress;
286     }
287 
288     /**
289      * Gets the phoneNumber attribute.
290      * 
291      * @return Returns the phoneNumber.
292      */
293     public String getContactPersonPhoneNumber() {
294         return contactPersonPhoneNumber;
295     }
296 
297     /**
298      * Sets the phoneNumber attribute value.
299      * 
300      * @param phoneNumber The phoneNumber to set.
301      */
302     public void setContactPersonPhoneNumber(String contactPersonPhoneNumber) {
303         this.contactPersonPhoneNumber = contactPersonPhoneNumber;
304     }
305 
306     /**
307      * Gets the campus attribute.
308      * 
309      * @return Returns the campus.
310      */
311     public Campus getCampus() {
312         Map<String, Object> criteria = new HashMap<String, Object>();
313         criteria.put(KRADPropertyConstants.CAMPUS_CODE, campusCode);
314         return campus = SpringContext.getBean(CampusService.class).getCampus(campusCode/*RICE_20_REFACTORME  criteria */);
315     }
316 
317     /**
318      * Sets the campus attribute value.
319      * 
320      * @param campus The campus to set.
321      */
322     public void setCampus(Campus campus) {
323         this.campus = campus;
324     }
325 }