Package org.gbif.api.service.collections
Interface InstitutionService
-
- All Superinterfaces:
CollectionEntityService<Institution>
,CommentService
,ContactService
,CrudService<Institution>
,IdentifierService
,MachineTagService
,OccurrenceMappingService
,PrimaryIdentifierService
,TagService
public interface InstitutionService extends CollectionEntityService<Institution>
Service for institutions in the collections context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
convertToCollection(UUID targetEntityKey, UUID collectionKey)
Converts an institution into a collection.UUID
createFromLatimerCore(@NotNull @Valid OrganisationalUnit organisationalUnit)
Similar toCrudService.create(CollectionEntity)
but it accepts Latimer Core.UUID
createFromOrganization(UUID organizationKey, String institutionCode)
Creates aInstitution
from aOrganization
.OrganisationalUnit
getAsLatimerCore(@NotNull UUID key)
Similar to theCrudService.get(UUID)
method but returns the results in Latimer Core format.PagingResponse<Institution>
list(InstitutionSearchRequest searchRequest)
PagesInstitution
entities based on the parameters received.PagingResponse<OrganisationalUnit>
listAsLatimerCore(InstitutionSearchRequest searchRequest)
Similar to thelist(InstitutionSearchRequest)
method but returns the results in Latimer Core format.PagingResponse<Institution>
listDeleted(InstitutionSearchRequest searchRequest)
Provides access to deleted institutions.org.geojson.FeatureCollection
listGeojson(InstitutionSearchRequest searchRequest)
Lists the institutions in GeoJson format.List<KeyCodeNameResult>
suggest(String q)
Provides a simple suggest service.void
updateFromLatimerCore(@NotNull @Valid OrganisationalUnit entity)
Similar toCrudService.update(CollectionEntity)
)} but it accepts Latimer Core.-
Methods inherited from interface org.gbif.api.service.collections.CollectionEntityService
addMasterSourceMetadata, deleteMasterSourceMetadata, findByMasterSource, getMasterSourceMetadata, replace, update
-
Methods inherited from interface org.gbif.api.service.registry.CommentService
addComment, deleteComment, listComments
-
Methods inherited from interface org.gbif.api.service.collections.ContactService
addContactPerson, addSuggestionContacts, listContactPersons, removeContactPerson, replaceContactPersons, updateContactPerson
-
Methods inherited from interface org.gbif.api.service.collections.CrudService
create, delete, exists, get, update
-
Methods inherited from interface org.gbif.api.service.registry.IdentifierService
addIdentifier, deleteIdentifier, listIdentifiers
-
Methods inherited from interface org.gbif.api.service.registry.MachineTagService
addMachineTag, addMachineTag, addMachineTag, deleteMachineTag, deleteMachineTags, deleteMachineTags, deleteMachineTags, deleteMachineTags, listMachineTags
-
Methods inherited from interface org.gbif.api.service.collections.OccurrenceMappingService
addOccurrenceMapping, deleteOccurrenceMapping, listOccurrenceMappings
-
Methods inherited from interface org.gbif.api.service.registry.PrimaryIdentifierService
updateIdentifier
-
Methods inherited from interface org.gbif.api.service.registry.TagService
addTag, addTag, deleteTag, listTags
-
-
-
-
Method Detail
-
list
PagingResponse<Institution> list(InstitutionSearchRequest searchRequest)
PagesInstitution
entities based on the parameters received.To iterate over all entities you can use code like this:
PagingRequest req = new PagingRequest(); PagingResponse<T> response; do { response = service.list(req); for (T obj : response.getResults()) { doStuff(); } req.nextPage(); } while (!response.isEndOfRecords());
- Parameters:
searchRequest
-InstitutionSearchRequest
with all the parameters- Returns:
- a list of entities ordered by their creation date, newest coming first
-
listAsLatimerCore
PagingResponse<OrganisationalUnit> listAsLatimerCore(InstitutionSearchRequest searchRequest)
Similar to thelist(InstitutionSearchRequest)
method but returns the results in Latimer Core format.
-
getAsLatimerCore
OrganisationalUnit getAsLatimerCore(@NotNull @NotNull UUID key)
Similar to theCrudService.get(UUID)
method but returns the results in Latimer Core format.
-
createFromLatimerCore
UUID createFromLatimerCore(@NotNull @Valid @NotNull @Valid OrganisationalUnit organisationalUnit)
Similar toCrudService.create(CollectionEntity)
but it accepts Latimer Core.
-
updateFromLatimerCore
void updateFromLatimerCore(@NotNull @Valid @NotNull @Valid OrganisationalUnit entity)
Similar toCrudService.update(CollectionEntity)
)} but it accepts Latimer Core.
-
listDeleted
PagingResponse<Institution> listDeleted(InstitutionSearchRequest searchRequest)
Provides access to deleted institutions.
-
suggest
List<KeyCodeNameResult> suggest(@Nullable String q)
Provides a simple suggest service.
-
convertToCollection
void convertToCollection(UUID targetEntityKey, UUID collectionKey)
Converts an institution into a collection. The institution converted is deleted.
-
createFromOrganization
UUID createFromOrganization(UUID organizationKey, String institutionCode)
Creates aInstitution
from aOrganization
.- Parameters:
organizationKey
- key of the dataset to create the institution frominstitutionCode
- the code to assign to the institution since it can't be inferred from the organization- Returns:
- UUID of the created institution
-
listGeojson
org.geojson.FeatureCollection listGeojson(InstitutionSearchRequest searchRequest)
Lists the institutions in GeoJson format.- Parameters:
searchRequest
- parameters to filter the request- Returns:
- a
FeatureCollection
object that conforms with GeoJson
-
-