001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package edu.iu.uis.eden.notes;
018:
019: import java.sql.Timestamp;
020: import java.text.DateFormat;
021: import java.text.SimpleDateFormat;
022: import java.util.ArrayList;
023: import java.util.Calendar;
024: import java.util.Date;
025: import java.util.List;
026:
027: import edu.iu.uis.eden.EdenConstants;
028: import edu.iu.uis.eden.WorkflowPersistable;
029:
030: /**
031: * A note attached to a document. May also contain a List of attachments.
032: *
033: * @see Attachment
034: *
035: * @author temay
036: * @author rkirkend
037: */
038: public class Note implements WorkflowPersistable {
039:
040: private static final long serialVersionUID = -6136544551121011531L;
041: private Long noteId;
042: private Long routeHeaderId;
043: private String noteAuthorWorkflowId;
044: private Timestamp noteCreateDate;
045: private String noteText;
046: private Integer lockVerNbr;
047:
048: private List attachments = new ArrayList();
049:
050: //additional data not in database
051: private String noteAuthorEmailAddress;
052: private String noteAuthorNetworkId;
053: private String noteAuthorFullName;
054: private Long noteCreateLongDate;
055: private Boolean authorizedToEdit;
056: private Boolean editingNote;
057:
058: public Integer getLockVerNbr() {
059: return lockVerNbr;
060: }
061:
062: public void setLockVerNbr(Integer lockVerNbr) {
063: this .lockVerNbr = lockVerNbr;
064: }
065:
066: public String getNoteAuthorWorkflowId() {
067: return noteAuthorWorkflowId;
068: }
069:
070: public void setNoteAuthorWorkflowId(String noteAuthorWorkflowId) {
071: this .noteAuthorWorkflowId = noteAuthorWorkflowId;
072: }
073:
074: public Timestamp getNoteCreateDate() {
075: return noteCreateDate;
076: }
077:
078: public void setNoteCreateDate(Timestamp noteCreateDate) {
079: this .noteCreateDate = noteCreateDate;
080: }
081:
082: public Long getNoteId() {
083: return noteId;
084: }
085:
086: public void setNoteId(Long noteId) {
087: this .noteId = noteId;
088: }
089:
090: public String getNoteText() {
091: return noteText;
092: }
093:
094: public void setNoteText(String noteText) {
095: this .noteText = noteText;
096: }
097:
098: public Long getRouteHeaderId() {
099: return routeHeaderId;
100: }
101:
102: public void setRouteHeaderId(Long routeHeaderId) {
103: this .routeHeaderId = routeHeaderId;
104: }
105:
106: public String getNoteAuthorEmailAddress() {
107: return noteAuthorEmailAddress;
108: }
109:
110: public void setNoteAuthorEmailAddress(String noteAuthorEmailAddress) {
111: this .noteAuthorEmailAddress = noteAuthorEmailAddress;
112: }
113:
114: public String getNoteAuthorFullName() {
115: return noteAuthorFullName;
116: }
117:
118: public void setNoteAuthorFullName(String noteAuthorFullName) {
119: this .noteAuthorFullName = noteAuthorFullName;
120: }
121:
122: public String getNoteAuthorNetworkId() {
123: return noteAuthorNetworkId;
124: }
125:
126: public void setNoteAuthorNetworkId(String noteAuthorNetworkId) {
127: this .noteAuthorNetworkId = noteAuthorNetworkId;
128: }
129:
130: public Long getNoteCreateLongDate() {
131: return noteCreateLongDate;
132: }
133:
134: public void setNoteCreateLongDate(Long noteCreateLongDate) {
135: this .noteCreateLongDate = noteCreateLongDate;
136: }
137:
138: public Boolean getAuthorizedToEdit() {
139: return authorizedToEdit;
140: }
141:
142: public void setAuthorizedToEdit(Boolean authorizedToEdit) {
143: this .authorizedToEdit = authorizedToEdit;
144: }
145:
146: public Boolean getEditingNote() {
147: return editingNote;
148: }
149:
150: public void setEditingNote(Boolean editingNote) {
151: this .editingNote = editingNote;
152: }
153:
154: public String getFormattedCreateDateTime() {
155: long time = getNoteCreateDate().getTime();
156: Calendar calendar = Calendar.getInstance();
157: calendar.setTimeInMillis(time);
158: Date date = calendar.getTime();
159: DateFormat dateFormat = new SimpleDateFormat(
160: EdenConstants.TIMESTAMP_DATE_FORMAT_PATTERN2);
161: return dateFormat.format(date);
162: }
163:
164: public String getFormattedCreateDate() {
165: long time = getNoteCreateDate().getTime();
166: Calendar calendar = Calendar.getInstance();
167: calendar.setTimeInMillis(time);
168: Date date = calendar.getTime();
169: DateFormat dateFormat = EdenConstants.getDefaultDateFormat();
170: return dateFormat.format(date);
171: }
172:
173: public String getFormattedCreateTime() {
174: long time = getNoteCreateDate().getTime();
175: Calendar calendar = Calendar.getInstance();
176: calendar.setTimeInMillis(time);
177: Date date = calendar.getTime();
178: DateFormat dateFormat = EdenConstants.getDefaultTimeFormat();
179: return dateFormat.format(date);
180: }
181:
182: public Object copy(boolean preserveKeys) {
183: return null;
184: }
185:
186: public List getAttachments() {
187: return attachments;
188: }
189:
190: public void setAttachments(List attachments) {
191: this.attachments = attachments;
192: }
193:
194: }
|