© 2002 BEA Systems, Inc.


com.beasys.commerce.ebusiness.catalog
Class MutableCatalogItemImpl

java.lang.Object
  |
  +--com.beasys.commerce.ebusiness.catalog.MutableCatalogItemImpl
Direct Known Subclasses:
MutableCategoryImpl, MutableProductItemImpl

public class MutableCatalogItemImpl
extends java.lang.Object
implements MutableCatalogItem

This is the mutable implementation class for all mutable items contained by the Catalog. This class exposes data accessors and mutators for item data conforming to the Dublin Core Metadata. Refer to the DCM spec for details: Dublin Core Element Set

See Also:
MutableCatalogItem, Serialized Form

Method Summary
 void addBusinessPolicy(java.lang.String policyKey, BusinessPolicy businessPolicy)
          Add a new business policy to the object with the specified key
 void addPropertyValue(java.lang.String scopeName, java.lang.String key, java.lang.Object propertyValue)
          Add the specified property value to the collection of values associated with the named key for the specified scope.
 void addPropertyValueMapped(java.lang.String scopeName, java.lang.String propertyKey, java.lang.String mappedKey, java.lang.Object propertyValue)
          Add the specified property value to the map object associated with the named key for the specified scope.
protected  void clearPropertyModifications()
          Clears any changes to attributes that have been tracked for this object.
 BusinessPolicy getBusinessPolicy(java.lang.String policyKey)
          Retrieve the business policy with the specified key.
 java.lang.String getContributor()
          Get the contributor for this catalog item
 java.lang.String getCoverage()
          Get the coverage for this catalog item
 java.util.Date getCreationDate()
          Get the creation date for this catalog item
 java.lang.String getCreator()
          Get the creator for this catalog item
 java.lang.String getDescription(int index)
          Get the description for this catalog item
 ImageInfo getImage(int index)
          Get an Image for this catalog item
 java.lang.String getJndiName()
          Retrieve the jndi name for an entity.
 CatalogItemKey getKey()
          Get the primary key for this catalog item
 java.lang.String getLanguage()
          Get the language for this catalog item
protected  java.util.Map getModificationMap()
          Returns the Map that can be used to query the changes made to attributes in this object.
 java.util.Date getModifiedDate()
          Get the modified date for this catalog item
 java.lang.String getName()
          Get the name for this catalog item
 java.lang.String getPkString()
          Retrieve the pk string for an entity.
 java.util.Map getProperties()
           
 java.util.Map getProperties(java.lang.String scopeName)
           
 java.lang.Object getProperty(java.lang.String key, java.lang.Object defaultValue)
          Retrieve the value associated with the named key in the default scope.
 java.lang.Object getProperty(java.lang.String propertySet, java.lang.String propertyName)
          Retrieve the value that was persisted for this entity for the given property, within the given property set.
 java.lang.Object getProperty(java.lang.String scopeName, java.lang.String key, ConfigurableEntity successor, java.lang.Object defaultValue)
          Retrieve the value associated with the named key in the specified scope.
 java.lang.String getPropertyAsString(java.lang.String propertySet, java.lang.String propertyName)
          Convenience method to return a property as a String.
 java.lang.String getPropertyAsString(java.lang.String scopeName, java.lang.String key, ConfigurableEntity successor, java.lang.String defaultValue)
          Retrieve the String value of the property associated the named key in the specified scope.
 java.lang.Object getPropertyDefault(java.lang.String scopeName, java.lang.String key, ConfigurableEntity successor)
          Retrieve the default value from the Schema for the named key and the specified scope.
 java.lang.Object getPropertyNoDefault(java.lang.String propertySet, java.lang.String propertyName)
          Retrieve the value associated with the named key in the specified property set, but does not return a default value from the property's PropertyDefinition if a value was not persisted for this entity.
 java.lang.Object getPropertyNoDefault(java.lang.String scopeName, java.lang.String key, ConfigurableEntity successor)
          Retrieve the value associated with the named key in the specified scope but does not return a default value if the property does not exist for the entity of in the hierarchy of successors.
 java.lang.String getPublisher()
          Get the publisher for this catalog item
 java.lang.String getRelation()
          Get the relation for this catalog item
 java.lang.String getRights()
          Get the rights for this catalog item
 java.lang.String getSource()
          Get the source for this catalog item
 ConfigurableEntity getSuccessor(java.lang.String scopeName)
          Retrieve the successor associated with this ConfigurableEntity for the specified scope.
 long getUniqueId()
          Retrieve the unique identifier generated for this ConfigurableEntity.
