1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.sys.businessobject;
18
19 import java.util.HashMap;
20 import java.util.Map;
21
22 import org.apache.commons.lang.StringUtils;
23 import org.kuali.ole.sys.context.SpringContext;
24 import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
25 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
26 import org.kuali.rice.krad.service.KualiModuleService;
27 import org.kuali.rice.krad.service.ModuleService;
28 import org.kuali.rice.location.api.LocationConstants;
29 import org.kuali.rice.location.framework.campus.CampusEbo;
30
31
32
33
34 public class Room extends PersistableBusinessObjectBase implements MutableInactivatable {
35
36 protected String campusCode;
37 protected String buildingCode;
38 protected String buildingRoomNumber;
39 protected String buildingRoomType;
40 protected String buildingRoomDepartment;
41 protected String buildingRoomDescription;
42 protected boolean active;
43
44 protected CampusEbo campus;
45 protected Building building;
46
47
48
49
50 public Room() {
51
52 }
53
54
55
56
57
58
59 public String getCampusCode() {
60 return campusCode;
61 }
62
63
64
65
66
67
68 public void setCampusCode(String campusCode) {
69 this.campusCode = campusCode;
70 }
71
72
73
74
75
76
77
78 public String getBuildingCode() {
79 return buildingCode;
80 }
81
82
83
84
85
86
87 public void setBuildingCode(String buildingCode) {
88 this.buildingCode = buildingCode;
89 }
90
91
92
93
94
95
96
97 public String getBuildingRoomNumber() {
98 return buildingRoomNumber;
99 }
100
101
102
103
104
105
106 public void setBuildingRoomNumber(String buildingRoomNumber) {
107 this.buildingRoomNumber = buildingRoomNumber;
108 }
109
110
111
112
113
114
115
116 public String getBuildingRoomType() {
117 return buildingRoomType;
118 }
119
120
121
122
123
124
125 public void setBuildingRoomType(String buildingRoomType) {
126 this.buildingRoomType = buildingRoomType;
127 }
128
129
130
131
132
133
134
135 public String getBuildingRoomDepartment() {
136 return buildingRoomDepartment;
137 }
138
139
140
141
142
143
144 public void setBuildingRoomDepartment(String buildingRoomDepartment) {
145 this.buildingRoomDepartment = buildingRoomDepartment;
146 }
147
148
149
150
151
152
153
154 public String getBuildingRoomDescription() {
155 return buildingRoomDescription;
156 }
157
158
159
160
161
162
163 public void setBuildingRoomDescription(String buildingRoomDescription) {
164 this.buildingRoomDescription = buildingRoomDescription;
165 }
166
167
168
169
170
171
172
173 public CampusEbo getCampus() {
174 if ( StringUtils.isBlank(campusCode) ) {
175 campus = null;
176 } else {
177 if ( campus == null || !StringUtils.equals( campus.getCode(),campusCode) ) {
178 ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CampusEbo.class);
179 if ( moduleService != null ) {
180 Map<String,Object> keys = new HashMap<String, Object>(1);
181 keys.put(LocationConstants.PrimaryKeyConstants.CODE, campusCode);
182 campus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);
183 } else {
184 throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class. Unable to proceed." );
185 }
186 }
187 }
188 return campus;
189 }
190
191
192
193
194
195
196
197 public void setCampus(CampusEbo campus) {
198 this.campus = campus;
199 }
200
201
202
203
204
205
206 public Building getBuilding() {
207 return building;
208 }
209
210
211
212
213
214
215
216 public void setBuilding(Building building) {
217 this.building = building;
218 }
219
220
221
222
223
224
225
226 @Override
227 public boolean isActive() {
228 return active;
229 }
230
231
232
233
234
235
236
237 @Override
238 public void setActive(boolean active) {
239 this.active = active;
240 }
241 }