atg.projects.store.dp
Class SiteSpecificPropertyDerivation

java.lang.Object
  extended by java.beans.FeatureDescriptor
      extended by atg.beans.SerializableFeatureDescriptor
          extended by atg.repository.dp.DerivationMethodImpl
              extended by atg.projects.store.dp.SiteSpecificPropertyDerivation
All Implemented Interfaces:
atg.repository.dp.Constants, atg.repository.dp.DerivationMethod, java.io.Serializable

public class SiteSpecificPropertyDerivation
extends atg.repository.dp.DerivationMethodImpl

This derived property method will derive a property based on the current site. For example:

   <property name="feature">
     <derivation user-method="atg.projects.store.dp.SiteSpecificPropertyDerivation">
       <expression>myFeature</expression>
       <expression>siteSpecificFeature</expression>
     </derivation>
   </property>

 where 'myFeature' is a property holding a single 'promotionalContent' 
 repository item and 'siteSpecificFeature' is a Map property holding site specific 
 'promotionalContent' items, i.e. site1=promo1,site2=promo2 etc.
 
 Note that the site specific expression should always be defined after the single value expression.
 
 

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/EStore/src/atg/projects/store/dp/SiteSpecificPropertyDerivation.java#2 $$Change: 788983 $
Author:
David Stewart
See Also:
Serialized Form

Field Summary
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 KEY_SERVICE_PATH
           
protected static java.lang.String SHORT_DESCRIPTION
           
 
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
SiteSpecificPropertyDerivation()
          Set the name, display name and short description properties.
 
Method Summary
protected  atg.repository.Query createQuery(int pQueryType, boolean pDerivedPropertyOnLeft, boolean pCountDerivedProperty, atg.repository.QueryExpression pOther, int pOperator, boolean pIgnoreCase, atg.repository.QueryExpression pMinScore, atg.repository.QueryExpression pSearchStringFormat, atg.repository.Query pItemQuery, atg.repository.QueryBuilder pBuilder, atg.repository.query.PropertyQueryExpression pParentProperty, java.util.List pChildPropertyList)
          We do not support query for this derivation implementation
 java.lang.Object derivePropertyValue(java.lang.Object pBean)
          Determine the derived property value using the specified bean.
 java.lang.Object derivePropertyValue(atg.repository.RepositoryItemImpl pItem)
          Determine the derived property value.
 boolean isQueryable()
          Determine whether the specified property can be used in a query.
 java.util.List<atg.repository.RepositoryException> 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, getPropertyOrigin, isEmpty, isWritable, rebuildExpression, setDerivation, setFrom, setPropertyDescriptor, setPropertyValue, setPropertyValue, wrap
 
Methods inherited from class atg.beans.SerializableFeatureDescriptor
copyFeatureDescriptor, getDisplayName, getDisplayNameResource, getDisplaySortString, getLocalizedResourceBundle, getResourceBundle, getShortDescription, getShortDescriptionResource, getSortString, setDisplayNameResource, setShortDescriptionResource, toString
 
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

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

DERIVATION_NAME

protected static final java.lang.String DERIVATION_NAME
See Also:
Constant Field Values

DISPLAY_NAME

protected static final java.lang.String DISPLAY_NAME
See Also:
Constant Field Values

SHORT_DESCRIPTION

protected static final java.lang.String SHORT_DESCRIPTION
See Also:
Constant Field Values

KEY_SERVICE_PATH

protected static final java.lang.String KEY_SERVICE_PATH
See Also:
Constant Field Values
Constructor Detail

SiteSpecificPropertyDerivation

public SiteSpecificPropertyDerivation()
Set the name, display name and short description properties.

Method Detail

createQuery

protected atg.repository.Query createQuery(int pQueryType,
                                           boolean pDerivedPropertyOnLeft,
                                           boolean pCountDerivedProperty,
                                           atg.repository.QueryExpression pOther,
                                           int pOperator,
                                           boolean pIgnoreCase,
                                           atg.repository.QueryExpression pMinScore,
                                           atg.repository.QueryExpression pSearchStringFormat,
                                           atg.repository.Query pItemQuery,
                                           atg.repository.QueryBuilder pBuilder,
                                           atg.repository.query.PropertyQueryExpression pParentProperty,
                                           java.util.List pChildPropertyList)
                                    throws atg.repository.RepositoryException
We do not support query for this derivation implementation

Specified by:
createQuery in class atg.repository.dp.DerivationMethodImpl
Throws:
atg.repository.RepositoryException

derivePropertyValue

public java.lang.Object derivePropertyValue(atg.repository.RepositoryItemImpl pItem)
                                     throws atg.repository.RepositoryException
Determine the derived property value.

Parameters:
pItem - The item whose property value is desired.
Returns:
The derived value or null.
Throws:
atg.repository.RepositoryException - if there is a problem deriving the value

derivePropertyValue

public java.lang.Object derivePropertyValue(java.lang.Object pBean)
                                     throws atg.repository.RepositoryException
Determine the derived property value using the specified bean.

Parameters:
pBean - the bean representing a repository item whose property value is desired
Returns:
the derived value
Throws:
atg.repository.RepositoryException - if there is a problem deriving the value

validate

public java.util.List<atg.repository.RepositoryException> validate()
Validate the derivation.

Specified by:
validate in interface atg.repository.dp.DerivationMethod
Overrides:
validate in class atg.repository.dp.DerivationMethodImpl
Returns:
a non-null, possibly empty List of RepositoryExceptions if the derivation is not valid. The size of the list is the number of errors found.

isQueryable

public boolean isQueryable()
Determine whether the specified property can be used in a query.