atg.commerce.search.refinement
Class RQLPropertyDescriptor

java.lang.Object
  extended by java.beans.FeatureDescriptor
      extended by atg.beans.SerializableFeatureDescriptor
          extended by atg.beans.DynamicPropertyDescriptor
              extended by atg.repository.RepositoryPropertyDescriptor
                  extended by atg.commerce.search.refinement.RQLPropertyDescriptor
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class RQLPropertyDescriptor
extends RepositoryPropertyDescriptor

A user-defined repository property descriptor that uses RQL to get a list of components as its value.

   <property name="someProperty" 
             property-type="atg.commerce.search.refinement.RQLPropertyDescriptor" 
             data-type="list" component-item-type="someOtherItemDescriptor"
             repository="/path/to/Repository">
     <attribute name="repository" value="/path/to/Repository"/>
     <attribute name="itemDescrptor" value="someOtherItemDescriptor">
     <attribute name="rql" value="(someProp = true) AND (someOtherProp > ?0)"
     <attribute name="param0" value="someBooleanProperty"/>
   </property>
 

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String ITEM_DESCRIPTOR_ATTRIBUTE_NAME
           
static java.lang.String PARAM_ATTRIBUTE_NAME_PREFIX
           
static java.lang.String REPOSITORY_ATTRIBUTE_NAME
           
static java.lang.String RQL_ATTRIBUTE_NAME
           
static java.lang.String sResources
           
 
Fields inherited from class atg.repository.RepositoryPropertyDescriptor
EMPTY_LIST, EMPTY_MAP, EMPTY_SET, FOREIGN_REPOSITORY_NAME, FOREIGN_REPOSITORY_PATH, mCollectionOrMap
 
Fields inherited from class atg.beans.DynamicPropertyDescriptor
PORTABLE_VALUE_KEY
 
Fields inherited from class atg.beans.SerializableFeatureDescriptor
BUNDLE_ATTRIBUTE_NAME, LOCALE_ATTRIBUTE_NAME
 
Constructor Summary
RQLPropertyDescriptor()
           
 
Method Summary
 RepositoryItemDescriptor getComponentItemDescriptor()
          Gets the item descriptor to run the query against.
 java.lang.Object[] getParams(java.lang.Object pBean)
          Get the parameters from the paramX attributes.
 java.lang.Class getPropertyType()
          Get the property type (always a List)
 java.lang.Object getPropertyValue(RepositoryItemImpl pItem, java.lang.Object pValue)
          Get the property value by executing the RQL query, returning the resuls as a List.
 Repository getRepository()
          Get the repository to run the query against.
 RepositoryView getRepositoryView()
          Get the repository view to run the query against.
 RqlStatement getRqlStatement()
          Get the RQL statement to run.
 boolean isWritable()
          Is the property writable? (always false)
 void logDebug(java.lang.String pMessage)
           
 void setValue(java.lang.String pString, java.lang.Object pObject)
          We override setValue to reset the repository, componentItemDesriptor, and repositoryView properties.
 
Methods inherited from class atg.repository.RepositoryPropertyDescriptor
clone, createPropertyDescriptorFromType, getCascadeDelete, getCascadeInsert, getCascadeUpdate, getComponentPropertyBeanInfo, getDefaultValue, getDefaultValueString, getItemDescriptor, getLocalizedResourceBundle, getPropertyBeanInfo, getPropertyItemDescriptor, getResourceBundle, getResourceBundleName, getTypeName, getUnmodifiableDefaultValue, isAssignableFrom, isCacheable, isCollectionOrMap, isDerived, isIdProperty, isIgnoreNullValue, isLoggingDebug, isMultiValued, isPersistent, isQueryable, isValidValue, isVersionable, isVersionableSet, registerPropertyDescriptorClass, setCacheable, setCascadeDelete, setCascadeInsert, setCascadeUpdate, setComponentItemDescriptor, setDefaultValue, setDefaultValueString, setDerived, setIdProperty, setIgnoreNullValue, setItemDescriptor, setLoggingDebug, setPersistent, setPropertyItemDescriptor, setPropertyType, setPropertyValue, setQueryable, setResourceBundleName, setVersionable, toString
 
Methods inherited from class atg.beans.DynamicPropertyDescriptor
createLocalePropertyEditor, createLocalePropertyEditor, createPropertyEditor, getComponentPropertyType, getPropertyEditorClass, getUIPropertyEditor, isReadable, isRequired, setComponentPropertyType, setPropertyEditorClass, setReadable, setRequired, setWritable
 
Methods inherited from class atg.beans.SerializableFeatureDescriptor
copyFeatureDescriptor, getDisplayName, getDisplayNameResource, getDisplaySortString, getShortDescription, getShortDescriptionResource, getSortString, setDisplayNameResource, setShortDescriptionResource
 
Methods inherited from class java.beans.FeatureDescriptor
attributeNames, getName, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


sResources

public static final java.lang.String sResources
See Also:
Constant Field Values

REPOSITORY_ATTRIBUTE_NAME

public static final java.lang.String REPOSITORY_ATTRIBUTE_NAME
See Also:
Constant Field Values

ITEM_DESCRIPTOR_ATTRIBUTE_NAME

public static final java.lang.String ITEM_DESCRIPTOR_ATTRIBUTE_NAME
See Also:
Constant Field Values

RQL_ATTRIBUTE_NAME

public static final java.lang.String RQL_ATTRIBUTE_NAME
See Also:
Constant Field Values

PARAM_ATTRIBUTE_NAME_PREFIX

public static final java.lang.String PARAM_ATTRIBUTE_NAME_PREFIX
See Also:
Constant Field Values
Constructor Detail

RQLPropertyDescriptor

public RQLPropertyDescriptor()
Method Detail

getParams

public java.lang.Object[] getParams(java.lang.Object pBean)
                             throws RepositoryException
Get the parameters from the paramX attributes.

Throws:
RepositoryException

getRepository

public Repository getRepository()
Get the repository to run the query against.


getComponentItemDescriptor

public RepositoryItemDescriptor getComponentItemDescriptor()
Gets the item descriptor to run the query against.

Overrides:
getComponentItemDescriptor in class RepositoryPropertyDescriptor
Returns:
The value of the property ComponentItemDescriptor.

getRepositoryView

public RepositoryView getRepositoryView()
                                 throws RepositoryException
Get the repository view to run the query against.

Throws:
RepositoryException

getRqlStatement

public RqlStatement getRqlStatement()
                             throws RepositoryException
Get the RQL statement to run.

Throws:
RepositoryException

getPropertyType

public java.lang.Class getPropertyType()
Get the property type (always a List)

Overrides:
getPropertyType in class DynamicPropertyDescriptor

isWritable

public boolean isWritable()
Is the property writable? (always false)

Overrides:
isWritable in class DynamicPropertyDescriptor

setValue

public void setValue(java.lang.String pString,
                     java.lang.Object pObject)
We override setValue to reset the repository, componentItemDesriptor, and repositoryView properties. This is due to the fact that during repository initialization, a call is made to getComponentItemDescriptor() with no itemDescriptor attribute, which sets mComponentItemDescriptor to an invalid value. Resetting here allows us to compute the value in its proper context each time.

Overrides:
setValue in class RepositoryPropertyDescriptor

getPropertyValue

public java.lang.Object getPropertyValue(RepositoryItemImpl pItem,
                                         java.lang.Object pValue)
Get the property value by executing the RQL query, returning the resuls as a List.

Overrides:
getPropertyValue in class RepositoryPropertyDescriptor

logDebug

public void logDebug(java.lang.String pMessage)