public class LanguageTranslation
extends atg.repository.dp.DerivationMethodImpl
RepositoryPropertyDescriptor
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
protected static java.lang.String |
DEFAULT_LOCALE
The name of the property holding the default locale.
|
protected static java.lang.String |
DEFAULT_PROPERTY
The name of the property whose value to return if no locale specific
translation is found.
|
static java.lang.String |
DEFAULT_TRANSLATIONS_PROPERTY_NAME
The name of the property that holds the translations.
|
protected static java.lang.String |
DERIVATION_NAME
The name of this derivation.
|
protected static java.lang.String |
KEY_SERVICE_PATH
The nucleus path to the LocaleService.
|
COMPARISON_QUERY, INCLUDES_ALL_QUERY, INCLUDES_ANY_QUERY, INCLUDES_ITEM_QUERY, INCLUDES_QUERY, IS_NULL_QUERY, PATTERN_MATCH_QUERY, sZero, TEXT_SEARCH_QUERY
BUNDLE_ATTRIBUTE_NAME, LOCALE_ATTRIBUTE_NAME
ATTR_METHOD, ATTR_OVERRIDE_PROPERTY, ATTR_USER_METHOD, DEFAULT_METHOD_NAME, DEFAULT_RECURSION_DEPTH, DP_COUNT_ATTR_NAME, ERR_BAD_ENUMERATION_TYPE, ERR_COLLECTION_EXPRESSION_TYPE, ERR_COLLECTION_ITEM_TYPE, ERR_DP_EXP_NOT_ARRAY, ERR_DP_EXP_NOT_COLLECTION, ERR_DP_EXP_NOT_MAP, ERR_DP_EXP_NOT_SET_LIST, ERR_DP_EXP_NOT_SET_LIST_MAP, ERR_DP_EXP_REFERENCES_DP, ERR_DP_EXP_TYPE_MISMATCH, ERR_DP_NOT_SET_LIST_MAP, ERR_DP_QUERYABLE_OP_NOT, ERR_DP_READABLE_OP_NOT, ERR_DP_WRITABLE_OP_NOT, ERR_DP_WRITABLE_WITH_NULL_OP, ERR_EMPTY_EXPRESSION, ERR_EXACTLY_ONE_EXPRESSION, ERR_INCOMPATIBLE_DP_EXP, ERR_INCOMPATIBLE_OP, ERR_INVALID_OVERRIDE_PROPERTY_NAME, ERR_INVALID_PROPERTY, ERR_METHOD_AND_USER_METHOD, ERR_MISSING_DERIVATION, ERR_NO_ATTRIBUTE, ERR_NO_DP, ERR_NO_EXP, ERR_NO_EXPRESSION, ERR_NO_METHOD, ERR_NO_PROPERTY_FOR_LOCALE, ERR_NO_PROPERTY_TYPE, ERR_NO_SET_LIST, ERR_NULL_ITEM_DESCRIPTOR, ERR_OP_SAME_AS_DP, ERR_OVERRIDE_NOT_SUPPORTED, ERR_PROP_COLLECTION_TYPE, ERR_SET_NOT_WRITABLE, PROPERTY_SEPARATOR, RECURSION_DEPTH_ATTR_NAME, RESOURCE_BUNDLE_NAME, TAG_DERIVATION, TAG_EXPRESSION
Constructor and Description |
---|
LanguageTranslation() |
Modifier and Type | Method and Description |
---|---|
protected Query |
constructQuery(int pQueryType,
boolean pDerivedPropertyOnLeft,
boolean pCountDerivedProperty,
QueryExpression pPropertyExpression,
QueryExpression pOther,
int pOperator,
boolean pIgnoreCase,
QueryExpression pMinScore,
QueryExpression pSearchStringFormat,
Query pItemQuery,
QueryBuilder pBuilder)
Constructs the query itself using given query expressions and based on the query type.
|
protected Query |
createQuery(int pQueryType,
boolean pDerivedPropertyOnLeft,
boolean pCountDerivedProperty,
QueryExpression pOther,
int pOperator,
boolean pIgnoreCase,
QueryExpression pMinScore,
QueryExpression pSearchStringFormat,
Query pItemQuery,
QueryBuilder pBuilder,
atg.repository.query.PropertyQueryExpression pParentProperty,
java.util.List pChildPropertyList)
Create a query for this derivation.
|
protected Query |
createTranslationsSubQueryForLocale(java.lang.String pLocale,
int pQueryType,
boolean pDerivedPropertyOnLeft,
boolean pCountDerivedProperty,
QueryExpression pOther,
int pOperator,
boolean pIgnoreCase,
QueryExpression pMinScore,
QueryExpression pSearchStringFormat,
Query pItemQuery,
QueryBuilder pBuilder)
Builds query that checks translation items for a specified locale.
|
java.lang.Object |
derivePropertyValue(java.lang.Object pItem)
Determine the derived property value.
|
java.lang.Object |
derivePropertyValue(RepositoryItemImpl pItem)
Determine the derived property value.
|
java.lang.String |
getDefaultLocale() |
java.lang.String |
getDefaultProperty() |
atg.repository.dp.RepositoryKeyService |
getKeyService()
Returns a locale key service for derived properties.
|
java.util.List |
getOtherUnderlyingExpressions()
Return any property expressions that will be used by this derivation
method and which are not already in the standard expression list.
|
RepositoryPropertyDescriptor |
getTranslationPropertyDescriptor()
Return a property descriptor for the equivalent property in the translations items
|
java.lang.String |
getTranslationsPropertyName()
If this property is null, return DEFAULT_TRANSLATIONS_PROPERTY_NAME.
|
boolean |
isQueryable()
The derivation is queryable, so always return true.
|
void |
setDefaultLocale(java.lang.String pDefaultLocale) |
void |
setDefaultProperty(java.lang.String pDefaultProperty) |
void |
setTranslationsPropertyName(java.lang.String pTranslationsPropertyName) |
void |
setValue(java.lang.String pAttributeName,
java.lang.Object pValue)
This operation sets the attribute values.
|
createComparisonQuery, createExpression, createIncludesAllQuery, createIncludesAnyQuery, createIncludesItemQuery, createIncludesQuery, createIsEmptyQuery, createIsNotEmptyQuery, createIsNullQuery, createPatternMatchQuery, createQuery, createReferencedByQuery, createTextSearchQuery, getAllowNoExpressions, getDerivation, getFeatureDescriptor, getPropertyDescriptor, getPropertyOrigin, getPropertyOrigin, getPropertyOrigin, getPropertyOrigin, getSupportsOverrideExpression, isEmpty, isWritable, rebuildExpression, setDerivation, setFrom, setPropertyDescriptor, setPropertyValue, setPropertyValue, validate, wrap
copyFeatureDescriptor, getCurrentLocale, getDisplayName, getDisplayName, getDisplayNameResource, getDisplaySortString, getLocalizedDisplayName, getLocalizedResourceBundle, getLocalizedResourceBundle, getResourceBundle, getShortDescription, getShortDescriptionResource, getSortString, setDisplayNameResource, setShortDescriptionResource, toString
public static java.lang.String CLASS_VERSION
protected static final java.lang.String DERIVATION_NAME
protected static final java.lang.String DEFAULT_LOCALE
protected static final java.lang.String DEFAULT_PROPERTY
protected static final java.lang.String KEY_SERVICE_PATH
public static final java.lang.String DEFAULT_TRANSLATIONS_PROPERTY_NAME
public java.lang.String getDefaultLocale()
public void setDefaultLocale(java.lang.String pDefaultLocale)
pDefaultLocale
- The default locale to use if a translation is
not found for the request localepublic java.lang.String getDefaultProperty()
public void setDefaultProperty(java.lang.String pDefaultProperty)
pDefaultProperty
- The name of the property whose
value to return if no translation is foundpublic java.lang.String getTranslationsPropertyName()
public void setTranslationsPropertyName(java.lang.String pTranslationsPropertyName)
pTranslationsPropertyName
- The translations property name that
will override DEFAULT_TRANSLATIONS_PROPERTY_NAME.public atg.repository.dp.RepositoryKeyService getKeyService()
public void setValue(java.lang.String pAttributeName, java.lang.Object pValue)
setValue
in class java.beans.FeatureDescriptor
pAttributeName
- Name of the attribute.pValue
- Value to be set to the attribute.protected Query createQuery(int pQueryType, boolean pDerivedPropertyOnLeft, boolean pCountDerivedProperty, QueryExpression pOther, int pOperator, boolean pIgnoreCase, QueryExpression pMinScore, QueryExpression pSearchStringFormat, Query pItemQuery, QueryBuilder pBuilder, atg.repository.query.PropertyQueryExpression pParentProperty, java.util.List pChildPropertyList) throws RepositoryException
createQuery
in class atg.repository.dp.DerivationMethodImpl
RepositoryException
protected Query createTranslationsSubQueryForLocale(java.lang.String pLocale, int pQueryType, boolean pDerivedPropertyOnLeft, boolean pCountDerivedProperty, QueryExpression pOther, int pOperator, boolean pIgnoreCase, QueryExpression pMinScore, QueryExpression pSearchStringFormat, Query pItemQuery, QueryBuilder pBuilder) throws RepositoryException
pLocale
- locale key to retrieve corresponding translationpQueryType
- the type of the original querypDerivedPropertyOnLeft
- if true
the derived property
is used as the left hand side in the query and pOtherExpression is
used as the right hand side. If false
the derived property
is used as the right hand side and pOtherExpression is used as the left
hand side.pCountDerivedProperty
- if true
the derived property
is used in a count query expressionpOther
- the other expression involved in binary queriespOperator
- the binary operator involved in binary queriespIgnoreCase
- whether to ignore case in pattern match queriespMinScore
- min score for text queriespSearchStringFormat
- search string format for text queriespItemQuery
- query to use in includes item queries onlypBuilder
- query builder to useRepositoryException
- Should an issue happen creating the query.protected Query constructQuery(int pQueryType, boolean pDerivedPropertyOnLeft, boolean pCountDerivedProperty, QueryExpression pPropertyExpression, QueryExpression pOther, int pOperator, boolean pIgnoreCase, QueryExpression pMinScore, QueryExpression pSearchStringFormat, Query pItemQuery, QueryBuilder pBuilder) throws RepositoryException
pQueryType
- the type of the original querypDerivedPropertyOnLeft
- if true
the derived property
is used as the left hand side in the query and pOtherExpression is
used as the right hand side. If false
the derived property
is used as the right hand side and pOtherExpression is used as the left
hand side.pCountDerivedProperty
- if true
the derived property
is used in a count query expressionpPropertyExpression
- the first expression involved in binary queriespOther
- the other expression involved in binary queriespOperator
- the binary operator involved in binary queriespIgnoreCase
- whether to ignore case in pattern match queriespMinScore
- min score for text queriespSearchStringFormat
- search string format for text queriespItemQuery
- query to use in includes item queries onlypBuilder
- query builder to useRepositoryException
- Should an issue happen creating the query.public java.lang.Object derivePropertyValue(RepositoryItemImpl pItem) throws RepositoryException
pItem
- the item whose property value is desired.RepositoryException
public java.lang.Object derivePropertyValue(java.lang.Object pItem) throws RepositoryException
pItem
- the item whose property value is desired.RepositoryException
public boolean isQueryable()
public java.util.List getOtherUnderlyingExpressions()
getOtherUnderlyingExpressions
in class atg.repository.dp.DerivationMethodImpl
public RepositoryPropertyDescriptor getTranslationPropertyDescriptor()