protected BaseUrlResolver baseUrlResolver;
@Override
public SiteMapGenerationResponse generateSiteMap() throws SiteMapException, IOException {
SiteMapGenerationResponse smgr = new SiteMapGenerationResponse();
SiteMapConfiguration smc = findActiveSiteMapConfiguration();
if (smc == null) {
if (LOG.isWarnEnabled()) {
LOG.warn("No SiteMap generated since no active configuration was found.");
}
smgr.setHasError(true);
smgr.setErrorCode("No SiteMap Configuration Found");
return smgr;
}
FileWorkArea fileWorkArea = broadleafFileService.initializeWorkArea();
SiteMapBuilder siteMapBuilder = new SiteMapBuilder(smc, fileWorkArea, baseUrlResolver.getSiteBaseUrl(), getGzipSiteMapFiles());
if (LOG.isTraceEnabled()) {
LOG.trace("File work area initalized with path " + fileWorkArea.getFilePathLocation());
}
for (SiteMapGeneratorConfiguration currentConfiguration : smc.getSiteMapGeneratorConfigurations()) {
if (currentConfiguration.isDisabled()) {
if (LOG.isTraceEnabled()) {
LOG.trace("Skipping disabled sitemap generator configuration" + currentConfiguration.getId());
}
continue;