org.alfresco.web.extensibility
Class SlingshotPresetComponentElementEvaluator

java.lang.Object
  extended by org.springframework.extensions.surf.extensibility.impl.DefaultSubComponentEvaluator
      extended by org.alfresco.web.extensibility.SlingshotPresetComponentElementEvaluator
All Implemented Interfaces:
org.springframework.beans.factory.BeanNameAware, org.springframework.extensions.surf.extensibility.SubComponentEvaluator

public class SlingshotPresetComponentElementEvaluator
extends org.springframework.extensions.surf.extensibility.impl.DefaultSubComponentEvaluator

Evaluator used to decide if a shall be bound in to a and .

Returns true if we are inside a site AND that site's sitePreset matches the regexp from the parameter.

Note! The regexp is expressed without using the surrounding // characters.

Note! The default value of the parameter is ".*" which will make it match all site presets.

Example:

<evaluator type="preset.component.evaluator">
    <params>
       <sitePresets>rm-site-dashboard</referrer>
    </params>
 </evaluator>
 

Will return true if we are inside a Records Management site (which always has a sitePreset id set to "rm-site-dashboard").


Field Summary
static java.lang.String SITE_PRESET_FILTER
           
protected  SlingshotEvaluatorUtil util
           
 
Constructor Summary
SlingshotPresetComponentElementEvaluator()
           
 
Method Summary
 boolean evaluate(org.springframework.extensions.surf.RequestContext context, java.util.Map params)
          Decides if we are inside a site or not.
 void setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil)
           
 
Methods inherited from class org.springframework.extensions.surf.extensibility.impl.DefaultSubComponentEvaluator
getBeanName, setBeanName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SITE_PRESET_FILTER

public static final java.lang.String SITE_PRESET_FILTER
See Also:
Constant Field Values

util

protected SlingshotEvaluatorUtil util
Constructor Detail

SlingshotPresetComponentElementEvaluator

public SlingshotPresetComponentElementEvaluator()
Method Detail

setSlingshotEvaluatorUtil

public void setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil)

evaluate

public boolean evaluate(org.springframework.extensions.surf.RequestContext context,
                        java.util.Map params)
Decides if we are inside a site or not.

Specified by:
evaluate in interface org.springframework.extensions.surf.extensibility.SubComponentEvaluator
Overrides:
evaluate in class org.springframework.extensions.surf.extensibility.impl.DefaultSubComponentEvaluator
Parameters:
context -
params -
Returns:
true if we are in a site and its id matches the param (defaults to ".*")


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.