org.dspace.app.xmlui.cocoon
Class DSpaceLocaleAction

java.lang.Object
  extended by org.apache.cocoon.util.AbstractLogEnabled
      extended by org.apache.cocoon.acting.AbstractAction
          extended by org.apache.cocoon.acting.ServiceableAction
              extended by org.dspace.app.xmlui.cocoon.DSpaceLocaleAction
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.acting.Action

public class DSpaceLocaleAction
extends org.apache.cocoon.acting.ServiceableAction
implements org.apache.avalon.framework.configuration.Configurable

This action looks at several places to determine what locale should be used for this request. We use cocoon's i18nUtils find local method which will look in several places continuing to the next step if no local is found.: 1. HTTP Request parameter 'locale' 2. Session attribute 'locale' 3. First matching cookie parameter 'locale' within each cookie sent 4. Sitemap parameter "locale" 5. Locale setting of the requesting browser or server default 6. Default 7. Blank 8. Fail Only those locales which are listed in xmlui.supported.locales will be identified, if no acceptable locales are found then the default locale will be used.

Author:
Scott Phillips

Nested Class Summary
static class DSpaceLocaleAction.DSpaceLocaleValidator
          This validator class works with cocoon's i18nutils class to test if locales are valid.
 
Field Summary
 
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
 
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
 
Fields inherited from interface org.apache.cocoon.acting.Action
ROLE
 
Constructor Summary
DSpaceLocaleAction()
           
 
Method Summary
 Map act(org.apache.cocoon.environment.Redirector redirector, org.apache.cocoon.environment.SourceResolver resolver, Map objectModel, String source, org.apache.avalon.framework.parameters.Parameters parameters)
          Action which obtains the current environments locale information, and places it in the objectModel (and optionally in a session/cookie).
 void configure(org.apache.avalon.framework.configuration.Configuration config)
          Configure the action.
 
Methods inherited from class org.apache.cocoon.acting.ServiceableAction
service
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSpaceLocaleAction

public DSpaceLocaleAction()
Method Detail

configure

public void configure(org.apache.avalon.framework.configuration.Configuration config)
Configure the action.

Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable

act

public Map act(org.apache.cocoon.environment.Redirector redirector,
               org.apache.cocoon.environment.SourceResolver resolver,
               Map objectModel,
               String source,
               org.apache.avalon.framework.parameters.Parameters parameters)
        throws Exception
Action which obtains the current environments locale information, and places it in the objectModel (and optionally in a session/cookie).

Specified by:
act in interface org.apache.cocoon.acting.Action
Throws:
Exception


Copyright © 2011 DuraSpace. All Rights Reserved.