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 List<Line> |
convertOMRSLinesToOMASLines(Set<Line> omrsLines)
Convert the OMRS Line objects to the equivalent OMAS objects and return them in a list.
|
static InstanceStatus |
convertStatusToInstanceStatus(Status status) |
static InstanceType |
createTemplateFromTypeDef(TypeDef typeDef) |
static GlossarySummary |
extractGlossarySummaryFromGlossary(Glossary glossary)
Extract glossarySummary
|
static IconSummary |
extractIconSummaryFromRelatedMedia(RelatedMedia relatedMedia)
extract iconSummary if this media is an icon
|
static GlossarySummary |
getGlossarySummaryForCategory(String userId,
SubjectAreaBeansToAccessOMRS subjectAreaBeansToAccessOMRS,
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 GlossarySummary |
getGlossarySummaryForTerm(String userId,
SubjectAreaBeansToAccessOMRS subjectAreaBeansToAccessOMRS,
Line line)
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 Set<IconSummary> |
getIconSummarySet(String userId,
SubjectAreaBeansToAccessOMRS subjectAreaBeansToAccessOMRS,
Set<Line> mediaReferenceRelationshipSet)
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 userId,
SubjectAreaBeansToAccessOMRS subjectAreaBeansToAccessOMRS,
Set<Line> lines)
Get a summary of the parent category.
|
static boolean |
isCategory(String typeName) |
static boolean |
isEffective(Date from,
Date to)
check check whether the current time lies between the from and to
|
static boolean |
isEffective(Line line) |
static boolean |
isGlossary(String typeName) |
static boolean |
isGovernanceActionClassification(String classificationName) |
static boolean |
isTerm(String typeName) |
static boolean |
isTopLevelGlossaryObject(String entityName) |
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 Set<IconSummary> getIconSummarySet(String userId, SubjectAreaBeansToAccessOMRS subjectAreaBeansToAccessOMRS, Set<Line> mediaReferenceRelationshipSet) throws UserNotAuthorizedException, InvalidParameterException, UnrecognizedGUIDException, MetadataServerUncontactableException
userId - userid under which to issue to the get of the related mediasubjectAreaBeansToAccessOMRS - bean to access OMRSmediaReferenceRelationshipSet - set of related media RelationshipsUserNotAuthorizedException - 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 - not able to communicate with a Metadata respository service.public static boolean isEffective(Line line)
line - line to checkpublic static boolean isEffective(Date from, Date to)
from - Date from which effectiveto - Date to which effectivepublic static GlossarySummary getGlossarySummaryForTerm(String userId, SubjectAreaBeansToAccessOMRS subjectAreaBeansToAccessOMRS, Line line) throws UserNotAuthorizedException, InvalidParameterException, UnrecognizedGUIDException, MetadataServerUncontactableException, FunctionNotSupportedException
userId - userid under which to issue to the get of the related mediasubjectAreaBeansToAccessOMRS - bean to access OMRSline - glossary relationshipUserNotAuthorizedException - 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 - not able to communicate with a Metadata respository service.FunctionNotSupportedException - Function not supportedpublic static GlossarySummary getGlossarySummaryForCategory(String userId, SubjectAreaBeansToAccessOMRS subjectAreaBeansToAccessOMRS, Line line) throws UserNotAuthorizedException, InvalidParameterException, UnrecognizedGUIDException, MetadataServerUncontactableException, FunctionNotSupportedException
userId - userid under which to issue to the get of the related mediasubjectAreaBeansToAccessOMRS - bean to access OMRSline - glossary relationshipUserNotAuthorizedException - 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 - not able to communicate with a Metadata respository service.FunctionNotSupportedException - Function not supportedpublic static CategorySummary getParentCategorySummary(String userId, SubjectAreaBeansToAccessOMRS subjectAreaBeansToAccessOMRS, Set<Line> lines) throws UserNotAuthorizedException, InvalidParameterException, UnrecognizedGUIDException, MetadataServerUncontactableException, FunctionNotSupportedException
userId - userid that the requests are issued undersubjectAreaBeansToAccessOMRS - servicelines - 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(RelatedMedia relatedMedia)
relatedMedia - related mediapublic static GlossarySummary extractGlossarySummaryFromGlossary(Glossary glossary)
glossary - to extractpublic static void checkStatusNotDeleted(Status status, SubjectAreaErrorCode errorCode) throws InvalidParameterException
InvalidParameterExceptionpublic static Status convertInstanceStatusToStatus(InstanceStatus instanceStatus)
public static InstanceStatus convertStatusToInstanceStatus(Status status)
public static List<Line> convertOMRSLinesToOMASLines(Set<Line> omrsLines)
omrsLines - - these are Lines generated by hte generator from the omrs relationshipspublic static SequencingOrder convertOMASToOMRSSequencingOrder(SequencingOrder sequencingOrder)
sequencingOrder - supplied omas sequencing orderCopyright © 2018–2019 ODPi. All rights reserved.