Package org.dspace.app.rest.repository
Class DuplicateRestRepository
java.lang.Object
org.dspace.app.rest.repository.AbstractDSpaceRestRepository
org.dspace.app.rest.repository.DSpaceRestRepository<PotentialDuplicateRest,String>
org.dspace.app.rest.repository.DuplicateRestRepository
- All Implemented Interfaces:
Aware,BeanNameAware,InitializingBean,org.springframework.data.repository.CrudRepository<PotentialDuplicateRest,,String> org.springframework.data.repository.PagingAndSortingRepository<PotentialDuplicateRest,,String> org.springframework.data.repository.Repository<PotentialDuplicateRest,String>
@ConditionalOnProperty("duplicate.enable")
@Component("submission.duplicates")
public class DuplicateRestRepository
extends DSpaceRestRepository<PotentialDuplicateRest,String>
implements InitializingBean
The REST repository for the api/submission/duplicates endpoint, which handles requests for finding
potential duplicates of a given item (archived or in-progress).
Find one and find all are not implemented as actual REST methods because a duplicate is the result
of comparing an item with other indexed items, not an object that can be referenced by some kind of ID, but
we must at least implement the Java methods here in order to extend DSpaceRestRepository and implement
SearchRestMethods.
- 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 this repository endpoint as /api/submission/duplicatesorg.springframework.data.domain.Page<PotentialDuplicateRest>This REST method is NOT IMPLEMENTED - it does not make sense in duplicate detection, where there can be no "all"org.springframework.data.domain.Page<PotentialDuplicateRest>findByItem(UUID uuid, org.springframework.data.domain.Pageable pageable) Return a paged list of potential duplicate matches for the given item ID.This REST method is NOT IMPLEMENTED - it does not make sense in duplicate detection, in which the only real addressable objects involved are Items.Return the domain class for potential duplicate objectsMethods inherited from class org.dspace.app.rest.repository.DSpaceRestRepository
action, action, count, createAndReturn, 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
-
DuplicateRestRepository
public DuplicateRestRepository()
-
-
Method Details
-
afterPropertiesSet
Register this repository endpoint as /api/submission/duplicates- Specified by:
afterPropertiesSetin interfaceInitializingBean- Throws:
Exception
-
findOne
This REST method is NOT IMPLEMENTED - it does not make sense in duplicate detection, in which the only real addressable objects involved are Items.- Specified by:
findOnein classDSpaceRestRepository<PotentialDuplicateRest,String> - Parameters:
context- the dspace contextname- the rest object id- Returns:
- not implemented
- Throws:
RepositoryMethodNotImplementedException
-
findAll
@PreAuthorize("permitAll()") public org.springframework.data.domain.Page<PotentialDuplicateRest> findAll(Context context, org.springframework.data.domain.Pageable pageable) This REST method is NOT IMPLEMENTED - it does not make sense in duplicate detection, where there can be no "all"- Specified by:
findAllin classDSpaceRestRepository<PotentialDuplicateRest,String> - Parameters:
context- the dspace contextpageable- object embedding the requested pagination info- Returns:
- not implemented
- Throws:
RepositoryMethodNotImplementedException
-
findByItem
@PreAuthorize("hasPermission(#uuid, \'ITEM\', \'READ\')") public org.springframework.data.domain.Page<PotentialDuplicateRest> findByItem(UUID uuid, org.springframework.data.domain.Pageable pageable) Return a paged list of potential duplicate matches for the given item ID. This may be an item wrapped in an in-progress item wrapper like workspace or workflow, as long as the current user has READ access to this item. Results from the service search method will only contain matches that lead to items which are readable by the current user.- Parameters:
uuid- The item UUID to searchpageable- Pagination options- Returns:
- Paged list of potential duplicates
- Throws:
Exception
-
getDomainClass
Return the domain class for potential duplicate objects- Specified by:
getDomainClassin classDSpaceRestRepository<PotentialDuplicateRest,String> - Returns:
- PotentialDuplicateRest.class
-