public class SlingshotEvaluatorUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
PAGE_CONTEXT |
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 and Description |
---|
SlingshotEvaluatorUtil() |
Modifier and Type | Method and Description |
---|---|
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.
|
java.util.List |
getGroups(java.lang.String groupsParm)
Gets the list of groups to check for membership of.
|
protected java.lang.String |
getHeader(java.lang.String name)
Helper method to get a request header value from the current request context
|
java.lang.String |
getPageContext(org.springframework.extensions.surf.RequestContext context)
Returns the current page context id OR null if one isn't supplied
|
java.lang.String |
getPageId(org.springframework.extensions.surf.RequestContext context)
Returns the current site id OR null if we aren't in a site
|
java.lang.Boolean |
getPortletHost(org.springframework.extensions.surf.RequestContext context)
Returns true if we are viewed from inside a portal.
|
java.lang.String |
getPortletUrl(org.springframework.extensions.surf.RequestContext context)
Returns the portal url if we are inside a portal, otherwise null.
|
java.lang.String |
getSite(org.springframework.extensions.surf.RequestContext context)
Returns the current site id OR null if we aren't in a site
|
java.lang.String |
getSitePreset(org.springframework.extensions.surf.RequestContext context,
java.lang.String siteId)
The site's sitePreset OR null if something goes wrong.
|
boolean |
isMemberOfGroups(org.springframework.extensions.surf.RequestContext context,
java.util.List groups,
boolean memberOfAllGroups)
Determines whether or not the current user is a member of the supplied group.
|
org.json.JSONObject |
jsonGet(java.lang.String uri)
Helper method for making a json get remote call to the default repository.
|
void |
setServiceRegistry(org.springframework.extensions.surf.WebFrameworkServiceRegistry serviceRegistry) |
public static final java.lang.String SITE_PRESET_CACHE
protected static final java.lang.String PORTLET_HOST
protected static final java.lang.String PORTLET_URL
protected static final java.lang.String SITE_PRESET
protected static final java.lang.String SITE
protected static final java.lang.String PAGE_CONTEXT
protected org.springframework.extensions.surf.WebFrameworkServiceRegistry serviceRegistry
public void setServiceRegistry(org.springframework.extensions.surf.WebFrameworkServiceRegistry serviceRegistry)
public java.lang.String getEvaluatorParam(java.util.Map params, java.lang.String name, java.lang.String defaultValue)
params
- name
- defaultValue
- public java.lang.Boolean getPortletHost(org.springframework.extensions.surf.RequestContext context)
context
- public java.lang.String getPortletUrl(org.springframework.extensions.surf.RequestContext context)
context
- public java.lang.String getPageId(org.springframework.extensions.surf.RequestContext context)
context
- public java.lang.String getSite(org.springframework.extensions.surf.RequestContext context)
context
- public java.lang.String getPageContext(org.springframework.extensions.surf.RequestContext context)
context
- public java.lang.String getSitePreset(org.springframework.extensions.surf.RequestContext context, java.lang.String siteId)
context
- siteId
- The id of the site to retrieve the sitePreset for.public org.json.JSONObject jsonGet(java.lang.String uri)
uri
- The uri to get the content for (MUST contain a json response)public boolean isMemberOfGroups(org.springframework.extensions.surf.RequestContext context, java.util.List groups, boolean memberOfAllGroups)
context
- groupName
- public java.util.List getGroups(java.lang.String groupsParm)
context
- evaluationProperties
- protected java.lang.String getHeader(java.lang.String name)
name
- Header name to retrieveCopyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.