protected  void initPropertyModifications()
          Initialize change tracking.
protected  boolean isPropertyExplicit(java.lang.String fieldName)
           
protected  boolean isPropertyModified(java.lang.String fieldName)
           
protected  void modifyProperty(java.lang.String fieldName, java.lang.Object value)
          Mark an attribute as modified.
 BusinessPolicy removeBusinessPolicy(java.lang.String policyKey)
          Remove the business policy with the specified key.
 void removeProperties()
          Remove the property associated with the named key in the specified scope.
 java.lang.Object removeProperty(java.lang.String key)
          Remove the property associated with the named key in the default scope.
 java.lang.Object removeProperty(java.lang.String propertySet, java.lang.String propertyName)
          Remove the property associated with the named key in the specified property set.
 java.lang.Object removePropertyValue(java.lang.String scopeName, java.lang.String key, java.lang.Object propertyValue)
          Remove the property value object from the collection associated with the named key in the specified scope.
 java.lang.Object removePropertyValueMapped(java.lang.String scopeName, java.lang.String propertyKey, java.lang.String mappedKey)
          Remove the property value object from the map associated with the named key in the specified scope.
 ConfigurableEntity removeSuccessor(java.lang.String scopeName)
          Remove the successor for the specified scope.
 void setContributor(java.lang.String contributor)
          Set the contributor for this catalog item
 void setCoverage(java.lang.String coverage)
          Set the coverage for this catalog item
 void setCreationDate(java.util.Date date)
          Set the creation date for this catalog item
 void setCreator(java.lang.String creator)
          Set the creator for this catalog item
 void setDescription(int index, java.lang.String description)
          Set the description for this catalog item
 void setImage(int index, ImageInfo imageInfo)
          Set an Image for this catalog item
 void setLanguage(java.lang.String language)
          Set the language for this catalog item
 void setModifiedDate(java.util.Date date)
          Set the modified date for this catalog item
 void setName(java.lang.String name)
          Set the name for this catalog item
 void setProperty(java.lang.String key, java.lang.Object value)
          Associate the specified value with the named key in the default scope.
 void setProperty(java.lang.String propertySet, java.lang.String propertyName, java.lang.Object value)
          Associate the specified value with the named key in the specified property set.
 void setPublisher(java.lang.String publisher)
          Set the publisher for this catalog item
 void setRelation(java.lang.String relation)
          Set the relation for this catalog item
 void setRights(java.lang.String rights)
          Set the rights for this catalog item
 void setSource(java.lang.String source)
          Set the source for this catalog item
 void setSuccessor(java.lang.String scopeName, ConfigurableEntity successor)
          Set the successor for the specified scope.
 java.lang.String toString()
          Builds a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getKey

public CatalogItemKey getKey()
Get the primary key for this catalog item

Returns:
the primary key for the item

getName

public java.lang.String getName()
Get the name for this catalog item

Returns:
the name for the item

setName

public void setName(java.lang.String name)
Set the name for this catalog item
Specified by:
setName in interface MutableCatalogItem

Parameters:
the - new name for the item

getDescription

public java.lang.String getDescription(int index)
Get the description for this catalog item

Parameters:
index - the description to retrive, either CatalogItem.SHORT_DESCRIPTION_INDEX or CatalogItem.LONG_DESCRIPTION_INDEX
Returns:
the description for the item

setDescription

