001: /******************************************************************************
002: * ContentReviewItem.java - created by Sakai App Builder -AZ
003: *
004: * Copyright (c) 2006 Sakai Project/Sakai Foundation
005: * Licensed under the Educational Community License version 1.0
006: *
007: * A copy of the Educational Community License has been included in this
008: * distribution and is available at: http://www.opensource.org/licenses/ecl1.php
009: *
010: *****************************************************************************/package org.sakaiproject.contentreview.model;
011:
012: import java.util.Date;
013:
014: /**
015: * This is a POJO (data storage object)
016: * @author David Jacka
017: */
018: public class ContentReviewItem {
019:
020: public static final String NOT_SUBMITTED = "Content awaiting submission";
021: public static final Long NOT_SUBMITTED_CODE = new Long(1);
022:
023: public static final String SUBMITTED_AWAITING_REPORT = "Content submitted for review and awaiting report";
024: public static final Long SUBMITTED_AWAITING_REPORT_CODE = new Long(
025: 2);
026:
027: public static final String SUBMITTED_REPORT_AVAILABLE = "Content submitted and report available";
028: public static final Long SUBMITTED_REPORT_AVAILABLE_CODE = new Long(
029: 3);
030:
031: public static final String SUBMISSION_ERROR_RETRY = "Temporary error occurred submitting content - will retry";
032: public static final Long SUBMISSION_ERROR_RETRY_CODE = new Long(4);
033:
034: public static final String SUBMISSION_ERROR_NO_RETRY = "Error occurred submitting content - will not retry";
035: public static final Long SUBMISSION_ERROR_NO_RETRY_CODE = new Long(
036: 5);
037:
038: public static final String SUBMISSION_ERROR_USER_DETAILS = "Error occurred submitting content - inconplete or Ivalid user details";
039: public static final Long SUBMISSION_ERROR_USER_DETAILS_CODE = new Long(
040: 6);
041:
042: public static final String REPORT_ERROR_RETRY = "Temporary error occurred retrieving report - will retry";
043: public static final Long REPORT_ERROR_RETRY_CODE = new Long(7);
044:
045: public static final String REPORT_ERROR_NO_RETRY = "Error occurred retrieving report - will not retry";
046: public static final Long REPORT_ERROR_NO_RETRY_CODE = new Long(8);
047:
048: public static final Long SUBMISSION_ERROR_RETRY_EXCEEDED = new Long(
049: 9);
050:
051: private long id; //hibernate uses this as a primary key
052: private String contentId; //Sakai contentId
053: private String userId; // Sakai userId
054: private String siteId; // Sakai siteId
055: private String taskId; // Sakai taskId
056: private String externalId; //the id from the external reviewer
057: private Date dateQueued;
058: private Date dateSubmitted;
059: private Date dateReportReceived;
060: private Long status;
061: private Integer reviewScore;
062: private String lastError;
063: private String iconUrl;
064: private Long retryCount;
065:
066: /**
067: * Default constructor
068: */
069: public ContentReviewItem() {
070: contentId = "no content id";
071: }
072:
073: /**
074: * Minimal constructor
075: */
076: public ContentReviewItem(String contentId) {
077: this .userId = null;
078: this .siteId = null;
079: this .contentId = contentId;
080: this .externalId = null;
081: this .dateQueued = null;
082: this .dateSubmitted = null;
083: this .dateReportReceived = null;
084: this .status = null;
085: this .reviewScore = null;
086: this .taskId = null;
087: this .retryCount = null;
088: }
089:
090: /**
091: * A constructor that sets all members to null and status to the provided string. This
092: * is used for retrieving items by status.
093: * @param status
094: */
095:
096: /**
097: * Constructor for a newly queued item
098: */
099:
100: public ContentReviewItem(String userId, String siteId,
101: String taskId, String contentId, Date dateQueued,
102: Long status) {
103: this .userId = userId;
104: this .siteId = siteId;
105: this .contentId = contentId;
106: this .dateQueued = dateQueued;
107: this .dateSubmitted = null;
108: this .dateReportReceived = null;
109: this .status = status;
110: this .reviewScore = null;
111: this .taskId = taskId;
112: }
113:
114: /**
115: * Full constructor
116: */
117: public ContentReviewItem(String userId, String siteId,
118: String taskId, String contentId, String externalId,
119: Date dateQueued, Date dateSubmitted,
120: Date dateReportReceived, long status, Integer reviewScore) {
121: this .userId = userId;
122: this .siteId = siteId;
123: this .contentId = contentId;
124: this .externalId = externalId;
125: this .dateQueued = dateQueued;
126: this .dateSubmitted = dateSubmitted;
127: this .dateReportReceived = dateReportReceived;
128: this .status = status;
129: this .reviewScore = reviewScore;
130: this .taskId = taskId;
131: }
132:
133: /**
134: * Getters and Setters
135: */
136:
137: public Date getDateQueued() {
138: return dateQueued;
139: }
140:
141: public void setDateQueued(Date dateQueued) {
142: this .dateQueued = dateQueued;
143: }
144:
145: public Date getDateReportReceived() {
146: return dateReportReceived;
147: }
148:
149: public void setDateReportReceived(Date dateReportReceived) {
150: this .dateReportReceived = dateReportReceived;
151: }
152:
153: public Date getDateSubmitted() {
154: return dateSubmitted;
155: }
156:
157: public void setDateSubmitted(Date dateSubmitted) {
158: this .dateSubmitted = dateSubmitted;
159: }
160:
161: public String getSiteId() {
162: return siteId;
163: }
164:
165: public void setSiteId(String siteId) {
166: this .siteId = siteId;
167: }
168:
169: public String getUserId() {
170: return userId;
171: }
172:
173: public void setUserId(String userId) {
174: this .userId = userId;
175: }
176:
177: public String getExternalId() {
178: return externalId;
179: }
180:
181: public void setExternalId(String externalId) {
182: this .externalId = externalId;
183: }
184:
185: public String getContentId() {
186: return contentId;
187: }
188:
189: public void setContentId(String contentId) {
190: this .contentId = contentId;
191: }
192:
193: public Integer getReviewScore() {
194: return reviewScore;
195: }
196:
197: public void setReviewScore(Integer reviewScore) {
198: this .reviewScore = reviewScore;
199: }
200:
201: public Long getStatus() {
202: return status;
203: }
204:
205: public void setStatus(Long status) {
206: this .status = status;
207: }
208:
209: public long getId() {
210: return id;
211: }
212:
213: public void setId(long id) {
214: this .id = id;
215: }
216:
217: public String getTaskId() {
218: return taskId;
219: }
220:
221: public void setTaskId(String taskId) {
222: this .taskId = taskId;
223: }
224:
225: public String getLastError() {
226: return this .lastError;
227: }
228:
229: public void setLastError(String le) {
230: this .lastError = le;
231: }
232:
233: public void setIconURL(String u) {
234: this .iconUrl = u;
235: }
236:
237: public String getIconUrl() {
238: return this .iconUrl;
239: }
240:
241: public Long getRetryCount() {
242: return this .retryCount;
243: }
244:
245: public void setRetryCount(Long l) {
246: this.retryCount = l;
247: }
248: }
|