Package com.jalios.jcms.taglib
Class IncludeTag
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- javax.servlet.jsp.tagext.BodyTagSupport
-
- com.jalios.jcms.taglib.IncludeTag
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.jsp.tagext.BodyTag
,javax.servlet.jsp.tagext.IterationTag
,javax.servlet.jsp.tagext.JspTag
,javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
AbstractApplicationTag
,AccordionTag
,BreadcrumbTag
,CardBackTag
,CardBlockTag
,CardFlipperTag
,CardFrontTag
,CardImageTag
,CardsTag
,CardTag
,ChartTag
,ControlTag
,DataListItemTag
,DataListTag
,DropdownTag
,FieldTag
,ListItemTag
,ListSubgroupTag
,ListTag
,MemberPhotoTag
,MenuItemTag
,MenuTag
,MessageTag
,ModalTag
,NoResultTag
,PanelContentTag
,PanelTag
,PortletBoxNoResultTag
,ScrollbarTag
,ToastrTag
,TreeViewTag
,WysiwygEditorTag
public class IncludeTag extends javax.servlet.jsp.tagext.BodyTagSupport
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INCLUDE_BODY
static java.lang.String
INCLUDE_CONTEXT
static java.lang.String
JCMS_RESOURCE_INCLUDE_PREFIX_PROP
static java.lang.String
REVISION
-
Constructor Summary
Constructors Constructor Description IncludeTag()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clean()
int
doAfterBody()
protected void
doBeforeBody()
Called on Init Body and for each body loopsint
doEndTag()
void
doInitBody()
int
doStartTag()
java.lang.String
getClazz()
java.lang.String
getFile()
java.lang.String
getId()
static java.lang.Object
getIncludeObject(javax.servlet.ServletRequest request, java.lang.String name, java.lang.Object def)
Retrieve Object from contextual includestatic java.lang.String
getIncludeString(javax.servlet.ServletRequest request, java.lang.String name, java.lang.String def)
Retrieve String from contextual includejava.lang.String
getJsp()
Publication
getPub()
java.lang.String
getResource()
java.lang.String
getTarget()
java.lang.String
getTargetContext()
java.lang.String
getUsage()
protected void
include()
protected void
include(java.lang.String body)
protected boolean
notRecusiveInclude(Publication pub)
Check if the current publication or the current portal element is a children of the given publication to include (Using TreeNode Hierarchy)static void
printErrorMessage(java.lang.String jsp, java.lang.String clazz, java.lang.Exception ex, javax.servlet.jsp.PageContext pageContext)
Print an Exception message in log and in JSP (if developement mode)void
setClazz(java.lang.String clazz)
protected void
setContext(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String body)
void
setFile(java.lang.String file)
void
setId(java.lang.String id)
static void
setIncludeString(javax.servlet.ServletRequest request, java.lang.String name, java.lang.String value)
Helper to store a value like a <jalios:buffer> in an include context to override some valuesvoid
setJsp(java.lang.String jsp)
void
setPub(Publication pub)
void
setResource(java.lang.String resource)
void
setTarget(java.lang.String target)
void
setTargetContext(java.lang.String targetContext)
void
setUsage(java.lang.String usage)
protected void
skipInclude()
-
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
getBodyContent, getPreviousOut, release, setBodyContent
-
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
-
-
-
-
Field Detail
-
REVISION
public static final java.lang.String REVISION
- See Also:
- Constant Field Values
-
INCLUDE_BODY
public static final java.lang.String INCLUDE_BODY
- See Also:
- Constant Field Values
-
INCLUDE_CONTEXT
public static final java.lang.String INCLUDE_CONTEXT
- See Also:
- Constant Field Values
-
JCMS_RESOURCE_INCLUDE_PREFIX_PROP
public static final java.lang.String JCMS_RESOURCE_INCLUDE_PREFIX_PROP
- See Also:
- Constant Field Values
-
-
Method Detail
-
setIncludeString
public static void setIncludeString(javax.servlet.ServletRequest request, java.lang.String name, java.lang.String value)
Helper to store a value like a <jalios:buffer> in an include context to override some values- Parameters:
request
- the current Requestname
- the name to storevalue
- the value associated
-
getIncludeString
public static java.lang.String getIncludeString(javax.servlet.ServletRequest request, java.lang.String name, java.lang.String def)
Retrieve String from contextual include- Parameters:
request
- the current Requestname
- the name to storedef
- the default value- Returns:
- String the associated String
-
getIncludeObject
public static java.lang.Object getIncludeObject(javax.servlet.ServletRequest request, java.lang.String name, java.lang.Object def)
Retrieve Object from contextual include- Parameters:
request
- the current Requestname
- the name to storedef
- the default value- Returns:
- Object the associated Object
-
getFile
public java.lang.String getFile()
-
setFile
public void setFile(java.lang.String file)
-
getJsp
public java.lang.String getJsp()
-
setJsp
public void setJsp(java.lang.String jsp)
-
getResource
public java.lang.String getResource()
-
setResource
public void setResource(java.lang.String resource)
-
getClazz
public java.lang.String getClazz()
-
setClazz
public void setClazz(java.lang.String clazz)
-
getId
public java.lang.String getId()
- Overrides:
getId
in classjavax.servlet.jsp.tagext.TagSupport
-
setId
public void setId(java.lang.String id)
- Overrides:
setId
in classjavax.servlet.jsp.tagext.TagSupport
-
getPub
public Publication getPub()
-
setPub
public void setPub(Publication pub)
-
getTarget
public java.lang.String getTarget()
-
setTarget
public void setTarget(java.lang.String target)
-
getTargetContext
public java.lang.String getTargetContext()
-
setTargetContext
public void setTargetContext(java.lang.String targetContext)
-
getUsage
public java.lang.String getUsage()
-
setUsage
public void setUsage(java.lang.String usage)
-
clean
public void clean()
-
setContext
protected void setContext(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String body)
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException
- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
-
doInitBody
public void doInitBody() throws javax.servlet.jsp.JspException
- Specified by:
doInitBody
in interfacejavax.servlet.jsp.tagext.BodyTag
- Overrides:
doInitBody
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
-
doAfterBody
public int doAfterBody() throws javax.servlet.jsp.JspException
- Specified by:
doAfterBody
in interfacejavax.servlet.jsp.tagext.IterationTag
- Overrides:
doAfterBody
in classjavax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
-
doEndTag
public int doEndTag()
- Specified by:
doEndTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjavax.servlet.jsp.tagext.BodyTagSupport
-
doBeforeBody
protected void doBeforeBody()
Called on Init Body and for each body loops
-
notRecusiveInclude
protected boolean notRecusiveInclude(Publication pub)
Check if the current publication or the current portal element is a children of the given publication to include (Using TreeNode Hierarchy)- Parameters:
pub
- the publication to include- Returns:
- boolean false if it is a recursive include.
-
include
protected void include()
-
include
protected void include(java.lang.String body)
-
skipInclude
protected void skipInclude()
-
printErrorMessage
public static void printErrorMessage(java.lang.String jsp, java.lang.String clazz, java.lang.Exception ex, javax.servlet.jsp.PageContext pageContext)
Print an Exception message in log and in JSP (if developement mode)- Parameters:
jsp
- the JSP usedclazz
- the class usedex
- the exceptionpageContext
- the given pageContext
-
-