public void setDescription(int index,
                           java.lang.String description)
Set the description for this catalog item
Specified by:
setDescription in interface MutableCatalogItem

Parameters:
index - the description to set, either CatalogItem.SHORT_DESCRIPTION_INDEX or CatalogItem.LONG_DESCRIPTION_INDEX
description - the new description for the item

getCreator

public java.lang.String getCreator()
Get the creator for this catalog item

Returns:
the creator for the item

setCreator

public void setCreator(java.lang.String creator)
Set the creator for this catalog item
Specified by:
setCreator in interface MutableCatalogItem

Parameters:
creator - the new creator for the item

getPublisher

public java.lang.String getPublisher()
Get the publisher for this catalog item

Returns:
the publisher for the item

setPublisher

public void setPublisher(java.lang.String publisher)
Set the publisher for this catalog item
Specified by:
setPublisher in interface MutableCatalogItem

Parameters:
publisher - the new publisher for the item

getContributor

public java.lang.String getContributor()
Get the contributor for this catalog item

Returns:
the new contributor for the item

setContributor

public void setContributor(java.lang.String contributor)
Set the contributor for this catalog item
Specified by:
setContributor in interface MutableCatalogItem

Parameters:
contributor - the new contributor for the item

getCreationDate

public java.util.Date getCreationDate()
Get the creation date for this catalog item

Returns:
the creation date for the item

setCreationDate

public void setCreationDate(java.util.Date date)
Set the creation date for this catalog item
Specified by:
setCreationDate in interface MutableCatalogItem

Parameters:
date - the new creation date for the item

getSource

public java.lang.String getSource()
Get the source for this catalog item

Returns:
the source for the item

setSource

public void setSource(java.lang.String source)
Set the source for this catalog item
Specified by:
setSource in interface MutableCatalogItem

Parameters:
source - the new source for the item

getLanguage

public java.lang.String getLanguage()
Get the language for this catalog item

Returns:
the language for the item

setLanguage

public void setLanguage(java.lang.String language)
Set the language for this catalog item
Specified by:
setLanguage in interface MutableCatalogItem

Parameters:
language - the new language for the item

getRelation

public java.lang.String getRelation()
Get the relation for this catalog item

Returns:
the relation for the item

setRelation

public void setRelation(java.lang.String relation)
Set the relation for this catalog item
Specified by:
setRelation in interface MutableCatalogItem

Parameters:
relation - the new relation for the item

getCoverage

public java.lang.String getCoverage()
Get the coverage for this catalog item

Returns:
the coverage for the item

setCoverage

public void setCoverage(java.lang.String coverage)
Set the coverage for this catalog item
Specified by:
setCoverage in interface MutableCatalogItem

Parameters:
coverage - the new coverage for the item

getRights

public java.lang.String getRights()
Get the rights for this catalog item

Returns:
the rights for the item

setRights

public void setRights(java.lang.String rights)
Set the rights for this catalog item
Specified by:
setRights in interface MutableCatalogItem

Parameters:
rights - the new rights for the item

getImage

public ImageInfo getImage(int index)
Get an Image for this catalog item

Parameters:
index - the image to retrive, either SMALL_IMAGE_INDEX or LARGE_IMAGE_INDEX
Returns:
an ImageInfo object for the image

setImage

public void setImage(int index,
                     ImageInfo imageInfo)
Set an Image for this catalog item
Specified by:
setImage in interface MutableCatalogItem

Parameters:
index - the image to set, either SMALL_IMAGE_INDEX or LARGE_IMAGE_INDEX
an - ImageInfo object for the image

getModifiedDate

public java.util.Date getModifiedDate()
Get the modified date for this catalog item

Returns:
the modified date for the item

setModifiedDate

public void setModifiedDate(java.util.Date date)
Set the modified date for this catalog item
Specified by:
setModifiedDate in interface MutableCatalogItem

Parameters:
the - new modified date for the item

addPropertyValue

