org.alfresco.web.extensibility
Class SlingshotSiteModuleEvaluator

java.lang.Object
  extended by org.alfresco.web.extensibility.SlingshotSiteModuleEvaluator
All Implemented Interfaces:
org.springframework.extensions.surf.extensibility.ExtensionModuleEvaluator

public class SlingshotSiteModuleEvaluator
extends java.lang.Object
implements org.springframework.extensions.surf.extensibility.ExtensionModuleEvaluator

Evaluator used to decide if an extension module (and its & ) shall be used for this request.

Makes it possible to decide if we are viewed specific sites based on their ids and sitePreset ids by matching them against the regexps inside the and parameters.

Note! If we are outside a side (i.e. a "global" page: i.e. the "Repository browser", A users dashboard or the "My Workflows" page the evaluator will return true. In other words this evaluator will only use the parameters if we are inside a site.

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

Example:

<evaluator>site.module.evaluator</evaluator>
 <evaluatorProperties>
     <sitePresets>rm-site-dashboard</sitePresets>
 </evaluatorProperties>
 

Will return true if we are outside a site OR inside a site with a sitePreset id of "rm-site-dashboard".

Example 2:

<evaluator>site.module.evaluator</evaluator>
 <evaluatorProperties>
     <sites>rm|photos</sitePresets>
 </evaluatorProperties>
 

Will return true if we are outside a site OR inside a site with a site id of "rm" or "photos".


Field Summary
static java.lang.String SITE_FILTER
           
static java.lang.String SITE_PRESET_FILTER
           
protected  SlingshotEvaluatorUtil util
           
 
Constructor Summary
SlingshotSiteModuleEvaluator()
           
 
Method Summary
 boolean applyModule(org.springframework.extensions.surf.RequestContext context, java.util.Map params)
          Will return true if we are outside a site OR inside a site with a sitePreset id of "rm-site-dashboard".
 java.lang.String[] getRequiredProperties()
           
 void setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil)
           
 
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

SITE_FILTER

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

util

protected SlingshotEvaluatorUtil util
Constructor Detail

SlingshotSiteModuleEvaluator

public SlingshotSiteModuleEvaluator()
Method Detail

setSlingshotEvaluatorUtil

public void setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil)

getRequiredProperties

public java.lang.String[] getRequiredProperties()
Specified by:
getRequiredProperties in interface org.springframework.extensions.surf.extensibility.ExtensionModuleEvaluator

applyModule

public boolean applyModule(org.springframework.extensions.surf.RequestContext context,
                           java.util.Map params)
Will return true if we are outside a site OR inside a site with a sitePreset id of "rm-site-dashboard".

Specified by:
applyModule in interface org.springframework.extensions.surf.extensibility.ExtensionModuleEvaluator
Parameters:
context -
params -
Returns:
true if we are outside a site OR inside a site with a sitePreset id of "rm-site-dashboard".


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