atg.projects.store.collections.validator
Class SiteValidator

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.projects.store.collections.validator.SiteValidator
All Implemented Interfaces:
atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, atg.service.collections.validator.CollectionObjectValidator, java.util.EventListener

public class SiteValidator
extends atg.nucleus.GenericService
implements atg.service.collections.validator.CollectionObjectValidator

SiteValidator validates an item based on its sites/siteGroup/siteIds properties. siteGroup and sites properties could be configured for promotional items, and siteIds property could be configured for products.

A Set of the (repository) items site ids and siteGroups site ids is constructed and compared to the site ids of the current sites mShareableTypeId siteGroup site ids. If any sites from the items Set match then the item will be returned.

*

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/EStore/src/atg/projects/store/collections/validator/SiteValidator.java#2 $Change: 630322 $
Author:
Yekaterina Kostenevich

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  boolean mIncludeDisabledSites
          property: includeDisabledSites
protected  boolean mIncludeInactiveSites
          property: includeInactiveSites
protected  java.lang.String mShareableTypeId
          property: shareableTypeId
protected  atg.multisite.SiteGroupManager mSiteGroupManager
          property: siteGroupManager
protected  java.lang.String mSiteGroupPropertyName
          property: siteGroupPropertyName
protected  java.lang.String mSiteIdsPropertyName
          property: SiteIdsPropertyName
protected  atg.multisite.SiteManager mSiteManager
          property: siteManager
protected  java.lang.String mSitesPropertyName
          property: sitesPropertyName
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
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
SiteValidator()
           
 
Method Summary
 java.lang.String getShareableTypeId()
           
 atg.multisite.SiteGroupManager getSiteGroupManager()
           
 java.lang.String getSiteGroupPropertyName()
           
protected  java.util.Set<java.lang.String> getSiteGroupSiteIds(atg.repository.RepositoryItem pItem)
          Gets the siteIds from all pItems siteGroups and returns them in a Set.
protected  java.util.Set<java.lang.String> getSiteIds(atg.repository.RepositoryItem pItem)
          Gets the siteIds property from the passed in RepositoryItem and returns them in a Set.
 java.lang.String getSiteIdsPropertyName()
           
 atg.multisite.SiteManager getSiteManager()
           
 java.lang.String getSitesPropertyName()
           
 boolean isIncludeDisabledSites()
           
 boolean isIncludeInactiveSites()
           
 void setIncludeDisabledSites(boolean pIncludeDisabledSites)
           
 void setIncludeInactiveSites(boolean pIncludeInactiveSites)
           
 void setShareableTypeId(java.lang.String pShareableTypeId)
           
 void setSiteGroupManager(atg.multisite.SiteGroupManager pSiteGroupManager)
           
 void setSiteGroupPropertyName(java.lang.String pSiteGroupPropertyName)
           
 void setSiteIdsPropertyName(java.lang.String pSiteIdsPropertyName)
           
 void setSiteManager(atg.multisite.SiteManager pSiteManager)
           
 void setSitesPropertyName(java.lang.String pSitesPropertyName)
           
 boolean validateObject(java.lang.Object pObject)
          This method validates the passed in object (repository items) based on whether or not any of its items sites/siteGroups.sites exist in the current mShareableTypeId siteGroup.
 
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 final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

mShareableTypeId

protected java.lang.String mShareableTypeId
property: shareableTypeId


mSiteIdsPropertyName

protected java.lang.String mSiteIdsPropertyName
property: SiteIdsPropertyName


mSitesPropertyName

protected java.lang.String mSitesPropertyName
property: sitesPropertyName


mSiteGroupPropertyName

protected java.lang.String mSiteGroupPropertyName
property: siteGroupPropertyName


mSiteGroupManager

protected atg.multisite.SiteGroupManager mSiteGroupManager
property: siteGroupManager


mSiteManager

protected atg.multisite.SiteManager mSiteManager
property: siteManager


mIncludeDisabledSites

