public class LocalizationManager extends Object implements ILocalizationManager
DO_NOT_RENDER_PARAMETERS
Constructor and Description |
---|
LocalizationManager() |
Modifier and Type | Method and Description |
---|---|
void |
add(LocaleConfig localeConfig)
Adds the given locale.
|
String |
addCustomString(SessionConfig sessionConfig,
CustomStringConfig customStringConfig,
ITransaction transaction)
Add a Custom String
|
void |
clearCache()
Clear the localization cache.
|
void |
clearCache(String resourcePath)
Clear the localization cache by passing the resource path.
|
void |
clearCache(String resourcePath,
Locale locale)
Clear the localization cache by passing the resource path and the locale.
|
void |
delete(String id)
Deletes the locale with the given identifier.
|
void |
deleteCustomString(SessionConfig sessionConfig,
String customStringId,
ITransaction transaction)
Delete a specified Custom String
|
Iterable<String> |
getCachedResourcePaths()
Deprecated.
|
CustomStringConfig |
getCustomString(SessionConfig sessionConfig,
String customStringId,
ITransaction transaction)
Get the Custom String object
|
Locale |
getDefaultLocale()
Returns the portal default locale.
|
Collection<Locale> |
getLocales()
Returns all locales currently available in the portal.
|
Collection<LocaleConfig> |
getLocales(ITransaction transaction)
Returns a collection of locale config
|
String |
localize(String id,
IResource resource)
Localizes the given string id using the given resource and current locale.
|
String |
localize(String id,
IResource resource,
Locale locale)
Localizes the given string id using the given resource and locale.
|
String |
localize(String id,
IResource resource,
Locale locale,
WebResource webResource)
Localizes the given string id using the given resource,
WebResource and locale. |
String |
localize(String id,
IResource resource,
PageWebResource pageWebResource)
Localizes the given string id using the given resource,
PageWebResource and current locale. |
String |
localize(String id,
List<IResource> resources)
Localizes the given string id using the given resources and current locale.
|
String |
localize(String id,
List<IResource> resources,
Locale locale)
Localizes the given string id using the given resources and locale.
|
String |
localize(String id,
List<IResource> resources,
Locale locale,
WebResource webResource)
Localizes the given string id using the given resources,
WebResource and locale. |
String |
localize(String id,
List<IResource> resources,
PageWebResource pageWebResource)
Localizes the given string id using the given resources,
PageWebResource and current locale. |
void |
update(LocaleConfig locale)
Updates the given locale.
|
void |
updateCustomString(SessionConfig sessionConfig,
CustomStringConfig customStringConfig,
ITransaction transaction)
Update a specified Custom String
|
public Collection<LocaleConfig> getLocales(ITransaction transaction) throws PortalException
getLocales
in interface ILocalizationManager
transaction
- the transaction for persistence access.PortalException
public Collection<Locale> getLocales()
ILocalizationManager
getLocales
in interface ILocalizationManager
public Locale getDefaultLocale()
ILocalizationManager
getDefaultLocale
in interface ILocalizationManager
public void add(LocaleConfig localeConfig) throws PortalException
ILocalizationManager
add
in interface ILocalizationManager
localeConfig
- the locale to be added.PortalException
public void delete(String id) throws PortalException
ILocalizationManager
delete
in interface ILocalizationManager
id
- the locale identifier.PortalException
public void update(LocaleConfig locale) throws PortalException
ILocalizationManager
update
in interface ILocalizationManager
locale
- the locale to be updated.PortalException
public String localize(String id, IResource resource) throws PortalException
ILocalizationManager
If no localized value is found for the given id, the id itself is returned.
If the string id passed in is null, the return value will also be null.
ILocalizationManager.localize(String, IResource, PageWebResource)
.localize
in interface ILocalizationManager
id
- The string id to localizeresource
- The resource to search for localizationsPortalException
public String localize(String id, IResource resource, PageWebResource pageWebResource) throws PortalException
ILocalizationManager
PageWebResource
and current locale.
If no localized value is found for the given id, the id itself is returned.
If the string id passed in is null, the return value will also be null.
localize
in interface ILocalizationManager
id
- The string id to localizeresource
- The resource to search for localizationspageWebResource
- The PageWebResource
used to search for localizations within themes.PortalException
public String localize(String id, List<IResource> resources) throws PortalException
ILocalizationManager
If no localized value is found for the given id, the id itself is returned.
If the string id passed in is null, the return value will also be null.
ILocalizationManager.localize(String, List, PageWebResource)
.localize
in interface ILocalizationManager
id
- The string id to localizeresources
- The resources to search for localizationsPortalException
public String localize(String id, List<IResource> resources, PageWebResource pageWebResource) throws PortalException
ILocalizationManager
PageWebResource
and current locale.
If no localized value is found for the given id, the id itself is returned.
If the string id passed in is null, the return value will also be null.
localize
in interface ILocalizationManager
id
- The string id to localizeresources
- The resources to search for localizationspageWebResource
- The PageWebResource
used to search for localizations within themes.PortalException
public String localize(String id, IResource resource, Locale locale) throws PortalException
ILocalizationManager
If no localized value is found for the given id, the id itself is returned.
If the string id passed in is null, the return value will also be null.
#localize(String, IResource, Locale, PageWebResource)
.localize
in interface ILocalizationManager
id
- The string id to localizeresource
- The resource to search for localizationslocale
- The locale to use for localizationPortalException
public String localize(String id, IResource resource, Locale locale, WebResource webResource) throws PortalException
ILocalizationManager
WebResource
and locale.
If no localized value is found for the given id, the id itself is returned.
If the string id passed in is null, the return value will also be null.
localize
in interface ILocalizationManager
id
- The string id to localizeresource
- The resources to search for localizationslocale
- The locale to use for localizationwebResource
- The WebResource
used to search for localizations within themes.PortalException
public String localize(String id, List<IResource> resources, Locale locale) throws PortalException
ILocalizationManager
If no localized value is found for the given id, the id itself is returned.
If the string id passed in is null, the return value will also be null.
#localize(String, List, Locale, PageWebResource)
.localize
in interface ILocalizationManager
id
- The string id to localizeresources
- The resources to search for localizationslocale
- The locale to use for localizationPortalException
public String localize(String id, List<IResource> resources, Locale locale, WebResource webResource) throws PortalException
ILocalizationManager
WebResource
and locale.
If no localized value is found for the given id, the id itself is returned.
If the string id passed in is null, the return value will also be null.
localize
in interface ILocalizationManager
id
- The string id to localizeresources
- The resources to search for localizationslocale
- The locale to use for localizationPortalException
public void clearCache() throws PortalException
ILocalizationManager
clearCache
in interface ILocalizationManager
PortalException
public void clearCache(String resourcePath) throws PortalException
ILocalizationManager
clearCache
in interface ILocalizationManager
PortalException
public void clearCache(String resourcePath, Locale locale) throws PortalException
ILocalizationManager
clearCache
in interface ILocalizationManager
PortalException
@Deprecated public Iterable<String> getCachedResourcePaths() throws ManagerException
ILocalizationManager
getCachedResourcePaths
in interface ILocalizationManager
ManagerException
public String addCustomString(SessionConfig sessionConfig, CustomStringConfig customStringConfig, ITransaction transaction) throws PortalException
ILocalizationManager
addCustomString
in interface ILocalizationManager
PortalException
public void updateCustomString(SessionConfig sessionConfig, CustomStringConfig customStringConfig, ITransaction transaction) throws PortalException
ILocalizationManager
updateCustomString
in interface ILocalizationManager
PortalException
public void deleteCustomString(SessionConfig sessionConfig, String customStringId, ITransaction transaction) throws PortalException
ILocalizationManager
deleteCustomString
in interface ILocalizationManager
PortalException
public CustomStringConfig getCustomString(SessionConfig sessionConfig, String customStringId, ITransaction transaction) throws PortalException
ILocalizationManager
getCustomString
in interface ILocalizationManager
PortalException
LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.