Class SiteMapServiceImpl

java.lang.Object
org.broadleafcommerce.common.sitemap.service.SiteMapServiceImpl
All Implemented Interfaces:
SiteMapService

@Service("blSiteMapService") public class SiteMapServiceImpl extends Object implements SiteMapService
Component responsible for generating a sitemap. Relies on SiteMapGenerators to produce the actual url entries within the sitemap.

Create a sitemap index file and at least one sitemap file with the URL elements.

Author:
bpolster
  • Field Details

  • Constructor Details

    • SiteMapServiceImpl

      public SiteMapServiceImpl()
  • Method Details

    • generateSiteMap

      public SiteMapGenerationResponse generateSiteMap() throws SiteMapException, IOException
      Description copied from interface: SiteMapService
      Generates a well formed SiteMap. When SiteMapService.getSiteMapFile(String) is called, if no file is found then it will invoke this method. Typically, an implementation will setup scheduled jobs to create the siteMap.xml.

      Implementation should implement a well formed SiteMap (for example, the default Broadleaf SiteMapImpl returns a SiteMap compatible with this schema.

      http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd

      Implementations should utilize the list of SiteMapGenerators that build the actual entries in the sitemap.xml files.

      Specified by:
      generateSiteMap in interface SiteMapService
      Throws:
      SiteMapException
      IOException
      See Also:
    • getSiteMapFile

      public File getSiteMapFile(String fileName) throws SiteMapException, IOException
      Description copied from interface: SiteMapService
      Returns the File object that can be used to retrieve the SiteMap.xml file
      Specified by:
      getSiteMapFile in interface SiteMapService
      Throws:
      SiteMapException
      IOException
    • findActiveSiteMapConfiguration

      protected SiteMapConfiguration findActiveSiteMapConfiguration()
    • selectSiteMapGenerator

      protected SiteMapGenerator selectSiteMapGenerator(SiteMapGeneratorConfiguration smgc)
      Returns the siteMapGenerator most qualified to handle the given configuration.
      Parameters:
      smgc -
      Returns:
    • gzipAndDeleteFiles

      protected void gzipAndDeleteFiles(FileWorkArea fileWorkArea, List<String> fileNames, boolean shouldDeleteOriginal)
      Parameters:
      fileWorkArea -
      fileNames -
    • gzipAndDeleteFiles

      protected void gzipAndDeleteFiles(FileWorkArea fileWorkArea, List<String> fileNames)
      GZip a file, Then delete it
      Parameters:
      fileWorkArea -
      fileNames -
    • getSiteMapGenerators

      public List<SiteMapGenerator> getSiteMapGenerators()
    • setSiteMapGenerators

      public void setSiteMapGenerators(List<SiteMapGenerator> siteMapGenerators)
    • getModuleConfigurationService

      public ModuleConfigurationService getModuleConfigurationService()
    • setModuleConfigurationService

      public void setModuleConfigurationService(ModuleConfigurationService moduleConfigurationService)
    • getGzipSiteMapFilesDefault

      protected boolean getGzipSiteMapFilesDefault()
    • getCreateSiteMapIfNotFound

      public boolean getCreateSiteMapIfNotFound()
    • getAutoGenerateSiteMapAfterTimeout

      public boolean getAutoGenerateSiteMapAfterTimeout()
    • getSiteMapTimeoutInMillis

      public Long getSiteMapTimeoutInMillis()
    • getGzipSiteMapFiles

      public boolean getGzipSiteMapFiles()
    • setGzipSiteMapFiles

      public void setGzipSiteMapFiles(Boolean gzipSiteMapFiles)