|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.repository.search.config.GenericDimensionService atg.repository.search.config.LanguageDimensionService
public class LanguageDimensionService
The language dimension service will expect the passed in value string to be a language string. The service will map the language to a locale and the locale of the customer request will then be checked against this to look for a match. Note that a partial match of locales is done rather than an exact match, e.g. if the customers locale is "en_US_WIN" and the language maps to the locale "en" then this will be a match however if the language maps to the locale "en_GB" then this is not a match. The mapping of language to locale is a property of the languageDimensionService.
atg.search.query.config.SearchDimension
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.repository.search.config.GenericDimensionService |
---|
mDimensionName, mDimensionValueKeyPrefix, mDimensionValuesLocalized, mDisabled, mDisplayNameKey, mDisplayNameLocalized, 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 | |
---|---|
LanguageDimensionService()
|
Method Summary | |
---|---|
boolean |
dimensionMatchesValue(DynamoHttpServletRequest pRequest,
java.lang.String pValue)
Checks the request locale against a passed in string locale for a match. |
boolean |
dimensionMatchesValue(RepositoryItem pProfile,
java.lang.String pTargetValue)
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. |
protected boolean |
doesLanguageMatchLocale(java.util.Locale pLocale,
java.lang.String pLanguage)
Utility method to check a language against a locale. |
void |
doStartService()
This is called after a Service has been created, placed into the naming hierarchy, and initialized with its configured property values. |
void |
doStopService()
This is called when a Service is required to shut down. |
java.lang.String |
getDefaultLocale()
|
java.lang.String |
getDimensionValueDisplayName(java.lang.String pDimensionValue)
Method to get a localised display name for a dimension value. |
java.util.List |
getDimensionValues()
Returns a list of string dimension values that are valid for this dimension. |
java.util.Map |
getLanguageLocaleMap()
Returns the map of language String to java.util.Locale objects. |
java.util.Map |
getLanguageMap()
|
java.lang.String |
getLocale(java.lang.String pLanguage)
Returns the locale string for the given language string. |
java.lang.String |
getLocaleDisplayName(java.lang.String pLocaleString)
Method to get a localised display name for a language of the locale string. |
java.util.Locale |
getLocaleFromProfile(RepositoryItem pProfile)
Method to retrieve Locale from user profile. |
java.util.List |
getLocales()
Returns the list of locales. |
java.lang.String |
getTestProfileLocaleProperty()
|
boolean |
isProfileBased()
|
void |
setDefaultLocale(java.lang.String pDefaultLocale)
|
void |
setDimensionValues(java.util.List pDimensionValues)
|
void |
setLanguageLocaleMap(java.util.Map pLanguageLocaleMap)
Sets the mapping of language String to java.util.Locale |
void |
setLanguageMap(java.util.Map pLanguageMap)
|
void |
setLocales(java.util.List pLocales)
|
void |
setTestProfileLocaleProperty(java.lang.String pTestProfileLocaleProperty)
|
protected boolean |
validateLocale(java.lang.String pLocale)
Validates the locale conforms to a java locale and has a language part. |
protected boolean |
validateLocales(java.util.List pLocales)
Validates the list of locale strings. |
protected boolean |
validateLocales(java.util.Map pMap)
Validates the map of language to locale strings. |
Methods inherited from class atg.repository.search.config.GenericDimensionService |
---|
getAllDimensionValues, getDimensionName, getDimensionValueKeyPrefix, getDimensionValuesLocalized, getDisplayName, getDisplayNameKey, getDisplayNameLocalized, getFormatter, isDisabled, setDimensionName, setDimensionValueKeyPrefix, setDimensionValuesLocalized, setDisabled, setDisplayNameKey, setDisplayNameLocalized, setFormatter |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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 |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public LanguageDimensionService()
Method Detail |
---|
public java.util.Map getLanguageMap()
public void setLanguageMap(java.util.Map pLanguageMap)
public java.util.List getLocales()
List
of localespublic void setLocales(java.util.List pLocales)
public java.lang.String getDefaultLocale()
public void setDefaultLocale(java.lang.String pDefaultLocale)
public java.lang.String getTestProfileLocaleProperty()
public void setTestProfileLocaleProperty(java.lang.String pTestProfileLocaleProperty)
public void doStartService() throws ServiceException
GenericService
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic void doStopService() throws ServiceException
GenericService
doStopService
in class GenericService
ServiceException
- if the Service had a problem shutting downpublic java.util.Map getLanguageLocaleMap()
public void setLanguageLocaleMap(java.util.Map pLanguageLocaleMap)
pLanguageLocaleMap
- Map of String language to Localepublic java.util.List getDimensionValues()
SearchDimension
Returns the language dimension values.
public java.lang.String getDimensionValueDisplayName(java.lang.String pDimensionValue)
getDimensionValueDisplayName
in interface SearchDimension
getDimensionValueDisplayName
in class GenericDimensionService
pDimensionValue
- String dimension value
java.util.MissingResourceException
- if resource can't be found.
java.lang.NullPointerException
- if locale or resource bundle name is null.public void setDimensionValues(java.util.List pDimensionValues)
public java.lang.String getLocale(java.lang.String pLanguage)
pLanguage
- language string to map to locale
public boolean dimensionMatchesValue(DynamoHttpServletRequest pRequest, java.lang.String pValue)
dimensionMatchesValue
in interface SearchDimension
dimensionMatchesValue
in class GenericDimensionService
pRequest
- DynamoHttpServletRequest.pValue
- locale string.
public boolean dimensionMatchesValue(java.lang.String pSourceValue, java.lang.String pTargetValue)
dimensionMatchesValue
in interface SearchDimension
dimensionMatchesValue
in class GenericDimensionService
pSourceValue
- String source value to checkpTargetValue
- String target value to check.
public boolean dimensionMatchesValue(RepositoryItem pProfile, java.lang.String pTargetValue)
GenericDimensionService
dimensionMatchesValue
in interface SearchDimension
dimensionMatchesValue
in class GenericDimensionService
pProfile
- RepositoryItem profile to usepTargetValue
- String vlaue to check.
public java.util.Locale getLocaleFromProfile(RepositoryItem pProfile)
pProfile
- RepositoryItem profile to use
public java.lang.String getLocaleDisplayName(java.lang.String pLocaleString)
pLocaleString
- String locale
java.lang.NullPointerException
- if locale or resource bundle name is null.public boolean isProfileBased()
protected boolean doesLanguageMatchLocale(java.util.Locale pLocale, java.lang.String pLanguage)
pLocale
- Locale to checkpLanguage
- String language to check
protected boolean validateLocales(java.util.List pLocales)
pLocales
- List of String locale, e.g. "en_US"
protected boolean validateLocales(java.util.Map pMap)
pMap
- Map of String language to String locale, e.g. "english=en_US"
protected boolean validateLocale(java.lang.String pLocale)
pLocale
- String locale, e.g. "en_US"
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |