Package com.day.cq.wcm.api.components
Interface AnalyzeContext
-
public interface AnalyzeContext
The analyze context is used to define the analyze behaviour of components. There is a context opened for every included component that can be analyzed. A component can be analyzed if it provides an analytics definition.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
getAttribute(java.lang.String name)
Returns the context attribute for the given nameComponent
getComponent()
Returns the primary component for this context.ComponentContext
getComponentContext()
Returns the primary component context that is bound to this context.AnalyzeContext
getParent()
Returns the parent analyze context ornull
if this context is the root context.AnalyzeContext
getRoot()
Returns the root analyze context.void
includeEpilog(SlingHttpServletRequest req, SlingHttpServletResponse resp, WCMMode mode)
Includes the html epilog of this context into the response.void
includeProlog(SlingHttpServletRequest req, SlingHttpServletResponse resp, WCMMode mode)
Includes the html prolog needed for editingboolean
isRoot()
Checks if this is the root analyze context.java.lang.Object
setAttribute(java.lang.String name, java.lang.Object value)
Sets a context attribute with the given name.
-
-
-
Method Detail
-
isRoot
boolean isRoot()
Checks if this is the root analyze context.- Returns:
true
if this is the root analyze context
-
getParent
AnalyzeContext getParent()
Returns the parent analyze context ornull
if this context is the root context.- Returns:
- the parent context or
null
-
getRoot
AnalyzeContext getRoot()
Returns the root analyze context.- Returns:
- the root analyze context.
-
getComponentContext
ComponentContext getComponentContext()
Returns the primary component context that is bound to this context. Note that an analyze context can span several component context if components are included that do not need editing.- Returns:
- the component context.
-
getComponent
Component getComponent()
Returns the primary component for this context.- Returns:
- the component.
-
getAttribute
java.lang.Object getAttribute(java.lang.String name)
Returns the context attribute for the given name- Parameters:
name
- the name of the attribute- Returns:
- the attribute or
null
if not defined.
-
setAttribute
java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
Sets a context attribute with the given name. If the given attribute isnull
it is removed from the attribute map.- Parameters:
name
- the name of the attributevalue
- the attribute value- Returns:
- the old attribute or
null
-
includeProlog
void includeProlog(SlingHttpServletRequest req, SlingHttpServletResponse resp, WCMMode mode) throws java.io.IOException, ServletException
Includes the html prolog needed for editing- Parameters:
req
- the requestresp
- the responsemode
- the wcm mode- Throws:
java.io.IOException
- if an I/O error occursServletException
- if a servlet error occurs
-
includeEpilog
void includeEpilog(SlingHttpServletRequest req, SlingHttpServletResponse resp, WCMMode mode) throws java.io.IOException, ServletException
Includes the html epilog of this context into the response.- Parameters:
req
- the requestresp
- the responsemode
- the wcm mode- Throws:
java.io.IOException
- if an I/O error occursServletException
- if a servlet error occurs
-
-