org.alfresco.web.extensibility
Class SlingshotEvaluatorUtil

java.lang.Object
  extended by org.alfresco.web.extensibility.SlingshotEvaluatorUtil

public class SlingshotEvaluatorUtil
extends java.lang.Object

Utility class for evaluators to pick values from the request and get site information etc.


Field Summary
protected static java.lang.String PORTLET_HOST
           
protected static java.lang.String PORTLET_URL
           
protected  org.springframework.extensions.surf.WebFrameworkServiceRegistry serviceRegistry
           
protected static java.lang.String SITE
           
protected static java.lang.String SITE_PRESET
           
static java.lang.String SITE_PRESET_CACHE
           
 
Constructor Summary
SlingshotEvaluatorUtil()
           
 
Method Summary
protected  java.lang.String getEvaluatorParam(java.util.Map params, java.lang.String name, java.lang.String defaultValue)
          Helper for getting an evaluator parameter trimmed OR defaultValue if no value has been provided.
protected  java.lang.Boolean getPortletHost(org.springframework.extensions.surf.RequestContext context)
          Returns true if we are viewed from inside a portal.
protected  java.lang.String getPortletUrl(org.springframework.extensions.surf.RequestContext context)
          Returns the portal url if we are inside a portal, otherwise null.
protected  java.lang.String getSite(org.springframework.extensions.surf.RequestContext context)
          Returns the current site id OR null if we aren't in a site
protected  java.lang.String getSitePreset(org.springframework.extensions.surf.RequestContext context, java.lang.String siteId)
          The site's sitePreset OR null if something goes wrong.
 void setServiceRegistry(org.springframework.extensions.surf.WebFrameworkServiceRegistry serviceRegistry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SITE_PRESET_CACHE

public static final java.lang.String SITE_PRESET_CACHE

PORTLET_HOST

protected static final java.lang.String PORTLET_HOST
See Also:
Constant Field Values

PORTLET_URL

protected static final java.lang.String PORTLET_URL
See Also:
Constant Field Values

SITE_PRESET

protected static final java.lang.String SITE_PRESET
See Also:
Constant Field Values

SITE

protected static final java.lang.String SITE
See Also:
Constant Field Values

serviceRegistry

protected org.springframework.extensions.surf.WebFrameworkServiceRegistry serviceRegistry
Constructor Detail

SlingshotEvaluatorUtil

public SlingshotEvaluatorUtil()
Method Detail

setServiceRegistry

public void setServiceRegistry(org.springframework.extensions.surf.WebFrameworkServiceRegistry serviceRegistry)

getEvaluatorParam

protected java.lang.String getEvaluatorParam(java.util.Map params,
                                             java.lang.String name,
                                             java.lang.String defaultValue)
Helper for getting an evaluator parameter trimmed OR defaultValue if no value has been provided.

Parameters:
params -
name -
defaultValue -
Returns:
A trimmed evaluator parameter OR defaultValue if no value has been provided.

getPortletHost

protected java.lang.Boolean getPortletHost(org.springframework.extensions.surf.RequestContext context)
Returns true if we are viewed from inside a portal.

Parameters:
context -
Returns:
true if we are viewed from inside a portal

getPortletUrl

protected java.lang.String getPortletUrl(org.springframework.extensions.surf.RequestContext context)
Returns the portal url if we are inside a portal, otherwise null.

Parameters:
context -
Returns:
the portal url if we are inside a portal, otherwise null.

getSite

protected java.lang.String getSite(org.springframework.extensions.surf.RequestContext context)
Returns the current site id OR null if we aren't in a site

Parameters:
context -
Returns:
The current site id OR null if we aren't in a site

getSitePreset

protected java.lang.String getSitePreset(org.springframework.extensions.surf.RequestContext context,
                                         java.lang.String siteId)
The site's sitePreset OR null if something goes wrong.

Parameters:
context -
siteId - The id of the site to retrieve the sitePreset for.
Returns:
The site's sitePreset OR null if something goes wrong.


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