atg.repository.search.refinement
Class FacetTrailDroplet

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.repository.search.refinement.FacetTrailDroplet
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, ParameterServlet, java.util.EventListener, javax.servlet.Servlet
Direct Known Subclasses:
CommerceFacetTrailDroplet

public class FacetTrailDroplet
extends DynamoServlet

Droplet class that provides a means of creating a FacetTrail bean object.

The droplet uses request parameters or url query parameters to create facet trail elements. Facet trail elements consist of the FacetValue objects and the current sort option. The parameters provided to the droplet may also add or remove facets from the trail.

If a parameter isn't specifically set then the droplet will check for it as a query parameter in the http request. Only the 'trail' parameter is mandatory and must either be set as a droplet parameter or else be present in the http request as a query parameter.

The query parameter names are configurable through the droplet's properties file however the droplet input parameter names are fixed.

Facet / Facet Value pairs are specified in a parameter string with a configurable separator (defaults to ':').

Here's an example. Here the user has selected facets for a 32" LCD Television costing $200-$300. In addition the user has just clicked to add a Panasonic brand facet value.

trail=1:cat444323:1:cat33222:2:200-300:45:32
addFacet=32:Panasonic

This example presumes the following refinement elements:
1 = Category.
2 = Price.
45 = Screen Size.
32 = Brand.
And the following categories exist:
cat444323 = Televisions.
cat33222 = LCD Televisions.

Here are the input parameters (These can also be passed as http request query parameters):

trail(Mandatory) String trail of facet/facet value pairs.
refineConfigThe refineConfig repository item to use for querying ES for this trail.
addFacetString facet/facet value pairs to add to the trail.
removeFacetString facet/facet value pairs to remove from the trail.
removeAllFacetsIf set to "true" then the trail is cleared.
removeFacetTypeA refinement element repository item id that causes the removal of all facet values with this facet.

There are 2 output parameters:

facetTrailFacetTrail bean generated from the parameters.
errorMessageString error message if an error occurs creating the FacetTrail bean.

There are 2 open parameters:

outputServiced if there are no problems creating the FacetTrail bean.
errorServiced for any errors creating the FacetTrail bean.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static ParameterName S_ADD_FACET
           
static ParameterName S_ERROR
           
static java.lang.String S_ERROR_MESSAGE
           
static java.lang.String S_FACET_TRAIL
           
static ParameterName S_OUTPUT
           
static ParameterName S_REFINE_CONFIG
           
static ParameterName S_REMOVE_ALL_FACETS
           
static ParameterName S_REMOVE_FACET
           
static ParameterName S_REMOVE_FACET_TYPE
           
static ParameterName S_TRAIL
           
 
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
FacetTrailDroplet()
           
 
Method Summary
protected  java.lang.String getAddFacet(DynamoHttpServletRequest pRequest)
           
 FacetTrailTools getFacetTrailTools()
           
protected  RefinementConfiguration getRefinementConfiguration(DynamoHttpServletRequest pRequest, FacetTrailTools.FacetTrailElements pFacetTrailElements)
           
protected  java.lang.String getRemoveAllFacets(DynamoHttpServletRequest pRequest)
           
protected  java.lang.String getRemoveFacet(DynamoHttpServletRequest pRequest)
           
protected  java.lang.String getRemoveFacetType(DynamoHttpServletRequest pRequest)
           
protected  java.lang.String getSortBy(DynamoHttpServletRequest pRequest)
           
protected  java.lang.String getTrail(DynamoHttpServletRequest pRequest)
           
 void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
          This method provides the default implementation of service, by dispatching to conventionally named methods which begin with "do".
 void setFacetTrailTools(FacetTrailTools pFacetTrailTools)
           
 
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


S_TRAIL

public static final ParameterName S_TRAIL

S_REFINE_CONFIG

public static final ParameterName S_REFINE_CONFIG

S_ADD_FACET

public static final ParameterName S_ADD_FACET

S_REMOVE_FACET

public static final ParameterName S_REMOVE_FACET

S_REMOVE_ALL_FACETS

public static final ParameterName S_REMOVE_ALL_FACETS

S_REMOVE_FACET_TYPE

public static final ParameterName S_REMOVE_FACET_TYPE

S_ERROR_MESSAGE

public static final java.lang.String S_ERROR_MESSAGE
See Also:
Constant Field Values

S_FACET_TRAIL

public static final java.lang.String S_FACET_TRAIL
See Also:
Constant Field Values

S_OUTPUT

public static final ParameterName S_OUTPUT

S_ERROR

public static final ParameterName S_ERROR
Constructor Detail

FacetTrailDroplet

public FacetTrailDroplet()
Method Detail

setFacetTrailTools

public void setFacetTrailTools(FacetTrailTools pFacetTrailTools)

getFacetTrailTools

public FacetTrailTools getFacetTrailTools()

service

public void service(DynamoHttpServletRequest pRequest,
                    DynamoHttpServletResponse pResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Description copied from class: DynamoServlet
This method provides the default implementation of service, by dispatching to conventionally named methods which begin with "do".

Overrides:
service in class DynamoServlet
Parameters:
pRequest - the request to be processed
pResponse - the response object for this request
Throws:
javax.servlet.ServletException - if an error occurred while processing the servlet request
java.io.IOException - if an error occurred while reading or writing the servlet request
See Also:
Generates a FacetTrail object instance as its output by converting request parameters.

getTrail

protected java.lang.String getTrail(DynamoHttpServletRequest pRequest)

getSortBy

protected java.lang.String getSortBy(DynamoHttpServletRequest pRequest)

getAddFacet

protected java.lang.String getAddFacet(DynamoHttpServletRequest pRequest)

getRemoveFacet

protected java.lang.String getRemoveFacet(DynamoHttpServletRequest pRequest)

getRemoveAllFacets

protected java.lang.String getRemoveAllFacets(DynamoHttpServletRequest pRequest)

getRemoveFacetType

protected java.lang.String getRemoveFacetType(DynamoHttpServletRequest pRequest)

getRefinementConfiguration

protected RefinementConfiguration getRefinementConfiguration(DynamoHttpServletRequest pRequest,
                                                             FacetTrailTools.FacetTrailElements pFacetTrailElements)
                                                      throws atg.repository.search.refinement.FacetException
Throws:
atg.repository.search.refinement.FacetException