atg.repository.search.config
Class GenericDimensionService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.repository.search.config.GenericDimensionService
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, SearchDimension, java.util.EventListener
Direct Known Subclasses:
LanguageDimensionService, RepositoryGroupDimensionService

public abstract class GenericDimensionService
extends GenericService
implements SearchDimension

Abstract base class to implement a dimension service. Provides the functionality to look up a resource bundle to get localised names for dimension values and for this dimension.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.lang.String mDimensionName
           
protected  java.lang.String mDimensionValueKeyPrefix
           
protected  boolean mDimensionValuesLocalized
           
protected  boolean mDisabled
           
protected  java.lang.String mDisplayNameKey
           
protected  boolean mDisplayNameLocalized
           
protected  atg.core.i18n.MultiBundleFormatter mFormatter
           
 
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
GenericDimensionService()
           
 
Method Summary
 boolean dimensionMatchesValue(DynamoHttpServletRequest pRequest, java.lang.String pValue)
          Checks whether or not a value matches this service.
 boolean dimensionMatchesValue(RepositoryItem pProfile, java.lang.String pValue)
          Checks whether or not a value extracted from the given profile matches the given value.
 boolean dimensionMatchesValue(java.lang.String pSourceValue, java.lang.String pTargetValue)
          Checks whether or not a given source value matches the given target value.
 java.util.List getAllDimensionValues()
          Returns list of dimension values + additional special element null.
 java.lang.String getDimensionName()
          Gets the string name of this dimension, e.g.
 java.lang.String getDimensionValueDisplayName(java.lang.String pDimensionValue)
          Method to get a localised display name for a dimension value.
 java.lang.String getDimensionValueKeyPrefix()
           
 boolean getDimensionValuesLocalized()
           
 java.lang.String getDisplayName()
          Method to get a localised display name for this dimension.
 java.lang.String getDisplayNameKey()
           
 boolean getDisplayNameLocalized()
           
 atg.core.i18n.MultiBundleFormatter getFormatter()
           
 boolean isDisabled()
           
 void setDimensionName(java.lang.String pDimensionName)
           
 void setDimensionValueKeyPrefix(java.lang.String pDimensionValueKeyPrefix)
           
 void setDimensionValuesLocalized(boolean pDimensionValuesLocalized)
           
 void setDisabled(boolean pDisabled)
           
 void setDisplayNameKey(java.lang.String pDisplayNameKey)
           
 void setDisplayNameLocalized(boolean pDisplayNameLocalized)
           
 void setFormatter(atg.core.i18n.MultiBundleFormatter pFormatter)
           
 
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
 
Methods inherited from interface atg.repository.search.config.SearchDimension
getDimensionValues, isProfileBased
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mDimensionName

protected java.lang.String mDimensionName

mFormatter

protected atg.core.i18n.MultiBundleFormatter mFormatter

mDimensionValueKeyPrefix

protected java.lang.String mDimensionValueKeyPrefix

mDisplayNameKey

protected java.lang.String mDisplayNameKey

mDisplayNameLocalized

protected boolean mDisplayNameLocalized

mDimensionValuesLocalized

protected boolean mDimensionValuesLocalized

mDisabled

protected boolean mDisabled
Constructor Detail

GenericDimensionService

public GenericDimensionService()
Method Detail

getDimensionName

public java.lang.String getDimensionName()
Description copied from interface: SearchDimension
Gets the string name of this dimension, e.g. "language" or "segment".

Specified by:
getDimensionName in interface SearchDimension
Returns:
String name of this dimension.

setDimensionName

public void setDimensionName(java.lang.String pDimensionName)

getFormatter

public atg.core.i18n.MultiBundleFormatter getFormatter()

setFormatter

public void setFormatter(atg.core.i18n.MultiBundleFormatter pFormatter)

getDimensionValueKeyPrefix

public java.lang.String getDimensionValueKeyPrefix()

setDimensionValueKeyPrefix

public void setDimensionValueKeyPrefix(java.lang.String pDimensionValueKeyPrefix)

getDisplayNameKey

public java.lang.String getDisplayNameKey()

setDisplayNameKey

public void setDisplayNameKey(java.lang.String pDisplayNameKey)

getDisplayNameLocalized

public boolean getDisplayNameLocalized()

setDisplayNameLocalized

public void setDisplayNameLocalized(boolean pDisplayNameLocalized)

getDimensionValuesLocalized

public boolean getDimensionValuesLocalized()

setDimensionValuesLocalized

public void setDimensionValuesLocalized(boolean pDimensionValuesLocalized)

isDisabled

public boolean isDisabled()
Specified by:
isDisabled in interface SearchDimension
Returns:
true if this dimension is disabled

setDisabled

public void setDisabled(boolean pDisabled)

getDisplayName

public java.lang.String getDisplayName()
Method to get a localised display name for this dimension. Looks up a resource bundle using the as the key. If null then the key is: .

Specified by:
getDisplayName in interface SearchDimension
Returns:
String display name for this dimension
Throws:
java.util.MissingResourceException - if resource can't be found.
java.lang.NullPointerException - if locale or resource bundle name is null.

getDimensionValueDisplayName

public java.lang.String getDimensionValueDisplayName(java.lang.String pDimensionValue)
Method to get a localised display name for a dimension value. Looks up a resource bundle using a key with the format: ...

Specified by:
getDimensionValueDisplayName in interface SearchDimension
Parameters:
pDimensionValue - String dimension value
Returns:
String display name for the passed in dimension value
Throws:
java.util.MissingResourceException - if resource can't be found.
java.lang.NullPointerException - if locale or resource bundle name is null.

dimensionMatchesValue

public boolean dimensionMatchesValue(java.lang.String pSourceValue,
                                     java.lang.String pTargetValue)
Checks whether or not a given source value matches the given target value. Default implementation just matches source and target strings ignoring case.

Specified by:
dimensionMatchesValue in interface SearchDimension
Parameters:
pSourceValue - String source value to check
pTargetValue - String target value to check.
Returns:
true if pSourceValue matches pTargetValue for this dimension

dimensionMatchesValue

public boolean dimensionMatchesValue(DynamoHttpServletRequest pRequest,
                                     java.lang.String pValue)
Checks whether or not a value matches this service. Default implementation only returns true for the 'All others' case.

Specified by:
dimensionMatchesValue in interface SearchDimension
Parameters:
pRequest - is the current customer DynamoHttpServletRequest request.
pValue - is the dimensionValue property of the item being checked.
Returns:
true if pValue is matched with appropriate value from pRequest.

dimensionMatchesValue

public boolean dimensionMatchesValue(RepositoryItem pProfile,
                                     java.lang.String pValue)
Checks whether or not a value extracted from the given profile matches the given value. Default implementation only returns true for the 'All others' case.

Specified by:
dimensionMatchesValue in interface SearchDimension
Parameters:
pProfile - RepositoryItem profile to use
pValue - String vlaue to check.
Returns:
true if pValue matches the dimension value extracted from pProfile

getAllDimensionValues

public java.util.List getAllDimensionValues()
Returns list of dimension values + additional special element null. Used for special cases such "All other" dimension value. See bug156416

Specified by:
getAllDimensionValues in interface SearchDimension
Returns:
List of String dimension values.