public class CmsJspTagContainer extends javax.servlet.jsp.tagext.BodyTagSupport implements javax.servlet.jsp.tagext.TryCatchFinally, I_CmsJspTagParamParent
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_MAX_ELEMENTS
Default number of max elements in the container in case no value has been set.
|
static java.lang.String |
DETAIL_FUNCTION_CONTAINER_NAME
The detail function container name.
|
static java.lang.String |
DUMMY_ELEMENT
HTML used for invisible dummy elements.
|
| Constructor and Description |
|---|
CmsJspTagContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
addParameter(java.lang.String name,
java.lang.String value)
Add a parameter to this tag.
|
int |
doAfterBody() |
void |
doCatch(java.lang.Throwable t) |
int |
doEndTag() |
void |
doFinally() |
int |
doStartTag()
Internal action method.
|
static I_CmsFormatterBean |
ensureValidFormatterSettings(CmsObject cms,
CmsContainerElementBean element,
CmsADEConfigData adeConfig,
java.lang.String containerName,
java.lang.String containerType,
int containerWidth)
Ensures the appropriate formatter configuration ID is set in the element settings.
|
protected java.lang.String |
getContainerData(CmsObject cms,
int maxElements,
boolean isDetailView,
boolean isDetailOnly)
Returns the serialized data of the given container.
|
java.lang.String |
getDetailview()
Returns the boolean value if this container is target of detail views.
|
java.lang.String |
getEditableby()
Returns the editable by tag attribute.
|
static I_CmsFormatterBean |
getFormatterConfigurationForElement(CmsObject cms,
CmsContainerElementBean element,
CmsADEConfigData adeConfig,
java.lang.String containerName,
java.lang.String containerType,
int containerWidth)
Returns the formatter configuration for the given element.
|
static java.util.List<CmsContainerElementBean> |
getGroupContainerElements(CmsObject cms,
CmsContainerElementBean element,
javax.servlet.ServletRequest req,
java.lang.String containerType)
Returns the element group elements.
|
static java.util.List<CmsContainerElementBean> |
getInheritedContainerElements(CmsObject cms,
CmsContainerElementBean element)
Reads elements from an inherited container.
|
java.lang.String |
getMaxElements()
Returns the maxElements attribute value.
|
java.lang.String |
getName()
Returns the container name, in case of nested containers with a prefix to guaranty uniqueness.
|
java.lang.String |
getNameprefix()
Returns the name prefix.
|
static java.lang.String |
getNestedContainerName(java.lang.String name,
java.lang.String parentIstanceId,
java.lang.String namePrefix)
Returns the prefixed nested container name.
|
java.lang.String |
getParam()
Returns the (optional) container parameter.
|
java.lang.String |
getTag()
Returns the tag attribute.
|
java.lang.String |
getTagClass()
Returns the tag class attribute.
|
protected static java.lang.String |
getTagClose(java.lang.String tagName)
Creates the closing tag for the container.
|
protected static java.lang.String |
getTagOpen(java.lang.String tagName,
java.lang.String containerName,
java.lang.String tagClass,
boolean nested,
boolean online,
java.lang.String containerData)
Creates the opening tag for the container assigning the appropriate id and class attributes.
|
java.lang.String |
getType()
Returns the type attribute value.
|
java.lang.String |
getWidth()
Returns the container width as a string.
|
protected boolean |
isEditable(CmsObject cms)
Returns if the container is editable by the current user.
|
protected boolean |
isNested()
Returns true if this is a nested container.
|
protected void |
printElementWrapperTagEnd(boolean isGroupcontainer)
Prints the closing tag for an element wrapper if in online mode.
|
protected void |
printElementWrapperTagStart(CmsObject cms,
CmsContainerElementBean elementBean,
CmsContainerPageBean page,
boolean isGroupContainer)
Prints the opening element wrapper tag for the container page editor if we are in Offline mode.
|
void |
setDetailonly(java.lang.String detailOnly)
Sets if this container should only be displayed on detail pages.
|
void |
setDetailview(java.lang.String detailView)
Sets if the current container is target of detail views.
|
void |
setEditableby(java.lang.String editableBy)
Sets the editable by tag attribute.
|
void |
setMaxElements(java.lang.String maxElements)
Sets the maxElements attribute value.
|
void |
setName(java.lang.String name)
Sets the name attribute value.
|
void |
setNameprefix(java.lang.String namePrefix)
Sets the name prefix.
|
void |
setParam(java.lang.String param)
Sets the container parameter.
|
void |
setSettings(java.lang.Object presets)
Sets the setting presets.
|
void |
setTag(java.lang.String tag)
Sets the tag attribute.
|
void |
setTagClass(java.lang.String tagClass)
Sets the tag class attribute.
|
void |
setType(java.lang.String type)
Sets the type attribute value.
|
void |
setWidth(java.lang.String width)
Sets the container width as a string.
|
doInitBody, getBodyContent, getPreviousOut, release, setBodyContentfindAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValuepublic static final java.lang.String DEFAULT_MAX_ELEMENTS
public static final java.lang.String DETAIL_FUNCTION_CONTAINER_NAME
public static final java.lang.String DUMMY_ELEMENT
public CmsJspTagContainer()
public static I_CmsFormatterBean ensureValidFormatterSettings(CmsObject cms, CmsContainerElementBean element, CmsADEConfigData adeConfig, java.lang.String containerName, java.lang.String containerType, int containerWidth)
cms - the cms contextelement - the element beanadeConfig - the ADE configuration datacontainerName - the container namecontainerType - the container typecontainerWidth - the container widthnull if no formatter available or a schema formatter is usedpublic static I_CmsFormatterBean getFormatterConfigurationForElement(CmsObject cms, CmsContainerElementBean element, CmsADEConfigData adeConfig, java.lang.String containerName, java.lang.String containerType, int containerWidth)
cms - the cms contextelement - the element beanadeConfig - the ADE configurationcontainerName - the container namecontainerType - the container typecontainerWidth - the container widthpublic static java.util.List<CmsContainerElementBean> getGroupContainerElements(CmsObject cms, CmsContainerElementBean element, javax.servlet.ServletRequest req, java.lang.String containerType) throws CmsException
cms - the current cms contextelement - group elementreq - the servlet requestcontainerType - the container typeCmsException - if something goes wrongpublic static java.util.List<CmsContainerElementBean> getInheritedContainerElements(CmsObject cms, CmsContainerElementBean element)
cms - the current CMS contextelement - the element which references the inherited containerpublic static java.lang.String getNestedContainerName(java.lang.String name, java.lang.String parentIstanceId, java.lang.String namePrefix)
This will be either {parentInstanceId}-{name} or {namePrefix}-{name} or in case namePrefix equals 'none' {name} only.
name - the container nameparentIstanceId - the parent instance idnamePrefix - the name prefix attributeprotected static java.lang.String getTagClose(java.lang.String tagName)
tagName - the tag nameprotected static java.lang.String getTagOpen(java.lang.String tagName, java.lang.String containerName, java.lang.String tagClass, boolean nested, boolean online, java.lang.String containerData)
tagName - the tag namecontainerName - the container name used as id attribute valuetagClass - the tag class attribute valuenested - true if this is a nested containeronline - true if we are in the online projectcontainerData - the container datapublic void addParameter(java.lang.String name, java.lang.String value)
I_CmsJspTagParamParentaddParameter in interface I_CmsJspTagParamParentname - the name of the parametervalue - the value of the parameterI_CmsJspTagParamParent.addParameter(java.lang.String, java.lang.String)public int doAfterBody()
doAfterBody in interface javax.servlet.jsp.tagext.IterationTagdoAfterBody in class javax.servlet.jsp.tagext.BodyTagSupportBodyTagSupport.doAfterBody()public void doCatch(java.lang.Throwable t) throws java.lang.Throwable
doCatch in interface javax.servlet.jsp.tagext.TryCatchFinallyjava.lang.ThrowableTryCatchFinally.doCatch(java.lang.Throwable)public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.BodyTagSupportjavax.servlet.jsp.JspExceptionTagSupport.doEndTag()public void doFinally()
doFinally in interface javax.servlet.jsp.tagext.TryCatchFinallyTryCatchFinally.doFinally()public int doStartTag()
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.BodyTagSupportTag.doStartTag()public java.lang.String getDetailview()
true or falsepublic java.lang.String getEditableby()
public java.lang.String getMaxElements()
public java.lang.String getName()
public java.lang.String getNameprefix()
public java.lang.String getParam()
This is useful for a dynamically generated nested container,
to pass information to the formatter used inside that container.
If no parameters have been set, this will return null
public java.lang.String getTag()
public java.lang.String getTagClass()
public java.lang.String getType()
If the container type has not been set, the name is substituted as type.
public java.lang.String getWidth()
public void setDetailonly(java.lang.String detailOnly)
detailOnly - if this container should only be displayed on detail pagespublic void setDetailview(java.lang.String detailView)
detailView - true or falsepublic void setEditableby(java.lang.String editableBy)
editableBy - the editable by tag attribute to setpublic void setMaxElements(java.lang.String maxElements)
maxElements - the maxElements value to setpublic void setName(java.lang.String name)
name - the name value to setpublic void setNameprefix(java.lang.String namePrefix)
namePrefix - the name prefix to setpublic void setParam(java.lang.String param)
This is useful for a dynamically generated nested container, to pass information to the formatter used inside that container.
param - the parameter String to setpublic void setSettings(java.lang.Object presets)
presets - a map with string keys and values, or nullpublic void setTag(java.lang.String tag)
tag - the createTag to setpublic void setTagClass(java.lang.String tagClass)
tagClass - the tag class attribute to setpublic void setType(java.lang.String type)
type - the type value to setpublic void setWidth(java.lang.String width)
width - the container width as a stringprotected java.lang.String getContainerData(CmsObject cms, int maxElements, boolean isDetailView, boolean isDetailOnly)
cms - the cms contextmaxElements - the maximum number of elements allowed within this containerisDetailView - true if this container is currently being used for the detail viewisDetailOnly - true if this is a detail only containerprotected boolean isEditable(CmsObject cms)
cms - the cms contexttrue if the container is editable by the current userprotected boolean isNested()
protected void printElementWrapperTagEnd(boolean isGroupcontainer) throws java.io.IOException
isGroupcontainer - true if element is a group-containerjava.io.IOException - if the output failsprotected void printElementWrapperTagStart(CmsObject cms, CmsContainerElementBean elementBean, CmsContainerPageBean page, boolean isGroupContainer) throws java.lang.Exception
cms - the Cms contextelementBean - the element beanpage - the container pageisGroupContainer - true if the element is a group-containerjava.lang.Exception - if something goes wrong