1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.fp.businessobject;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import org.apache.commons.lang.StringUtils;
22 import org.kuali.ole.sys.OLEPropertyConstants;
23 import org.kuali.ole.sys.businessobject.Building;
24 import org.kuali.ole.sys.businessobject.Room;
25 import org.kuali.ole.sys.context.SpringContext;
26 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
27 import org.kuali.rice.krad.service.KualiModuleService;
28 import org.kuali.rice.krad.service.ModuleService;
29 import org.kuali.rice.location.api.LocationConstants;
30 import org.kuali.rice.location.framework.campus.CampusEbo;
31
32 public class CapitalAssetInformationDetail extends PersistableBusinessObjectBase {
33
34
35 protected String documentNumber;
36 protected Integer capitalAssetLineNumber;
37 protected Integer itemLineNumber;
38 protected String campusCode;
39 protected String buildingCode;
40 protected String buildingRoomNumber;
41 protected String buildingSubRoomNumber;
42 protected String capitalAssetTagNumber;
43 protected String capitalAssetSerialNumber;
44
45 protected CampusEbo campus;
46 protected Building building;
47 protected Room room;
48 protected CapitalAssetInformation capitalAssetInformation;
49
50
51
52
53
54
55
56 public String getDocumentNumber() {
57 return documentNumber;
58 }
59
60
61
62
63
64
65 public void setDocumentNumber(String documentNumber) {
66 this.documentNumber = documentNumber;
67 }
68
69
70
71
72
73
74 public Integer getItemLineNumber() {
75 return itemLineNumber;
76 }
77
78
79
80
81
82
83 public void setItemLineNumber(Integer itemLineNumber) {
84 this.itemLineNumber = itemLineNumber;
85 }
86
87
88
89
90
91
92 public String getCampusCode() {
93 return campusCode;
94 }
95
96
97
98
99
100
101 public void setCampusCode(String campusCode) {
102 this.campusCode = campusCode;
103 }
104
105
106
107
108
109
110 public String getBuildingCode() {
111 return buildingCode;
112 }
113
114
115
116
117
118
119 public void setBuildingCode(String buildingCode) {
120 this.buildingCode = buildingCode;
121 }
122
123
124
125
126
127
128 public String getBuildingRoomNumber() {
129 return buildingRoomNumber;
130 }
131
132
133
134
135
136
137 public void setBuildingRoomNumber(String buildingRoomNumber) {
138 this.buildingRoomNumber = buildingRoomNumber;
139 }
140
141
142
143
144
145
146 public String getCapitalAssetTagNumber() {
147 return capitalAssetTagNumber;
148 }
149
150
151
152
153
154
155 public void setCapitalAssetTagNumber(String capitalAssetTagNumber) {
156 this.capitalAssetTagNumber = capitalAssetTagNumber;
157 }
158
159
160
161
162
163
164 public String getCapitalAssetSerialNumber() {
165 return capitalAssetSerialNumber;
166 }
167
168
169
170
171
172
173 public void setCapitalAssetSerialNumber(String capitalAssetSerialNumber) {
174 this.capitalAssetSerialNumber = capitalAssetSerialNumber;
175 }
176
177
178
179
180
181
182 public CampusEbo getCampus() {
183 if ( StringUtils.isBlank(campusCode) ) {
184 campus = null;
185 } else {
186 if ( campus == null || !StringUtils.equals( campus.getCode(),campusCode) ) {
187 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CampusEbo.class);
188 if ( moduleService != null ) {
189 Map<String,Object> keys = new HashMap<String, Object>(1);
190 keys.put(LocationConstants.PrimaryKeyConstants.CODE, campusCode);
191 campus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);
192 } else {
193 throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
194 }
195 }
196 }
197
198 return campus;
199 }
200
201
202
203
204
205
206 public void setCampus(CampusEbo campus) {
207 this.campus = campus;
208 }
209
210
211
212
213
214
215 public Building getBuilding() {
216 return building;
217 }
218
219
220
221
222
223
224 public void setBuilding(Building building) {
225 this.building = building;
226 }
227
228
229
230
231
232
233 public Room getRoom() {
234 return room;
235 }
236
237
238
239
240
241
242 public void setRoom(Room room) {
243 this.room = room;
244 }
245
246
247
248
249
250
251 public CapitalAssetInformation getCapitalAssetInformation() {
252 return capitalAssetInformation;
253 }
254
255
256
257
258
259
260 public void setCapitalAssetInformation(CapitalAssetInformation capitalAssetInformation) {
261 this.capitalAssetInformation = capitalAssetInformation;
262 }
263
264
265
266
267
268 public String getBuildingSubRoomNumber() {
269 return buildingSubRoomNumber;
270 }
271
272
273
274
275
276 public void setBuildingSubRoomNumber(String buildingSubRoomNumber) {
277 this.buildingSubRoomNumber = buildingSubRoomNumber;
278 }
279
280
281
282
283
284 public Integer getCapitalAssetLineNumber() {
285 return capitalAssetLineNumber;
286 }
287
288
289
290
291
292 public void setCapitalAssetLineNumber(Integer capitalAssetLineNumber) {
293 this.capitalAssetLineNumber = capitalAssetLineNumber;
294 }
295
296
297
298
299
300
301 public Map<String, Object> getValuesMap() {
302 Map<String, Object> simpleValues = new HashMap<String, Object>();
303
304 simpleValues.put(OLEPropertyConstants.DOCUMENT_NUMBER, this.getDocumentNumber());
305 simpleValues.put(OLEPropertyConstants.CAPITAL_ASSET_LINE_NUMBER, this.getCapitalAssetLineNumber());
306 simpleValues.put(OLEPropertyConstants.ITEM_LINE_NUMBER, this.getItemLineNumber());
307 simpleValues.put(OLEPropertyConstants.CAMPUS_CODE, this.getCampusCode());
308 simpleValues.put(OLEPropertyConstants.BUILDING_CODE, this.getBuildingCode());
309 simpleValues.put(OLEPropertyConstants.BUILDING_ROOM_NUMBER, this.getBuildingRoomNumber());
310
311 return simpleValues;
312 }
313 }