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