Front Office multilang management
Front Office multilang management
The WMS_FO_MultiLang plugin
Section(s): front office, plugin, standard plugin
Brief Description
The WMS_FO_MultiLang plugin is responsible for :
- Resolving in FO the current language (known as activeLang)
- Initializing SQL base for selecting langs (available langs must be limited to current media langs (if activeMedia exists)
- Initializing the locale session scope attribute
- Initializing language related SQL bases
It provides tools for resolving internallinks
Requirements
Datamodel must be compliant with WMS multilang model :
- Existence of object : lang
Parameters
- errorOnLangEmpty : Does the plugin have to force an HTTP Error if lang cannot be resolved : boolean
- errorCodeOnLangEmpty : What error code should be sent (default 404)
Entry points
- /front/common/init/init_before.jsp
- /front/common/init/initBaseWhere/initBaseWhere_content_before.jsp
- /front/common/tools/internallink/resolve-internallink_before.jsp
Description
- /front/common/init/init_before.jsp
- Initialize if empty the config_parameter_name_lang request attribute to lang. This request attribute gives us the parameter name in the querystring for resolving the language.
- Include /front/common/init/init_activelang.jsp (try to resolve the requested language)
- Skip if activeLang request attribute is not null.
- Retrieves from querystring the lang parameter (using the config_parameter_name_lang request attribute value as parameter name) in tmpLangCode.
- Retrieves from querystring the server name parameter (using the config_parameter_name_servername request attribute value as parameter name). If empty, uses the server name (request.getServerName())
- if tmpLangCode is available, trys to resolve current lang from it (if we are in a multisite context, a media filter will be added - using media activated langs in live mode and media langs in preview mode as additional restrictions)
- if previous search didn't or couldn't work, try to get the lang from domainlang? object (activeMedia might once again been used as an additional filter)
- If not found, but activeMedia exists, we will take the defaultlang as language.
- Stop process on error if set to
- Include /front/common/init/init_activelangs.jsp
- Initializes basewhere_view_lang request attribute as context lang base.
- Include /front/common/init/init_locale.jsp
- uses activeLang code property to initialize locale (session scope).
- /front/common/init/initBaseWhere/initBaseWhere_before.jsp
- Initialize base_lang request attribute as a SQL query base giving a constraint on lang property equals to 0 (associated to all langs) or id of activeLang (associated to activeLang)
- Initialize base_lang_child_notempty request attribute as a SQL query base giving a constraint on lang property equals to id of activeLang
- Initialize base_lang_childmultilngdb_notempty request attribute as a SQL query base giving a constraint on lang property containing id of activeLang
- /front/common/tools/internallink/resolve-internallink_before.jsp
