Class 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.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 implmented in org.dspace.app.rest.IdentifierRestController
Author:
Kim Shepherd
  • Field Details

  • Constructor Details

    • IdentifierRestRepository

      public IdentifierRestRepository()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Register /api/pid/find?id=... as a discoverable endpoint service
      Specified by:
      afterPropertiesSet in interface org.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:
      findAll in class DSpaceRestRepository<IdentifierRest,String>
      Parameters:
      context - the dspace context
      pageable - 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:
      findOne in class DSpaceRestRepository<IdentifierRest,String>
      Parameters:
      context - the dspace context
      identifier - 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

      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:
      createAndReturn in class DSpaceRestRepository<IdentifierRest,String>
      Parameters:
      context - the dspace context
      list - A uri-list with the item URI for which to create an identifier
      Returns:
      201 Created with object JSON on success
      Throws:
      AuthorizeException
      SQLException
      RepositoryMethodNotImplementedException
    • 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, SQLException
      Redirect to a DSO page, given an identifier
      Parameters:
      request - HTTP request
      response - HTTP response
      id - The persistent identifier (eg. handle, DOI) to search for
      Throws:
      IOException
      SQLException
    • getDomainClass

      public Class<IdentifierRest> getDomainClass()
      Description copied from class: DSpaceRestRepository
      The REST model supported by the repository
      Specified by:
      getDomainClass in class DSpaceRestRepository<IdentifierRest,String>