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/non-site-page" page: i.e. the "Repository browser", A users dashboard or the
"My Workflows" page the evaluator will return true by default. To change this behaviour you can set
to false, which means the evaluator will return true ONLY when 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 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 inside a site with a site id of "rm" or "photos".
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APPLY_FOR_NON_SITES |
static java.lang.String |
SITE_FILTER |
static java.lang.String |
SITE_PRESET_FILTER |
protected SlingshotEvaluatorUtil |
util |
| Constructor and Description |
|---|
SlingshotSiteModuleEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
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) |
public static final java.lang.String SITE_PRESET_FILTER
public static final java.lang.String SITE_FILTER
public static final java.lang.String APPLY_FOR_NON_SITES
protected SlingshotEvaluatorUtil util
public void setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil)
public java.lang.String[] getRequiredProperties()
getRequiredProperties in interface org.springframework.extensions.surf.extensibility.ExtensionModuleEvaluatorpublic boolean applyModule(org.springframework.extensions.surf.RequestContext context,
java.util.Map params)
applyModule in interface org.springframework.extensions.surf.extensibility.ExtensionModuleEvaluatorcontext - params - Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.