Package org.dspace.app.rest.submit
Class SubmissionService
- java.lang.Object
-
- org.dspace.app.rest.submit.SubmissionService
-
@Component public class SubmissionService extends Object
Service to manipulate in-progress submissions.- Author:
- Luigi Andrea Pascarelli (luigiandrea.pascarelli at 4science.it)
-
-
Field Summary
Fields Modifier and Type Field Description protected CollectionServicecollectionServiceprotected ConfigurationServiceconfigurationServiceprotected CreativeCommonsServicecreativeCommonsServiceprotected ItemServiceitemServiceprotected WorkflowItemService<XmlWorkflowItem>workflowItemServiceprotected WorkflowService<XmlWorkflowItem>workflowServiceprotected WorkspaceItemServiceworkspaceItemService
-
Constructor Summary
Constructors Constructor Description SubmissionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UploadBitstreamRestbuildUploadBitstream(ConfigurationService configurationService, Bitstream source)Build the rest representation of a bitstream as used in the upload section (DataUpload.XmlWorkflowItemcreateWorkflowItem(Context context, String requestUriListString)Create a workflowitem using the information in the requestWorkspaceItemcreateWorkspaceItem(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 submissionDataCCLicensegetDataCCLicense(InProgressSubmission obj)Builds 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)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
-
-
-
Field Detail
-
configurationService
@Autowired protected ConfigurationService configurationService
-
collectionService
@Autowired protected CollectionService collectionService
-
itemService
@Autowired protected ItemService itemService
-
workspaceItemService
@Autowired protected WorkspaceItemService workspaceItemService
-
workflowItemService
@Autowired protected WorkflowItemService<XmlWorkflowItem> workflowItemService
-
workflowService
@Autowired protected WorkflowService<XmlWorkflowItem> workflowService
-
creativeCommonsService
@Autowired protected CreativeCommonsService creativeCommonsService
-
-
Constructor Detail
-
SubmissionService
public SubmissionService() throws SubmissionConfigReaderException- Throws:
SubmissionConfigReaderException
-
-
Method Detail
-
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
public void saveWorkspaceItem(Context context, WorkspaceItem wsi)
-
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
-
-