001: /**********************************************************************************
002: * $URL: $
003: * $Id: $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2007 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.contentreview.service;
021:
022: import java.util.Date;
023: import java.util.List;
024: import org.sakaiproject.content.api.ContentResource;
025: import org.sakaiproject.site.api.Site;
026:
027: import org.sakaiproject.contentreview.exception.QueueException;
028: import org.sakaiproject.contentreview.exception.ReportException;
029: import org.sakaiproject.contentreview.exception.SubmissionException;
030:
031: /**
032: * ContentReview Service manages submission to the Content review queue and retrieving reports from the service
033: *
034: * @author David Jaka, David Horwitz
035: */
036: public interface ContentReviewService {
037:
038: /**
039: * Add an item to the Queue for Submission to Turnitin
040: *
041: * @param userID if nulll current user is used
042: * @param SiteId is null current site is used
043: * @param Entity reference to the task this is for
044: * @param Reference to the content object that should be submitted
045: *
046: */
047: public void queueContent(String userId, String siteId,
048: String taskId, String contentId) throws QueueException;
049:
050: /**
051: * Retrieve a score for a specific item
052: * @param contentId
053: * @return the origionality score
054: * @throws QueueException
055: * @throws ReportException
056: * @throws Exception
057: */
058: public int getReviewScore(String contentId) throws QueueException,
059: ReportException, Exception;
060:
061: /**
062: * Get the URL of the report
063: * @param contentId
064: * @return the url
065: * @throws QueueException
066: * @throws ReportException
067: */
068: public String getReviewReport(String contentId)
069: throws QueueException, ReportException;
070:
071: /**
072: * Get the status of a submission
073: * @param contentId
074: * @return
075: * @throws QueueException
076: */
077: public Long getReviewStatus(String contentId) throws QueueException;
078:
079: /**
080: * The date an item was queued
081: * @param contextId
082: * @return
083: * @throws QueueException
084: */
085: public Date getDateQueued(String contextId) throws QueueException;
086:
087: /**
088: * The date an item was submitted to the queue
089: * @param contextId
090: * @return
091: * @throws QueueException
092: * @throws SubmissionException
093: */
094: public Date getDateSubmitted(String contextId)
095: throws QueueException, SubmissionException;
096:
097: /**
098: * Proccess all pending jobs in the Queue
099: */
100: public void processQueue();
101:
102: /**
103: * Check for reports for all submitted items that don't have reports yet
104: */
105: public void checkForReports();
106:
107: /**
108: * Get a list of reports for a task
109: * @param siteId
110: * @param taskId
111: * @return
112: * @throws QueueException
113: * @throws SubmissionException
114: * @throws ReportException
115: */
116: public List getReportList(String siteId, String taskId)
117: throws QueueException, SubmissionException, ReportException;
118:
119: /**
120: * Get a list of reports for all tasks in a site
121: *
122: * @param siteId
123: * @return
124: * @throws QueueException
125: * @throws SubmissionException
126: * @throws ReportException
127: */
128: public List getReportList(String siteId) throws QueueException,
129: SubmissionException, ReportException;
130:
131: /**
132: * Return the Name of the Service Implementation for Display Purposes
133: *
134: */
135: public String getServiceName();
136:
137: /**
138: * Reset the Items for a specific user that where locked because of incomplete user details
139: * @param userId
140: */
141:
142: public void resetUserDetailsLockedItems(String userId);
143:
144: /**
145: * Is the content resource of an type that can be accepted by the service implementation
146: * @param resource
147: * @return
148: */
149: public boolean isAcceptableContent(ContentResource resource);
150:
151: /**
152: * Can this site make use of the content review service
153: *
154: * @param site
155: * @return
156: *
157: */
158: public boolean isSiteAcceptable(Site site);
159:
160: /**
161: * Get a icon URL that for a specific score
162: * @param score
163: * @return
164: */
165: public String getIconUrlforScore(Long score);
166:
167: /**
168: * Does the service support resubmissions?
169: * @return
170: */
171: public boolean allowResubmission();
172:
173: }
|