001 /** 002 * Copyright 2005-2012 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.rice.edl.framework.extract; 017 018 import org.kuali.rice.core.api.util.RiceConstants; 019 import org.kuali.rice.kew.api.KewApiConstants; 020 021 import java.io.Serializable; 022 import java.sql.Timestamp; 023 import java.text.DateFormat; 024 import java.text.SimpleDateFormat; 025 import java.util.ArrayList; 026 import java.util.Calendar; 027 import java.util.Date; 028 import java.util.List; 029 030 public class DumpDTO implements Serializable { 031 032 private static final long serialVersionUID = -6136544551121011531L; 033 034 private String docId; 035 private String docTypeName; 036 private String docRouteStatusCode; 037 private Timestamp docModificationDate; 038 private Timestamp docCreationDate; 039 private String docDescription; 040 private String docInitiatorId; 041 private String docCurrentNodeName; 042 private Integer lockVerNbr; 043 044 private List<FieldDTO> fields = new ArrayList<FieldDTO>(); 045 046 public Timestamp getDocCreationDate() { 047 return docCreationDate; 048 } 049 public void setDocCreationDate(final Timestamp docCreationDate) { 050 this.docCreationDate = docCreationDate; 051 } 052 public String getDocCurrentNodeName() { 053 return docCurrentNodeName; 054 } 055 public void setDocCurrentNodeName(final String docCurrentNodeName) { 056 this.docCurrentNodeName = docCurrentNodeName; 057 } 058 public String getDocDescription() { 059 return docDescription; 060 } 061 public void setDocDescription(final String docDescription) { 062 this.docDescription = docDescription; 063 } 064 public String getDocId() { 065 return docId; 066 } 067 public String getDocInitiatorId() { 068 return docInitiatorId; 069 } 070 public void setDocInitiatorId(final String docInitiatorId) { 071 this.docInitiatorId = docInitiatorId; 072 } 073 public Timestamp getDocModificationDate() { 074 return docModificationDate; 075 } 076 public void setDocModificationDate(final Timestamp docModificationDate) { 077 this.docModificationDate = docModificationDate; 078 } 079 public String getDocRouteStatusCode() { 080 return docRouteStatusCode; 081 } 082 public void setDocRouteStatusCode(final String docRouteStatusCode) { 083 this.docRouteStatusCode = docRouteStatusCode; 084 } 085 public String getDocTypeName() { 086 return docTypeName; 087 } 088 public void setDocTypeName(final String docTypeName) { 089 this.docTypeName = docTypeName; 090 } 091 public Integer getLockVerNbr() { 092 return lockVerNbr; 093 } 094 public void setLockVerNbr(final Integer lockVerNbr) { 095 this.lockVerNbr = lockVerNbr; 096 } 097 public String getFormattedCreateDateTime() { 098 long time = getDocCreationDate().getTime(); 099 Calendar calendar = Calendar.getInstance(); 100 calendar.setTimeInMillis(time); 101 Date date = calendar.getTime(); 102 DateFormat dateFormat = new SimpleDateFormat(KewApiConstants.TIMESTAMP_DATE_FORMAT_PATTERN2); 103 return dateFormat.format(date); 104 } 105 106 public String getFormattedCreateDate() { 107 long time = getDocCreationDate().getTime(); 108 Calendar calendar = Calendar.getInstance(); 109 calendar.setTimeInMillis(time); 110 Date date = calendar.getTime(); 111 DateFormat dateFormat = RiceConstants.getDefaultDateFormat(); 112 return dateFormat.format(date); 113 } 114 public void setDocId(final String docId) { 115 this.docId = docId; 116 } 117 118 119 public List<FieldDTO> getFields() { 120 return fields; 121 } 122 123 public void setFields(final List<FieldDTO> fields) { 124 this.fields = fields; 125 } 126 127 } 128