atg.repository.search
Class MetaProperty

java.lang.Object
  extended by java.beans.FeatureDescriptor
      extended by atg.beans.SerializableFeatureDescriptor
          extended by atg.beans.DynamicPropertyDescriptor
              extended by atg.repository.search.MetaProperty
All Implemented Interfaces:
java.io.Serializable

public class MetaProperty
extends DynamicPropertyDescriptor

The Property class provides the information necessary for the UI to display a property that is available.

See Also:
Serialized Form

Nested Class Summary
 class MetaProperty.MetaPropertyValue
          Inner class to represent a valid indexed value for this meta property in the search index.
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static ApplicationLoggingImpl log
          Logger
 
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
MetaProperty(DynamicPropertyDescriptor pDpd, java.lang.String pTypeString)
          Create a new Property with the given descriptor.
 
Method Summary
 java.beans.PropertyEditor createLocalePropertyEditor(java.util.Locale pLocale)
          Returns a localized PropertyEditor.
 java.beans.PropertyEditor createPropertyEditor()
          Returns a PropertyEditor which exposes the possible enumerated values through the tags property of the PropertyEditor
 boolean equals(java.lang.Object pOther)
          Compare other object for equality.
 java.lang.String getDisplayName()
          Returns the potentially localized display name of the property.
 java.lang.String getDisplayName(java.util.Locale pLocale)
           
 java.lang.String getDisplayValue(java.lang.String pValue)
          Method to get a UI display String for a given String search engine indexed value.
 java.lang.String getDisplayValue(java.lang.String pValue, java.util.Locale pLocale)
           
 java.util.Map<java.lang.String,MetaProperty.MetaPropertyValue> getIndexedValuesMap()
          Gets the map of indexed values to display names for this meta property or null if this is not known
protected  java.util.Locale getLocale()
          Gets the Locale to use if one is not passed in to another method.
 java.lang.String getLocalPropertyDescriptorDisplayName(SerializableFeatureDescriptor pProp, java.util.Locale pLocale)
          Gets the localized display name for a dynamic property descriptor.
 MetaPropertyFormatter getMetaPropertyFormatter()
          Gets the formatter for the name and display name of this meta property, may be null
 MetaPropertyValueFormatter getMetaPropertyValueFormatter()
          Gets the formatter to display values of this meta property
 java.lang.String getName()
           
 java.lang.String getOutputName()
          Gets the optional explicit string output name of the property.
 DynamicPropertyDescriptor[] getParentPropertyDescriptors()
          Gets the parent property descriptors.
 DynamicPropertyDescriptor getPropertyDescriptor()
          Gets the original property descriptor.
protected  java.util.ResourceBundle getResourceBundle(java.util.Locale pLocale)
          Gets the ResourceBundle for the given locale.
protected  java.lang.String getResourceBundleName()
          Gets the resource bundle name to look up values and property name.
 atg.repository.search.indexing.specifier.PropertyTypeEnum getTypeEnum()
          Gets the PropertyTypeEnum the property.
 java.lang.String getTypeString()
          Gets the string type of the property.
 int hashCode()
          Get the hash code for this Property.
 boolean isRankedDynamically()
           
 boolean isRepositoryIdProperty()
          Boolean method, returns true if values of this meta property are repository ids
 void setMetaPropertyFormatter(MetaPropertyFormatter pMetaPropertyFormatter)
           
 void setMetaPropertyValueFormatter(MetaPropertyValueFormatter pMetaPropertyValueFormatter)
           
 void setMetaPropertyValues(java.lang.String[] pIndexedValues, java.lang.String[] pIndexedDisplayValues)
          If the total set of valid values in the search engine index is available then it can be set here.
 void setOutputName(java.lang.String pOutputName)
           
 void setParentPropertyDescriptors(DynamicPropertyDescriptor[] pParentPropertyDescriptors)
           
 void setPropertyDescriptor(DynamicPropertyDescriptor pPropertyDescriptor)
           
 void setRankedDynamically(boolean pRankedDynamically)
           
 void setTypeString(java.lang.String pTypeString)
           
 java.lang.String toString()
          Return a String representation of this Property.
 
Methods inherited from class atg.beans.DynamicPropertyDescriptor
createLocalePropertyEditor, getComponentPropertyBeanInfo, getComponentPropertyType, getPropertyBeanInfo, getPropertyEditorClass, getPropertyType, getUIPropertyEditor, isMultiValued, isReadable, isRequired, isWritable, setComponentPropertyType, setPropertyEditorClass, setPropertyType, setReadable, setRequired, setWritable
 
Methods inherited from class atg.beans.SerializableFeatureDescriptor
copyFeatureDescriptor, getDisplayNameResource, getDisplaySortString, getLocalizedResourceBundle, getResourceBundle, getShortDescription, getShortDescriptionResource, getSortString, setDisplayNameResource, setShortDescriptionResource
 
Methods inherited from class java.beans.FeatureDescriptor
attributeNames, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription, setValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


log

public static ApplicationLoggingImpl log
Logger

Constructor Detail

MetaProperty

public MetaProperty(DynamicPropertyDescriptor pDpd,
                    java.lang.String pTypeString)
Create a new Property with the given descriptor.

Method Detail

getTypeString

public java.lang.String getTypeString()
Gets the string type of the property.


setTypeString

public void setTypeString(java.lang.String pTypeString)

getTypeEnum

public atg.repository.search.indexing.specifier.PropertyTypeEnum getTypeEnum()
Gets the PropertyTypeEnum the property.


getOutputName

