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:
Serializable,javax.servlet.jsp.tagext.BodyTag,javax.servlet.jsp.tagext.IterationTag,javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.tagext.Tag
- Direct Known Subclasses:
AccordionTag,AddressLinkTag,BackgroundProcessTag,CardBackTag,CardFlipperTag,CardFrontTag,CardImageTag,CardsTag,CardTag,ComponentTag,ControlTag,DataListItemTag,DataListTag,DropdownTag,FieldTag,ListItemTag,ListSubgroupTag,ListTag,MapMarkerTag,MapTag,MemberPhotoGroupTag,MemberPhotoTag,MenuItemTag,MenuTag,ModalTag,PanelContentTag,ScrollbarTag,ToastrTag,TreeViewTag,WysiwygEditorTag
public class IncludeTag
extends javax.servlet.jsp.tagext.BodyTagSupport
- See Also:
-
Field Summary
FieldsFields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContentFields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContextFields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAGFields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclean()intprotected voidCalled on Init Body and for each body loopsintdoEndTag()voidintgetClazz()getFile()getId()static booleangetIncludeBoolean(javax.servlet.ServletRequest request, String name, boolean def) Retrieve boolean from contextual includestatic ObjectgetIncludeObject(javax.servlet.ServletRequest request, String name, Object def) Retrieve Object from contextual includestatic StringgetIncludeString(javax.servlet.ServletRequest request, String name, String def) Retrieve String from contextual includegetJsp()getPub()getUsage()protected voidinclude()protected voidprotected booleanCheck if the current publication or the current portal element is a children of the given publication to include (Using TreeNode Hierarchy)static voidprintErrorMessage(String jsp, String clazz, Exception ex, javax.servlet.jsp.PageContext pageContext) Print an Exception message in log and in JSP (if developement mode)static voidregisterIncludeStringsAsBufferContent(javax.servlet.jsp.PageContext pageContext, String... prefix) copy some values from include context to pageContext attribute and servlet Buffer content map (like BufferTag action)static voidregisterIncludeStringsAsRequestAttribute(javax.servlet.http.HttpServletRequest request, String... prefix) copy some values from include context to request attributevoidprotected voidsetContext(Map<String, Object> map, String body) voidvoidstatic voidsetIncludeString(javax.servlet.ServletRequest request, String name, String value) Helper to store a value like a <jalios:buffer> in an include context to override some valuesvoidvoidsetPub(Publication pub) voidsetResource(String resource) voidvoidsetTargetContext(String targetContext) voidprotected voidMethods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
getBodyContent, getPreviousOut, release, setBodyContentMethods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
-
Field Details
-
INCLUDE_BODY
- See Also:
-
INCLUDE_CONTEXT
- See Also:
-
JCMS_RESOURCE_INCLUDE_PREFIX_PROP
- See Also:
-
-
Constructor Details
-
IncludeTag
public IncludeTag()
-
-
Method Details
-
setIncludeString
public static void setIncludeString(javax.servlet.ServletRequest request, String name, 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 String getIncludeString(javax.servlet.ServletRequest request, String name, String def) Retrieve String from contextual include- Parameters:
request- the current Requestname- the name to storedef- the default value- Returns:
- String the associated String
-
getIncludeBoolean
public static boolean getIncludeBoolean(javax.servlet.ServletRequest request, String name, boolean def) Retrieve boolean from contextual include- Parameters:
request- the current Requestname- the name to storedef- the default boolean value- Returns:
- boolean the associated boolean
- Since:
- jcms-10.0.8
-
getIncludeObject
public static Object getIncludeObject(javax.servlet.ServletRequest request, String name, Object def) Retrieve Object from contextual include- Parameters:
request- the current Requestname- the name to storedef- the default value- Returns:
- Object the associated Object
-
registerIncludeStringsAsBufferContent
public static void registerIncludeStringsAsBufferContent(javax.servlet.jsp.PageContext pageContext, String... prefix) copy some values from include context to pageContext attribute and servlet Buffer content map (like BufferTag action)- Parameters:
pageContext- the currentPageContextprefix- the prefix of key, contained in includes context to be copied
-
registerIncludeStringsAsRequestAttribute
public static void registerIncludeStringsAsRequestAttribute(javax.servlet.http.HttpServletRequest request, String... prefix) copy some values from include context to request attribute- Parameters:
request- the currentHttpServletRequestprefix- the prefix of key, contained in includes context to be copied
-
getFile
-
setFile
-
getJsp
-
setJsp
-
getResource
-
setResource
-
getClazz
-
setClazz
-
getId
- Overrides:
getIdin classjavax.servlet.jsp.tagext.TagSupport
-
setId
- Overrides:
setIdin classjavax.servlet.jsp.tagext.TagSupport
-
getPub
-
setPub
-
getTarget
-
setTarget
-
getTargetContext
-
setTargetContext
-
getUsage
-
setUsage
-
clean
public void clean() -
setContext
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException- Specified by:
doStartTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException
-
doInitBody
public void doInitBody() throws javax.servlet.jsp.JspException- Specified by:
doInitBodyin interfacejavax.servlet.jsp.tagext.BodyTag- Overrides:
doInitBodyin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException
-
doAfterBody
public int doAfterBody() throws javax.servlet.jsp.JspException- Specified by:
doAfterBodyin interfacejavax.servlet.jsp.tagext.IterationTag- Overrides:
doAfterBodyin classjavax.servlet.jsp.tagext.BodyTagSupport- Throws:
javax.servlet.jsp.JspException
-
doEndTag
public int doEndTag()- Specified by:
doEndTagin interfacejavax.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjavax.servlet.jsp.tagext.BodyTagSupport
-
doBeforeBody
protected void doBeforeBody()Called on Init Body and for each body loops -
notRecusiveInclude
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
-
skipInclude
protected void skipInclude() -
printErrorMessage
public static void printErrorMessage(String jsp, String clazz, 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
-