001package org.kuali.ole.select.bo; 002 003import org.kuali.ole.select.document.OLEPlatformRecordDocument; 004import org.kuali.rice.krad.bo.BusinessObjectBase; 005import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; 006import org.kuali.rice.krad.service.KRADServiceLocator; 007import org.kuali.rice.krad.util.GlobalVariables; 008import org.springframework.web.multipart.MultipartFile; 009 010import java.sql.Date; 011import java.util.HashMap; 012import java.util.Map; 013 014/** 015 * Created by chenchulakshmig on 9/17/14. 016 * OLEPlatformEventLog provides platform event log information through getter and setter. 017 */ 018public class OLEPlatformEventLog extends PersistableBusinessObjectBase { 019 020 private String platformEventLogId; 021 022 private String olePlatformId; 023 024 private String logTypeId; 025 026 private String logTypeName; 027 028 private String eventTypeId; 029 030 private String eventTypeName; 031 032 private String problemTypeId; 033 034 private String problemTypeName; 035 036 private String eventNote; 037 038 private String eventUserId; 039 040 private Date eventReportedDate; 041 042 private String eventStatus; 043 044 private Date eventResolvedDate; 045 046 private String eventResolution; 047 048 private Integer eventTempId; 049 050 private boolean saveFlag; 051 052 private OLEPlatformRecordDocument olePlatformRecordDocument; 053 054 private OLEEResPltfrmEventType eventType; 055 056 private OLEProblemType problemType; 057 058 private OLELogType logType; 059 060 private MultipartFile attachmentFile1; 061 062 private String attachmentFileName1; 063 064 private String attachmentMimeType1; 065 066 private byte[] attachmentContent1; 067 068 private MultipartFile attachmentFile2; 069 070 private String attachmentFileName2; 071 072 private String attachmentMimeType2; 073 074 private byte[] attachmentContent2; 075 076 public OLEPlatformEventLog() { 077 this.setLogTypeId("1"); 078 this.setEventReportedDate(new Date(System.currentTimeMillis())); 079 if (GlobalVariables.getUserSession() != null) { 080 this.setEventUserId(GlobalVariables.getUserSession().getPrincipalId()); 081 } 082 } 083 084 public String getPlatformEventLogId() { 085 return platformEventLogId; 086 } 087 088 public void setPlatformEventLogId(String platformEventLogId) { 089 this.platformEventLogId = platformEventLogId; 090 } 091 092 public String getOlePlatformId() { 093 return olePlatformId; 094 } 095 096 public void setOlePlatformId(String olePlatformId) { 097 this.olePlatformId = olePlatformId; 098 } 099 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}