public java.lang.String getOutputName()
Gets the optional explicit string output name of the property.


setOutputName

public void setOutputName(java.lang.String pOutputName)

getPropertyDescriptor

public DynamicPropertyDescriptor getPropertyDescriptor()
Gets the original property descriptor. Can be used for enumerated types.


setPropertyDescriptor

public void setPropertyDescriptor(DynamicPropertyDescriptor pPropertyDescriptor)

getParentPropertyDescriptors

public DynamicPropertyDescriptor[] getParentPropertyDescriptors()
Gets the parent property descriptors.


setParentPropertyDescriptors

public void setParentPropertyDescriptors(DynamicPropertyDescriptor[] pParentPropertyDescriptors)

getMetaPropertyFormatter

public MetaPropertyFormatter getMetaPropertyFormatter()
Gets the formatter for the name and display name of this meta property, may be null


setMetaPropertyFormatter

public void setMetaPropertyFormatter(MetaPropertyFormatter pMetaPropertyFormatter)

getMetaPropertyValueFormatter

public MetaPropertyValueFormatter getMetaPropertyValueFormatter()
Gets the formatter to display values of this meta property


setMetaPropertyValueFormatter

public void setMetaPropertyValueFormatter(MetaPropertyValueFormatter pMetaPropertyValueFormatter)

getIndexedValuesMap

public java.util.Map<java.lang.String,MetaProperty.MetaPropertyValue> getIndexedValuesMap()
Gets the map of indexed values to display names for this meta property or null if this is not known


isRankedDynamically

public boolean isRankedDynamically()

setRankedDynamically

public void setRankedDynamically(boolean pRankedDynamically)

getDisplayName

public java.lang.String getDisplayName()
Description copied from class: SerializableFeatureDescriptor
Returns the potentially localized display name of the property.

Overrides:
getDisplayName in class SerializableFeatureDescriptor
Parameters:
pLocale - Optional java locale to resource display name with.
Returns:
String display name showing entire hierarchy for this MetaProperty.
See Also:
Creates a localized display name based on the property hierarchy. e.g. ancestorCategories.displayName involves two properties "ancestorCategories" and "displayName". They will be combined and resources looked up to form a string like "Ancestor Categories -> Name"

getDisplayName

public java.lang.String getDisplayName(java.util.Locale pLocale)

getLocalPropertyDescriptorDisplayName

public java.lang.String getLocalPropertyDescriptorDisplayName(SerializableFeatureDescriptor pProp,
                                                              java.util.Locale pLocale)
Gets the localized display name for a dynamic property descriptor.

Parameters:
pProp - SerializableFeatureDescriptor to get display name
pLocale - Optional Java Locale
Returns:
String localized display name

getName

public java.lang.String getName()
Overrides:
getName in class java.beans.FeatureDescriptor
Returns:
String name showing entire hierarchy for this MetaProperty.
See Also:
Creates a full name based on the property hierarchy. e.g. ancestorCategories.displayName involves two MetaProperties "ancestorCategories" and "displayName".

createPropertyEditor

public java.beans.PropertyEditor createPropertyEditor()
Returns a PropertyEditor which exposes the possible enumerated values through the tags property of the PropertyEditor

Overrides:
createPropertyEditor in class DynamicPropertyDescriptor

createLocalePropertyEditor

public java.beans.PropertyEditor createLocalePropertyEditor(java.util.Locale pLocale)
Returns a localized PropertyEditor.

Overrides:
createLocalePropertyEditor in class DynamicPropertyDescriptor
Parameters:
pLocale - the Locale for which the localized editor should be created, or null for the default locale.

setMetaPropertyValues

public void setMetaPropertyValues(java.lang.String[] pIndexedValues,
                                  java.lang.String[] pIndexedDisplayValues)
If the total set of valid values in the search engine index is available then it can be set here. This allows a UI to display a picker, or to display enumerated property values. If pIndexedDisplayValue is not null then it must match pIndexedValues in length.

Parameters:
pIndexedValues - String array of indexed values
pIndexedDisplayValues - String array of UI display names or resource keys for each indexed value

getDisplayValue

public java.lang.String getDisplayValue(java.lang.String pValue)
Method to get a UI display String for a given String search engine indexed value. e.g. if this is a Date property and the given String is a Long number then this method will return the date as a formatted string 'MM/dd/YYYY'

Parameters:
pValue - String value as stored in the index
Returns:
String to display on a UI

getDisplayValue

public java.lang.String getDisplayValue(java.lang.String pValue,
                                        java.util.Locale pLocale)

isRepositoryIdProperty

public boolean isRepositoryIdProperty()
Boolean method, returns true if values of this meta property are repository ids

Returns:
true if values of this meta property are repository ids

hashCode

public int hashCode()
Get the hash code for this Property.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object pOther)
Compare other object for equality.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Return a String representation of this Property.

Overrides:
toString in class SerializableFeatureDescriptor

getLocale

protected java.util.Locale getLocale()
Gets the Locale to use if one is not passed in to another method. Uses ServletUtil.getUserLocale first or if null then the default Dynamo licensed locale.

Returns:
Locale

getResourceBundleName

protected java.lang.String getResourceBundleName()
Gets the resource bundle name to look up values and property name. Trys to get it from the property descriptor. May be null.

Returns:
String resource bundle name

getResourceBundle

protected java.util.ResourceBundle getResourceBundle(java.util.Locale pLocale)
Gets the ResourceBundle for the given locale. May be null. Uses getResourceBundleName method.

Parameters:
pLocale - Locale to use
Returns:
ResourceBundle to use