Class CmsXmlSitemapActionElement

java.lang.Object
org.opencms.jsp.CmsJspBean
org.opencms.jsp.CmsJspActionElement
org.opencms.site.xmlsitemap.CmsXmlSitemapActionElement

Action element class for displaying the XML sitemap from a JSP.

  • Field Details

  • Constructor Details

    • CmsXmlSitemapActionElement

      public CmsXmlSitemapActionElement(javax.servlet.jsp.PageContext pageContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Constructor, with parameters.
      Parameters:
      pageContext - the JSP page context object
      request - the JSP request
      response - the JSP response
  • Method Details

    • createSitemapGenerator

      public static CmsXmlSitemapGenerator createSitemapGenerator(String className, String folderRootPath) throws CmsException
      Creates an XML sitemap generator instance given a class name and the root path for the sitemap.

      Parameters:
      className - the class name of the sitemap generator (may be null for the default
      folderRootPath - the root path of the start folder for the sitemap
      Returns:
      the sitemap generator instance
      Throws:
      CmsException - if something goes wrong
    • prepareSitemapGenerator

      Constructs an XML sitemap generator given an XML sitemap configuration file.

      Parameters:
      seoFileRes - the sitemap XML file
      config - the parsed configuration
      Returns:
      the sitemap generator, or null if the given configuration is not an XML sitemap configuration
      Throws:
      CmsException - if something goes wrong
    • run

      public void run() throws Exception
      Displays either the generated sitemap.xml or the generated robots.txt, depending on the configuration.

      Throws:
      Exception - if something goes wrong