Class BaseContentReviewService

    • Field Detail

      • assignmentService

        protected org.sakaiproject.assignment.api.AssignmentService assignmentService
      • crqs

        protected org.sakaiproject.contentreview.service.ContentReviewQueueService crqs
      • entityManager

        protected org.sakaiproject.entity.api.EntityManager entityManager
      • preferencesService

        protected org.sakaiproject.user.api.PreferencesService preferencesService
      • serverConfigurationService

        protected org.sakaiproject.component.api.ServerConfigurationService serverConfigurationService
    • Constructor Detail

      • BaseContentReviewService

        public BaseContentReviewService()
    • Method Detail

      • getUserEULATimestamp

        public Instant getUserEULATimestamp​(String userId)
        Specified by:
        getUserEULATimestamp in interface org.sakaiproject.contentreview.service.ContentReviewService
      • getUserEULAVersion

        public String getUserEULAVersion​(String userId)
        Specified by:
        getUserEULAVersion in interface org.sakaiproject.contentreview.service.ContentReviewService
      • updateUserEULATimestamp

        public void updateUserEULATimestamp​(String userId)
        Specified by:
        updateUserEULATimestamp in interface org.sakaiproject.contentreview.service.ContentReviewService
      • createAssignment

        public void createAssignment​(String contextId,
                                     String taskId,
                                     Map opts)
                              throws org.sakaiproject.contentreview.exception.SubmissionException,
                                     org.sakaiproject.contentreview.exception.TransientSubmissionException
        Specified by:
        createAssignment in interface org.sakaiproject.contentreview.service.ContentReviewService
        Throws:
        org.sakaiproject.contentreview.exception.SubmissionException
        org.sakaiproject.contentreview.exception.TransientSubmissionException
      • queueAllSubmissionsForAssignment

        protected void queueAllSubmissionsForAssignment​(String taskId)
      • deleteAssignment

        public void deleteAssignment​(String siteId,
                                     String taskId)
        Specified by:
        deleteAssignment in interface org.sakaiproject.contentreview.service.ContentReviewService
      • deleteAllSubmissionsForAssignment

        protected void deleteAllSubmissionsForAssignment​(String siteId,
                                                         String taskId)
      • getReviewReport

        public String getReviewReport​(String contentId,
                                      String assignmentRef,
                                      String userId)
                               throws org.sakaiproject.contentreview.exception.QueueException,
                                      org.sakaiproject.contentreview.exception.ReportException
        Specified by:
        getReviewReport in interface org.sakaiproject.contentreview.service.ContentReviewService
        Throws:
        org.sakaiproject.contentreview.exception.QueueException
        org.sakaiproject.contentreview.exception.ReportException
      • getReviewReportInstructor

        public String getReviewReportInstructor​(String contentId,
                                                String assignmentRef,
                                                String userId)
                                         throws org.sakaiproject.contentreview.exception.QueueException,
                                                org.sakaiproject.contentreview.exception.ReportException
        Specified by:
        getReviewReportInstructor in interface org.sakaiproject.contentreview.service.ContentReviewService
        Throws:
        org.sakaiproject.contentreview.exception.QueueException
        org.sakaiproject.contentreview.exception.ReportException
      • getReviewReportStudent

        public String getReviewReportStudent​(String contentId,
                                             String assignmentRef,
                                             String userId)
                                      throws org.sakaiproject.contentreview.exception.QueueException,
                                             org.sakaiproject.contentreview.exception.ReportException
        Specified by:
        getReviewReportStudent in interface org.sakaiproject.contentreview.service.ContentReviewService
        Throws:
        org.sakaiproject.contentreview.exception.QueueException
        org.sakaiproject.contentreview.exception.ReportException
      • getReviewReportRedirectUrl

        public String getReviewReportRedirectUrl​(String contentId,
                                                 String assignmentRef,
                                                 String userId,
                                                 String contextId,
                                                 boolean isInstructor)
        Specified by:
        getReviewReportRedirectUrl in interface org.sakaiproject.contentreview.service.ContentReviewService
      • createFormattedMessageXML

        protected Object createFormattedMessageXML​(Document document,
                                                   String key,
                                                   Object... args)
        Creates XML that represents calls to ResourceLoader.getFormattedMessage().
        Returns:
        an XML element representing the i18n message key and arguments - unless document is null, in which case the formatted message is returned as a String using the current session locale
      • setLastError

        protected void setLastError​(org.sakaiproject.contentreview.dao.ContentReviewItem item,
                                    BaseContentReviewService.LastErrorUpdater leu)
        Sets the ContentReviewItem's lastError property to the result of createLastError(leu). Changes are not committed - the caller is responsible to do so. Afterward, the message can be localized to end users via getLocalizedLastError(item).
      • setLastError

        protected void setLastError​(org.sakaiproject.contentreview.dao.ContentReviewItem item,
                                    Exception e)
        Convenience method: If the Exception is an instance of ContentReviewProviderException, the item's lastError is set to the exception's I18nXml; otherwise it falls back to getLocalizedMessage()
      • setLastError

        protected void setLastError​(org.sakaiproject.contentreview.dao.ContentReviewItem item,
                                    Exception e,
                                    BaseContentReviewService.LastErrorUpdater leu)
        If the Exception is an instance of ContentReviewProviderException, the item's lastError is set to the exception's I18nXml; otherwise it falls back to leu; if leu is null, it falls back to getLocalizedMessage()
      • createLastError

        protected String createLastError​(BaseContentReviewService.LastErrorUpdater leu)
        Create's an XML model that represents calls to ResourceLoader.getFormattedMessage(...). Example - represent an i18n compliant message for "An error has occurred with the service. Error code: 42; cause: A Sakaiger ate the paper" given: service.error=An error has occurred with the service. Error code: {0}; cause: {1} service.sakaiger.ate.paper=A Sakaiger ate the paper You may invoke: createLastError(doc -> createFormattedMessageXML(doc, "service.error", 42, createFormattedMessageXML(doc, "service.sakaiger.ate.paper")));
      • getLocalizedLastError

        public String getLocalizedLastError​(org.sakaiproject.contentreview.dao.ContentReviewItem item)
        Specified by:
        getLocalizedLastError in interface org.sakaiproject.contentreview.service.ContentReviewService
      • getResourceLoader

        protected org.sakaiproject.util.ResourceLoader getResourceLoader()
        The Resource Loader specific to the content-review service implementation
      • getResourceLoaderName

        protected String getResourceLoaderName()
        Gets the name of the resource loader's file. Default implementation is getServiceName() to lower case, and this should be overriden as necessary
      • allowSubmissionsOnBehalf

        public boolean allowSubmissionsOnBehalf()
        Specified by:
        allowSubmissionsOnBehalf in interface org.sakaiproject.contentreview.service.ContentReviewService