Web Dynpro API Documentation

com.sap.tc.webdynpro.services.sal.localization.api
Class WDResourceHandler

java.lang.Object
  |
  +--com.sap.tc.webdynpro.services.sal.localization.api.WDResourceHandler

public abstract class WDResourceHandler
extends java.lang.Object

The class WDResourceHandler is used to access instances of type IWDResourceHandler.

Example: An IWDResourceHandler object can be accessed as follows:

 IWDResourceHandler resourceHandler = WDResourceHandler.createResourceHandler(Locale.GERMAN);
 

See Also:
IWDResourceHandler

Constructor Summary
WDResourceHandler()
           
 
Method Summary
static IWDResourceHandler createResourceHandler(java.util.Locale locale)
          Return is the resource handler representing the set locale.
static IWDResourceHandler createResourceHandler(java.util.Locale locale, java.util.TimeZone timezone)
          Return is the resource handler representing the set locale and timezone.
static IWDResourceHandler createResourceHandlerForCurrentSession()
          Return is the resource handler with the locale for the current session.
static IWDResourceHandler createResourceHandlerForCurrentUser()
          Return is the resource handler with the locale for the current client user.
static java.util.Locale getCurrentSessionLocale()
          Return is the locale for the current session.
static java.util.Locale getCurrentUserLocale()
          Deprecated. Use WDClientUser.getCurrentUser().getLocale() instead. This method may be withdrawn with the first new NetWeaver release in 2006.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WDResourceHandler

public WDResourceHandler()
Method Detail

createResourceHandler

public static IWDResourceHandler createResourceHandler(java.util.Locale locale,
                                                       java.util.TimeZone timezone)
Return is the resource handler representing the set locale and timezone. If one of the input parameters is set to null, the default locale / timezone of the virtual machine is used.
Parameters:
locale - the locale to be used
timezone - the timezone to be used
Returns:
the resource handler according to the specified I18N settings

createResourceHandler

public static IWDResourceHandler createResourceHandler(java.util.Locale locale)
Return is the resource handler representing the set locale. If the input parameter is set to null, the default locale of the virtual machine is used.
Parameters:
locale - the locale to be used
Returns:
the resource handler according to the specified I18N settings

createResourceHandlerForCurrentUser

public static IWDResourceHandler createResourceHandlerForCurrentUser()
Return is the resource handler with the locale for the current client user. For a description how the locale of the current client user is detected, see method getCurrentUserLocale.
Returns:
the resource handler with the locale for the current user
See Also:
getCurrentUserLocale()

createResourceHandlerForCurrentSession

public static IWDResourceHandler createResourceHandlerForCurrentSession()
Return is the resource handler with the locale for the current session. For a description how the locale of the current client user is detected, see method getCurrentSessionLocale().
Returns:
the resource handler with the locale for the current session
See Also:
getCurrentSessionLocale()

getCurrentUserLocale

public static java.util.Locale getCurrentUserLocale()
Deprecated. Use WDClientUser.getCurrentUser().getLocale() instead. This method may be withdrawn with the first new NetWeaver release in 2006.

Return is the locale for the current client user. The concrete locale is determined in the following order: in the following way:
  1. If a default locale is specified for the current (authenticated) client user (by the user's profile), this locale is taken.
  2. If the HTTP header contains an "Accept-Language" header with a valid ISO-639 language, this language is used as current user locale.
  3. The default locale of the current application (the application of the current session) is used if specified.
  4. If no such default locale is specified, the default locale for the Web Dynpro runtime is used if specified.
  5. If this one is also not specified, the default locale of the server VM is used as last fallback locale.
Returns:
the locale for the current client user

getCurrentSessionLocale

public static java.util.Locale getCurrentSessionLocale()
Return is the locale for the current session. See IWDClientUser.getLocale() for a description of the fallback sequence that is used to determine the locale for the current session.

Note that the session locale is determined once for each client session and then stored as part of the session. If e.g. the browser locale is used as session locale and the locale is changed in the browser settings, the change first becomes effective after a new browser instance is opened.

Returns:
the locale for the current session

Web Dynpro API Documentation

Copyright © 2004 SAP AG. Automatically generated Thu Mar 3 2005, 22:15