org.apache.cocoon.ajax
Class AjaxRequestSelector

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.selection.AbstractSwitchSelector
          extended by org.apache.cocoon.ajax.AjaxRequestSelector
All Implemented Interfaces:
Component, LogEnabled, ThreadSafe, Selector, SwitchSelector

public class AjaxRequestSelector
extends AbstractSwitchSelector

Choose a select branch depending on if the current request is an Ajax request. The test value can be either "true" or "false".

   <map:select type="ajax-request">
     <map:when test="true">
       ... ajax request ...
     </map:when>
     <map:otherwise>
       ... non ajax request ...
     </map:otherwise>
   </map:select>
 

Since:
2.1.8
Version:
$Id: AjaxRequestSelector.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Field Summary
 
Fields inherited from interface org.apache.cocoon.selection.SwitchSelector
ROLE
 
Constructor Summary
AjaxRequestSelector()
           
 
Method Summary
 Object getSelectorContext(Map objectModel, Parameters parameters)
          Method to create a selector context.
 boolean select(String expression, Object selectorContext)
          Switch Selectors test patterns against a context object and signal success with the returned boolean value
 
Methods inherited from class org.apache.cocoon.selection.AbstractSwitchSelector
select
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AjaxRequestSelector

public AjaxRequestSelector()
Method Detail

getSelectorContext

public Object getSelectorContext(Map objectModel,
                                 Parameters parameters)
Description copied from interface: SwitchSelector
Method to create a selector context.

Parameters:
objectModel - The Map containing object of the calling environment which may be used to select values to test the expression.
parameters - The sitemap parameters, as specified by <parameter/> tags.
Returns:
Selector context

select

public boolean select(String expression,
                      Object selectorContext)
Description copied from interface: SwitchSelector
Switch Selectors test patterns against a context object and signal success with the returned boolean value

Parameters:
expression - The expression to test.
selectorContext - The context this test should be performed in.
Returns:
true if the test was successful.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.