org.chenillekit.access.internal
Class ChenillekitAccessInternalUtils

java.lang.Object
  extended by org.chenillekit.access.internal.ChenillekitAccessInternalUtils

public class ChenillekitAccessInternalUtils
extends Object

Version:
$Id: ChenillekitAccessInternalUtils.java 374 2008-12-12 16:47:49Z mlusetti $

Method Summary
static String buildMetaForHandlerMethod(String componentId, String eventType, String suffix)
           
static String extractComponentId(TransformMethodSignature method, OnEvent annotation)
          This code is taken deliberatly from http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java?view=log
static String extractEventType(TransformMethodSignature method, OnEvent annotation)
          This code is taken deliberatly from: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java?view=log
static String getContextAsString(EventContext context)
          Build a string representing the context to be stored inside a cookie.
static EventContext getContextFromString(ContextValueEncoder valueEncoder, String contextString)
           
static String getStringArrayAsString(String[] groups)
          build an CSV string from group array.
static String[] getStringAsStringArray(String groups)
           
static boolean hasUserRequiredGroup(String[] userGroups, String[] requiredGroups)
          check if user has required group to access page/component/event.
static boolean hasUserRequiredRole(int userRoleWeigh, int requiredRoleWeigh)
          check if user has required role to access page/component/event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getContextAsString

public static final String getContextAsString(EventContext context)
Build a string representing the context to be stored inside a cookie.

Parameters:
context - the context to be stored in the cookie
Returns:
a String rapresentation of the EventContext

getContextFromString

public static final EventContext getContextFromString(ContextValueEncoder valueEncoder,
                                                      String contextString)
Parameters:
valueEncoder -
contextString -
Returns:

hasUserRequiredRole

public static final boolean hasUserRequiredRole(int userRoleWeigh,
                                                int requiredRoleWeigh)
check if user has required role to access page/component/event.

Parameters:
userRoleWeigh - role weigh the user have
requiredRoleWeigh - role weigh required for page/component/event access
Returns:
true if user fulfill the required role

hasUserRequiredGroup

public static final boolean hasUserRequiredGroup(String[] userGroups,
                                                 String[] requiredGroups)
check if user has required group to access page/component/event.

Parameters:
userGroups - groups the user have
requiredGroups - groups required for page/component/event access
Returns:
true if user has the required group

buildMetaForHandlerMethod

public static final String buildMetaForHandlerMethod(String componentId,
                                                     String eventType,
                                                     String suffix)
Parameters:
componentId -
eventType -
suffix -
Returns:

getStringArrayAsString

public static final String getStringArrayAsString(String[] groups)
build an CSV string from group array.

Returns:
CSV string

getStringAsStringArray

public static final String[] getStringAsStringArray(String groups)
Parameters:
groups -
Returns:

extractComponentId

public static final String extractComponentId(TransformMethodSignature method,
                                              OnEvent annotation)
This code is taken deliberatly from http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java?view=log


extractEventType

public static final String extractEventType(TransformMethodSignature method,
                                            OnEvent annotation)
This code is taken deliberatly from: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/OnEventWorker.java?view=log



Copyright © 2008-2009 ChenilleKit. All Rights Reserved.