lumis.portal.localization
Class LocalizationManager

Package class diagram package LocalizationManager
java.lang.Object
  extended by lumis.portal.localization.LocalizationManager
All Implemented Interfaces:
ILocalizationManager

public class LocalizationManager
extends Object
implements ILocalizationManager

Class responsible for localizing strings, using static resources from xml files and dynamic resources (custom strings) from database. Each string resource is cached upon first access.

Since:
4.0.0

Field Summary
 
Fields inherited from interface lumis.portal.localization.ILocalizationManager
DO_NOT_RENDER_PARAMETERS
 
Constructor Summary
LocalizationManager()
           
 
Method Summary
 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 deleteCustomString(SessionConfig sessionConfig, String customStringId, ITransaction transaction)
          Delete a specified Custom String
 Iterable<String> getCachedResourcePaths()
          Get the keys for all cached items
 CustomStringConfig getCustomString(SessionConfig sessionConfig, String customStringId, ITransaction transaction)
          Get the Custom String object
 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.
 String localize(String id, IResource resource, Locale locale)
           
 String localize(String id, List<IResource> resources)
          Localizes the given string id using the given list of resources.
 String localize(String id, List<IResource> resources, Locale locale)
           
 void updateCustomString(SessionConfig sessionConfig, CustomStringConfig customStringConfig, ITransaction transaction)
          Update a specified Custom String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalizationManager

public LocalizationManager()
Method Detail

getLocales

public Collection<LocaleConfig> getLocales(ITransaction transaction)
                                    throws PortalException
Returns a collection of locale config

Specified by:
getLocales in interface ILocalizationManager
Parameters:
transaction - the transaction for persistence access.
Returns:
A collection with the available locales.
Throws:
PortalException
Since:
4.0.10

localize

public String localize(String id,
                       IResource resource)
                throws ManagerException,
                       PortalException
Description copied from interface: ILocalizationManager
Localizes the given string id using the given resource. 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.

Specified by:
localize in interface ILocalizationManager
Returns:
a String.
Throws:
ManagerException
PortalException

localize

public String localize(String id,
                       List<IResource> resources)
                throws ManagerException,
                       PortalException
Description copied from interface: ILocalizationManager
Localizes the given string id using the given list of resources. 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.

Specified by:
localize in interface ILocalizationManager
Returns:
a String.
Throws:
ManagerException
PortalException

localize

public String localize(String id,
                       IResource resource,
                       Locale locale)
                throws ManagerException,
                       PortalException
Specified by:
localize in interface ILocalizationManager
Returns:
a String.
Throws:
ManagerException
PortalException

localize

public String localize(String id,
                       List<IResource> resources,
                       Locale locale)
                throws ManagerException,
                       PortalException
Specified by:
localize in interface ILocalizationManager
Returns:
a String.
Throws:
ManagerException
PortalException

clearCache

public void clearCache()
                throws ManagerException,
                       PortalException
Description copied from interface: ILocalizationManager
Clear the localization cache.

Specified by:
clearCache in interface ILocalizationManager
Throws:
ManagerException
PortalException

clearCache

public void clearCache(String resourcePath)
                throws ManagerException,
                       PortalException
Description copied from interface: ILocalizationManager
Clear the localization cache by passing the resource path.

Specified by:
clearCache in interface ILocalizationManager
Throws:
ManagerException
PortalException

clearCache

public void clearCache(String resourcePath,
                       Locale locale)
                throws ManagerException,
                       PortalException
Description copied from interface: ILocalizationManager
Clear the localization cache by passing the resource path and the locale.

Specified by:
clearCache in interface ILocalizationManager
Throws:
ManagerException
PortalException

getCachedResourcePaths

public Iterable<String> getCachedResourcePaths()
                                        throws ManagerException
Description copied from interface: ILocalizationManager
Get the keys for all cached items

Specified by:
getCachedResourcePaths in interface ILocalizationManager
Returns:
Throws:
ManagerException

addCustomString

public String addCustomString(SessionConfig sessionConfig,
                              CustomStringConfig customStringConfig,
                              ITransaction transaction)
                       throws ManagerException,
                              PortalException
Description copied from interface: ILocalizationManager
Add a Custom String

Specified by:
addCustomString in interface ILocalizationManager
Returns:
Throws:
ManagerException
PortalException

updateCustomString

public void updateCustomString(SessionConfig sessionConfig,
                               CustomStringConfig customStringConfig,
                               ITransaction transaction)
                        throws ManagerException,
                               PortalException
Description copied from interface: ILocalizationManager
Update a specified Custom String

Specified by:
updateCustomString in interface ILocalizationManager
Throws:
ManagerException
PortalException

deleteCustomString

public void deleteCustomString(SessionConfig sessionConfig,
                               String customStringId,
                               ITransaction transaction)
                        throws ManagerException,
                               PortalException
Description copied from interface: ILocalizationManager
Delete a specified Custom String

Specified by:
deleteCustomString in interface ILocalizationManager
Throws:
ManagerException
PortalException

getCustomString

public CustomStringConfig getCustomString(SessionConfig sessionConfig,
                                          String customStringId,
                                          ITransaction transaction)
                                   throws PortalException
Description copied from interface: ILocalizationManager
Get the Custom String object

Specified by:
getCustomString in interface ILocalizationManager
Returns:
Throws:
PortalException


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.