Class MultiLanguageManagement
java.lang.Object
org.odpi.openmetadata.frameworks.integration.context.MultiLanguageManagement
MultiLanguageManagement enables translations of the string properties of a metadata element to be created, maintained and retrieved.
-
Constructor Summary
ConstructorDescriptionMultiLanguageManagement
(OpenMetadataClient openMetadataStore, String userId) The constructor needs an implementation of the open metadata store. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearTranslation
(String elementGUID, String language, String locale) Remove the translation for a particular language/locale for a metadata element.getTranslation
(String elementGUID, String language, String locale) Retrieve the translation for the matching language/locale.getTranslations
(String elementGUID, int startFrom, int pageSize) Retrieve all translations associated with a metadata element.void
setTranslation
(String elementGUID, TranslationDetail translationDetail) Create or update the translation for a particular language/locale for a metadata element.
-
Constructor Details
-
MultiLanguageManagement
The constructor needs an implementation of the open metadata store.- Parameters:
openMetadataStore
- client implementationuserId
- calling user
-
-
Method Details
-
setTranslation
public void setTranslation(String elementGUID, TranslationDetail translationDetail) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create or update the translation for a particular language/locale for a metadata element.- Parameters:
elementGUID
- unique identifier of the element that this translation is related totranslationDetail
- properties of the translation- Throws:
InvalidParameterException
- the unique identifier is null or not known.UserNotAuthorizedException
- the service is not able to access the elementPropertyServerException
- there is a problem accessing the metadata store
-
clearTranslation
public void clearTranslation(String elementGUID, String language, String locale) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the translation for a particular language/locale for a metadata element.- Parameters:
elementGUID
- unique identifier of the element that this translation is related tolanguage
- language requestedlocale
- optional locale to qualify which translation if there are multiple translations for the language.- Throws:
InvalidParameterException
- the language is null or not known or not unique (add locale)UserNotAuthorizedException
- the service is not able to access the elementPropertyServerException
- there is a problem accessing the metadata store
-
getTranslation
public TranslationDetail getTranslation(String elementGUID, String language, String locale) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the translation for the matching language/locale.- Parameters:
elementGUID
- unique identifier of the element that this translation is related tolanguage
- language requestedlocale
- optional locale to qualify which translation if there are multiple translations for the language.- Returns:
- the properties of the translation or null if there is none
- Throws:
InvalidParameterException
- the unique identifier is null or not known.UserNotAuthorizedException
- the service is not able to access the elementPropertyServerException
- there is a problem accessing the metadata store
-
getTranslations
public List<TranslationDetail> getTranslations(String elementGUID, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve all translations associated with a metadata element.- Parameters:
elementGUID
- unique identifier of the element that this translation is related tostartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return- Returns:
- list of translation properties or null if there are none
- Throws:
InvalidParameterException
- the unique identifier is null or not known.UserNotAuthorizedException
- the service is not able to access the elementPropertyServerException
- there is a problem accessing the metadata store
-