Package com.day.cq.wcm.api.components
Class IncludeOptions
- java.lang.Object
-
- com.day.cq.wcm.api.components.IncludeOptions
-
public class IncludeOptions extends java.lang.ObjectIncludeOptionsprovide constants for the next component include
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTR_NAMEName of the request attribute
-
Constructor Summary
Constructors Constructor Description IncludeOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IncludeOptionsclear(ServletRequest req)Clears the include options from the request attributes and returns it.IncludeOptionsforceCellName(java.lang.String cellName)Sets the option to force the cell name of the next includeIncludeOptionsforceCurrentPage(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.IncludeOptionsforceSameContext(boolean force)Sets the option to force the next include to be in the same edit context as the current one.java.lang.StringgetCellName()Returns the cell name for the next include.java.util.Set<java.lang.String>getCssClassNames()Returns a modifiable set of additional css class names to be added to the including <div> tag.PagegetCurrentPage()Returns the currentPage for the next include if forced, or null.java.lang.StringgetDecorationTagName()Returns the decoration tag name override.static IncludeOptionsgetOptions(ServletRequest req, boolean force)Returns the include options as stored in the current request.booleanisForceEditContext()Checks a new edit context is forced.booleanisSameContext()Checks if the same edit context is requested.voidsetDecorationTagName(java.lang.String decorationTagName)Sets the decoration tag name override.
-
-
-
Method Detail
-
getOptions
public static IncludeOptions getOptions(ServletRequest req, boolean force)
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
public static IncludeOptions clear(ServletRequest req)
Clears the include options from the request attributes and returns it.- Parameters:
req- the request- Returns:
- the include options or
nullif never defined.
-
forceSameContext
public IncludeOptions forceSameContext(boolean force)
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
public IncludeOptions forceCurrentPage(Page currentPage)
Sets the option to force a particular current page for the next include.- Parameters:
currentPage- the forced page- Returns:
- this include option
-
getCurrentPage
public Page getCurrentPage()
Returns the currentPage for the next include if forced, or null.- Returns:
- the forced page or
null
-
forceCellName
public IncludeOptions forceCellName(java.lang.String cellName)
Sets the option to force the cell name of the next include- Parameters:
cellName- the cell name- Returns:
- this include option
-
getCellName
public java.lang.String getCellName()
Returns the cell name for the next include.- Returns:
- the cell name or
null
-
getCssClassNames
public java.util.Set<java.lang.String> 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
public java.lang.String getDecorationTagName()
Returns the decoration tag name override.- Returns:
- the decoration tag name.
-
setDecorationTagName
public void setDecorationTagName(java.lang.String decorationTagName)
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:
ComponentContext.setDecorationTagName(String)
-
-