public void addPropertyValue(java.lang.String scopeName,
                             java.lang.String key,
                             java.lang.Object propertyValue)
                      throws SystemException,
                             java.rmi.RemoteException
Add the specified property value to the collection of values associated with the named key for the specified scope.

Parameters:
scopeName - The name of the scope.
key - The name to associate the collection of values with.
propertyValue - The value to associate with the key and scope.

addPropertyValueMapped

public void addPropertyValueMapped(java.lang.String scopeName,
                                   java.lang.String propertyKey,
                                   java.lang.String mappedKey,
                                   java.lang.Object propertyValue)
                            throws SystemException,
                                   java.rmi.RemoteException
Add the specified property value to the map object associated with the named key for the specified scope.

Parameters:
scopeName - The name of the scope.
propertykey - The name to associate the map object with.
mappedkey - The map key to associate the value in the map.
propertyValue - The value put in the map for the map key.

getProperty

public java.lang.Object getProperty(java.lang.String key,
                                    java.lang.Object defaultValue)
                             throws SystemException,
                                    java.rmi.RemoteException
Retrieve the value associated with the named key in the default scope. If the entity does not have the property defined, the property will be searched in the successor hiearchy for the default scope. If the property could not be found in the successor chain, a lookup for the default value defined for the PropertyMetaData in the Schema is returned. The Schema is retrieved using the SchemaGroupName environment property defined for the bean. If the property meta data is not available (or there is no Schema defined) then the specified default value is returned.

Parameters:
key - The name of the property to retrieve.
defaultValue - The value to return if that property is not set and there is not default value found in the Schema.

getProperty

public java.lang.Object getProperty(java.lang.String scopeName,
                                    java.lang.String key,
                                    ConfigurableEntity successor,
                                    java.lang.Object defaultValue)
                             throws SystemException,
                                    java.rmi.RemoteException
Retrieve the value associated with the named key in the specified scope. If the entity does not have the property defined for the specified scope, the property will be searched in the successor hiearchy using the explicit successor first and then the successor for the specified scope. If the could not be found in the successors hiearchy, a lookup for default value defined for the PropertyMetaData in the Schema is returned. The Schema is retrieved using the SchemaGroupName environment property defined for the bean. If the property meta data is not available (or there is no Schema defined) then the specified default value is returned.

Parameters:
scopeName - The name of the scope.
key - The name of the property to retrieve.
successor - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.
defaultValue - The value to return if that property is not set.

getProperties

public java.util.Map getProperties(java.lang.String scopeName)
                            throws SystemException,
                                   java.rmi.RemoteException

Parameters:
scopeName - The name of the scope.
key - The name of the property to retrieve.
successor - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.
defaultValue - The value to return if that property is not set.

getProperties

public java.util.Map getProperties()
                            throws SystemException,
                                   java.rmi.RemoteException

Parameters:
scopeName - The name of the scope.
key - The name of the property to retrieve.
successor - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.
defaultValue - The value to return if that property is not set.

getPropertyAsString

public java.lang.String getPropertyAsString(java.lang.String scopeName,
                                            java.lang.String key,
                                            ConfigurableEntity successor,
                                            java.lang.String defaultValue)
                                     throws SystemException,
                                            java.rmi.RemoteException
Retrieve the String value of the property associated the named key in the specified scope.

Parameters:
scopeName - The name of the scope.
key - The name of the property to retrieve.
successor - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.
defaultValue - The String to return if that property is not set.
See Also:
com.beasys.commerce.foundation.ConfigurableEntity#getProperty(String scopeName, String key, ConfigurableEntity successor, Object defaultValue)

getPropertyDefault

public java.lang.Object getPropertyDefault(java.lang.String scopeName,
                                           java.lang.String key,
                                           ConfigurableEntity successor)
                                    throws SystemException,
                                           java.rmi.RemoteException
Retrieve the default value from the Schema for the named key and the specified scope. This method is used by the implementation of the getProperty methods for retrieving the default value for a property from the successor hierarchy.

Parameters:
scopeName - The name of the scope.
key - The name of the property to retrieve.
successor - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.

getPropertyNoDefault

public java.lang.Object getPropertyNoDefault(java.lang.String scopeName,
                                             java.lang.String key,
                                             ConfigurableEntity successor)
                                      throws SystemException,
                                             java.rmi.RemoteException
Retrieve the value associated with the named key in the specified scope but does not return a default value if the property does not exist for the entity of in the hierarchy of successors. This method is used by the implementation of the getProperty methods so that the search in the successor hierarchy does not return a default value from the Schema.

Parameters:
scopeName - The name of the scope.
key - The name of the property to retrieve.
successor - The explicit successor to use for sucessor hiearchy search if the entity does not have the property defined.

getSuccessor

public ConfigurableEntity getSuccessor(java.lang.String scopeName)
                                throws SystemException,
                                       java.rmi.RemoteException
Retrieve the successor associated with this ConfigurableEntity for the specified scope.

Parameters:
scopeName - The name of the scope.

removeProperty

public java.lang.Object removeProperty(java.lang.String key)
                                throws SystemException,
                                       java.rmi.RemoteException
Remove the property associated with the named key in the default scope.

Parameters:
key - The name of the property to remove.

removeProperties

public void removeProperties()
                      throws SystemException,
                             java.rmi.RemoteException
Remove the property associated with the named key in the specified scope.

Parameters:
scopeName - The name of the scope.
key - The name of the property to remove.

removePropertyValue

public java.lang.Object removePropertyValue(java.lang.String scopeName,
                                            java.lang.String key,
                                            java.lang.Object propertyValue)
                                     throws SystemException,
                                            java.rmi.RemoteException
Remove the property value object from the collection associated with the named key in the specified scope.

Parameters:
scopeName - The name of the scope.
key - The name of the property that is associated with the collection of values.
propertyValue - The object to remove from the collection.

removePropertyValueMapped

public java.lang.Object removePropertyValueMapped(java.lang.String scopeName,
                                                  java.lang.String propertyKey,
                                                  java.lang.String mappedKey)
                                           throws SystemException,
                                                  java.rmi.RemoteException
Remove the property value object from the map associated with the named key in the specified scope.

Parameters:
scopeName - The name of the scope.
propertykey - The name of the property that is associated with the map.
propertyValue - The map key of the object to remove from the map.

removeSuccessor

public ConfigurableEntity removeSuccessor(java.lang.String scopeName)
                                   throws java.rmi.RemoteException
Remove the successor for the specified scope.

Parameters:
scopeName - The name of the scope.

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
                 throws SystemException,
                        java.rmi.RemoteException
Associate the specified value with the named key in the default scope.

Parameters:
name - The name to associate the value with.
value - The value to associate with the name.

setSuccessor

public void setSuccessor(java.lang.String scopeName,
                         ConfigurableEntity successor)
                  throws SystemException,
                         java.rmi.RemoteException
Set the successor for the specified scope.

Parameters:
scopeName - The name of the scope.
successor - The scope-level successor used during the search of a property.

addBusinessPolicy

public void addBusinessPolicy(java.lang.String policyKey,
                              BusinessPolicy businessPolicy)
                       throws SystemException,
                              java.rmi.RemoteException
Add a new business policy to the object with the specified key


getBusinessPolicy

public BusinessPolicy getBusinessPolicy(java.lang.String policyKey)
                                 throws SystemException,
                                        java.rmi.RemoteException
Retrieve the business policy with the specified key.


removeBusinessPolicy

public BusinessPolicy removeBusinessPolicy(java.lang.String policyKey)
                                    throws SystemException,
                                           java.rmi.RemoteException
Remove the business policy with the specified key.


getProperty

public java.lang.Object getProperty(java.lang.String propertySet,
                                    java.lang.String propertyName)
                             throws java.rmi.RemoteException
