|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.beans.FeatureDescriptor atg.beans.SerializableFeatureDescriptor atg.repository.dp.DerivationMethodImpl atg.commerce.dp.InventoryLevelDerivation
public class InventoryLevelDerivation
This derivation method is used to obtain inventory information for
a specified catalogRefId. The catalogRefId that is used to query the
atg.commerce.inventory.InventoryManager
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.
InventoryManager
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:
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Fields inherited from class atg.repository.dp.DerivationMethodImpl |
---|
COMPARISON_QUERY, INCLUDES_ALL_QUERY, INCLUDES_ANY_QUERY, INCLUDES_ITEM_QUERY, INCLUDES_QUERY, IS_NULL_QUERY, PATTERN_MATCH_QUERY, sZero, TEXT_SEARCH_QUERY |
Fields inherited from class atg.beans.SerializableFeatureDescriptor |
---|
BUNDLE_ATTRIBUTE_NAME, LOCALE_ATTRIBUTE_NAME |
Fields inherited from interface atg.repository.dp.Constants |
---|
ATTR_METHOD, ATTR_OVERRIDE_PROPERTY, ATTR_USER_METHOD, DEFAULT_METHOD_NAME, DEFAULT_RECURSION_DEPTH, DP_COUNT_ATTR_NAME, ERR_COLLECTION_EXPRESSION_TYPE, ERR_COLLECTION_ITEM_TYPE, ERR_DP_EXP_NOT_ARRAY, ERR_DP_EXP_NOT_COLLECTION, 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_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 Summary | |
---|---|
InventoryLevelDerivation()
Set the name, display name and short description properties. |
Method Summary | |
---|---|
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. |
Methods inherited from class atg.repository.dp.DerivationMethodImpl |
---|
createComparisonQuery, createExpression, createIncludesAllQuery, createIncludesAnyQuery, createIncludesItemQuery, createIncludesQuery, createIsNullQuery, createPatternMatchQuery, createQuery, createReferencedByQuery, createTextSearchQuery, getAllowNoExpressions, getDerivation, getFeatureDescriptor, getPropertyDescriptor, getPropertyOrigin, getPropertyOrigin, getPropertyOrigin, isEmpty, isWritable, rebuildExpression, setDerivation, setFrom, setPropertyDescriptor, setPropertyValue, setPropertyValue, wrap |
Methods inherited from class java.beans.FeatureDescriptor |
---|
attributeNames, getName, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
Constructor Detail |
---|
public InventoryLevelDerivation()
class
.
Method Detail |
---|
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 desired
public 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 elements
pList
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
value
Object
value
RepositoryException
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 computed
Object
value
RepositoryException
- 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |