@AlfrescoPublicApi
public interface MessageService
extends org.alfresco.repo.tenant.TenantDeployer, org.alfresco.service.cmr.i18n.MessageLookup
Modifier and Type | Method and Description |
---|---|
String |
getBaseBundleName(String resourceName) |
Locale |
getContentLocale()
Get the content local for the current thread.
This will revert to getLocale() if no value has been defined. |
Locale |
getLocale()
Get the general local for the current thread, will revert to the default locale if none
specified for this thread.
|
Locale |
getNearestLocale(Locale templateLocale,
Set<Locale> options)
Searches for the nearest locale from the available options.
|
Set<String> |
getRegisteredBundles()
Get set of registered message resource bundles
|
ResourceBundle |
getRepoResourceBundle(org.alfresco.service.cmr.repository.StoreRef storeRef,
String path,
Locale locale)
Get message resource bundle from the repository
note: also used by Web Client (ResourceBundleWrapper)
|
Locale |
parseLocale(String localeStr)
Factory method to create a Locale from a lang_country_variant string.
|
void |
register(MessageDeployer messageDeployer)
Register message deployer with message service
|
void |
registerResourceBundle(String bundleBasePath)
Register a resource bundle.
|
void |
setContentLocale(Locale locale)
Set the content locale for the current thread.
|
void |
setLocale(Locale locale)
Set the locale for the current thread.
|
void |
unregisterResourceBundle(String resBundlePath)
Unregister a resource bundle
|
void setLocale(Locale locale)
locale
- the localeLocale getLocale()
void setContentLocale(Locale locale)
locale
- the content localeLocale getContentLocale()
getLocale()
if no value has been defined.Locale getNearestLocale(Locale templateLocale, Set<Locale> options)
templateLocale
- the template to search for or null to match any localeoptions
- the available locales to search fromLocale parseLocale(String localeStr)
localeStr
- e.g. fr_FRdefault
if the
string is invalidvoid registerResourceBundle(String bundleBasePath)
This should be the bundle base path eg, alfresco/messages/errors or, workspace://SpaceStore/app:company_home/app:dictionary/app:labels/cm:errors
Once registered the messages will be available via getMessage, assuming the bundle resource exists at the given path location.
bundleBasePath
- the bundle base pathvoid unregisterResourceBundle(String resBundlePath)
This should be the bundle base path eg alfresco/messages/errors or workspace://SpaceStore/app:company_home/app:dictionary/app:labels/cm:errors
Once unregistered the messages will no longer be available via getMessage
resBundlePath
- the bundle base pathResourceBundle getRepoResourceBundle(org.alfresco.service.cmr.repository.StoreRef storeRef, String path, Locale locale) throws IOException
storeRef
- store refpath
- repository path (XPath)locale
- localeIOException
Set<String> getRegisteredBundles()
void register(MessageDeployer messageDeployer)
messageDeployer
- MessageDeployerCopyright © 2005–2017 Alfresco Software. All rights reserved.