public interface ComponentContext
edit
mode and if the
components are editable it also provides an EditContext
.
Note that an edit context can span several component contexts if not all of
the components that are included provide editing. for example pure
general purpose scripts.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE
name of the request attribute to bypass component handling.
|
static java.lang.String |
CONTEXT_ATTR_NAME
Request attribute name for retrieving the current context
|
Modifier and Type | Method and Description |
---|---|
AnalyzeContext |
getAnalyzeContext()
Returns the analyze context for this include.
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the context attribute for the given name
|
Cell |
getCell()
Returns the design cell.
|
Component |
getComponent()
Returns the top most component that is associated with this context.
|
java.util.Set<java.lang.String> |
getCssClassNames()
Returns the set of css class names to be added to the html tag.
|
java.lang.String |
getDecorationTagName()
Returns the decoration tag name.
|
java.lang.String |
getDefaultDecorationTagName()
Returns the default decoration tag name.
|
EditContext |
getEditContext()
Returns the edit context for this include.
|
Page |
getPage()
Returns the page this component context is operating on.
|
ComponentContext |
getParent()
Returns the parent context or
null if this context
is the root context. |
Resource |
getResource()
Returns the top most resource that is associated with this context.
|
ComponentContext |
getRoot()
Returns the root context.
|
boolean |
hasDecoration()
Checks if this contexts needs decoration at all.
|
boolean |
isRoot()
Checks if this is the root context.
|
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a context attribute with the given name.
|
void |
setDecorate(boolean decorate)
Sets if this context needs decoration.
|
void |
setDecorationTagName(java.lang.String decorationTagName)
Sets the decoration tag name.
|
void |
setDefaultDecorationTagName(java.lang.String decorationTagName)
Sets the default decoration tag name.
|
static final java.lang.String CONTEXT_ATTR_NAME
static final java.lang.String BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE
ComponentContext getParent()
null
if this context
is the root context.null
ComponentContext getRoot()
boolean isRoot()
true
if this is the root contextResource getResource()
null
if not bound.Cell getCell()
EditContext getEditContext()
WCMMode.EDIT
or WCMMode.DESIGN
null
is returned.
Please note that for different component contexts, the same edit context
can be returned, if the respective component spans several includes.null
AnalyzeContext getAnalyzeContext()
WCMMode.ANALYTICS
, null
is
returned.null
Component getComponent()
null
if not bound.Page getPage()
java.lang.Object getAttribute(java.lang.String name)
name
- the name of the attributenull
if not defined.java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
null
it is removed from the attribute map.name
- the name of the attributevalue
- the attribute valuenull
java.util.Set<java.lang.String> getCssClassNames()
boolean hasDecoration()
true
if this context needs decorationvoid setDecorate(boolean decorate)
decorate
- true
if decoration should be drawnjava.lang.String getDecorationTagName()
setDecorationTagName(String)
void setDecorationTagName(java.lang.String decorationTagName)
null
the default
name will be used, if set to an empty string, no decoration tag is rendered.
the tag name is initialized by the "cq:tagName" property of the
"cq:htmlTag" node of the component definition, unless it is overriden by a
include option.decorationTagName
- the name of the decoration tag.setDefaultDecorationTagName(String)
,
Component.getHtmlTagAttributes()
,
IncludeOptions.setDecorationTagName(String)
java.lang.String getDefaultDecorationTagName()
setDefaultDecorationTagName(String)
void setDefaultDecorationTagName(java.lang.String decorationTagName)
null
it will be
inherited from the parent context, if set to an empty string, no
decoration tag is rendered.
the default tag name is used if non is provided by the component or set via
include options. it defaults to div
.decorationTagName
- the name of the decoration tag.setDecorationTagName(String)
,
Component.getHtmlTagAttributes()
,
IncludeOptions.setDecorationTagName(String)
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"