atg.commerce.sitemap
Class CatalogSitemapGenerator

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.sitemap.DynamicSitemapGenerator
              extended by atg.commerce.sitemap.CatalogSitemapGenerator
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, SitemapGenerator, java.util.EventListener

public class CatalogSitemapGenerator
extends DynamicSitemapGenerator

Extension of DynamicSitemapGenerator to be used with custom catalogs. Some properties of repository items in custom catalogs are dynamically derived based on the current profile's catalog. As sitemap generators are used outside the scope of a request or a session so profile object is not available during sitemaps generating. This extension sets current context catalog to allow custom catalog derived properties to be resolved outside of request scope. Context catalog is determined as default catalog for passed site ID. If not site ID is specified then configured contextCatalog property is used to get the value of default catalog. This class is intended to be used when generating sitemaps for dynamic URLs using indirect URL templates along with custom catalogs. Some additional properties should be specified for CatalogSitemapGenerator component in comparison with DynamicSitemapGenerator component: - contextCatalog - catalog id to use for resolving custom catalog derived properties. - catalogRepository - path to catalog repository component - catalogProperties - path to component that holds the names of all catalog properties - catalogTools - path custom catalog tools component


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.sitemap.DynamicSitemapGenerator
SITEMAP_FOOTER
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.sitemap.SitemapGenerator
MAX_SITEMAPS, MAX_SIZE, MAX_URLS
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
CatalogSitemapGenerator()
           
 
Method Summary
 CatalogProperties getCatalogProperties()
           
 Repository getCatalogRepository()
           
 CustomCatalogTools getCatalogTools()
           
 java.lang.String getContextCatalog()
           
protected  RepositoryItem getDefaultCatalogForSite(java.lang.String pSiteId, SitemapGeneratorService pSitemapGeneratorService)
          Returns default catalog for a specified site ID.
protected  void preGenerateSitemapUrls(SitemapGeneratorService pSitemapGeneratorService, java.lang.String pSiteId)
          Overrides DynamicSytemapGenerator preGenerateSitemapUrls method to set current context catalog before generating sitemaps.
 void setCatalogProperties(CatalogProperties pCatalogProperties)
           
 void setCatalogRepository(Repository pCatalogRepository)
           
 void setCatalogTools(CustomCatalogTools pCatalogTools)
           
 void setContextCatalog(java.lang.String pContextCatalog)
           
 
Methods inherited from class atg.sitemap.DynamicSitemapGenerator
generateSitemap, generateSitemapUrls, generateSitemapUrls, getChangeFrequency, getItemDescriptorName, getNumberOfItemsPerTransaction, getPriority, getQuery, getSitemapFilePrefix, getSitemapURL, getSitemapURL, getSortDirectives, getSourceRepository, getTemplate, getTransactionManager, getUrlParameterLookup, getUrlPrefix, getWebApp, populateUrlParameters, setChangeFrequency, setItemDescriptorName, setNumberOfItemsPerTransaction, setPriority, setSitemapFilePrefix, setSourceRepository, setTemplate, setTransactionManager, setUrlPrefix, setWebApp
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

CatalogSitemapGenerator

public CatalogSitemapGenerator()
Method Detail

getContextCatalog

public java.lang.String getContextCatalog()
Returns:
catalog ID to use for resolving custom catalog properties

setContextCatalog

public void setContextCatalog(java.lang.String pContextCatalog)
Parameters:
ContextCatalog - catalog ID to use for resolving custom catalog properties

getCatalogRepository

public Repository getCatalogRepository()
Returns:
the Catalog Repository

setCatalogRepository

public void setCatalogRepository(Repository pCatalogRepository)
Parameters:
the - Catalog Repository

setCatalogProperties

public void setCatalogProperties(CatalogProperties pCatalogProperties)
Parameters:
the - class that holds the names of all catalog properties

getCatalogProperties

public CatalogProperties getCatalogProperties()
Returns:
the class that holds the names of all catalog properties

getCatalogTools

public CustomCatalogTools getCatalogTools()
Returns:
the Catalog tools

setCatalogTools

public void setCatalogTools(CustomCatalogTools pCatalogTools)
Parameters:
the - Catalog tools

preGenerateSitemapUrls

protected void preGenerateSitemapUrls(SitemapGeneratorService pSitemapGeneratorService,
                                      java.lang.String pSiteId)
Overrides DynamicSytemapGenerator preGenerateSitemapUrls method to set current context catalog before generating sitemaps. If site ID is specified the current catalog is set to default catalog for a site, otherwise the configured default context catalog is used.

Overrides:
preGenerateSitemapUrls in class DynamicSitemapGenerator
Parameters:
pSitemapGeneratorService - Sitemap Generator service that holds global settings for sitemap generating.
pSiteId - site ID for which sitemap is generated.

getDefaultCatalogForSite

protected RepositoryItem getDefaultCatalogForSite(java.lang.String pSiteId,
                                                  SitemapGeneratorService pSitemapGeneratorService)
                                           throws RepositoryException
Returns default catalog for a specified site ID.

Parameters:
pSiteId - site ID
pSitemapGeneratorService - Sitemap Generator service component
Returns:
default catalog for a specified site ID.
Throws:
RepositoryException