atg.projects.store.recommendations.droplet
Class RecommendationAlternativeSiteIdsDroplet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.nucleus.servlet.ServletService
                  extended by atg.nucleus.servlet.HttpServletService
                      extended by atg.servlet.DynamoServlet
                          extended by atg.projects.store.recommendations.droplet.RecommendationAlternativeSiteIdsDroplet
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.servlet.ParameterServlet, java.util.EventListener, javax.servlet.Servlet

@Service(requiredProperties={"siteGroupManager","storeSitePropertiesManager"})
public class RecommendationAlternativeSiteIdsDroplet
extends atg.servlet.DynamoServlet

This droplet returns the list of alternative store IDs in the order of preference that will be used to lookup product link, price, etc. The first sites in the list will be sites from the same site sharing group as the current site, then the rest sites will go. The input parameters:

siteId (optional)
The site ID that should be used to look for the sites in the same sharing group or to compare site channels. If siteId is not provided the current site ID will be used.
shareableTypeId (optional)
The shareable type ID to use to look up for the sites in the same site sharing group. If not provided the shareable type ID configured in the corresponding component's property is used
excludeInputSite
If true input site will be excluded form the list of alternative site IDs.
includeActiveSites
If true only active sites will be returned.
inputSiteChannelOnly
If true only sites that have the same channel as the input site will be included into the result. Default is true
The output parameters for this droplet are:
output
This parameter is rendered once if a collection of sites is found.
sites
This parameter is set to the list of Site objects in the order of preference.

Version:
$Change: 788983 $$DateTime: 2013/02/07 14:16:38 $$Author: jsiddaga $
Author:
sshulman

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static atg.nucleus.naming.ParameterName EXCLUDE_INPUT_SITE
          ParameterName for excludeInputSite
static atg.nucleus.naming.ParameterName INCLUDE_ACTIVE_SITES
          ParameterName for includeActiveSites
static atg.nucleus.naming.ParameterName INPUT_SITE_CHANNEL_ONLY
          ParameterName for inputSiteChannelOnly
protected  boolean mExcludeInputSite
          ExcludeInputSite
protected  boolean mIncludeActiveSites
          IncludeActiveSites
protected  boolean mInputSiteChannelOnly
          InputSiteChannelOnly
protected  java.lang.String mShareableTypeId
          ShareableTypeId
protected  atg.multisite.SiteGroupManager mSiteGroupManager
          SiteGroupManager
static atg.nucleus.naming.ParameterName OUTPUT
          ParameterName for output
static atg.nucleus.naming.ParameterName SHAREABLE_TYPE_ID
          ParameterName for shareableTypeId
static atg.nucleus.naming.ParameterName SITE_ID
          ParameterName for siteId
static java.lang.String SITES_IDS_PROP_NAME
          Parameter name for site
 
Fields inherited from class atg.servlet.DynamoServlet
mAllowCleanupRequest, mParameters
 