protected boolean mIncludeDisabledSites
property: includeDisabledSites


mIncludeInactiveSites

protected boolean mIncludeInactiveSites
property: includeInactiveSites

Constructor Detail

SiteValidator

public SiteValidator()
Method Detail

getShareableTypeId

public java.lang.String getShareableTypeId()
Returns:
shareable ID to be used when determining sharing sites.

setShareableTypeId

public void setShareableTypeId(java.lang.String pShareableTypeId)
Parameters:
pShareableTypeId - SharableTypeId to set

getSiteIdsPropertyName

public java.lang.String getSiteIdsPropertyName()
Returns:
'mSitesPropertyName' that contains the name of the property that holds references to an item's sites.

setSiteIdsPropertyName

public void setSiteIdsPropertyName(java.lang.String pSiteIdsPropertyName)
Parameters:
pSitesPropertyName - value to set

getSitesPropertyName

public java.lang.String getSitesPropertyName()
Returns:
mSitesPropertyName, that contains the name of the property that holds references to an item's sites.

setSitesPropertyName

public void setSitesPropertyName(java.lang.String pSitesPropertyName)
Parameters:
pSitesPropertyName - value to set

getSiteGroupPropertyName

public java.lang.String getSiteGroupPropertyName()
Returns:
mSiteGroupPropertyName, that contains the name of the property that holds references to an item's siteGroups.

setSiteGroupPropertyName

public void setSiteGroupPropertyName(java.lang.String pSiteGroupPropertyName)
Parameters:
pSiteGroupPropertyName - value to set

getSiteGroupManager

public atg.multisite.SiteGroupManager getSiteGroupManager()
Returns:
SiteGroupManager instance, that contains a reference to SiteGroupManager to be used when determining sharing sites.

setSiteGroupManager

public void setSiteGroupManager(atg.multisite.SiteGroupManager pSiteGroupManager)
Parameters:
pSiteGroupManager - value to set

getSiteManager

public atg.multisite.SiteManager getSiteManager()
Returns:
SiteManager instance, that contains a reference to SiteManager to be used when determining active sites.

setSiteManager

public void setSiteManager(atg.multisite.SiteManager pSiteManager)
Parameters:
pSiteManager - value to set

isIncludeDisabledSites

public boolean isIncludeDisabledSites()
Returns:
the includeDisabledSites property, that indicates if items from disabled sites should pass validation

setIncludeDisabledSites

public void setIncludeDisabledSites(boolean pIncludeDisabledSites)
Parameters:
pIncludeDisabledSites - whether or not to filter out items that exist only on disabled sites

isIncludeInactiveSites

public boolean isIncludeInactiveSites()
Returns:
the includeInactiveSites property, that indicates if items from inactive sites should pass validation

setIncludeInactiveSites

public void setIncludeInactiveSites(boolean pIncludeInactiveSites)
Parameters:
pIncludeInactiveSites - whether or not to filter out items that exist only on inactive sites

validateObject

public boolean validateObject(java.lang.Object pObject)
This method validates the passed in object (repository items) based on whether or not any of its items sites/siteGroups.sites exist in the current mShareableTypeId siteGroup.

Specified by:
validateObject in interface atg.service.collections.validator.CollectionObjectValidator
Parameters:
object - to validate
Returns:
true if the object passes validation or if no validation was performed.

getSiteIds

protected java.util.Set<java.lang.String> getSiteIds(atg.repository.RepositoryItem pItem)
Gets the siteIds property from the passed in RepositoryItem and returns them in a Set.

Parameters:
pItem - A RepositoryItem
Returns:
A Set of pItems siteIds

getSiteGroupSiteIds

protected java.util.Set<java.lang.String> getSiteGroupSiteIds(atg.repository.RepositoryItem pItem)
Gets the siteIds from all pItems siteGroups and returns them in a Set.

Parameters:
pItem - A RepositoryItem
Returns:
A Set of siteIds constructed from the siteGroups of pItem