Package org.dspace.app.rest.repository
Class IdentifierRestRepository
java.lang.Object
org.dspace.app.rest.repository.AbstractDSpaceRestRepository
org.dspace.app.rest.repository.DSpaceRestRepository<IdentifierRest,String>
org.dspace.app.rest.repository.IdentifierRestRepository
- All Implemented Interfaces:
Aware,BeanNameAware,InitializingBean,org.springframework.data.repository.CrudRepository<IdentifierRest,,String> org.springframework.data.repository.PagingAndSortingRepository<IdentifierRest,,String> org.springframework.data.repository.Repository<IdentifierRest,String>
@RestController
@RequestMapping("/api/pid")
@Component("pid.identifiers")
public class IdentifierRestRepository
extends DSpaceRestRepository<IdentifierRest,String>
implements InitializingBean
Item REST Repository and Controller for persistent identifiers.
The controller annotation and endpoint registration allows the "find DSO by identifier" method which was
previously implemented in org.dspace.app.rest.IdentifierRestController
- Author:
- Kim Shepherd
-
Field Summary
Fields inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
converter, requestService, utils -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegister /api/pid/find?protected IdentifierRestcreateAndReturn(Context context, List<String> list) Create (mint / queue for registration) a new persistent identifier of a given type (eg DOI) for an item Currently, the only supported identifier type for this operation is "doi"org.springframework.data.domain.Page<IdentifierRest>Find all identifiers.org.springframework.data.domain.Page<IdentifierRest>findByItem(String uuid, org.springframework.data.domain.Pageable pageable) Find identifiers associated with a given itemFind the identifier object for a given identifier string (eg. doi).The REST model supported by the repositoryvoidgetDSObyIdentifier(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String id) Redirect to a DSO page, given an identifierMethods inherited from class org.dspace.app.rest.repository.DSpaceRestRepository
action, action, count, createAndReturn, createAndReturn, createAndReturn, createAndReturn, createAndReturn, delete, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findAll, findAll, findAll, findAllById, findById, patch, patch, put, put, put, put, save, save, saveAll, setBeanName, upload, upload, uploadMethods inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
getRequestService, obtainContext
-
Constructor Details
-
IdentifierRestRepository
public IdentifierRestRepository()
-
-
Method Details
-
afterPropertiesSet
Register /api/pid/find?id=... as a discoverable endpoint service- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
Exception
-
findAll
@PreAuthorize("permitAll()") public org.springframework.data.domain.Page<IdentifierRest> findAll(Context context, org.springframework.data.domain.Pageable pageable) Find all identifiers. Not implemented.- Specified by:
findAllin classDSpaceRestRepository<IdentifierRest,String> - Parameters:
context- the dspace contextpageable- object embedding the requested pagination info- Returns:
-
findOne
Find the identifier object for a given identifier string (eg. doi). Not implemented -- Tomcat interprets %2F as path separators which means parameters are a safer way to handle these operations- Specified by:
findOnein classDSpaceRestRepository<IdentifierRest,String> - Parameters:
context- the dspace contextidentifier- the rest object id- Returns:
-
findByItem
@PreAuthorize("permitAll()") public org.springframework.data.domain.Page<IdentifierRest> findByItem(String uuid, org.springframework.data.domain.Pageable pageable) Find identifiers associated with a given item- Parameters:
uuid-pageable-- Returns:
-
createAndReturn
protected IdentifierRest createAndReturn(Context context, List<String> list) throws AuthorizeException, SQLException, RepositoryMethodNotImplementedException Create (mint / queue for registration) a new persistent identifier of a given type (eg DOI) for an item Currently, the only supported identifier type for this operation is "doi"- Overrides:
createAndReturnin classDSpaceRestRepository<IdentifierRest,String> - Parameters:
context- the dspace contextlist- A uri-list with the item URI for which to create an identifier- Returns:
- 201 Created with object JSON on success
- Throws:
AuthorizeExceptionSQLExceptionRepositoryMethodNotImplementedException
-
getDSObyIdentifier
@RequestMapping(method=GET, value="find", params="id") public void getDSObyIdentifier(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, @RequestParam("id") String id) throws IOException, SQLException Redirect to a DSO page, given an identifier- Parameters:
request- HTTP requestresponse- HTTP responseid- The persistent identifier (eg. handle, DOI) to search for- Throws:
IOExceptionSQLException
-
getDomainClass
Description copied from class:DSpaceRestRepositoryThe REST model supported by the repository- Specified by:
getDomainClassin classDSpaceRestRepository<IdentifierRest,String>
-