|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.acting.LangSelect
LangSelect Action returns two character language code to sitemap. Definition in sitemap:
<map:actions> <map:action name="lang_select" src="org.apache.cocoon.acting.LangSelect"/>And you use it in following way:
<map:match pattern="file"> <map:act type="lang_select"> <map:generate src="file_{lang}.xml"/> </map:act>{lang} is substituted with language code. eg. if user selects url ../file?lang=en then Sitemap engine generates file_en.xml source. Creation date: (3.11.2000 14:32:19) Modification date: (29.05.2001 0:30:01)
Field Summary |
Fields inherited from interface org.apache.cocoon.acting.Action |
ROLE |
Constructor Summary | |
LangSelect()
Deprecated. |
Method Summary | |
java.util.Map |
act(Redirector redirector,
SourceResolver resolver,
java.util.Map objectModel,
java.lang.String source,
org.apache.avalon.framework.parameters.Parameters par)
Deprecated. Selects language if it is not set already in objectModel Puts lang parameter to session and to objectModel if it is not already there. |
void |
configure(org.apache.avalon.framework.configuration.Configuration conf)
Deprecated. Configure this action. |
static java.lang.String |
getLang(java.util.Map objectModel,
org.apache.avalon.framework.parameters.Parameters par)
Deprecated. Returns two character language code by checking environment in following order Http request has parameter lang Http session has parameter lang Cookies has parameter lang User locales has matching language we are providing Otherwise we return default_lang from sitemap or if that is not found then 'en' |
void |
storeLang(java.util.Map objectModel,
java.lang.String lang)
Deprecated. Stores language code in the session or a cookie |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LangSelect()
Method Detail |
public void configure(org.apache.avalon.framework.configuration.Configuration conf) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
public java.util.Map act(Redirector redirector, SourceResolver resolver, java.util.Map objectModel, java.lang.String source, org.apache.avalon.framework.parameters.Parameters par) throws java.lang.Exception
act
in interface Action
resolver
- The SourceResolver
in chargeobjectModel
- The Map
with object of the
calling environment which can be used
to select values this controller may need
(ie Request, Response).source
- A source String
to the Action
Map
object with
sitemap substitution values which can be used
in subsequent elements attributes like src=
using a xpath like expression: src="mydir/{myval}/foo"
If the return value is null the processing inside
the java.lang.Exception
- Indicates something is totally wrongpublic static java.lang.String getLang(java.util.Map objectModel, org.apache.avalon.framework.parameters.Parameters par)
objectModel
- java.util.Mappar
- org.apache.avalon.framework.parameter.Parameters
public void storeLang(java.util.Map objectModel, java.lang.String lang) throws java.lang.Exception
objectModel
- java.util.Maplang
- String The language code to store
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |