public class SlingshotConfigComponentElementEvaluator
extends org.springframework.extensions.surf.extensibility.impl.DefaultSubComponentEvaluator
Evaluator used to decide if a shall be bound in to a and .
Finds the value of the config element in share-config.xml (or other deployed xxx-config.xml files) specificed by the parameter.
If no additional parameters has been provided it will simply test if the value equals "true". If the value instead shall match a different value that value can be specified using a regexp inside the parameter.
Note! The regexp is expressed without using the surrounding // characters.
Example:
<evaluator type="config.component.evaluator">
<params>
<element>DocumentDetails/document-details/display-web-preview</element>
</params>
</evaluator>
Will return true if we are inside a site with an id of "marketing" or "engineering".
Modifier and Type | Field and Description |
---|---|
protected org.springframework.extensions.config.ConfigService |
configService |
static java.lang.String |
ELEMENT |
static java.lang.String |
MATCH |
protected SlingshotEvaluatorUtil |
util |
Constructor and Description |
---|
SlingshotConfigComponentElementEvaluator() |
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(org.springframework.extensions.surf.RequestContext context,
java.util.Map params)
Decides if we are inside a site or not.
|
void |
setConfigService(org.springframework.extensions.config.ConfigService configService)
Sets the config service.
|
void |
setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil)
Sets the evaluator util.
|
public static final java.lang.String ELEMENT
public static final java.lang.String MATCH
protected SlingshotEvaluatorUtil util
protected org.springframework.extensions.config.ConfigService configService
public SlingshotConfigComponentElementEvaluator()
public void setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil)
slingshotExtensibilityUtil
- the evaluator utilpublic void setConfigService(org.springframework.extensions.config.ConfigService configService)
configService
- the new config servicepublic boolean evaluate(org.springframework.extensions.surf.RequestContext context, java.util.Map params)
evaluate
in interface org.springframework.extensions.surf.extensibility.SubComponentEvaluator
evaluate
in class org.springframework.extensions.surf.extensibility.impl.DefaultSubComponentEvaluator
context
- params
- Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.