Class CmsJspTagResourceLoad

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected CmsObject m_cms
      The CmsObject for the current user.
      protected java.lang.String m_collector
      The name of the collector to use for list building.
      protected java.lang.String m_collectorName
      The name of the resource collector used.
      protected java.lang.String m_collectorParam
      The parameters of the resource collector uses.
      protected java.util.List<CmsResource> m_collectorResult
      The list of collected resource items.
      protected CmsContentInfoBean m_contentInfoBean
      The bean to store information required to make the result list browsable.
      protected CmsFlexController m_controller
      The FlexController for the current request.
      protected java.lang.String m_pageIndex
      The index of the current page that gets displayed.
      protected java.lang.String m_pageNavLength
      The number of page links in the Google-like page navigation.
      protected java.lang.String m_pageSize
      The size of a page to be displayed.
      protected java.lang.String m_param
      Parameter used for the collector.
      protected boolean m_preload
      Indicates if the collector results should be preloaded.
      protected java.lang.String m_property
      The (optional) property to extend the parameter with.
      protected CmsResource m_resource
      Reference to the last loaded resource element.
      protected java.lang.String m_resourceName
      The file name to load the current content value from.
      • Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport

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

        id, 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
      CmsJspTagResourceLoad()
      Empty constructor, required for JSP tags.
      CmsJspTagResourceLoad​(I_CmsResourceContainer container, javax.servlet.jsp.PageContext context, java.lang.String collectorName, java.lang.String collectorParam)
      Constructor used when using resourceload from scriptlet code.
      CmsJspTagResourceLoad​(I_CmsResourceContainer container, javax.servlet.jsp.PageContext context, java.lang.String collectorName, java.lang.String collectorParam, java.lang.String pageIndex, java.lang.String pageSize)
      Constructor used when using resourceload from scriptlet code.
    • Field Detail

      • m_cms

        protected transient CmsObject m_cms
        The CmsObject for the current user.
      • m_collector

        protected java.lang.String m_collector
        The name of the collector to use for list building.
      • m_collectorName

        protected java.lang.String m_collectorName
        The name of the resource collector used.
      • m_collectorParam

        protected java.lang.String m_collectorParam
        The parameters of the resource collector uses.
      • m_pageIndex

        protected java.lang.String m_pageIndex
        The index of the current page that gets displayed.
      • m_pageNavLength

        protected java.lang.String m_pageNavLength
        The number of page links in the Google-like page navigation.
      • m_pageSize

        protected java.lang.String m_pageSize
        The size of a page to be displayed.
      • m_param

        protected java.lang.String m_param
        Parameter used for the collector.
      • m_preload

        protected boolean m_preload
        Indicates if the collector results should be preloaded.
      • m_property

        protected java.lang.String m_property
        The (optional) property to extend the parameter with.
      • m_resourceName

        protected java.lang.String m_resourceName
        The file name to load the current content value from.
    • Constructor Detail

      • CmsJspTagResourceLoad

        public CmsJspTagResourceLoad​(I_CmsResourceContainer container,
                                     javax.servlet.jsp.PageContext context,
                                     java.lang.String collectorName,
                                     java.lang.String collectorParam)
                              throws javax.servlet.jsp.JspException
        Constructor used when using resourceload from scriptlet code.

        Parameters:
        container - the parent resource container (could be a preloader)
        context - the JSP page context
        collectorName - the collector name to use
        collectorParam - the collector param to use
        Throws:
        javax.servlet.jsp.JspException - in case something goes wrong
      • CmsJspTagResourceLoad

        public CmsJspTagResourceLoad​(I_CmsResourceContainer container,
                                     javax.servlet.jsp.PageContext context,
                                     java.lang.String collectorName,
                                     java.lang.String collectorParam,
                                     java.lang.String pageIndex,
                                     java.lang.String pageSize)
                              throws javax.servlet.jsp.JspException
        Constructor used when using resourceload from scriptlet code.

        Parameters:
        container - the parent resource container (could be a preloader)
        context - the JSP page context
        collectorName - the collector name to use
        collectorParam - the collector param to use
        pageIndex - the display page index (may contain macros)
        pageSize - the display page size (may contain macros)
        Throws:
        javax.servlet.jsp.JspException - in case something goes wrong
    • Method Detail

      • getResourceName

        protected static java.lang.String getResourceName​(CmsObject cms,
                                                          I_CmsResourceContainer contentContainer)
        Returns the resource name currently processed.

        Parameters:
        cms - the current OpenCms user context
        contentContainer - the current resource container
        Returns:
        the resource name currently processed
      • limitCollectorResult

        protected static java.util.List<CmsResourcelimitCollectorResult​(CmsContentInfoBean contentInfoBean,
                                                                          java.util.List<CmsResource> collectorResult)
        Limits the collector's result list to the size of a page to be displayed in a JSP.

        Parameters:
        contentInfoBean - the info bean of the collector
        collectorResult - the result list of the collector
        Returns:
        a limited collector's result list
      • 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
        See Also:
        BodyTagSupport.doAfterBody()
      • doEndTag

        public int doEndTag()
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
        See Also:
        Tag.doEndTag()
      • doStartTag

        public int doStartTag()
                       throws javax.servlet.jsp.JspException,
                              CmsIllegalArgumentException
        Specified by:
        doStartTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
        Throws:
        javax.servlet.jsp.JspException
        CmsIllegalArgumentException
        See Also:
        Tag.doStartTag()
      • getCollector

        public java.lang.String getCollector()
        Returns the collector.

        Returns:
        the collector
      • getPageIndex

        public java.lang.String getPageIndex()
        Returns the index of the page to be displayed.

        Returns:
        the index of the page to be displayed
      • getPageNavLength

        public java.lang.String getPageNavLength()
        Returns the number of page links in the Google-like page navigation.

        Returns:
        the number of page links in the Google-like page navigation
      • getPageSize

        public java.lang.String getPageSize()
        Returns the size of a single page to be displayed.

        Returns:
        the size of a single page to be displayed
      • getParam

        public java.lang.String getParam()
        Returns the collector parameter.

        Returns:
        the collector parameter
      • getPreload

        public java.lang.String getPreload()
        Returns "true" if this content load tag should only preload the values from the collector.

        Returns:
        "true" if this content load tag should only preload the values from the collector
      • getProperty

        public java.lang.String getProperty()
        Returns the property.

        Returns:
        the property
      • setCollector

        public void setCollector​(java.lang.String collector)
        Sets the collector name.

        Parameters:
        collector - the collector name to set
      • setPageIndex

        public void setPageIndex​(java.lang.String pageIndex)
        Sets the index of the page to be displayed.

        Parameters:
        pageIndex - the index of the page to be displayed
      • setPageNavLength

        public void setPageNavLength​(java.lang.String pageNavLength)
        Sets the number of page links in the Google-like page navigation.

        Parameters:
        pageNavLength - the number of page links in the Google-like page navigation
      • setPageSize

        public void setPageSize​(java.lang.String pageSize)
        Sets the size of a single page to be displayed.

        Parameters:
        pageSize - the size of a single page to be displayed
      • setParam

        public void setParam​(java.lang.String param)
        Sets the collector parameter.

        Parameters:
        param - the collector parameter to set
      • setPreload

        public void setPreload​(java.lang.String preload)
        Sets the preload flag for this resource load tag.

        If this is set to true, then the collector result will only be preloaded, but not iterated.

        Parameters:
        preload - the preload flag to set
      • setProperty

        public void setProperty​(java.lang.String property)
        Sets the property.

        Parameters:
        property - the property to set
      • doLoadNextResource

        protected void doLoadNextResource()
        Load the next resource from the initialized list of resources.

      • getNextResource

        protected CmsResource getNextResource()
        Returns the next resource from the collector.

        Returns:
        the next resource from the collector
      • init

        protected void init​(I_CmsResourceContainer container)
                     throws javax.servlet.jsp.JspException
        Initializes this content load tag.

        Parameters:
        container - the parent container (could be a preloader)
        Throws:
        javax.servlet.jsp.JspException - in case something goes wrong