Package com.day.cq.wcm.api.components
Class IncludeOptions
java.lang.Object
com.day.cq.wcm.api.components.IncludeOptions
IncludeOptions provide constants for the next component include-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IncludeOptionsclear(ServletRequest req) Clears the include options from the request attributes and returns it.forceCellName(String cellName) Sets the option to force the cell name of the next includeforceCurrentPage(Page currentPage) Sets the option to force a particular current page for the next include.voidforceEditContext(boolean forceEditContext) Define if a new edit context should be openend.forceSameContext(boolean force) Sets the option to force the next include to be in the same edit context as the current one.Returns the cell name for the next include.Returns a modifiable set of additional css class names to be added to the including <div> tag.Returns the currentPage for the next include if forced, or null.Returns the decoration tag name override.static IncludeOptionsgetOptions(ServletRequest req, boolean force) Returns the include options as stored in the current request.booleanChecks a new edit context is forced.booleanChecks if the same edit context is requested.voidsetDecorationTagName(String decorationTagName) Sets the decoration tag name override.
-
Field Details
-
ATTR_NAME
Name of the request attribute
-
-
Constructor Details
-
IncludeOptions
public IncludeOptions()
-
-
Method Details
-
getOptions
Returns the include options as stored in the current request. If no such request attribute is defined butforceistrue, new include options are created and stored as request attribute.- Parameters:
req- the requestforce- flag to force creation- Returns:
- the include options or
null
-
clear
Clears the include options from the request attributes and returns it.- Parameters:
req- the request- Returns:
- the include options or
nullif never defined.
-
forceSameContext
Sets the option to force the next include to be in the same edit context as the current one. i.e. no new edit context is created.- Parameters:
force-trueif no new edit context is to be created.- Returns:
- this include options.
-
isSameContext
public boolean isSameContext()Checks if the same edit context is requested.- Returns:
trueif the next include should use the same edit context.
-
forceCurrentPage
Sets the option to force a particular current page for the next include.- Parameters:
currentPage- the forced page- Returns:
- this include option
-
getCurrentPage
Returns the currentPage for the next include if forced, or null.- Returns:
- the forced page or
null
-
forceCellName
Sets the option to force the cell name of the next include- Parameters:
cellName- the cell name- Returns:
- this include option
-
getCellName
Returns the cell name for the next include.- Returns:
- the cell name or
null
-
getCssClassNames
Returns a modifiable set of additional css class names to be added to the including <div> tag.- Returns:
- the array of names
-
isForceEditContext
public boolean isForceEditContext()Checks a new edit context is forced.- Returns:
trueif forced.
-
forceEditContext
public void forceEditContext(boolean forceEditContext) Define if a new edit context should be openend.- Parameters:
forceEditContext-trueif a new edit context should be openend.
-
getDecorationTagName
Returns the decoration tag name override.- Returns:
- the decoration tag name.
-
setDecorationTagName
Sets the decoration tag name override. This override any automatic decoation tag name computation in the wcm request filter or explicit definition by the component. If set to an empty string, no decoration tag will be rendered at all. Note that the decoration tag name defined in the include options will only be applied to the component context before inclusion and will not be inheirted to the sub contextes.- Parameters:
decorationTagName- the decoration tag name.- Since:
- 5.3
- See Also:
-