Class IncludeTag

    • 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  
      • Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport

        bodyContent
      • Fields inherited from class javax.servlet.jsp.tagext.TagSupport

        pageContext
      • Fields inherited from interface javax.servlet.jsp.tagext.BodyTag

        EVAL_BODY_BUFFERED, EVAL_BODY_TAG
      • Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

        EVAL_BODY_AGAIN
      • Fields inherited from interface javax.servlet.jsp.tagext.Tag

        EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
    • 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 loops
      int 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 include
      static java.lang.String getIncludeString​(javax.servlet.ServletRequest request, java.lang.String name, java.lang.String def)
      Retrieve String from contextual include
      java.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 values
      void 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.servlet.jsp.tagext.Tag

        getParent, setPageContext, setParent
    • Constructor Detail

      • IncludeTag

        public IncludeTag()
    • 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 Request
        name - the name to store
        value - 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 Request
        name - the name to store
        def - 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 Request
        name - the name to store
        def - 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 class javax.servlet.jsp.tagext.TagSupport
      • setId

        public void setId​(java.lang.String id)
        Overrides:
        setId in class javax.servlet.jsp.tagext.TagSupport
      • 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 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​(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 used
        clazz - the class used
        ex - the exception
        pageContext - the given pageContext