public class CatalogMapPropertyDerivation extends CatalogMapDerivation
<property name="parentCategory">
<derivation user-method="atg.commerce.dp.CatalogMapDerivation">
<expression>productInfos</expression>
</derivation>
</property>
In this example, parentCategory would be returned from the productInfo in the map
"productInfos" that is mapped to by the current session scoped profile.catalog.
If this is accessed outside the scope of a session, or there is no catalog, this
will return null. The property that is return from the component object of the
expression will have the same name as the derived property. In the above example,
this means that productInfos.someKey.parentCategory would be returned.
Created: Tue Apr 03 15:36:03 2001Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected static java.lang.String |
DERIVATION_NAME |
protected static java.lang.String |
DISPLAY_NAME |
protected static java.lang.String |
SHORT_DESCRIPTION |
CATALOG_KEY_PROPERTY, MAP_TYPE_NAME, PROFILE_CATALOG_PROPERTY
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 |
---|
CatalogMapPropertyDerivation() |
Modifier and Type | Method and Description |
---|---|
Query |
createIsNullQuery(QueryBuilder pBuilder,
atg.repository.query.PropertyQueryExpression pParentProperty,
java.util.List pChildPropertyList)
Create a query to check if our derived property is null.
|
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)
Do the real work of implementing a query to find the correct map
value.
|
java.lang.Object |
derivePropertyValue(java.lang.Object pBean)
Determine the specified derived property value.
|
java.lang.Object |
derivePropertyValue(RepositoryItemImpl pItem)
Determine the specified derived property value.
|
atg.repository.dp.Expression |
getPropertyOrigin(RepositoryItemImpl pItem)
Determine from where the specified property value is derived, if
applicable.
|
protected java.lang.String |
getPropertyToDerive() |
boolean |
isQueryable()
Determine whether the specified property can be used in a query.
|
java.util.List |
validate()
Validate the derivation.
|
getCatalog, getKey, getProfile
createComparisonQuery, createExpression, createIncludesAllQuery, createIncludesAnyQuery, createIncludesItemQuery, createIncludesQuery, createIsEmptyQuery, createIsNotEmptyQuery, createPatternMatchQuery, createQuery, createReferencedByQuery, createTextSearchQuery, getAllowNoExpressions, getDerivation, getFeatureDescriptor, getOtherUnderlyingExpressions, getPropertyDescriptor, getPropertyOrigin, getPropertyOrigin, getPropertyOrigin, getSupportsOverrideExpression, isEmpty, isWritable, rebuildExpression, setDerivation, setFrom, setPropertyDescriptor, setPropertyValue, setPropertyValue, 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 DISPLAY_NAME
protected static final java.lang.String SHORT_DESCRIPTION
public java.util.List validate()
validate
in interface atg.repository.dp.DerivationMethod
validate
in class CatalogMapDerivation
public java.lang.Object derivePropertyValue(RepositoryItemImpl pItem) throws RepositoryException
derivePropertyValue
in interface atg.repository.dp.DerivationMethod
derivePropertyValue
in class CatalogMapDerivation
pItem
- the item whose property value is desiredPropertyNotFoundException
- if a property referenced in this
expression could not be found in the specified beanRepositoryException
public java.lang.Object derivePropertyValue(java.lang.Object pBean) throws RepositoryException
derivePropertyValue
in interface atg.repository.dp.DerivationMethod
derivePropertyValue
in class CatalogMapDerivation
pBean
- the bean representing a repository item whose property
value is desiredPropertyNotFoundException
- if a property referenced in this
expression could not be found in the specified beanRepositoryException
public atg.repository.dp.Expression getPropertyOrigin(RepositoryItemImpl pItem) throws RepositoryException
getPropertyOrigin
in interface atg.repository.dp.DerivationMethod
getPropertyOrigin
in class CatalogMapDerivation
pItem
- the item whose property value origin is desiredRepositoryException
public boolean isQueryable()
isQueryable
in interface atg.repository.dp.DerivationMethod
isQueryable
in class CatalogMapDerivation
protected java.lang.String getPropertyToDerive() throws RepositoryException
RepositoryException
public Query createIsNullQuery(QueryBuilder pBuilder, atg.repository.query.PropertyQueryExpression pParentProperty, java.util.List pChildPropertyList) throws RepositoryException
createIsNullQuery
in interface atg.repository.dp.DerivationMethod
createIsNullQuery
in class CatalogMapDerivation
pBuilder
- query builder to usepParentProperty
- the parent of the derived property, if the
derived property is not a direct child of the Item being queried.pChildPropertyList
- a list of the children of the derived
property, if the derived property is not the last expression
in the query.RepositoryException
- if there is problem building the queryprotected 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
All of the QueryExpression arguments to this method were created by pBuilder and thus can be used as is without being translated.
createQuery
in class CatalogMapDerivation
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 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 usepParentProperty
- the parent of the derived property, if the
derived property is not a direct child of the Item being queried.pChildPropertyList
- a list of the children of the derived
property, if the derived property is not the last expression
in the query.RepositoryException
- if there is problem building the query