Retrieve the value that was persisted for this entity for the given property, within the given property set. If the entity does not have a value persisted for this property, the default value from the property set will be returned.

Parameters:
propertySet - The name of the property set to look in
propertyName - The name of the property to retrieve.
Returns:
the value for this property, or null if all searches failed

getPropertyAsString

public java.lang.String getPropertyAsString(java.lang.String propertySet,
                                            java.lang.String propertyName)
                                     throws java.rmi.RemoteException
Convenience method to return a property as a String.

Parameters:
propertySet - The name of the property set to look in
propertyName - The name of the property to retrieve.
Returns:
the value for this property as a String, or null if all searches failed

getPropertyNoDefault

public java.lang.Object getPropertyNoDefault(java.lang.String propertySet,
                                             java.lang.String propertyName)
                                      throws java.rmi.RemoteException
Retrieve the value associated with the named key in the specified property set, but does not return a default value from the property's PropertyDefinition if a value was not persisted for this entity. This method is used by the implementation of the getProperty methods so that the search in the successor hierarchy does not return a default value from the Schema.

Parameters:
propertySet - The name of the property set
propertyName - The name of the property to retrieve.
Returns:
the value for this property, or null if all searches failed

setProperty

public void setProperty(java.lang.String propertySet,
                        java.lang.String propertyName,
                        java.lang.Object value)
                 throws PropertyValidationException,
                        java.rmi.RemoteException
Associate the specified value with the named key in the specified property set.

Parameters:
propertySet - The name of the property set.
propertyName - The name of the property to assign
value - The value to associate with the property name
Throws:
PropertyValidationException - If the property value does not match the PropertyDefinition for this property set

removeProperty

public java.lang.Object removeProperty(java.lang.String propertySet,
                                       java.lang.String propertyName)
                                throws java.rmi.RemoteException
Remove the property associated with the named key in the specified property set.

NOTE: if an explicit setter method is found for this property, this method will set the value to null.

Parameters:
propertySet - The name of the property set.
propertyName - The name of the property to remove.
Returns:
the old value of the property, or null if there was none.

getUniqueId

public long getUniqueId()
                 throws java.rmi.RemoteException
Retrieve the unique identifier generated for this ConfigurableEntity. The unique identifier is used by the EntityPropertyManager to optimize the foreign keys in the persistent storage. This method may not be implemented in a lightweight implementation of ConfigurableEntity.

Returns:
this entity's unique id

getPkString

public java.lang.String getPkString()
                             throws java.rmi.RemoteException
Retrieve the pk string for an entity. A combination of pk string and jndi name is always unique between entities.

Returns:
the primary key string identifier for this entity

getJndiName

public java.lang.String getJndiName()
                             throws java.rmi.RemoteException
Retrieve the jndi name for an entity. A combination of pk string and jndi name is always unique between entities.

Returns:
the jndi name for this entity

clearPropertyModifications

protected void clearPropertyModifications()
Clears any changes to attributes that have been tracked for this object. This is an advanced method.


getModificationMap

protected java.util.Map getModificationMap()
Returns the Map that can be used to query the changes made to attributes in this object. The Map contains the names of the attributes that were modifed (keys) and the values for each modified attribute (values). This is an advanced method and is untested.


isPropertyModified

protected boolean isPropertyModified(java.lang.String fieldName)

Returns:
true if the named attribute has been modified since this object was created or clearPropertyModifications was called. This is an advanced method.

isPropertyExplicit

protected boolean isPropertyExplicit(java.lang.String fieldName)

Returns:
true if the named attribute is an explicit property. This is an advanced method.

initPropertyModifications

protected void initPropertyModifications()
Initialize change tracking. This is an advanced method.


modifyProperty

protected void modifyProperty(java.lang.String fieldName,
                              java.lang.Object value)
Mark an attribute as modified. This is an advanced method.

Parameters:
fieldName - the name of the attrbute
value - the new value for the attribute

toString

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

Returns:
the string
Overrides:
toString in class java.lang.Object

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved