org.alfresco.web.extensibility
Class SlingshotPortletComponentElementEvaluator

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

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

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

Makes it possible to decide if we are viewed from a portal and (optional) which portal using a regexp in the parameter.

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

Example:



 

Will return true if we are viewed from inside a portlet.

Example 2:

<evaluator type="portlet.component.evaluator">
    <params>
       <portletUrls>regexp matching portlet urls</portletUrls>
    </params>
 </evaluator>
 

Will return true if we are ina portal with a url matching the defined regexp.


Field Summary
static java.lang.String PORTLET_URL_FILTER
           
protected  SlingshotEvaluatorUtil util
           
 
Constructor Summary
SlingshotPortletComponentElementEvaluator()
           
 
Method Summary
 boolean evaluate(org.springframework.extensions.surf.RequestContext context, java.util.Map params)
          Decides if we are inside a portal 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

PORTLET_URL_FILTER

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

util

protected SlingshotEvaluatorUtil util
Constructor Detail

SlingshotPortletComponentElementEvaluator

public SlingshotPortletComponentElementEvaluator()
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 portal 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 portlet and its url matches the param (defaults to ".*")


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