Package org.dspace.app.rest.repository
Class WorkflowItemRestRepository
- java.lang.Object
-
- org.dspace.app.rest.repository.AbstractDSpaceRestRepository
-
- org.dspace.app.rest.repository.DSpaceRestRepository<WorkflowItemRest,Integer>
-
- org.dspace.app.rest.repository.WorkflowItemRestRepository
-
- All Implemented Interfaces:
org.springframework.data.repository.CrudRepository<WorkflowItemRest,Integer>,org.springframework.data.repository.PagingAndSortingRepository<WorkflowItemRest,Integer>,org.springframework.data.repository.Repository<WorkflowItemRest,Integer>
@Component("workflow.workflowitem") public class WorkflowItemRestRepository extends DSpaceRestRepository<WorkflowItemRest,Integer>This is the repository responsible to manage WorkflowItem Rest object- Author:
- Andrea Bollini (andrea.bollini at 4science.it)
-
-
Field Summary
Fields Modifier and Type Field Description static StringOPERATION_PATH_SECTIONSprotected XmlWorkflowFactoryworkflowFactoryprotected XmlWorkflowItemServicexmlWorkflowItemService-
Fields inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
converter, requestService, utils
-
-
Constructor Summary
Constructors Constructor Description WorkflowItemRestRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WorkflowItemRestcreateAndReturn(Context context, List<String> stringList)Method to implement to support the creation of a new instance.protected voiddelete(Context context, Integer id)Method to implement to support delete of a single object instanceorg.springframework.data.domain.Page<WorkflowItemRest>findAll(Context context, org.springframework.data.domain.Pageable pageable)Method to implement to support scroll of entity instances from the collection resource endpointWorkflowItemRestfindByItemUuid(UUID itemUuid, org.springframework.data.domain.Pageable pageable)This is a search method that will return the WorkflowItemRest object found through the UUID of an item.org.springframework.data.domain.Page<WorkflowItemRest>findBySubmitter(UUID submitterID, org.springframework.data.domain.Pageable pageable)WorkflowItemRestfindOne(Context context, Integer id)Method to implement to support retrieval of a specific REST object instanceClass<WorkflowItemRest>getDomainClass()The REST model supported by the repositoryvoidpatch(Context context, javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id, Patch patch)Method to implement to allow partial update of the REST object via JSON PatchWorkflowItemRestupload(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id, org.springframework.web.multipart.MultipartFile file)Method to implement to attach/upload a file to a specific REST object-
Methods inherited from class org.dspace.app.rest.repository.DSpaceRestRepository
action, action, count, createAndReturn, createAndReturn, createAndReturn, createAndReturn, createAndReturn, delete, deleteAll, deleteAll, deleteById, existsById, findAll, findAll, findAll, findAllById, findById, patch, put, put, put, put, save, save, saveAll, upload, upload
-
Methods inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
getRequestService, obtainContext
-
-
-
-
Field Detail
-
OPERATION_PATH_SECTIONS
public static final String OPERATION_PATH_SECTIONS
- See Also:
- Constant Field Values
-
xmlWorkflowItemService
@Autowired protected XmlWorkflowItemService xmlWorkflowItemService
-
workflowFactory
@Autowired protected XmlWorkflowFactory workflowFactory
-
-
Constructor Detail
-
WorkflowItemRestRepository
public WorkflowItemRestRepository() throws SubmissionConfigReaderException- Throws:
SubmissionConfigReaderException
-
-
Method Detail
-
findOne
@PreAuthorize("hasPermission(#id, \'WORKFLOWITEM\', \'READ\')") public WorkflowItemRest findOne(Context context, Integer id)Description copied from class:DSpaceRestRepositoryMethod to implement to support retrieval of a specific REST object instance- Specified by:
findOnein classDSpaceRestRepository<WorkflowItemRest,Integer>- Parameters:
context- the dspace contextid- the rest object id- Returns:
- the REST object identified by its ID
-
findAll
@PreAuthorize("hasAuthority(\'ADMIN\')") public org.springframework.data.domain.Page<WorkflowItemRest> findAll(Context context, org.springframework.data.domain.Pageable pageable)Description copied from class:DSpaceRestRepositoryMethod to implement to support scroll of entity instances from the collection resource endpoint- Specified by:
findAllin classDSpaceRestRepository<WorkflowItemRest,Integer>- Parameters:
context- the dspace contextpageable- object embedding the requested pagination info- Returns:
-
findBySubmitter
@PreAuthorize("hasAuthority(\'ADMIN\')") public org.springframework.data.domain.Page<WorkflowItemRest> findBySubmitter(UUID submitterID, org.springframework.data.domain.Pageable pageable)
-
createAndReturn
protected WorkflowItemRest createAndReturn(Context context, List<String> stringList)
Description copied from class:DSpaceRestRepositoryMethod to implement to support the creation of a new instance. Usually require to retrieve the http request from the thread bound attribute- Overrides:
createAndReturnin classDSpaceRestRepository<WorkflowItemRest,Integer>- Parameters:
context- the dspace contextstringList- The list of Strings that will be used as data for the object that's to be created This list is retrieved from the uri-list body- Returns:
- the created REST object
-
getDomainClass
public Class<WorkflowItemRest> getDomainClass()
Description copied from class:DSpaceRestRepositoryThe REST model supported by the repository- Specified by:
getDomainClassin classDSpaceRestRepository<WorkflowItemRest,Integer>
-
upload
public WorkflowItemRest upload(javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id, org.springframework.web.multipart.MultipartFile file) throws SQLException
Description copied from class:DSpaceRestRepositoryMethod to implement to attach/upload a file to a specific REST object- Overrides:
uploadin classDSpaceRestRepository<WorkflowItemRest,Integer>- Parameters:
request- the http requestid- the ID of the target REST objectfile- the uploaded file- Returns:
- the new state of the REST object
- Throws:
SQLException
-
patch
public void patch(Context context, javax.servlet.http.HttpServletRequest request, String apiCategory, String model, Integer id, Patch patch) throws SQLException, AuthorizeException
Description copied from class:DSpaceRestRepositoryMethod to implement to allow partial update of the REST object via JSON Patch- Overrides:
patchin classDSpaceRestRepository<WorkflowItemRest,Integer>request- the http requestid- the ID of the target REST objectpatch- the JSON Patch (https://tools.ietf.org/html/rfc6902) operation- Throws:
SQLExceptionAuthorizeException
-
delete
protected void delete(Context context, Integer id)
Description copied from class:DSpaceRestRepositoryMethod to implement to support delete of a single object instance- Overrides:
deletein classDSpaceRestRepository<WorkflowItemRest,Integer>- Parameters:
context- the dspace contextid- the id of the rest object to delete
-
findByItemUuid
public WorkflowItemRest findByItemUuid(UUID itemUuid, org.springframework.data.domain.Pageable pageable)
This is a search method that will return the WorkflowItemRest object found through the UUID of an item. It'll find the Item through the given UUID and try to resolve the WorkflowItem relevant for that item and return it. It'll return a 401/403 if the current user isn't allowed to view the WorkflowItem. It'll return a 204 if nothing was found- Parameters:
itemUuid- The UUID for the Item to be usedpageable- The pageable if present- Returns:
- The resulting WorkflowItemRest object
-
-