Package org.dspace.app.rest.submit
Class SubmissionService
java.lang.Object
org.dspace.app.rest.submit.SubmissionService
Service to manipulate in-progress submissions.
- Author:
- Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CollectionServiceprotected ConfigurationServiceprotected CreativeCommonsServiceprotected ItemServiceprotected WorkflowItemService<XmlWorkflowItem>protected WorkflowService<XmlWorkflowItem>protected WorkspaceItemService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildUploadBitstream(ConfigurationService configurationService, Bitstream source) Build the rest representation of a bitstream as used in the upload section (DataUpload.createWorkflowItem(Context context, String requestUriListString) Create a workflowitem using the information in the requestcreateWorkspaceItem(Context context, Request request) Create a workspaceitem using the information in the requestvoidevaluatePatchToInprogressSubmission(Context context, javax.servlet.http.HttpServletRequest request, InProgressSubmission source, AInprogressSubmissionRest wsi, String section, Operation op) Utility method used by theWorkspaceItemRestRepositoryandWorkflowItemRestRepositoryto deal with the patch of an inprogress submissionBuilds the CC License data of an inprogress submission based on the cc license info present in the metadatavoidsaveWorkflowItem(Context context, XmlWorkflowItem source) voidsaveWorkspaceItem(Context context, WorkspaceItem wsi) uploadFileToInprogressSubmission(Context context, javax.servlet.http.HttpServletRequest request, AInprogressSubmissionRest wsi, InProgressSubmission source, org.springframework.web.multipart.MultipartFile file) Utility method used by theWorkspaceItemRestRepositoryandWorkflowItemRestRepositoryto deal with the upload in an inprogress submission
-
Field Details
-
configurationService
-
collectionService
-
itemService
-
workspaceItemService
-
workflowItemService
-
workflowService
-
creativeCommonsService
-
-
Constructor Details
-
SubmissionService
- Throws:
SubmissionConfigReaderException
-
-
Method Details
-
createWorkspaceItem
public WorkspaceItem createWorkspaceItem(Context context, Request request) throws SQLException, AuthorizeException Create a workspaceitem using the information in the request- Parameters:
context- the dspace contextrequest- the request containing the details about the workspace to create- Returns:
- Throws:
SQLExceptionAuthorizeException
-
saveWorkspaceItem
-
buildUploadBitstream
public UploadBitstreamRest buildUploadBitstream(ConfigurationService configurationService, 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 (@linkAccessConditionDTO- Parameters:
configurationService- the DSpace ConfigurationServicesource- the bitstream to translate in its rest submission representation- Returns:
- Throws:
SQLException
-
createWorkflowItem
public XmlWorkflowItem createWorkflowItem(Context context, String requestUriListString) throws SQLException, AuthorizeException, WorkflowException Create a workflowitem using the information in the request- Parameters:
context- the dspace contextrequestUriListString- the id of the workspaceItem- Returns:
- Throws:
SQLExceptionAuthorizeExceptionWorkflowException
-
saveWorkflowItem
public void saveWorkflowItem(Context context, XmlWorkflowItem source) throws SQLException, AuthorizeException - Throws:
SQLExceptionAuthorizeException
-
getDataCCLicense
public DataCCLicense getDataCCLicense(InProgressSubmission obj) throws SQLException, IOException, 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:
SQLExceptionIOExceptionAuthorizeException
-
uploadFileToInprogressSubmission
public List<ErrorRest> uploadFileToInprogressSubmission(Context context, javax.servlet.http.HttpServletRequest request, AInprogressSubmissionRest wsi, InProgressSubmission source, org.springframework.web.multipart.MultipartFile file) Utility method used by theWorkspaceItemRestRepositoryandWorkflowItemRestRepositoryto deal with the upload in an inprogress submission- Parameters:
context- DSpace Context Objectrequest- the http request containing the upload requestwsi- the inprogress submission current rest representationsource- the current inprogress submissionfile- the multipartfile of the request- Returns:
- the errors present in the resulting inprogress submission
-
evaluatePatchToInprogressSubmission
public void evaluatePatchToInprogressSubmission(Context context, javax.servlet.http.HttpServletRequest request, InProgressSubmission source, AInprogressSubmissionRest wsi, String section, Operation op) Utility method used by theWorkspaceItemRestRepositoryandWorkflowItemRestRepositoryto deal with the patch of an inprogress submission- Parameters:
context- DSpace Context Objectrequest- the http requestsource- the current inprogress submissionwsi- the inprogress submission current rest representationsection- the section that is involved in the patchop- the patch operation
-