com.nitido.nimbox.http.enhanced
Class EnhancedDispatcher
java.lang.Object
com.nitido.nimbox.http.SkinDispatcher
com.nitido.nimbox.http.enhanced.EnhancedDispatcher
- All Implemented Interfaces:
- EnhancedDispatcherConstants, HttpNimletConstants
public class EnhancedDispatcher
- extends SkinDispatcher
- implements EnhancedDispatcherConstants
The Enhanced Skin dispatcher for Nimlet. Currently can be used to dispatch
skins of the following protocols:
- @see com.nitido.nimbox.http.HttpNimletConstants#PROTOCOL_STATIC
- @see com.nitido.nimbox.http.HttpNimletConstants#PROTOCOL_DYNAMIC
This HttpSkinDispatcher implementation will resolves the requesting client's
device profile from the HTTP header. Then it will store the resolved
device profile in the session
All of the configuration must be prepended by the prefix associated to the
protocol it is configured to support. For example, if this dispatcher
is used to dispatch the static protocol, the configuratino should all
be prepended by "com.nitido.nimbox.http.skinsetting.static.". The WURFL
configuration will be "com.nitido.nimbox.http.skinsetting.static.wurfl".
It requires 4 types of configurations provided by NiM's Configuration
Service:
DeviceHandler configuration:
Contains the configurations needed to retrieve the preferred markup language
for a given request.
- wurfl =/home/myuser/wurfl.xml>
(constant is EnhancedDispatcherConstants.CONF_KEY_WURFL_URL) - the location of
wurfl file. If missing or invalid wurfl file then wurfl step for checking
the markup language is disabled. This file contains the "devices" information
- webpatchwurfl=/home/myuser/wurfl_patch.xml
(constant is EnhancedDispatcherConstants.FOR_WEB_PATCH_WURFL_URL) - the location of
web patch for wurfl file. If missing or invalid wurfl web patch file then
wurfl markup language checking is disabled.This file contains the web browsers
information
- ruleslocation=/home/myuser/rules.xml
(constant is EnhancedDispatcherConstants.CONF_KEY_RULES_LOCATION) - the location of
rules file. If missing, invalid or contains a document
which does not follows the expected XML Schema rules.xsd then the rules
checking is disabled.
- defaultskin=xhtml
(constant is EnhancedDispatcherConstants.CONF_KEY_DEFAULT_SKIN_TYPE) - the default
skin type. If missing or empty the "html" is assigned as default skin type.
LocaleHandler configuration
Contains the configurations needed to retrieve the preferred locale
- locale.keys=key1,key2,key3
(constant is EnhancedDispatcherConstants.CONF_KEY_LOCALE_KEYS) - contain a
comma-separated list of user space keys. For more details @see LocaleHandler
- locale.default=en
(constant is EnhancedDispatcherConstants.CONF_KEY_LOCALE_KEYS) - the default
locale. If default locale from configuration is missing or empty, then "en"
is assigned for preferred language.
PathFormatter configuration
Contains path layout configuration.
- pathlayout=/%l/%m/ver%v/%n
(constant is EnhancedDispatcherConstants.CONF_KEY_SKIN_PATH_LAYOUT) - the path
layout to be used to get the real url for skin. %l" represents language, "%m"
represents the markup language, "%v" represents the markup language version
and "%n" represents the skin name. For * dispatching an english wml 1.1 page
with the name "myPage.jsp", the converted
path configuration for above path layout will generate a converted
page path "/en/wml/ver1.1/myPage.jsp".
Ad Service cofiguration
- enableADService=[true|false]
(constant is KEY_ENABLE_AD_SERVICE_FLAG)- If KEY_ENABLE_AD_SERVICE_FLAG is
set to true, the skin dispatcher will initialize the SimpleAdService,
otherwise the AD service is not initialized.
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 |
Fields inherited from interface com.nitido.nimbox.http.HttpNimletConstants |
CONF_KEY_CONTAINER_ENTITY_ID, CONF_KEY_CONTAINER_ENTITY_PWD, CONF_KEY_CONTAINER_INIT_ALL_NIMLETS, CONF_KEY_ERROR_SKIN, CONF_KEY_PREFIX_NIMLET_MAP, CONF_KEY_PREFIX_NIMLET_SETTING, CONF_KEY_PREFIX_PARSER_MULTIPART, CONF_KEY_PREFIX_SKIN_SETTING, CONF_KEY_PREFIX_SKIN_TYPE, CONF_KEY_REG_ENCODING, CONTAINER_TYPE, DEF_SAVE_DIRECTORY, KEY_ENABLE_AD_SERVICE_FLAG, KEY_ERROR_EXCEPTION, KEY_ERROR_MESSAGE, KEY_ERROR_OLD_SKIN, KEY_NIM_ENTITY, KEY_RESPONSE_EXCLUDED_SKINS, KEY_RESPONSE_OVERRIDE_HEADERS, KEY_SKIN_AD_MAP, LEN_KEY_PREFIX_NIMLET_MAP, LEN_KEY_PREFIX_PARSER_MULTIPART, LEN_KEY_PREFIX_SKIN_TYPE, LEN_PREFIX_KEY_RESPONSE_HEADER, LEN_PROTOCOL_DYNAMIC, LEN_PROTOCOL_FORWARD, LEN_PROTOCOL_INCLUDE, LEN_PROTOCOL_NIMLET, LEN_PROTOCOL_REDIRECT, LEN_PROTOCOL_STATIC, LEN_PROTOCOL_VOID, MSG_NO_NIMLET, MULTIPART_PARSER, PARAM_KEY_NIMLET, PREFIX_KEY_RESPONSE_HEADER, PROTOCOL_DYNAMIC, PROTOCOL_FORWARD, PROTOCOL_INCLUDE, PROTOCOL_NIMLET, PROTOCOL_REDIRECT, PROTOCOL_SEPARATOR, PROTOCOL_STATIC, PROTOCOL_VOID, REGULAR_PARSER, REQ_HEADER_CONTENT_TYPE, SKIN_START_DYNAMIC, SKIN_START_FORWARD, SKIN_START_INCLUDE, SKIN_START_NIMLET, SKIN_START_REDIRECT, SKIN_START_STATIC, SKIN_START_VOID, TYPE_MULTIPART_FORM |
Method Summary |
void |
dispatch(HttpNimletContainer container,
HttpNimletOutput prevOut)
This method is responsible for dispatching the information as
specified by the parameters |
void |
init(java.util.HashMap setting)
Initializes the SkinDispatcher. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_adService
protected NiMAdService _adService
EnhancedDispatcher
public EnhancedDispatcher()
- Default constructor.
Note: although this class is only used within this package, we
should still leave the constructor public so that we can use
reflection to instantiate this in the future.
init
public void init(java.util.HashMap setting)
throws javax.servlet.ServletException
- Initializes the SkinDispatcher.
- Specified by:
init
in class SkinDispatcher
- Parameters:
setting
- HashMap with the dispatcher initialization parameters.
- Throws:
javax.servlet.ServletException
- if the SkinDispatcher cannot be initialized correctly. We
throw ServletException because this is the standard Java
Servlet exception to be thrown for initialization failure.
dispatch
public void dispatch(HttpNimletContainer container,
HttpNimletOutput prevOut)
throws javax.servlet.ServletException,
java.io.IOException
- Description copied from class:
SkinDispatcher
- This method is responsible for dispatching the information as
specified by the parameters
- Specified by:
dispatch
in class SkinDispatcher
- Parameters:
container
- The HttpNimletContainer objectprevOut
- The HttpNimletOutput object to be passed to the skin being
dispatched.
- Throws:
javax.servlet.ServletException
- if the target resource throws this exception.
java.io.IOException
- if an input or output error is detected when dispatching.
These JavaDoc pages are generated for release/nim_2_5-2.5.44 Copyright © 1999-2009 Nitido Inc. Proprietary and Confidential. All Rights Reserved.