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:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.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.identifier") public class IdentifierRestRepository extends DSpaceRestRepository<IdentifierRest,String> implements org.springframework.beans.factory.InitializingBeanItem REST Repository and Controller for persistent identifiers. The controller annotation and endpoint registration allows the "find DSO by identifier" method which was previously implmented in org.dspace.app.rest.IdentifierRestController- Author:
- Kim Shepherd
-
-
Field Summary
Fields Modifier and Type Field Description static StringCATEGORYstatic StringNAME-
Fields inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
converter, requestService, utils
-
-
Constructor Summary
Constructors Constructor Description IdentifierRestRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Register /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>findAll(Context context, org.springframework.data.domain.Pageable pageable)Find all identifiers.org.springframework.data.domain.Page<IdentifierRest>findByItem(String uuid, org.springframework.data.domain.Pageable pageable)Find identifiers associated with a given itemIdentifierRestfindOne(Context context, String identifier)Find the identifier object for a given identifier string (eg. doi).Class<IdentifierRest>getDomainClass()The REST model supported by the repositoryvoidgetDSObyIdentifier(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String id)Redirect to a DSO page, given an identifier-
Methods 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, upload
-
Methods inherited from class org.dspace.app.rest.repository.AbstractDSpaceRestRepository
getRequestService, obtainContext
-
-
-
-
Field Detail
-
CATEGORY
public static final String CATEGORY
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws ExceptionRegister /api/pid/find?id=... as a discoverable endpoint service- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- 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
@PreAuthorize("permitAll()") public IdentifierRest findOne(Context context, String identifier)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(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @RequestParam("id") String id) throws IOException, SQLExceptionRedirect 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
public Class<IdentifierRest> getDomainClass()
Description copied from class:DSpaceRestRepositoryThe REST model supported by the repository- Specified by:
getDomainClassin classDSpaceRestRepository<IdentifierRest,String>
-
-