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 Details

  • 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 Request
      name - the name to store
      value - 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 Request
      name - the name to store
      def - 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 Request
      name - the name to store
      def - 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 Request
      name - the name to store
      def - 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 current PageContext
      prefix - 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 current HttpServletRequest
      prefix - the prefix of key, contained in includes context to be copied
    • getFile

      public String getFile()
    • setFile

      public void setFile(String file)
    • getJsp

      public String getJsp()
    • setJsp

      public void setJsp(String jsp)
    • getResource

      public String getResource()
    • setResource

      public void setResource(String resource)
    • getClazz

      public String getClazz()
    • setClazz

      public void setClazz(String clazz)
    • getId

      public String getId()
      Overrides:
      getId in class javax.servlet.jsp.tagext.TagSupport
    • setId

      public void setId(String id)
      Overrides:
      setId in class javax.servlet.jsp.tagext.TagSupport
    • getPub

      public Publication getPub()
    • setPub

      public void setPub(Publication pub)
    • getTarget

      public String getTarget()
    • setTarget

      public void setTarget(String target)
    • getTargetContext

      public String getTargetContext()
    • setTargetContext

      public void setTargetContext(String targetContext)
    • getUsage

      public String getUsage()
    • setUsage

      public void setUsage(String usage)
    • clean

      public void clean()
    • setContext

      protected void setContext(Map<String,Object> map, String body)
    • doStartTag

      public int doStartTag() throws javax.servlet.jsp.JspException
      Specified by:
      doStartTag in interface javax.servlet.jsp.tagext.Tag
      Overrides:
      doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
      Throws:
      javax.servlet.jsp.JspException
    • doInitBody

      public void doInitBody() throws javax.servlet.jsp.JspException
      Specified by:
      doInitBody in interface javax.servlet.jsp.tagext.BodyTag
      Overrides:
      doInitBody in class javax.servlet.jsp.tagext.BodyTagSupport
      Throws:
      javax.servlet.jsp.JspException
    • doAfterBody

      public int doAfterBody() throws javax.servlet.jsp.JspException
      Specified by:
      doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
      Overrides:
      doAfterBody in class javax.servlet.jsp.tagext.BodyTagSupport
      Throws:
      javax.servlet.jsp.JspException
    • doEndTag

      public int doEndTag()
      Specified by:
      doEndTag in interface javax.servlet.jsp.tagext.Tag
      Overrides:
      doEndTag in class javax.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(String body)
    • 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 used
      clazz - the class used
      ex - the exception
      pageContext - the given pageContext