Class SiteMapBuilder
java.lang.Object
org.broadleafcommerce.common.sitemap.service.SiteMapBuilder
Handles creating the various sitemap files.
- Author:
- bpolster
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected SiteMapURLSetWrapper
protected FileWorkArea
protected boolean
protected static final org.apache.commons.logging.Log
protected SiteMapConfiguration
-
Constructor Summary
ConstructorsConstructorDescriptionSiteMapBuilder
(SiteMapConfiguration siteMapConfig, FileWorkArea fileWorkArea, String baseUrl, boolean gzipSiteMapFiles) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUrl
(SiteMapURLWrapper urlWrapper) Returns the SiteMapURLSetWrapper that a Generator should use to add its next URL element.protected String
Create the name of the indexed files.protected void
Save the site map index file.protected void
persistIndexedURLSetWrapper
(SiteMapURLSetWrapper urlSetWrapper) Save the passed in URL set to a new indexed file.protected void
Save the passed in URL set to a non-indexed file.protected void
protected void
persistXMLDocument
(String fileName, Object xmlObject) Method takes in a valid JAXB object (e.g. has a RootElement) and persists it to the temporary directory associated with this builder.
-
Field Details
-
LOG
protected static final org.apache.commons.logging.Log LOG -
fileWorkArea
-
siteMapConfig
-
currentURLSetWrapper
-
indexedFileNames
-
baseUrl
-
gzipSiteMapFiles
protected boolean gzipSiteMapFiles
-
-
Constructor Details
-
SiteMapBuilder
public SiteMapBuilder(SiteMapConfiguration siteMapConfig, FileWorkArea fileWorkArea, String baseUrl, boolean gzipSiteMapFiles)
-
-
Method Details
-
addUrl
Returns the SiteMapURLSetWrapper that a Generator should use to add its next URL element. -
persistXMLDocument
Method takes in a valid JAXB object (e.g. has a RootElement) and persists it to the temporary directory associated with this builder.- Parameters:
fileName
-
-
persistIndexedURLSetWrapper
Save the passed in URL set to a new indexed file. -
persistNonIndexedSiteMap
protected void persistNonIndexedSiteMap()Save the passed in URL set to a non-indexed file. -
persistIndexedSiteMap
protected void persistIndexedSiteMap()Save the site map index file. -
createNextIndexedFileName
Create the name of the indexed files. For example, sitemap1.xml, sitemap2.xml, etc.- Returns:
-
persistSiteMap
protected void persistSiteMap() -
getIndexedFileNames
-
getBaseUrl
-