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 BaseUrlResolver
protected BroadleafFileService
protected static final String
protected Boolean
protected static final org.apache.commons.logging.Log
protected ModuleConfigurationService
protected List<SiteMapGenerator>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected SiteMapConfiguration
Generates a well formed SiteMap.boolean
boolean
boolean
protected boolean
getSiteMapFile
(String fileName) Returns the File object that can be used to retrieve the SiteMap.xml fileprotected void
gzipAndDeleteFiles
(FileWorkArea fileWorkArea, List<String> fileNames) GZip a file, Then delete itprotected void
gzipAndDeleteFiles
(FileWorkArea fileWorkArea, List<String> fileNames, boolean shouldDeleteOriginal) protected SiteMapGenerator
Returns the siteMapGenerator most qualified to handle the given configuration.void
setGzipSiteMapFiles
(Boolean gzipSiteMapFiles) void
setModuleConfigurationService
(ModuleConfigurationService moduleConfigurationService) void
setSiteMapGenerators
(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:SiteMapService
Generates 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:
generateSiteMap
in interfaceSiteMapService
- Throws:
SiteMapException
IOException
- See Also:
-
getSiteMapFile
Description copied from interface:SiteMapService
Returns the File object that can be used to retrieve the SiteMap.xml file- Specified by:
getSiteMapFile
in interfaceSiteMapService
- Throws:
SiteMapException
IOException
-
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
-