001 /*
002 * Copyright 2011 The Kuali Foundation.
003 *
004 * Licensed under the Educational Community License, Version 2.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/ecl2.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 * Created on Aug 19, 2004
018 *
019 */
020 package org.kuali.kfs.pdp.businessobject;
021
022 import java.sql.Timestamp;
023 import java.util.LinkedHashMap;
024
025 import org.kuali.kfs.sys.KFSPropertyConstants;
026 import org.kuali.kfs.sys.businessobject.TimestampedBusinessObjectBase;
027 import org.kuali.kfs.sys.context.SpringContext;
028 import org.kuali.rice.kim.bo.Person;
029 import org.kuali.rice.kns.bo.Campus;
030 import org.kuali.rice.kns.service.KualiModuleService;
031 import org.kuali.rice.kns.util.KualiInteger;
032
033
034 /**
035 * This class represents a Payment Process.
036 */
037 public class PaymentProcess extends TimestampedBusinessObjectBase {
038 private KualiInteger id;
039 private Timestamp processTimestamp;
040 private String campusCode;
041 private String processUserId;
042 private Person processUser;
043 private boolean extractedInd;
044 private boolean formattedIndicator;
045
046 private Campus campus;
047
048 /**
049 * Constructs a PaymentProcess.
050 */
051 public PaymentProcess() {
052 super();
053 this.setExtractedInd(false);
054 this.setFormattedIndicator(false);
055 }
056
057 /**
058 * This method updates the user based on processUserId.
059 *
060 * @param userService
061 */
062 public void updateUser(org.kuali.rice.kim.service.PersonService userService) {
063 Person u = userService.getPerson(processUserId);
064 setProcessUser(u);
065 }
066
067 /**
068 * This method gets the campusCode.
069 *
070 * @return campusCode
071 */
072 public String getCampusCode() {
073 return campusCode;
074 }
075
076 /**
077 * This method sets the campusCode.
078 *
079 * @param campusCode
080 */
081 public void setCampusCode(String campusCode) {
082 this.campusCode = campusCode;
083 }
084
085 /**
086 * This method gets the Id.
087 *
088 * @return id
089 */
090 public KualiInteger getId() {
091 return id;
092 }
093
094 /**
095 * This method sets the id.
096 *
097 * @param id
098 */
099 public void setId(KualiInteger id) {
100 this.id = id;
101 }
102
103 /**
104 * This method gets the processTimestamp
105 *
106 * @return processTimestamp
107 */
108 public Timestamp getProcessTimestamp() {
109 return processTimestamp;
110 }
111
112 /**
113 * This method sets the processTimestamp.
114 *
115 * @param processTimestamp
116 */
117 public void setProcessTimestamp(Timestamp processTimestamp) {
118 this.processTimestamp = processTimestamp;
119 }
120
121 /**
122 * This method gets the processUser.
123 *
124 * @return processUser
125 */
126 public Person getProcessUser() {
127 processUser = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(processUserId, processUser);
128 return processUser;
129 }
130
131 /**
132 * This method sets the processUser.
133 *
134 * @param processUser
135 */
136 public void setProcessUser(Person processUser) {
137 if (processUser != null) {
138 processUserId = processUser.getPrincipalId();
139 }
140 this.processUser = processUser;
141 }
142
143 /**
144 * This method gets the processUserId.
145 *
146 * @return processUserId
147 */
148 public String getProcessUserId() {
149 return processUserId;
150 }
151
152 /**
153 * This method sets the processUserId.
154 *
155 * @param processUserId
156 */
157 public void setProcessUserId(String processUserId) {
158 this.processUserId = processUserId;
159 }
160
161
162 /**
163 * This method gets the extractedInd.
164 *
165 * @return extractedInd
166 */
167 public boolean isExtractedInd() {
168 return extractedInd;
169 }
170
171
172 /**
173 * This method sets the extractedInd.
174 *
175 * @param extractedInd
176 */
177 public void setExtractedInd(boolean extractedInd) {
178 this.extractedInd = extractedInd;
179 }
180
181 /**
182 * This method gets the formattedIndicator.
183 *
184 * @return formattedIndicator
185 */
186 public boolean isFormattedIndicator() {
187 return formattedIndicator;
188 }
189
190 /**
191 * This method sets the formattedIndicator.
192 *
193 * @param formattedIndicator
194 */
195 public void setFormattedIndicator(boolean formattedIndicator) {
196 this.formattedIndicator = formattedIndicator;
197 }
198
199 /**
200 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
201 */
202 @Override
203 protected LinkedHashMap toStringMapper() {
204 LinkedHashMap m = new LinkedHashMap();
205
206 m.put(KFSPropertyConstants.ID, this.id);
207
208 return m;
209 }
210
211 /**
212 * This method gets the campus.
213 *
214 * @return campus
215 */
216 public Campus getCampus() {
217 return campus = (Campus) SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(Campus.class).retrieveExternalizableBusinessObjectIfNecessary(this, campus, "campus");
218 }
219
220 /**
221 * This method sets the campus.
222 *
223 * @param campus
224 */
225 public void setCampus(Campus campus) {
226 this.campus = campus;
227 }
228
229 }