1   package org.kuali.ole.describe.bo;
2   
3   import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
4   
5   import java.util.LinkedHashMap;
6   
7   
8   
9   
10  
11  public class OleLocation extends PersistableBusinessObjectBase {
12  
13      private String locationId;
14      private String locationCode;
15      private String locationName;
16      private String parentLocationId;
17      private String levelId;
18      private String levelCode;
19      private OleLocation oleLocation;
20      private OleLocationLevel oleLocationLevel;
21      private String fullLocationPath;
22  
23      
24  
25  
26  
27  
28      public String getLevelCode() {
29          return oleLocationLevel.getLevelCode();
30      }
31  
32      
33  
34  
35  
36  
37      public void setLevelCode(String levelCode) {
38          this.levelCode = levelCode;
39      }
40  
41      
42  
43  
44  
45  
46      public String getParentLocationId() {
47          return parentLocationId;
48      }
49  
50      
51  
52  
53  
54  
55      public void setParentLocationId(String parentLocationId) {
56          if (parentLocationId != null && parentLocationId.equals(""))
57              this.parentLocationId = null;
58          else
59              this.parentLocationId = parentLocationId;
60      }
61  
62      
63  
64  
65  
66  
67      public String getLocationName() {
68          return locationName;
69      }
70  
71      
72  
73  
74  
75  
76      public void setLocationName(String locationName) {
77          this.locationName = locationName;
78      }
79  
80      
81  
82  
83  
84  
85      public String getLocationCode() {
86          return locationCode;
87      }
88  
89      
90  
91  
92  
93  
94      public void setLocationCode(String locationCode) {
95          this.locationCode = locationCode;
96      }
97  
98      
99  
100 
101 
102 
103     public String getLocationId() {
104         return locationId;
105     }
106 
107     
108 
109 
110 
111 
112     public void setLocationId(String locationId) {
113         this.locationId = locationId;
114     }
115 
116     
117 
118 
119 
120 
121     public OleLocation getOleLocation() {
122         return oleLocation;
123     }
124 
125     
126 
127 
128 
129 
130     public void setOleLocation(OleLocation oleLocation) {
131         this.oleLocation = oleLocation;
132     }
133 
134     
135 
136 
137 
138 
139     public String getLevelId() {
140         return levelId;
141     }
142 
143     
144 
145 
146 
147 
148     public void setLevelId(String levelId) {
149         this.levelId = levelId;
150     }
151 
152     
153 
154 
155 
156 
157     public OleLocationLevel getOleLocationLevel() {
158         return oleLocationLevel;
159     }
160 
161     
162 
163 
164 
165 
166     public void setOleLocationLevel(OleLocationLevel oleLocationLevel) {
167         this.oleLocationLevel = oleLocationLevel;
168     }
169 
170     
171 
172 
173 
174 
175     protected LinkedHashMap toStringMapper() {
176         LinkedHashMap toStringMap = new LinkedHashMap();
177         toStringMap.put("locationId", locationId);
178         return toStringMap;
179     }
180 
181 
182     public String getFullLocationPath() {
183         String fullLocationCode = this.getLocationCode();
184         OleLocation deskLocation = this.getOleLocation();
185         while (deskLocation != null) {
186             fullLocationCode = deskLocation.getLocationCode() + "/" + fullLocationCode;
187             if (deskLocation.getParentLocationId() != null) {
188                 deskLocation = deskLocation.getOleLocation();
189             } else
190                 deskLocation = null;
191         }
192         return fullLocationCode;
193     }
194 
195     public void setFullLocationPath(String fullLocationPath) {
196         this.fullLocationPath = fullLocationPath;
197     }
198 
199 
200 }