public class InventoryLevelDerivation
extends atg.repository.dp.DerivationMethodImpl
atg.commerce.inventory.InventoryManagerInventoryManager
is obtained from a value in the expression list. Because the property
is dervied via logic (querying an inventory manager), it is impossible
to query based upon this property. This property can only be
accessed for read-only information.
An example of how this method property might be used is as follows: <property name="inventoryLevel"> <derivation method="InventoryLevel"> <expression>catalogRefId</expression> </derivation> </property>
This configuration assumes that the repository item on
which this property is configured has a property named catalogRefId
. That String value of the catalogRefId property is obtained
and is used to query the inventory system. This information can then
be used in a variety of ways:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
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_PROP_COLLECTION_TYPE, ERR_SET_NOT_WRITABLE, PROPERTY_SEPARATOR, RECURSION_DEPTH_ATTR_NAME, RESOURCE_BUNDLE_NAME, TAG_DERIVATION, TAG_EXPRESSION
Constructor and Description |
---|
InventoryLevelDerivation()
Set the name, display name and short description properties.
|
Modifier and Type | Method and Description |
---|---|
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 creating a query.
|
java.lang.Object |
derivePropertyValue(java.lang.Object pBean)
This method is not supported.
|
java.lang.Object |
derivePropertyValue(RepositoryItemImpl pItem)
This method will return the inventory level associated
with the passed in
catalogRefId . |
protected java.lang.String |
getCatalogRefId(java.util.List pList,
RepositoryItemImpl pItem)
Given a list of
PropertyExpression
objects, return the catalogRefId. |
InventoryManager |
getInventoryManager()
Return the inventoryManager property.
|
atg.repository.dp.Expression |
getPropertyOrigin(RepositoryItemImpl pItem)
Determine from where the specified property value is derived, if
applicable.
|
boolean |
isQueryable()
Because this property derives its value from a InventoryManager
service, it is impossible to query on it.
|
boolean |
isThrowExceptionOnInventoryException()
Return the throwExceptionOnInventoryException property.
|
void |
setThrowExceptionOnInventoryException(boolean pThrowExceptionOnInventoryException)
Set the throwExceptionOnInventoryException property.
|
java.util.List |
validate()
Validate the derivation.
|
createComparisonQuery, createExpression, createIncludesAllQuery, createIncludesAnyQuery, createIncludesItemQuery, createIncludesQuery, createIsNullQuery, createPatternMatchQuery, createQuery, createReferencedByQuery, createTextSearchQuery, getAllowNoExpressions, getDerivation, getFeatureDescriptor, getOtherUnderlyingExpressions, getPropertyDescriptor, getPropertyOrigin, getPropertyOrigin, getPropertyOrigin, isEmpty, isWritable, rebuildExpression, setDerivation, setFrom, setPropertyDescriptor, setPropertyValue, setPropertyValue, wrap
copyFeatureDescriptor, getDisplayName, getDisplayNameResource, getDisplaySortString, getLocalizedResourceBundle, getResourceBundle, getShortDescription, getShortDescriptionResource, getSortString, setDisplayNameResource, setShortDescriptionResource, toString
public static final java.lang.String CLASS_VERSION
public InventoryLevelDerivation()
class
.public InventoryManager getInventoryManager()
public boolean isThrowExceptionOnInventoryException()
public void setThrowExceptionOnInventoryException(boolean pThrowExceptionOnInventoryException)
pThrowExceptionOnInventoryException
- public atg.repository.dp.Expression getPropertyOrigin(RepositoryItemImpl pItem)
getPropertyOrigin
in interface atg.repository.dp.DerivationMethod
getPropertyOrigin
in class atg.repository.dp.DerivationMethodImpl
pItem
- the item whose property value origin is desiredpublic java.util.List validate()
false
for the question isMultiValued
Only the first <Element> is checked for its multivalue status
since this implementation only extracts the catalogRefId
value from the first <Element> in the list.validate
in interface atg.repository.dp.DerivationMethod
validate
in class atg.repository.dp.DerivationMethodImpl
protected java.lang.String getCatalogRefId(java.util.List pList, RepositoryItemImpl pItem) throws RepositoryException
PropertyExpressionPropertyExpression
objects, return the catalogRefId.
This implementation will return the String value of the first object extracted from the list. This means that the repository definition file is expected to define a single <Express> tag that can evaluate to a catalogRefId.
pList
- a list of PropertyExpression elementspList
RepositoryException
- if error evaluating PropertyExpressionpublic java.lang.Object derivePropertyValue(RepositoryItemImpl pItem) throws RepositoryException
catalogRefId
. This
catalogRefId
is obtained from the
one of the PropertyExpressions in the PropertyExpression
list. This means that if an item-desciptor has a property
named catalogRefId
which refers to the catalogRefId
we would configure this derivation method in our repository
configuration file to look like pItem
- a RepositoryItemImpl
valueObject
valueRepositoryException
public java.lang.Object derivePropertyValue(java.lang.Object pBean) throws RepositoryException
derivePropertyValue
method that
uses a RepositoryItemImpl, or that is called server side.pBean
- an Object
value to be computedObject
valueRepositoryException
- if an error occurspublic boolean isQueryable()
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
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