atg.repository
Class RepositoryPropertyDescriptor

java.lang.Object
  extended by java.beans.FeatureDescriptor
      extended by atg.beans.SerializableFeatureDescriptor
          extended by atg.beans.DynamicPropertyDescriptor
              extended by atg.repository.RepositoryPropertyDescriptor
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
CatalogAlias, atg.repository.ChooserPropertyDescriptor, DerivedSearchConfigsPropertyDescriptor, DistributorPropertyDescriptor, FilePropertyDescriptor, GroupMembersPropertyDescriptor, GSAPropertyDescriptor, InventoryAvailabilityPropertyDescriptor, MetaPropertyDisplayNamePropertyDescriptor, MimeTyperPropertyDescriptor, RepositoryLinkPropertyDescriptor, RQLPropertyDescriptor

public class RepositoryPropertyDescriptor
extends DynamicPropertyDescriptor
implements java.lang.Cloneable

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
protected static java.util.List EMPTY_LIST
           
protected static java.util.Map EMPTY_MAP
           
protected static java.util.Set EMPTY_SET
           
static java.lang.String FOREIGN_REPOSITORY_NAME
          If your property descriptor refers to an item in another repository, it can find the name of that repository by looking for a feature descriptor attribute with this name.
static java.lang.String FOREIGN_REPOSITORY_PATH
          If your property descriptor refers to an item in another repository, it can find the path of that repository by looking for a feature descriptor attribute with this name.
protected  boolean 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
RepositoryPropertyDescriptor()
          Constructs a new RepositoryPropertyDescriptor.
RepositoryPropertyDescriptor(RepositoryPropertyDescriptor pDescriptor)
           
RepositoryPropertyDescriptor(java.lang.String pPropertyName)
          Constructs a new RepositoryPropertyDescriptor.
RepositoryPropertyDescriptor(java.lang.String pPropertyName, java.lang.Class pPropertyType, java.lang.String pShortDescription)
          Constructs a new RepositoryPropertyDescriptor with the given property name, property type, and short description.
 
Method Summary
 java.lang.Object clone()
           
static RepositoryPropertyDescriptor createPropertyDescriptorFromType(java.lang.String pType)
          Creates a new RepositoryPropertyDescriptor of a given type.
 boolean getCascadeDelete()
           
 boolean getCascadeInsert()
           
 boolean getCascadeUpdate()
           
 RepositoryItemDescriptor getComponentItemDescriptor()
           
 DynamicBeanInfo getComponentPropertyBeanInfo()
          Overrides the getPropertyBeanInfo from the super type.
 java.lang.Object getDefaultValue()
          Returns property DefaultValue
 java.lang.String getDefaultValueString()
           
 RepositoryItemDescriptor getItemDescriptor()
          Get property ItemDescriptor
 DynamicBeanInfo getPropertyBeanInfo()
          Overrides the getPropertyBeanInfo from the super type.
 RepositoryItemDescriptor getPropertyItemDescriptor()
           
 java.lang.Object getPropertyValue(RepositoryItemImpl pItem, java.lang.Object pValue)
          This method is called to retrieve a read-only value for this property.
 java.util.ResourceBundle getResourceBundle()
          Override the getResourceBundle method which is used to localize values for this property descriptor.
 java.lang.String getResourceBundleName()
          Returns the bundle name used by this resource bundle
 java.lang.String getTypeName()
          Returns the name used for this type in the property descriptor.
 java.lang.Object getUnmodifiableDefaultValue()
          Returns property UnmodifiableDefaultValue
 boolean isAssignableFrom(RepositoryPropertyDescriptor pOther)
          Determine if properties of this type can be assigned values from objects of the specified property descriptor.
 boolean isCacheable()
          Returns property Cacheable
 boolean isCollectionOrMap()
           
 boolean isDerived()
          Test property derived
 boolean isIdProperty()
           
 boolean isIgnoreNullValue()
          Returns property IgnoreNullValue
 boolean isLoggingDebug()
           
 boolean isMultiValued()
          Convenience method for retrieving multi valued status.
 boolean isPersistent()
          Test property persistent.
 boolean isQueryable()
          Returns property Queryable
 boolean isValidValue(java.lang.Object pPropertyValue)
          Returns true if the given property value is a valid value for this property, false otherwise.
 boolean isVersionable()
           
protected  boolean isVersionableSet()
          Returns true if someone explicitly specified a value for the versionable property.
static void registerPropertyDescriptorClass(java.lang.String pType, java.lang.Class pClass)
          Adds a new type of PropertyDescriptor to repositories which support user-defined property descriptors.
 void setCacheable(boolean pCacheable)
          Sets property Cacheable.
 void setCascadeDelete(boolean pCascadeDelete)
          Sets the property CascadeDelete.
 void setCascadeInsert(boolean pCascadeInsert)
          Sets the property CascadeInsert.
 void setCascadeUpdate(boolean pCascadeUpdate)
          Sets the property CascadeUpdate.
 void setComponentItemDescriptor(RepositoryItemDescriptor pComponentItemDescriptor)
          Sets the property ComponentItemDescriptor.
 void setDefaultValue(java.lang.Object pDefaultValue)
          Sets property DefaultValue
 void setDefaultValueString(java.lang.String pDefaultValueString)
          Sets the property DefaultValueString.
protected  void setDerived(boolean pDerived)
          Set property derived
 void setIdProperty(boolean pIdProperty)
          Sets the property IdProperty.
 void setIgnoreNullValue(boolean pIgnoreNullValue)
          Sets property IgnoreNullValue, indicating whether NULL value will be ignore for this property.
 void setItemDescriptor(RepositoryItemDescriptor pItemDescriptor)
          Set property ItemDescriptor.
 void setLoggingDebug(boolean pLoggingDebug)
          Log operations using this property descriptor.
protected  void setPersistent(boolean pPersistent)
          Set property persistent.
 void setPropertyItemDescriptor(RepositoryItemDescriptor pPropertyItemDescriptor)
          Sets the property PropertyItemDescriptor.
 void setPropertyType(java.lang.Class pPropertyType)
          Sets property PropertyType: the class which this property can be expected to have at runtime.
 void setPropertyValue(RepositoryItemImpl pItem, java.lang.Object pValue)
          Sets the property of this type for the item descriptor provided.
 void setQueryable(boolean pQueryable)
          Sets property Queryable
 void setResourceBundleName(java.lang.String pResourceBundleName)
          Sets the bundle name used for this resource bundle.
 void setValue(java.lang.String pAttributeName, java.lang.Object pValue)
          Associate a named attribute with this feature.
 void setVersionable(boolean pVersionable)
          Sets the property Versionable.
 java.lang.String toString()
          Return a string representation of this object
 
Methods inherited from class atg.beans.DynamicPropertyDescriptor
createLocalePropertyEditor, createLocalePropertyEditor, createPropertyEditor, getComponentPropertyType, getPropertyEditorClass, getPropertyType, getUIPropertyEditor, isReadable, isRequired, isWritable, 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

EMPTY_LIST

protected static final java.util.List EMPTY_LIST

EMPTY_MAP

protected static final java.util.Map EMPTY_MAP

EMPTY_SET

protected static final java.util.Set EMPTY_SET

FOREIGN_REPOSITORY_NAME

public static final java.lang.String FOREIGN_REPOSITORY_NAME
If your property descriptor refers to an item in another repository, it can find the name of that repository by looking for a feature descriptor attribute with this name.

See Also:
Constant Field Values

FOREIGN_REPOSITORY_PATH

public static final java.lang.String FOREIGN_REPOSITORY_PATH
If your property descriptor refers to an item in another repository, it can find the path of that repository by looking for a feature descriptor attribute with this name.

