org.alfresco.web.extensibility
Class SlingshotConfigComponentElementEvaluator

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

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".


Field Summary
protected  org.springframework.extensions.config.ConfigService configService
           
static java.lang.String ELEMENT
           
static java.lang.String MATCH
           
protected  SlingshotEvaluatorUtil util
           
 
Constructor Summary
SlingshotConfigComponentElementEvaluator()
           
 
Method Summary
 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.
 
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

ELEMENT

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

MATCH

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

util

protected SlingshotEvaluatorUtil util

configService

protected org.springframework.extensions.config.ConfigService configService
Constructor Detail

SlingshotConfigComponentElementEvaluator

public SlingshotConfigComponentElementEvaluator()
Method Detail

setSlingshotEvaluatorUtil

public void setSlingshotEvaluatorUtil(SlingshotEvaluatorUtil slingshotExtensibilityUtil)
Sets the evaluator util.

Parameters:
slingshotExtensibilityUtil - the evaluator util

setConfigService

public void setConfigService(org.springframework.extensions.config.ConfigService configService)
Sets the config service.

Parameters:
configService - the new config service

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.