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