Class SiteMapBuilder
java.lang.Object
org.broadleafcommerce.common.sitemap.service.SiteMapBuilder
Handles creating the various sitemap files.
- Author:
- bpolster
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected SiteMapURLSetWrapperprotected FileWorkAreaprotected booleanprotected static final org.apache.commons.logging.Logprotected SiteMapConfiguration -
Constructor Summary
ConstructorsConstructorDescriptionSiteMapBuilder(SiteMapConfiguration siteMapConfig, FileWorkArea fileWorkArea, String baseUrl, boolean gzipSiteMapFiles) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUrl(SiteMapURLWrapper urlWrapper) Returns the SiteMapURLSetWrapper that a Generator should use to add its next URL element.protected StringCreate the name of the indexed files.protected voidSave the site map index file.protected voidpersistIndexedURLSetWrapper(SiteMapURLSetWrapper urlSetWrapper) Save the passed in URL set to a new indexed file.protected voidSave the passed in URL set to a non-indexed file.protected voidprotected voidpersistXMLDocument(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
-