Fields inherited from class atg.nucleus.servlet.ServletService
SERVLET_INFO_KEY
 
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
RecommendationAlternativeSiteIdsDroplet()
           
 
Method Summary
protected  void addSiteToList(atg.repository.RepositoryItem pSite, java.util.List<java.lang.String> pSitesList, java.lang.String pInputSiteId, boolean pExcludeInputSite, java.lang.String pInputSiteChannel, boolean pInputSiteChannelOnly)
          Adds site's ID to the list of sites.
 java.lang.String getShareableTypeId()
           
 atg.multisite.SiteGroupManager getSiteGroupManager()
          Returns the SiteGroupManager.
 StoreSitePropertiesManager getStoreSitePropertiesManager()
          Gets the StoreSitePropertiesManager bean which is used to manage store properties.
 boolean isExcludeInputSite()
           
 boolean isIncludeActiveSites()
          Returns the includeActiveSites parameter, determining whether only active sites should be retrieved
 boolean isInputSiteChannelOnly()
          Returns the InputSiteChannelOnly property, determining whether only sites with the same channel as the input site should be included.
 void service(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Services the output oparam if a the list of sites can be determined.
 void setExcludeInputSite(boolean pExcludeInputSite)
           
 void setIncludeActiveSites(boolean pIncludeActiveSites)
          Sets the includeActiveSites property, determining whether only active site should be retrieved
 void setInputSiteChannelOnly(boolean pInputSiteChannelOnly)
          Sets the InputSiteChannelOnly property, determining whether only sites with the same channel as the input site should be included.
 void setShareableTypeId(java.lang.String pShareableTypeId)
           
 void setSiteGroupManager(atg.multisite.SiteGroupManager pSiteGroupManager)
          Sets the SiteGroupManager
 void setStoreSitePropertiesManager(StoreSitePropertiesManager pStoreSitePropertiesManager)
          Sets the StoreSitePropertiesManager bean which is used to manage store properties.
 
Methods inherited from class atg.servlet.DynamoServlet
doDelete, doGet, doPost, doPut, getParameter, getParameters, getServletContext, init, service, service, setParameter
 
Methods inherited from class atg.nucleus.servlet.ServletService
destroy, getServletConfig, getServletInfo, setServletInfo
 
Methods inherited from class atg.nucleus.TimedOperationService
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
 
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


SITE_ID

public static final atg.nucleus.naming.ParameterName SITE_ID
ParameterName for siteId


SHAREABLE_TYPE_ID

public static final atg.nucleus.naming.ParameterName SHAREABLE_TYPE_ID
ParameterName for shareableTypeId


EXCLUDE_INPUT_SITE

public static final atg.nucleus.naming.ParameterName EXCLUDE_INPUT_SITE
ParameterName for excludeInputSite


INCLUDE_ACTIVE_SITES

public static final atg.nucleus.naming.ParameterName INCLUDE_ACTIVE_SITES
ParameterName for includeActiveSites


INPUT_SITE_CHANNEL_ONLY

public static final atg.nucleus.naming.ParameterName INPUT_SITE_CHANNEL_ONLY
ParameterName for inputSiteChannelOnly


OUTPUT

public static final atg.nucleus.naming.ParameterName OUTPUT
ParameterName for output


SITES_IDS_PROP_NAME

public static final java.lang.String SITES_IDS_PROP_NAME
Parameter name for site

See Also:
Constant Field Values

mSiteGroupManager

protected atg.multisite.SiteGroupManager mSiteGroupManager
SiteGroupManager


mShareableTypeId

protected java.lang.String mShareableTypeId
ShareableTypeId


mExcludeInputSite

protected boolean mExcludeInputSite
ExcludeInputSite


mIncludeActiveSites

protected boolean mIncludeActiveSites
IncludeActiveSites


mInputSiteChannelOnly

protected boolean mInputSiteChannelOnly
InputSiteChannelOnly

Constructor Detail

RecommendationAlternativeSiteIdsDroplet

public RecommendationAlternativeSiteIdsDroplet()
Method Detail

getSiteGroupManager

public atg.multisite.SiteGroupManager getSiteGroupManager()
Returns the SiteGroupManager.

Returns:
the siteGroupManager

setSiteGroupManager

public void setSiteGroupManager(atg.multisite.SiteGroupManager pSiteGroupManager)
Sets the SiteGroupManager

Parameters:
pSiteGroupManager - the siteGroupManager to set

getStoreSitePropertiesManager

public StoreSitePropertiesManager getStoreSitePropertiesManager()
Gets the StoreSitePropertiesManager bean which is used to manage store properties.

Returns:
The StoreSitePropertiesManager bean which is used to manage store properties.

setStoreSitePropertiesManager

public void setStoreSitePropertiesManager(StoreSitePropertiesManager pStoreSitePropertiesManager)
Sets the StoreSitePropertiesManager bean which is used to manage store properties.

Parameters:
StoreSitePropertiesManager - Set a new storeSitePropertyManager.

getShareableTypeId

public java.lang.String getShareableTypeId()
Returns:
the mShareableTypeId

setShareableTypeId

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

isExcludeInputSite

public boolean isExcludeInputSite()
Returns:
the excludeInputSite

setExcludeInputSite

public void setExcludeInputSite(boolean pExcludeInputSite)
Parameters:
pExcludeInputSite - the excludeInputSite to set

isIncludeActiveSites

public boolean isIncludeActiveSites()
Returns the includeActiveSites parameter, determining whether only active sites should be retrieved

The default value for this property is false.

Returns:
the includeActiveSites

setIncludeActiveSites

public void setIncludeActiveSites(boolean pIncludeActiveSites)
Sets the includeActiveSites property, determining whether only active site should be retrieved

The default value for this property is false.

Parameters:
pIncludeActiveSites - the includeActiveSites to set

isInputSiteChannelOnly

public boolean isInputSiteChannelOnly()
Returns the InputSiteChannelOnly property, determining whether only sites with the same channel as the input site should be included. E.g., if the input site is the mobile one then only sites with 'mobile' channel will be include.

The default value for this property is true.

Returns:
the InputSiteChannelOnly

setInputSiteChannelOnly

public void setInputSiteChannelOnly(boolean pInputSiteChannelOnly)
Sets the InputSiteChannelOnly property, determining whether only sites with the same channel as the input site should be included. E.g., if the input site is the mobile one then only sites with 'mobile' channel will be include.

The default value for this property is false.

Parameters:
pInputSiteChannelOnly - the InputSiteChannelOnly property to set

service

public void service(atg.servlet.DynamoHttpServletRequest pRequest,
                    atg.servlet.DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Services the output oparam if a the list of sites can be determined.

Overrides:
service in class atg.servlet.DynamoServlet
Parameters:
pRequest - The request
pResponse - The response
Throws:
javax.servlet.ServletException
java.io.IOException
See Also:
DynamoServlet.service(atg.servlet.DynamoHttpServletRequest, atg.servlet.DynamoHttpServletResponse), SiteGroupManager.findSharingSites(String, String, boolean, boolean)

addSiteToList

protected void addSiteToList(atg.repository.RepositoryItem pSite,
                             java.util.List<java.lang.String> pSitesList,
                             java.lang.String pInputSiteId,
                             boolean pExcludeInputSite,
                             java.lang.String pInputSiteChannel,
                             boolean pInputSiteChannelOnly)
Adds site's ID to the list of sites. Before adding the site the method checks whether the site conforms to all conditions. If pExcludeInputSite is true then input site will not be added. If pInputSiteChannel is true then only sites with the same channel will be added to the list.

Parameters:
pSite - The site repository item to add to the list
pSitesList - The list of sites to add to.
pInputSiteId - The droplet's input site.
pExcludeInputSite - The boolean indicating whether input site should be excluded.
pInputSiteChannel - The channel of the input site.
pInputSiteChannelOnly - The boolean indicating whether only site's with the same channel as the input site can be added to the list.