com.opencms.flex.cache
Class CmsFlexController

java.lang.Object
  |
  +--com.opencms.flex.cache.CmsFlexController

public class CmsFlexController
extends Object

Controller for getting access to the CmsObject, should be used as a request attribute.

Version:
$Revision: 1.1.2.1 $
Author:
Alexander Kandzior (a.kandzior@alkacon.com)

Field Summary
static String ATTRIBUTE_NAME
          Constant for the controller request attribute name
 
Constructor Summary
CmsFlexController(CmsObject cms, CmsFile file, CmsFlexCache cache, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Default constructor.
 
Method Summary
 CmsFlexCache getCmsCache()
          Returns the CmsFlexCache instance where all results from this request will be cached in.
 CmsFile getCmsFile()
          This method provides access to the top-level CmsFile of the request which is of a type that supports the FlexCache, i.e. usually the CmsFile that is identical to the file uri requested by the user, not he current included element.
 CmsObject getCmsObject()
          Returns the wrapped CmsObject.
static CmsObject getCmsObject(javax.servlet.ServletRequest req)
          Returns the wrapped CmsObject form the provided request, or null if the request is not running inside OpenCms.
 CmsFlexRequest getCurrentRequest()
           
 CmsFlexResponse getCurrentResponse()
           
 int getResponseQueueSize()
           
 javax.servlet.http.HttpServletRequest getTopRequest()
           
 javax.servlet.http.HttpServletResponse getTopResponse()
           
static boolean isCmsRequest(javax.servlet.ServletRequest req)
          Checks if the provided request is running in OpenCms.
 CmsFlexRequest popRequest()
           
 CmsFlexResponse popResponse()
           
 void pushRequest(CmsFlexRequest req)
           
 void pushResponse(CmsFlexResponse res)
           
 void suspendFlexResponse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_NAME

public static final String ATTRIBUTE_NAME
Constant for the controller request attribute name

See Also:
Constant Field Values
Constructor Detail

CmsFlexController

public CmsFlexController(CmsObject cms,
                         CmsFile file,
                         CmsFlexCache cache,
                         javax.servlet.http.HttpServletRequest req,
                         javax.servlet.http.HttpServletResponse res)
Default constructor.

Parameters:
cms - the initial CmsObject to wrap in the controller
Method Detail

getCmsObject

public CmsObject getCmsObject()
Returns the wrapped CmsObject.

Returns:
the wrapped CmsObject

getCmsObject

public static CmsObject getCmsObject(javax.servlet.ServletRequest req)
Returns the wrapped CmsObject form the provided request, or null if the request is not running inside OpenCms.

Returns:
the wrapped CmsObject

isCmsRequest

public static boolean isCmsRequest(javax.servlet.ServletRequest req)
Checks if the provided request is running in OpenCms.

Returns:
true if the request is running in OpenCms, false otherwise

getCmsCache

public CmsFlexCache getCmsCache()
Returns the CmsFlexCache instance where all results from this request will be cached in.

This is public so that pages like the Flex Cache Administration page have a way to access the cache object.

Returns:
the CmsFlexCache instance where all results from this request will be cached in

getCmsFile

public CmsFile getCmsFile()
This method provides access to the top-level CmsFile of the request which is of a type that supports the FlexCache, i.e. usually the CmsFile that is identical to the file uri requested by the user, not he current included element.

In case a JSP is used as a sub-element in a XMLTemplate, this method will not return the top-level uri but the "topmost" file of a type that is supported by the FlexCache. In case you need the top uri, use getCmsObject().getRequestContext().getUri().

Returns:
the requested top-level CmsFile

getCurrentRequest

public CmsFlexRequest getCurrentRequest()

pushRequest

public void pushRequest(CmsFlexRequest req)

popRequest

public CmsFlexRequest popRequest()

getCurrentResponse

public CmsFlexResponse getCurrentResponse()

pushResponse

public void pushResponse(CmsFlexResponse res)

popResponse

public CmsFlexResponse popResponse()

suspendFlexResponse

public void suspendFlexResponse()

getResponseQueueSize

public int getResponseQueueSize()

getTopRequest

public javax.servlet.http.HttpServletRequest getTopRequest()

getTopResponse

public javax.servlet.http.HttpServletResponse getTopResponse()