View Javadoc
1   package org.kuali.ole.select.bo;
2   
3   import org.kuali.ole.select.document.OLEPlatformRecordDocument;
4   import org.kuali.rice.krad.bo.BusinessObjectBase;
5   import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
6   import org.kuali.rice.krad.service.KRADServiceLocator;
7   import org.kuali.rice.krad.util.GlobalVariables;
8   import org.springframework.web.multipart.MultipartFile;
9   
10  import java.sql.Date;
11  import java.util.HashMap;
12  import java.util.Map;
13  
14  /**
15   * Created by chenchulakshmig on 9/17/14.
16   * OLEPlatformEventLog provides platform event log information through getter and setter.
17   */
18  public class OLEPlatformEventLog extends PersistableBusinessObjectBase {
19  
20      private String platformEventLogId;
21  
22      private String olePlatformId;
23  
24      private String logTypeId;
25  
26      private String logTypeName;
27  
28      private String eventTypeId;
29  
30      private String eventTypeName;
31  
32      private String problemTypeId;
33  
34      private String problemTypeName;
35  
36      private String eventNote;
37  
38      private String eventUserId;
39  
40      private Date eventReportedDate;
41  
42      private String eventStatus;
43  
44      private Date eventResolvedDate;
45  
46      private String eventResolution;
47  
48      private Integer eventTempId;
49  
50      private boolean saveFlag;
51  
52      private OLEPlatformRecordDocument olePlatformRecordDocument;
53  
54      private OLEEResPltfrmEventType eventType;
55  
56      private OLEProblemType problemType;
57  
58      private OLELogType logType;
59  
60      private MultipartFile attachmentFile1;
61  
62      private String attachmentFileName1;
63  
64      private String attachmentMimeType1;
65  
66      private byte[] attachmentContent1;
67  
68      private MultipartFile attachmentFile2;
69  
70      private String attachmentFileName2;
71  
72      private String attachmentMimeType2;
73  
74      private byte[] attachmentContent2;
75  
76      public OLEPlatformEventLog() {
77          this.setLogTypeId("1");
78          this.setEventReportedDate(new Date(System.currentTimeMillis()));
79          if (GlobalVariables.getUserSession() != null) {
80              this.setEventUserId(GlobalVariables.getUserSession().getPrincipalId());
81          }
82      }
83  
84      public String getPlatformEventLogId() {
85          return platformEventLogId;
86      }
87  
88      public void setPlatformEventLogId(String platformEventLogId) {
89          this.platformEventLogId = platformEventLogId;
90      }
91  
92      public String getOlePlatformId() {
93          return olePlatformId;
94      }
95  
96      public void setOlePlatformId(String olePlatformId) {
97          this.olePlatformId = olePlatformId;
98      }
99  
100     public String getLogTypeId() {
101         return logTypeId;
102     }
103 
104     public void setLogTypeId(String logTypeId) {
105         this.logTypeId = logTypeId;
106     }
107 
108     public String getLogTypeName() {
109         if (this.logType != null) {
110             return logType.getLogTypeName();
111         } else if (this.logTypeId != null) {
112             Map logTypeMap = new HashMap();
113             logTypeMap.put("logTypeId", this.logTypeId);
114             OLELogType oleLogType = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OLELogType.class, logTypeMap);
115             if (oleLogType != null) {
116                 return oleLogType.getLogTypeName();
117             }
118         }
119         return logTypeName;
120     }
121 
122     public void setLogTypeName(String logTypeName) {
123         this.logTypeName = logTypeName;
124     }
125 
126     public String getEventTypeId() {
127         return eventTypeId;
128     }
129 
130     public void setEventTypeId(String eventTypeId) {
131         this.eventTypeId = eventTypeId;
132     }
133 
134     public String getEventTypeName() {
135         if (this.eventType != null) {
136             return eventType.geteResPltfrmEventTypeName();
137         } else if (this.eventTypeId != null) {
138             Map eventTypeMap = new HashMap();
139             eventTypeMap.put("eResPltfrmEventTypeId", this.eventTypeId);
140             OLEEResPltfrmEventType oleEventType = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OLEEResPltfrmEventType.class, eventTypeMap);
141             if (oleEventType != null) {
142                 return oleEventType.geteResPltfrmEventTypeName();
143             }
144         }
145         return eventTypeName;
146     }
147 
148     public void setEventTypeName(String eventTypeName) {
149         this.eventTypeName = eventTypeName;
150     }
151 
152     public String getEventNote() {
153         return eventNote;
154     }
155 
156     public void setEventNote(String eventNote) {
157         this.eventNote = eventNote;
158     }
159 
160     public String getEventUserId() {
161         return eventUserId;
162     }
163 
164     public void setEventUserId(String eventUserId) {
165         this.eventUserId = eventUserId;
166     }
167 
168     public Date getEventReportedDate() {
169         return eventReportedDate;
170     }
171 
172     public void setEventReportedDate(Date eventReportedDate) {
173         this.eventReportedDate = eventReportedDate;
174     }
175 
176     public String getEventStatus() {
177         return eventStatus;
178     }
179 
180     public void setEventStatus(String eventStatus) {
181         this.eventStatus = eventStatus;
182     }
183 
184     public Date getEventResolvedDate() {
185         return eventResolvedDate;
186     }
187 
188     public void setEventResolvedDate(Date eventResolvedDate) {
189         this.eventResolvedDate = eventResolvedDate;
190     }
191 
192     public String getEventResolution() {
193         return eventResolution;
194     }
195 
196     public void setEventResolution(String eventResolution) {
197         this.eventResolution = eventResolution;
198     }
199 
200     public Integer getEventTempId() {
201         return eventTempId;
202     }
203 
204     public void setEventTempId(Integer eventTempId) {
205         this.eventTempId = eventTempId;
206     }
207 
208     public boolean isSaveFlag() {
209         return saveFlag;
210     }
211 
212     public void setSaveFlag(boolean saveFlag) {
213         this.saveFlag = saveFlag;
214     }
215 
216     public OLEPlatformRecordDocument getOlePlatformRecordDocument() {
217         return olePlatformRecordDocument;
218     }
219 
220     public void setOlePlatformRecordDocument(OLEPlatformRecordDocument olePlatformRecordDocument) {
221         this.olePlatformRecordDocument = olePlatformRecordDocument;
222     }
223 
224     public String getProblemTypeId() {
225         return problemTypeId;
226     }
227 
228     public void setProblemTypeId(String problemTypeId) {
229         this.problemTypeId = problemTypeId;
230     }
231 
232     public String getProblemTypeName() {
233         if (this.problemType != null) {
234             return problemType.getProblemTypeName();
235         } else if (this.problemTypeId != null) {
236             Map problemTypeMap = new HashMap();
237             problemTypeMap.put("problemTypeId", this.problemTypeId);
238             OLEProblemType oleProblemType = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(OLEProblemType.class, problemTypeMap);
239             if (oleProblemType != null) {
240                 return oleProblemType.getProblemTypeName();
241             }
242         }
243         return problemTypeName;
244     }
245 
246     public void setProblemTypeName(String problemTypeName) {
247         this.problemTypeName = problemTypeName;
248     }
249 
250     public OLEEResPltfrmEventType getEventType() {
251         return eventType;
252     }
253 
254     public void setEventType(OLEEResPltfrmEventType eventType) {
255         this.eventType = eventType;
256     }
257 
258     public OLEProblemType getProblemType() {
259         return problemType;
260     }
261 
262     public void setProblemType(OLEProblemType problemType) {
263         this.problemType = problemType;
264     }
265 
266     public OLELogType getLogType() {
267         return logType;
268     }
269 
270     public void setLogType(OLELogType logType) {
271         this.logType = logType;
272     }
273 
274     public MultipartFile getAttachmentFile1() {
275         return attachmentFile1;
276     }
277 
278     public void setAttachmentFile1(MultipartFile attachmentFile1) {
279         this.attachmentFile1 = attachmentFile1;
280     }
281 
282     public String getAttachmentFileName1() {
283         return attachmentFileName1;
284     }
285 
286     public void setAttachmentFileName1(String attachmentFileName1) {
287         this.attachmentFileName1 = attachmentFileName1;
288     }
289 
290     public String getAttachmentMimeType1() {
291         return attachmentMimeType1;
292     }
293 
294     public void setAttachmentMimeType1(String attachmentMimeType1) {
295         this.attachmentMimeType1 = attachmentMimeType1;
296     }
297 
298     public byte[] getAttachmentContent1() {
299         return attachmentContent1;
300     }
301 
302     public void setAttachmentContent1(byte[] attachmentContent1) {
303         this.attachmentContent1 = attachmentContent1;
304     }
305 
306     public MultipartFile getAttachmentFile2() {
307         return attachmentFile2;
308     }
309 
310     public void setAttachmentFile2(MultipartFile attachmentFile2) {
311         this.attachmentFile2 = attachmentFile2;
312     }
313 
314     public String getAttachmentFileName2() {
315         return attachmentFileName2;
316     }
317 
318     public void setAttachmentFileName2(String attachmentFileName2) {
319         this.attachmentFileName2 = attachmentFileName2;
320     }
321 
322     public String getAttachmentMimeType2() {
323         return attachmentMimeType2;
324     }
325 
326     public void setAttachmentMimeType2(String attachmentMimeType2) {
327         this.attachmentMimeType2 = attachmentMimeType2;
328     }
329 
330     public byte[] getAttachmentContent2() {
331         return attachmentContent2;
332     }
333 
334     public void setAttachmentContent2(byte[] attachmentContent2) {
335         this.attachmentContent2 = attachmentContent2;
336     }
337 }