com.hascode.confluence.plugin.socialcomments.util
Class Util

java.lang.Object
  extended by com.hascode.confluence.plugin.socialcomments.util.Util

public class Util
extends Object

utility class


Constructor Summary
Util()
           
 
Method Summary
 com.atlassian.user.User getCurrentUser()
          returns the current user
 Map<String,Object> getDefaultVelocityContext()
          returns a hashmap to use with the velocity context
 String getRequestParameter(String key)
          returns parameters from the current request
 String getVelocityRenderedTemplate(String macroTemplate, Map<String,Object> context)
          returns a rendered template enriched with context parameters
 boolean userIsAdmin()
          returns whether the current user has the administrator role
 boolean userLoggedin()
          returns whether the current user is logged in or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

userLoggedin

public boolean userLoggedin()
returns whether the current user is logged in or not

Returns:
login state

userIsAdmin

public boolean userIsAdmin()
returns whether the current user has the administrator role

Returns:
role check result

getRequestParameter

public String getRequestParameter(String key)
returns parameters from the current request

Parameters:
key - the param key
Returns:
the param value

getCurrentUser

public com.atlassian.user.User getCurrentUser()
returns the current user

Returns:
the user

getDefaultVelocityContext

public Map<String,Object> getDefaultVelocityContext()
returns a hashmap to use with the velocity context

Returns:

getVelocityRenderedTemplate

public String getVelocityRenderedTemplate(String macroTemplate,
                                          Map<String,Object> context)
returns a rendered template enriched with context parameters

Parameters:
macroTemplate - the template
context - the context
Returns:
the rendered template


Copyright © 2011 hasCode.com. All Rights Reserved.