Nitido Inc.

com.nitido.nimbox.http.enhanced
Class LocaleHandler

java.lang.Object
  extended by com.nitido.nimbox.http.enhanced.LocaleHandler
All Implemented Interfaces:
EnhancedDispatcherConstants

public class LocaleHandler
extends java.lang.Object
implements EnhancedDispatcherConstants

Determines the preferred language. The handler requires configurations to specifies which user space keys to fetch and the order of checking the values. If the user is unauthenticated then the parameters from request are going to be fetch. Locale Keys Configuration The language configuration will contain a comma-separated list of user space keys. The configuration key is "locale.keys". For example, if the EnhancedDispatcher has been configured for the static protocol, the configuration for the associated LocaleHandler's locale keys will have the name: "com.nitido.nimbox.http.skinsetting.static.locale.keys". The order of the key in the list represent the order that they were checked. For example, a configuration value "key1, key2, key3" will tell the dispatcher to first check the user space value of key 1 first. If that value is null, then check the user space value of key2 and so on. If all the values from userspace for the configuration keys are null, then a default locale is being used. For example, if the dispatcher is configured for static protocol and it needs to search for the key "locale", "language" and "mylocale", the configuration will be: com.nitido.nimbox.http.skinsetting.static.locale.keys=locale,language,mylocale Default Locale Value Configuration The default locale can be specified using the configuration "locale.default". For example, if the EnhancedDispatcher has been configured for the dynamic protocol, the configuration for the associated LocaleHandler's default locale will have the name: "com.nitido.nimbox.http.skinsetting.dynamic.locale.default" If default locale from configuration is missing or empty, then the LOCALE_EN ("en") is assigned for preferred language.


Field Summary
 
Fields inherited from interface com.nitido.nimbox.http.enhanced.EnhancedDispatcherConstants
ACCEPT, ALLOF, ANYOF, CONF_KEY_DEFAULT_LOCALE, CONF_KEY_DEFAULT_SKIN_TYPE, CONF_KEY_LOCALE_KEYS, CONF_KEY_RULES_LOCATION, CONF_KEY_SKIN_PATH_LAYOUT, CONF_KEY_WEB_PATCH_WURFL_URL, CONF_KEY_WURFL_URL, CONTAINS, DEFAULT_SKIN_TYPE, DOM_NODE_PROP, EXTERNAL_NONAMESPACE_SCHEMA_LOCATION_PROP, GENERIC_DEVICE_ID, HTML_VER_3_2, HTML_VER_4_0, IF, IF_CONDITIONAL, IHTML_VER_1_0, IHTML_VER_2_0, IHTML_VER_3_0, IHTML_VER_4_0, IHTML_VER_5_0, IS, IXHTML_VER_1_0, KEY_CLIENT_PROFILE, KEY_LOCALE, LOCALE_EN, MARKUP_TYPE, MARKUP_VERSION_TYPE, NAMESPACE_PREFIXES_FEATURE, SCHEMA_FULL_CHECKING_FEATURE, SCHEMA_VALIDATION_FEATURE, STARTS_WITH, TAG_CONDITION, TAG_EXPRESSION, TAG_HTTP_HEADER, TAG_MATCH_HOLDER, TAG_RELATION, TAG_RESULT, TAG_RESULT_TYPE, TAG_RESULT_VALUE, TAG_RULE, USER_AGENT, VALIDATION_FEATURE, WML_VER_1_1, WML_VER_1_2, WML_VER_1_3, WURFL_KEY_COLUMNS, WURFL_KEY_MAX_DECK_SIZE, WURFL_KEY_MAX_IMAGE_HEIGHT, WURFL_KEY_MAX_IMAGE_WIDTH, WURFL_KEY_MAX_OBJECT_SIZE, WURFL_KEY_MAX_URL_LENGTH_CACHED_PAGE, WURFL_KEY_MAX_URL_LENGTH_IN_REQUEST, WURFL_KEY_PREFERRED_MARKUP, WURFL_KEY_RESOLUTION_HEIGHT, WURFL_KEY_RESOLUTION_WIDTH, WURFL_KEY_ROWS, XHTML_VER_BASIC, XHTML_VER_MP_1_0
 
Constructor Summary
LocaleHandler(java.util.HashMap setting)
          Default constructor.
 
Method Summary
 java.lang.String getLocale(HttpNimletContainer container)
          Returns the preffered language.
 java.util.Vector getLocaleKeys()
          Get the available locale keys.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleHandler

public LocaleHandler(java.util.HashMap setting)
Default constructor.

Method Detail

getLocaleKeys

public java.util.Vector getLocaleKeys()
Get the available locale keys.

Returns:
a Vector of the available locale keys. This Vector is a clone of the cached settings.

getLocale

public java.lang.String getLocale(HttpNimletContainer container)
Returns the preffered language. The handler requires configurations to specifies which user space keys to fetch and the order of checking the values. If the user is unauthenticated user then the parameters from request are going to be fetch. The language configuration will contain a comma-separated list of user space keys. com.nitido.nimbox.http.skinsetting.locale.keys=key1,key2,key3. The order of the key in the list represent the order that they were checked. For example, a configuration value "key1, key2, key3" will tell the dispatcher to first check the user space value of key 1 first. If that value is null or empty, then check the user space value of key2 and so on. If all the values from userspace for the configuration keys are null, then a default locale is being used. The default locale can be specified using the following configuration com.nitido.nimbox.http.skinsetting.locale.default=en

Parameters:
container - The HttpNimletContainer object
Returns:
A string that holds the preferred locale.

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.