See Also:
Constant Field Values

CLASS_VERSION

public static java.lang.String CLASS_VERSION

mCollectionOrMap

protected boolean mCollectionOrMap
Constructor Detail

RepositoryPropertyDescriptor

public RepositoryPropertyDescriptor()
Constructs a new RepositoryPropertyDescriptor.


RepositoryPropertyDescriptor

public RepositoryPropertyDescriptor(java.lang.String pPropertyName)
Constructs a new RepositoryPropertyDescriptor.


RepositoryPropertyDescriptor

public RepositoryPropertyDescriptor(java.lang.String pPropertyName,
                                    java.lang.Class pPropertyType,
                                    java.lang.String pShortDescription)
Constructs a new RepositoryPropertyDescriptor with the given property name, property type, and short description.


RepositoryPropertyDescriptor

public RepositoryPropertyDescriptor(RepositoryPropertyDescriptor pDescriptor)
Method Detail

setQueryable

public void setQueryable(boolean pQueryable)
Sets property Queryable


isQueryable

public boolean isQueryable()
Returns property Queryable


setCacheable

public void setCacheable(boolean pCacheable)
Sets property Cacheable. This should be set to true for properties that can be cached.


isCacheable

public boolean isCacheable()
Returns property Cacheable


setVersionable

public void setVersionable(boolean pVersionable)
Sets the property Versionable. Should concurrent update checks be applied to this property? Set this to false for properties whose consistency should not be maintained by the item descriptor. To clarify: This property is not related to the version repository implementation. It is only used for concurrency checking.

Parameters:
pVersionable - new value to set

isVersionable

public boolean isVersionable()
Returns:
The value of the property Versionable.

isVersionableSet

protected boolean isVersionableSet()
Returns true if someone explicitly specified a value for the versionable property.


setDefaultValue

public void setDefaultValue(java.lang.Object pDefaultValue)
Sets property DefaultValue


getDefaultValue

public java.lang.Object getDefaultValue()
Returns property DefaultValue


getUnmodifiableDefaultValue

public java.lang.Object getUnmodifiableDefaultValue()
Returns property UnmodifiableDefaultValue


setIdProperty

public void setIdProperty(boolean pIdProperty)
Sets the property IdProperty.

Parameters:
pIdProperty - new value to set

isIdProperty

public boolean isIdProperty()
Returns:
The value of the property IdProperty. This returns true if this property corresponds to the id column itself.

setDerived

protected void setDerived(boolean pDerived)
Set property derived

Parameters:
pDerived - the new value to set

isDerived

public boolean isDerived()
Test property derived

Returns:
derived

setPersistent

protected void setPersistent(boolean pPersistent)
Set property persistent. This is a flag indicating if this is a persistent property.

Parameters:
pPersistent - new value to set

isPersistent

public boolean isPersistent()
Test property persistent. This is a flag indicating if this is a persistent property.

Returns:
persistent

isValidValue

public boolean isValidValue(java.lang.Object pPropertyValue)
Returns true if the given property value is a valid value for this property, false otherwise. Specifically, verifies that the property value has a valid type.


setIgnoreNullValue

public void setIgnoreNullValue(boolean pIgnoreNullValue)
Sets property IgnoreNullValue, indicating whether NULL value will be ignore for this property.


isIgnoreNullValue

public boolean isIgnoreNullValue()
Returns property IgnoreNullValue


setDefaultValueString

public void setDefaultValueString(java.lang.String pDefaultValueString)
                           throws java.lang.IllegalArgumentException
Sets the property DefaultValueString. This is a string version of the default value for this property if it is not explicitly set. If it is null, no default is used. When you set this property, the value is automatically converted to the correct type and set.

You should set this after you've defined the data type for the descriptor so that the conversion can be performed correctly. In some cases, the data type is determined by the type of the column that this is associated with so make sure that the column is defined too.

