public class SubjectAreaUtils extends Object
| Constructor and Description |
|---|
SubjectAreaUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addStringToInstanceProperty(String key,
String value,
InstanceProperties instanceProperties) |
static void |
checkStatusNotDeleted(Status status,
SubjectAreaErrorCode errorCode) |
static Status |
convertInstanceStatusToStatus(InstanceStatus instanceStatus) |
static SequencingOrder |
convertOMASToOMRSSequencingOrder(SequencingOrder sequencingOrder)
convert omas sequencing order to omrs sequencing order
|
static SubjectAreaOMASAPIResponse |
convertOMRSRelationshipsToOMASLines(OMRSAPIHelper omrsapiHelper,
List<Relationship> omrsRelationships)
Convert the OMRS Lines to their equivalent OMAS objects and return them in a Response of type lines.
|
static InstanceStatus |
convertStatusToInstanceStatus(Status status) |
static SystemAttributes |
createSystemAttributes(InstanceHeader instanceHeader)
create SystemAttributes instance from an insance header object
|
static InstanceType |
createTemplateFromTypeDef(TypeDef typeDef) |
static GlossarySummary |
extractGlossarySummaryFromGlossary(Glossary glossary,
Line line)
Extract glossarySummary
|
static IconSummary |
extractIconSummaryFromRelatedMedia(EntityDetail relatedMedia)
extract iconSummary if this media is an icon
|
static SubjectAreaOMASAPIResponse |
getGlossarySummaryForCategory(String restAPIName,
String userId,
OMRSAPIHelper omrsapiHelper,
Line line)
Get a Categories icon summaries from related media relationships by issuing a call to omrs using the related media guid - which is at one end of the relationship.
|
static SubjectAreaOMASAPIResponse |
getGlossarySummaryForTerm(String restAPIName,
String userId,
OMRSAPIHelper omrsapiHelper,
TermAnchorRelationship termAnchorRelationship,
Term term)
Get a Term's icon summaries from related media relationships by issuing a call to omrs using the related media guid - which is at one end of the relationship.
|
static SubjectAreaOMASAPIResponse |
getIconSummarySet(String userId,
OMRSAPIHelper oMRSAPIHelper,
String guid)
Set icon summaries from related media relationships by issuing a call to omrs using the related media guid - which is at one end of the relationship.
|
static CategorySummary |
getParentCategorySummary(String restAPIName,
String userId,
OMRSAPIHelper omrsapiHelper,
Set<Line> lines)
Get a summary of the parent category.
|
static boolean |
isCategory(String typeName) |
static boolean |
isGlossary(String typeName) |
static boolean |
isGovernanceActionClassification(String classificationName) |
static boolean |
isTerm(String typeName) |
static boolean |
isTopLevelGlossaryObject(String entityName) |
static void |
populateSystemAttributesForInstanceAuditHeader(SystemAttributes systemAttributes,
InstanceAuditHeader instanceAuditHeader) |
static void |
setDatePropertyInInstanceProperties(InstanceProperties instanceProperties,
Date date,
String propertyName)
set the Date value into the InstanceProperties
|
static void |
setIntegerPropertyInInstanceProperties(InstanceProperties instanceProperties,
Integer integerValue,
String propertyName)
Set the Integer value into the InstanceProperties.
|
static void |
setStringPropertyInInstanceProperties(InstanceProperties instanceProperties,
String stringValue,
String propertyName)
Set the String value into the InstanceProperties.
|
public static boolean isTopLevelGlossaryObject(String entityName)
public static boolean isGovernanceActionClassification(String classificationName)
public static InstanceType createTemplateFromTypeDef(TypeDef typeDef)
public static boolean isTerm(String typeName)
public static boolean isCategory(String typeName)
public static boolean isGlossary(String typeName)
public static void addStringToInstanceProperty(String key, String value, InstanceProperties instanceProperties)
public static SubjectAreaOMASAPIResponse getIconSummarySet(String userId, OMRSAPIHelper oMRSAPIHelper, String guid)
userId - userid under which to issue to the get of the related mediaoMRSAPIHelper - interface to OMRSguid - to get associated icons frompublic static SubjectAreaOMASAPIResponse getGlossarySummaryForTerm(String restAPIName, String userId, OMRSAPIHelper omrsapiHelper, TermAnchorRelationship termAnchorRelationship, Term term)
restAPIName - rest API NameuserId - userid under which to issue to the get of the related mediaomrsapiHelper - helper to access OMRStermAnchorRelationship - term glossary relationshipterm - supplied termpublic static SubjectAreaOMASAPIResponse getGlossarySummaryForCategory(String restAPIName, String userId, OMRSAPIHelper omrsapiHelper, Line line)
restAPIName - rest API NameuserId - userid under which to issue to the get of the related mediaomrsapiHelper - helper to access OMRSline - glossary relationshippublic static CategorySummary getParentCategorySummary(String restAPIName, String userId, OMRSAPIHelper omrsapiHelper, Set<Line> lines) throws UserNotAuthorizedException, InvalidParameterException, UnrecognizedGUIDException, MetadataServerUncontactableException, FunctionNotSupportedException
restAPIName - rest API NameuserId - userid that the requests are issued underomrsapiHelper - helper to access OMRSlines - set of Lines that are of the right type.UserNotAuthorizedException - the requesting user is not authorized to issue this request.InvalidParameterException - one of the parameters is null or invalid.UnrecognizedGUIDException - the supplied guid was not recognisedMetadataServerUncontactableException - Unable to contact the serverFunctionNotSupportedException - Function not supportedpublic static IconSummary extractIconSummaryFromRelatedMedia(EntityDetail relatedMedia)
relatedMedia - related mediapublic static GlossarySummary extractGlossarySummaryFromGlossary(Glossary glossary, Line line)
glossary - the glossary that is to be summarisedline - the line to the glossary, which feeds part of the node summarypublic static void checkStatusNotDeleted(Status status, SubjectAreaErrorCode errorCode) throws InvalidParameterException
InvalidParameterExceptionpublic static Status convertInstanceStatusToStatus(InstanceStatus instanceStatus)
public static InstanceStatus convertStatusToInstanceStatus(Status status)
public static SubjectAreaOMASAPIResponse convertOMRSRelationshipsToOMASLines(OMRSAPIHelper omrsapiHelper, List<Relationship> omrsRelationships)
omrsapiHelper - OMRS API helper - used to construct the mappersomrsRelationships - - these are OMRS relationshipspublic static SequencingOrder convertOMASToOMRSSequencingOrder(SequencingOrder sequencingOrder)
sequencingOrder - supplied omas sequencing orderpublic static SystemAttributes createSystemAttributes(InstanceHeader instanceHeader)
instanceHeader - omrs instance headerpublic static void populateSystemAttributesForInstanceAuditHeader(SystemAttributes systemAttributes, InstanceAuditHeader instanceAuditHeader)
public static void setStringPropertyInInstanceProperties(InstanceProperties instanceProperties, String stringValue, String propertyName)
instanceProperties - supplied instancepropertiesstringValue - string valuepropertyName - property name.public static void setIntegerPropertyInInstanceProperties(InstanceProperties instanceProperties, Integer integerValue, String propertyName)
instanceProperties - supplied instancepropertiesintegerValue - integer valuepropertyName - property name.public static void setDatePropertyInInstanceProperties(InstanceProperties instanceProperties, Date date, String propertyName)
instanceProperties - supplied instancepropertiesdate - Datew valuepropertyName - property nameCopyright © 2018–2019 ODPi. All rights reserved.