public class SubjectAreaTermHandler extends SubjectAreaHandler
oMRSAPIHelper| Constructor and Description |
|---|
SubjectAreaTermHandler(OMRSAPIHelper oMRSAPIHelper)
Construct the Subject Area Term Handler
needed to operate within a single server instance.
|
| Modifier and Type | Method and Description |
|---|---|
SubjectAreaOMASAPIResponse |
createTerm(SubjectAreaGlossaryHandler glossaryHandler,
String userId,
Term suppliedTerm)
Create a Term.
|
SubjectAreaOMASAPIResponse |
deleteTerm(String userId,
String guid,
Boolean isPurge)
Delete a Term instance
|
SubjectAreaOMASAPIResponse |
findTerm(String userId,
String searchCriteria,
Date asOfTime,
Integer offset,
Integer pageSize,
SequencingOrder sequencingOrder,
String sequencingProperty)
Find Term
|
protected SubjectAreaOMASAPIResponse |
getResponse(SubjectAreaOMASAPIResponse response)
Take an entityDetail response and map it to the appropriate Term orientated response
|
SubjectAreaOMASAPIResponse |
getTermByGuid(String userId,
String guid)
Get a term by guid.
|
SubjectAreaOMASAPIResponse |
getTermRelationships(String userId,
String guid,
Date asOfTime,
Integer offset,
Integer pageSize,
SequencingOrder sequencingOrder,
String sequencingProperty)
Get Term relationships
|
SubjectAreaOMASAPIResponse |
restoreTerm(String userId,
String guid)
Restore a Term
|
SubjectAreaOMASAPIResponse |
updateTerm(String userId,
String guid,
Term suppliedTerm,
boolean isReplace)
Update a Term
|
getRelationshipsFromGuid, validateGlossarySummaryDuringCreationpublic SubjectAreaTermHandler(OMRSAPIHelper oMRSAPIHelper)
oMRSAPIHelper - omrs API helperprotected SubjectAreaOMASAPIResponse getResponse(SubjectAreaOMASAPIResponse response)
getResponse in class SubjectAreaHandlerresponse - entityDetailResponsepublic SubjectAreaOMASAPIResponse createTerm(SubjectAreaGlossaryHandler glossaryHandler, String userId, Term suppliedTerm)
Terms with the same name can be confusing. Best practise is to createTerms that have unique names. This Create call does not police that term names are unique. So it is possible to create Terms with the same name as each other.
Valid nodeTypes for this request are:
glossaryHandler - glossary handleruserId - unique identifier for requesting user, under which the request is performedsuppliedTerm - Term to createpublic SubjectAreaOMASAPIResponse getTermByGuid(String userId, String guid)
userId - unique identifier for requesting user, under which the request is performedguid - guid of the term to getpublic SubjectAreaOMASAPIResponse findTerm(String userId, String searchCriteria, Date asOfTime, Integer offset, Integer pageSize, SequencingOrder sequencingOrder, String sequencingProperty)
userId - unique identifier for requesting user, under which the request is performedsearchCriteria - String expression matching Term property values. If not specified then all terms are returned.asOfTime - the terms returned as they were at this time. null indicates at the current time.offset - the starting element number for this set of results. This is used when retrieving elements
beyond the first page of results. Zero means the results start from the first element.pageSize - the maximum number of elements that can be returned on this request.
0 means there is no limit to the page sizesequencingOrder - the sequencing order for the results.sequencingProperty - the name of the property that should be used to sequence the results.public SubjectAreaOMASAPIResponse getTermRelationships(String userId, String guid, Date asOfTime, Integer offset, Integer pageSize, SequencingOrder sequencingOrder, String sequencingProperty)
userId - unique identifier for requesting user, under which the request is performedguid - guid of the term to getasOfTime - the relationships returned as they were at this time. null indicates at the current time. If specified, the date is in milliseconds since 1970-01-01 00:00:00.offset - the starting element number for this set of results. This is used when retrieving elements
beyond the first page of results. Zero means the results start from the first element.pageSize - the maximum number of elements that can be returned on this request.
0 means there is not limit to the page sizesequencingOrder - the sequencing order for the results.sequencingProperty - the name of the property that should be used to sequence the results.public SubjectAreaOMASAPIResponse updateTerm(String userId, String guid, Term suppliedTerm, boolean isReplace)
If the caller has chosen to incorporate the term name in their Term Terms or Categories qualified name, renaming the term will cause those qualified names to mismatch the Term name. If the caller has chosen to incorporate the term qualifiedName in their Term Terms or Categories qualified name, changing the qualified name of the term will cause those qualified names to mismatch the Term name. Status is not updated using this call.
userId - unique identifier for requesting user, under which the request is performedguid - guid of the term to updatesuppliedTerm - term to be updatedisReplace - flag to indicate that this update is a replace. When not set only the supplied (non null) fields are updated.public SubjectAreaOMASAPIResponse deleteTerm(String userId, String guid, Boolean isPurge)
The deletion of a term is only allowed if there is no term content (i.e. no terms or categories).
There are 2 types of deletion, a soft delete and a hard delete (also known as a purge). All repositories support hard deletes. Soft deletes support is optional. Soft delete is the default.
A soft delete means that the term instance will exist in a deleted state in the repository after the delete operation. This means that it is possible to undo the delete. A hard delete means that the term will not exist after the operation. when not successful the following Exceptions can occur
userId - unique identifier for requesting user, under which the request is performedguid - guid of the term to be deleted.isPurge - true indicates a hard delete, false is a soft delete.public SubjectAreaOMASAPIResponse restoreTerm(String userId, String guid)
Restore allows the deleted Term to be made active again. Restore allows deletes to be undone. Hard deletes are not stored in the repository so cannot be restored.
userId - unique identifier for requesting user, under which the request is performedguid - guid of the term to restoreCopyright © 2018–2020 ODPi. All rights reserved.