com.adobe.icc.dbforms.util
Class JCRSessionUtils

java.lang.Object
  extended by com.adobe.icc.dbforms.util.JCRSessionUtils

public class JCRSessionUtils
extends java.lang.Object

This class provides methods for performing following operations:


Constructor Summary
JCRSessionUtils()
           
 
Method Summary
static void checkWritePermission(java.lang.String resourceId)
          Checks for write permission on the specified resource.
static Session getCurrentSession()
          Returns original user session.
static void resetContext()
          Resets the context to the original value.
static void saveSession()
          Saves the changes done in admin context
static void setAdminContext(ResourceResolverFactory resolverFactory)
          Swaps the current context with the admin context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCRSessionUtils

public JCRSessionUtils()
Method Detail

setAdminContext

public static void setAdminContext(ResourceResolverFactory resolverFactory)
Swaps the current context with the admin context. It can be called multiple times and it will keep a counter of how many times it has been called thus allowing nested invocation

Parameters:
resolverFactory - resolver factory object for retrieving admin context.

saveSession

public static void saveSession()
Saves the changes done in admin context


checkWritePermission

public static void checkWritePermission(java.lang.String resourceId)
Checks for write permission on the specified resource. Original user context is used for this check.

Parameters:
resourceId - resource id on which permission is required to be verified.
Throws:
ICCException - if user does not have write permission on the specified resource.

getCurrentSession

public static Session getCurrentSession()
Returns original user session.


resetContext

public static void resetContext()
Resets the context to the original value. This depends on the depth parameter. Each time this is called, depth is decremented. When depth becomes 1, i.e. we have reached the top level, the context is actually reset to the original value



[an error occurred while processing this directive] [an error occurred while processing this directive]