Save This Page
Home » cocoon-2.1.11-src » org.apache » cocoon » acting » [javadoc | source]
org.apache.cocoon.acting
public class: LangSelect [javadoc | source]
java.lang.Object
   org.apache.avalon.framework.logger.AbstractLoggable
      org.apache.cocoon.acting.LangSelect

All Implemented Interfaces:
    Action, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.configuration.Configurable

Deprecated! Use - LocaleAction instead.

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)
Method from org.apache.cocoon.acting.LangSelect Summary:
act,   configure,   getLang,   storeLang
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cocoon.acting.LangSelect Detail:
 public Map act(Redirector redirector,
    SourceResolver resolver,
    Map objectModel,
    String source,
    Parameters par) throws Exception 
      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.
 public  void configure(Configuration conf) throws ConfigurationException 
      Deprecated!
    Configure this action.
 public static String getLang(Map objectModel,
    Parameters par) 
      Deprecated!
    Returns two character language code by checking environment in following order
    1. Http request has parameter lang
    2. Http session has parameter lang
    3. Cookies has parameter lang
    4. User locales has matching language we are providing
    5. Otherwise we return default_lang from sitemap or if that is not found then 'en'
 public  void storeLang(Map objectModel,
    String lang) throws Exception 
      Deprecated!
    Stores language code in the session or a cookie