Class SubmissionService


  • @Component
    public class SubmissionService
    extends Object
    Service to manipulate in-progress submissions.
    Author:
    Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it)
    • Field Detail

      • collectionService

        @Autowired
        protected org.dspace.content.service.CollectionService collectionService
      • itemService

        @Autowired
        protected org.dspace.content.service.ItemService itemService
      • workspaceItemService

        @Autowired
        protected org.dspace.content.service.WorkspaceItemService workspaceItemService
      • workflowItemService

        @Autowired
        protected org.dspace.workflow.WorkflowItemService<org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem> workflowItemService
      • workflowService

        @Autowired
        protected org.dspace.workflow.WorkflowService<org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem> workflowService
      • creativeCommonsService

        @Autowired
        protected org.dspace.license.service.CreativeCommonsService creativeCommonsService
    • Constructor Detail

      • SubmissionService

        public SubmissionService()
                          throws org.dspace.app.util.SubmissionConfigReaderException
        Throws:
        org.dspace.app.util.SubmissionConfigReaderException
    • Method Detail

      • createWorkspaceItem

        public org.dspace.content.WorkspaceItem createWorkspaceItem​(org.dspace.core.Context context,
                                                                    Request request)
                                                             throws SQLException,
                                                                    org.dspace.authorize.AuthorizeException
        Create a workspaceitem using the information in the request
        Parameters:
        context - the dspace context
        request - the request containing the details about the workspace to create
        Returns:
        Throws:
        SQLException
        org.dspace.authorize.AuthorizeException
      • saveWorkspaceItem

        public void saveWorkspaceItem​(org.dspace.core.Context context,
                                      org.dspace.content.WorkspaceItem wsi)
      • buildUploadBitstream

        public UploadBitstreamRest buildUploadBitstream​(ConfigurationService configurationService,
                                                        org.dspace.content.Bitstream source)
                                                 throws SQLException
        Build the rest representation of a bitstream as used in the upload section (DataUpload. It contains all its metadata and the list of applied access conditions (@link UploadBitstreamAccessConditionDTO
        Parameters:
        configurationService - the DSpace ConfigurationService
        source - the bitstream to translate in its rest submission representation
        Returns:
        Throws:
        SQLException
      • createWorkflowItem

        public org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem createWorkflowItem​(org.dspace.core.Context context,
                                                                                          String requestUriListString)
                                                                                   throws SQLException,
                                                                                          org.dspace.authorize.AuthorizeException,
                                                                                          org.dspace.workflow.WorkflowException
        Create a workflowitem using the information in the request
        Parameters:
        context - the dspace context
        requestUriListString - the id of the workspaceItem
        Returns:
        Throws:
        SQLException
        org.dspace.authorize.AuthorizeException
        org.dspace.workflow.WorkflowException
      • saveWorkflowItem

        public void saveWorkflowItem​(org.dspace.core.Context context,
                                     org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem source)
                              throws SQLException,
                                     org.dspace.authorize.AuthorizeException
        Throws:
        SQLException
        org.dspace.authorize.AuthorizeException
      • getDataCCLicense

        public DataCCLicense getDataCCLicense​(org.dspace.content.InProgressSubmission obj)
                                       throws SQLException,
                                              IOException,
                                              org.dspace.authorize.AuthorizeException
        Builds the CC License data of an inprogress submission based on the cc license info present in the metadata
        Parameters:
        obj - - the in progress submission
        Returns:
        an object representing the CC License data
        Throws:
        SQLException
        IOException
        org.dspace.authorize.AuthorizeException
      • uploadFileToInprogressSubmission

        public List<ErrorRest> uploadFileToInprogressSubmission​(org.dspace.core.Context context,
                                                                javax.servlet.http.HttpServletRequest request,
                                                                AInprogressSubmissionRest wsi,
                                                                org.dspace.content.InProgressSubmission source,
                                                                org.springframework.web.multipart.MultipartFile file)
        Utility method used by the WorkspaceItemRestRepository and WorkflowItemRestRepository to deal with the upload in an inprogress submission
        Parameters:
        context - DSpace Context Object
        request - the http request containing the upload request
        wsi - the inprogress submission current rest representation
        source - the current inprogress submission
        file - the multipartfile of the request
        Returns:
        the errors present in the resulting inprogress submission
      • evaluatePatchToInprogressSubmission

        public void evaluatePatchToInprogressSubmission​(org.dspace.core.Context context,
                                                        javax.servlet.http.HttpServletRequest request,
                                                        org.dspace.content.InProgressSubmission source,
                                                        AInprogressSubmissionRest wsi,
                                                        String section,
                                                        Operation op)
        Utility method used by the WorkspaceItemRestRepository and WorkflowItemRestRepository to deal with the patch of an inprogress submission
        Parameters:
        context - DSpace Context Object
        request - the http request
        source - the current inprogress submission
        wsi - the inprogress submission current rest representation
        section - the section that is involved in the patch
        op - the patch operation