Parameters:
pDefaultValueString - value to set
Throws:
java.lang.IllegalArgumentException - if the conversion to the correct data type fails

getDefaultValueString

public java.lang.String getDefaultValueString()
Returns:
The value of the property DefaultValueString.

isCollectionOrMap

public boolean isCollectionOrMap()

setPropertyType

public void setPropertyType(java.lang.Class pPropertyType)
Description copied from class: DynamicPropertyDescriptor
Sets property PropertyType: the class which this property can be expected to have at runtime.

Overrides:
setPropertyType in class DynamicPropertyDescriptor

setCascadeInsert

public void setCascadeInsert(boolean pCascadeInsert)
Sets the property CascadeInsert. If this is true on a property that refers to another item, the create operation will automatically create a new item in the referenced repository and set the value of this property to it. Typically this should be used in conjunction with CascadeUpdate so that this value gets added and updated at the same time as well. The default is false. You cannot set this to true for properties which do not refer to other items.

Parameters:
pCascadeInsert - new value to set

getCascadeInsert

public boolean getCascadeInsert()
Returns:
The value of the property CascadeInsert.

setCascadeUpdate

public void setCascadeUpdate(boolean pCascadeUpdate)
Sets the property CascadeUpdate. If this is true on a property that refers to another item (or items), the add and update operations apply recursively to the referenced item (or items). More specifically, setting this property to true on a property descriptor changes the behavior of the system in the following ways: The default is false. You cannot set this to true for properties which do not refer to other items.

Parameters:
pCascadeUpdate - new value to set

getCascadeUpdate

public boolean getCascadeUpdate()
Returns:
The value of the property CascadeUpdate.

setCascadeDelete

public void setCascadeDelete(boolean pCascadeDelete)
Sets the property CascadeDelete. If this is true on a property that refers to another item (or items), the remove operation applies recursively to the referenced item (or items). More specifically, setting this property to true on a property descriptor changes the behavior of the system in the following ways: The default is false. You cannot set this to true for properties which do not refer to other items.

Parameters:
pCascadeDelete - new value to set

getCascadeDelete

public boolean getCascadeDelete()
Returns:
The value of the property CascadeDelete.

setItemDescriptor

public void setItemDescriptor(RepositoryItemDescriptor pItemDescriptor)
Set property ItemDescriptor. This is the item descriptor that contains this property descriptor. Do not confuse this with the propertyItemDescriptor or componentItemDescriptor properties which define the type of a property which refers to other items.

Parameters:
pItemDescriptor - new value to set

getItemDescriptor

public RepositoryItemDescriptor getItemDescriptor()
Get property ItemDescriptor

Returns:
ItemDescriptor

setPropertyItemDescriptor

public void setPropertyItemDescriptor(RepositoryItemDescriptor pPropertyItemDescriptor)
Sets the property PropertyItemDescriptor. If this property refers to another item's type, this is the item descriptor for that type.

Parameters:
pPropertyItemDescriptor - new value to set

getPropertyItemDescriptor

public RepositoryItemDescriptor getPropertyItemDescriptor()
Returns:
The value of the property PropertyItemDescriptor.

getPropertyBeanInfo

public DynamicBeanInfo getPropertyBeanInfo()
                                    throws java.beans.IntrospectionException
Overrides the getPropertyBeanInfo from the super type. If this property refers to another item descriptor, that item descriptor is the bean info for this property.

Overrides:
getPropertyBeanInfo in class DynamicPropertyDescriptor
Throws:
java.beans.IntrospectionException

getComponentPropertyBeanInfo

public DynamicBeanInfo getComponentPropertyBeanInfo()
                                             throws java.beans.IntrospectionException
Overrides the getPropertyBeanInfo from the super type. If this property refers to another item descriptor, that item descriptor is the bean info for this property.

Overrides:
getComponentPropertyBeanInfo in class DynamicPropertyDescriptor
Throws:
java.beans.IntrospectionException

setComponentItemDescriptor

public void setComponentItemDescriptor(RepositoryItemDescriptor pComponentItemDescriptor)
Sets the property ComponentItemDescriptor. If this is a collection of items, this is the item descriptor of the component type.

Parameters:
pComponentItemDescriptor - new value to set

getComponentItemDescriptor

public RepositoryItemDescriptor getComponentItemDescriptor()
Returns:
The value of the property ComponentItemDescriptor.

getPropertyValue

public java.lang.Object getPropertyValue(RepositoryItemImpl pItem,
                                         java.lang.Object pValue)
This method is called to retrieve a read-only value for this property. Once a repository has computed the value it would like to return for this property, this property descriptor gets a chance to modify it based on how the property is defined. For example, if null is to be returned, we return the default value.


setPropertyValue

public void setPropertyValue(RepositoryItemImpl pItem,
                             java.lang.Object pValue)
Sets the property of this type for the item descriptor provided.


getTypeName

public java.lang.String getTypeName()
Returns the name used for this type in the property descriptor. For properties which refer to built-in property types, this returns the name of the data type. For example, an "int" property will return "int" for this method. All other property types should return null from this method.


createPropertyDescriptorFromType

public static RepositoryPropertyDescriptor createPropertyDescriptorFromType(java.lang.String pType)
Creates a new RepositoryPropertyDescriptor of a given type.


registerPropertyDescriptorClass

public static void registerPropertyDescriptorClass(java.lang.String pType,
                                                   java.lang.Class pClass)
Adds a new type of PropertyDescriptor to repositories which support user-defined property descriptors. These property descriptors implement the getPropertyValue operation given a RepositoryItem. They compute the return the value of a property of a given name.


clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

isMultiValued

public boolean isMultiValued()
Convenience method for retrieving multi valued status.

Overrides:
isMultiValued in class DynamicPropertyDescriptor

setLoggingDebug

public void setLoggingDebug(boolean pLoggingDebug)
Log operations using this property descriptor. The get method returns true if we are debugging the item type, or the repository as well.

Parameters:
pLoggingDebug - new value to set

isLoggingDebug

public boolean isLoggingDebug()
Returns:
The value of the property LoggingDebug.

getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Override the getResourceBundle method which is used to localize values for this property descriptor. If a resource bundle is not defined specifically for this property, we look and use the one for the item-descriptor to which this property belongs.

Overrides:
getResourceBundle in class SerializableFeatureDescriptor

getResourceBundleName

public java.lang.String getResourceBundleName()
Returns the bundle name used by this resource bundle


setResourceBundleName

public void setResourceBundleName(java.lang.String pResourceBundleName)
Sets the bundle name used for this resource bundle. This is to make it look like we have a resourcebundlename property. Its to make the i18n stuff added into the GSA templates useable from the HTML and XML simple repositories, so that the Quincy funds demo's can be localized. The other option was to add functionality to allow setting of arbitrary feature descriptor properties, but for now this does the trick for i18n, and is the most localized [pun intended] fix.


setValue

public void setValue(java.lang.String pAttributeName,
                     java.lang.Object pValue)
Associate a named attribute with this feature.

Overrides:
setValue in class java.beans.FeatureDescriptor
Parameters:
attributeName - The locale-independent name of the attribute
value - The value.

isAssignableFrom

public boolean isAssignableFrom(RepositoryPropertyDescriptor pOther)
Determine if properties of this type can be assigned values from objects of the specified property descriptor. This is done strictly, which means that two Lists are not considered compatible unless their component type is also the same.

Parameters:
pOther - the property descriptor defining the other type, must be non-null
Returns:
true if objects of this property descriptor can be assigned values from objects of the specified property descriptor, else false.

toString

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

Overrides:
toString in class SerializableFeatureDescriptor
Returns:
a string representation of this object