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 Summary
FieldsModifier and TypeFieldDescriptionprotected BaseUrlResolverprotected BroadleafFileServiceprotected static final Stringprotected Booleanprotected static final org.apache.commons.logging.Logprotected ModuleConfigurationServiceprotected List<SiteMapGenerator> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SiteMapConfigurationGenerates a well formed SiteMap.booleanbooleanbooleanprotected booleangetSiteMapFile(String fileName) Returns the File object that can be used to retrieve the SiteMap.xml fileprotected voidgzipAndDeleteFiles(FileWorkArea fileWorkArea, List<String> fileNames) GZip a file, Then delete itprotected voidgzipAndDeleteFiles(FileWorkArea fileWorkArea, List<String> fileNames, boolean shouldDeleteOriginal) protected SiteMapGeneratorReturns the siteMapGenerator most qualified to handle the given configuration.voidsetGzipSiteMapFiles(Boolean gzipSiteMapFiles) voidsetModuleConfigurationService(ModuleConfigurationService moduleConfigurationService) voidsetSiteMapGenerators(List<SiteMapGenerator> siteMapGenerators)
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
ENCODING_EXTENSION
- See Also:
-
gzipSiteMapFiles
-
moduleConfigurationService
-
siteMapGenerators
-
broadleafFileService
-
baseUrlResolver
-
-
Constructor Details
-
SiteMapServiceImpl
public SiteMapServiceImpl()
-
-
Method Details
-
generateSiteMap
Description copied from interface:SiteMapServiceGenerates a well formed SiteMap. WhenSiteMapService.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:
generateSiteMapin interfaceSiteMapService- Throws:
SiteMapExceptionIOException- See Also:
-
getSiteMapFile
Description copied from interface:SiteMapServiceReturns the File object that can be used to retrieve the SiteMap.xml file- Specified by:
getSiteMapFilein interfaceSiteMapService- Throws:
SiteMapExceptionIOException
-
findActiveSiteMapConfiguration
-
selectSiteMapGenerator
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
GZip a file, Then delete it- Parameters:
fileWorkArea-fileNames-
-
getSiteMapGenerators
-
setSiteMapGenerators
-
getModuleConfigurationService
-
setModuleConfigurationService
-
getGzipSiteMapFilesDefault
protected boolean getGzipSiteMapFilesDefault() -
getCreateSiteMapIfNotFound
public boolean getCreateSiteMapIfNotFound() -
getAutoGenerateSiteMapAfterTimeout
public boolean getAutoGenerateSiteMapAfterTimeout() -
getSiteMapTimeoutInMillis
-
getGzipSiteMapFiles
public boolean getGzipSiteMapFiles() -
setGzipSiteMapFiles
-