com.ideo.sweetdevria.i18n.impl
Class DefaultResourcesManagerImpl

java.lang.Object
  extended by com.ideo.sweetdevria.i18n.impl.DefaultResourcesManagerImpl
All Implemented Interfaces:
ResourcesManager

public class DefaultResourcesManagerImpl
extends java.lang.Object
implements ResourcesManager

This class is a default resource manager wich manage internationalized labels for RIA components and type format for excel export.


Field Summary
 
Fields inherited from interface com.ideo.sweetdevria.i18n.ResourcesManager
LOCAL_SESSION_KEY
 
Constructor Summary
DefaultResourcesManagerImpl()
          Default constructor.
 
Method Summary
 java.util.Locale getLocale(javax.servlet.http.HttpSession session)
          Get the locale from the session.
 java.util.Locale getLocale(javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
          Locale entry point Define the way to get the locale, for a request and a session.
 java.lang.String getMessage(java.lang.String key, javax.servlet.http.HttpSession session)
          Try to get the value from internationalized bundle, if not found, then from excel type format bundle.
 java.lang.String getMessage(java.lang.String key, javax.servlet.jsp.PageContext pageContext)
          Try to get the value from internationalized bundle, if not found, then from excel type format bundle.
 java.lang.String getMessage(java.lang.String key, javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
          Try to get the value from internationalized bundle, if not found, then from excel type format bundle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResourcesManagerImpl

public DefaultResourcesManagerImpl()
Default constructor.

Method Detail

getLocale

public java.util.Locale getLocale(javax.servlet.ServletRequest request,
                                  javax.servlet.http.HttpSession session)
Locale entry point Define the way to get the locale, for a request and a session. Request can be null. By default, the local is retrieved from the session, the default one is extracted from the request

Parameters:
request - the request to get the locale from
session - the session to get the locale from
Returns:
the locale for this couple request/session
See Also:
com.ideo.sweetdevria.i18n.ResourcesManager#getLocale(HttpSession session)

getLocale

public java.util.Locale getLocale(javax.servlet.http.HttpSession session)
Get the locale from the session. By default, the locale is initialized from the request one.

Parameters:
session - the session
Returns:
the locale for this session

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   javax.servlet.jsp.PageContext pageContext)
Description copied from interface: ResourcesManager
Try to get the value from internationalized bundle, if not found, then from excel type format bundle. If the value is not found, then return the key.

Specified by:
getMessage in interface ResourcesManager
Parameters:
key - to find
Returns:
value found from bundle.
See Also:
com.ideo.sweetdevria.i18n.ResourcesManager#getMessage(final String key, final PageContext pageContext)

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   javax.servlet.http.HttpSession session)
Description copied from interface: ResourcesManager
Try to get the value from internationalized bundle, if not found, then from excel type format bundle. If the value is not found, then return the key.

Specified by:
getMessage in interface ResourcesManager
Parameters:
key - to find
Returns:
value found from bundle.
See Also:
com.ideo.sweetdevria.i18n.ResourcesManager#getMessage(final String key, final HttpSession session)

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   javax.servlet.ServletRequest request,
                                   javax.servlet.http.HttpSession session)
Description copied from interface: ResourcesManager
Try to get the value from internationalized bundle, if not found, then from excel type format bundle. If the value is not found, then return the key.

Specified by:
getMessage in interface ResourcesManager
Parameters:
key - to find
Returns:
value found from bundle.
See Also:
com.ideo.sweetdevria.i18n.ResourcesManager#getMessage(final String key, final ServletRequest request, final HttpSession session)


Copyright © 2010 Ideo Technologies. All Rights Reserved.