MutableCatalogItemImpl Class
- public class MutableCatalogItemImpl
extends 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
Related Topics
MutableCatalogItem
-
Hierarchy
-
Object
MutableCatalogItemImpl
-
All Implemented Interfaces
-
CatalogItem
, ConfigurableEntity
, MutableCatalogItem
, Serializable
-
Direct Known Subclasses
-
MutableCategoryImpl
, MutableProductItemImpl
public void |
-
addBusinessPolicy (String policyKey, BusinessPolicy businessPolicy)
- Add a new business policy to the object with the specified key
|
public void |
-
addPropertyValue (String scopeName, String key, Object propertyValue)
- Add the specified property value to the collection of values
associated with the named key for the specified scope.
|
public void |
-
addPropertyValueMapped (String scopeName, String propertyKey, String mappedKey, 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.
|
public BusinessPolicy |
-
getBusinessPolicy (String policyKey)
- Retrieve the business policy with the specified key.
|
public String |
-
getContributor ()
- Get the contributor for this catalog item
|
public String |
-
getCoverage ()
- Get the coverage for this catalog item
|
public Date |
-
getCreationDate ()
- Get the creation date for this catalog item
|
public String |
-
getCreator ()
- Get the creator for this catalog item
|
public String |
-
getDescription (int index)
- Get the description for this catalog item
|
public ImageInfo |
-
getImage (int index)
- Get an Image for this catalog item
|
public String |
-
getJndiName ()
- Retrieve the jndi name for an entity.
|
public CatalogItemKey |
-
getKey ()
- Get the primary key for this catalog item
|
public String |
-
getLanguage ()
- Get the language for this catalog item
|
protected Map |
-
getModificationMap ()
- Returns the Map that can be used to query the changes
made to attributes in this object.
|
public Date |
-
getModifiedDate ()
- Get the modified date for this catalog item
|
public String |
-
getName ()
- Get the name for this catalog item
|
public String |
-
getPkString ()
- Retrieve the pk string for an entity.
|
public Map |
-
getProperties (String scopeName)
|
public Map |
-
getProperties ()
|
public Object |
-
getProperty (String key, Object defaultValue)
- Retrieve the value associated with the named key in the
default scope.
|
public Object |
-
getProperty (String scopeName, String key, ConfigurableEntity successor, Object defaultValue)
- Retrieve the value associated with the named key in the
specified scope.
|
public Object |
-
getProperty (String propertySet, String propertyName)
- Retrieve the value that was persisted for this entity for the
given property, within the given property set.
|
public String |
-
getPropertyAsString (String scopeName, String key, ConfigurableEntity successor, String defaultValue)
- Retrieve the String value of the property associated the
named key in the specified scope.
|
public String |
-
getPropertyAsString (String propertySet, String propertyName)
- Convenience method to return a property as a String.
|
public Object |
-
getPropertyDefault (String scopeName, String key, ConfigurableEntity successor)
- Retrieve the default value from the Schema for the
named key and the specified scope.
|
public Object |
-
getPropertyNoDefault (String scopeName, 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.
|
public Object |
-
getPropertyNoDefault (String propertySet, 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.
|
public String |
-
getPublisher ()
- Get the publisher for this catalog item
|
public String |
-
getRelation ()
- Get the relation for this catalog item
|
public String |
-
getRights ()
- Get the rights for this catalog item
|
public String |
-
getSource ()
- Get the source for this catalog item
|
public ConfigurableEntity |
-
getSuccessor (String scopeName)
- Retrieve the successor associated with this ConfigurableEntity
for the specified scope.
|
public long |
-
getUniqueId ()
- Retrieve the unique identifier generated for this ConfigurableEntity.
|
protected void |
-
initPropertyModifications ()
- Initialize change tracking.
|
protected boolean |
-
isPropertyExplicit (String fieldName)
|
protected boolean |
-
isPropertyModified (String fieldName)
|
protected void |
-
modifyProperty (String fieldName, Object value)
- Mark an attribute as modified.
|
public BusinessPolicy |
-
removeBusinessPolicy (String policyKey)
- Remove the business policy with the specified key.
|
public void |
-
removeProperties ()
- Remove the property associated with the named key in the specified
scope.
|
public Object |
-
removeProperty (String key)
- Remove the property associated with the named key in the default
scope.
|
public Object |
-
removeProperty (String propertySet, String propertyName)
- Remove the property associated with the named key in the specified
property set.
|
public Object |
-
removePropertyValue (String scopeName, String key, Object propertyValue)
- Remove the property value object from the collection
associated with the named key in the specified scope.
|
public Object |
-
removePropertyValueMapped (String scopeName, String propertyKey, String mappedKey)
- Remove the property value object from the map
associated with the named key in the specified scope.
|
public ConfigurableEntity |
-
removeSuccessor (String scopeName)
- Remove the successor for the specified scope.
|
public void |
-
setContributor (String contributor)
- Set the contributor for this catalog item
|
public void |
-
setCoverage (String coverage)
- Set the coverage for this catalog item
|
public void |
-
setCreationDate (Date date)
- Set the creation date for this catalog item
|
public void |
-
setCreator (String creator)
- Set the creator for this catalog item
|
public void |
-
setDescription (int index, String description)
- Set the description for this catalog item
|
public void |
-
setImage (int index, ImageInfo imageInfo)
- Set an Image for this catalog item
|
public void |
-
setLanguage (String language)
- Set the language for this catalog item
|
public void |
-
setModifiedDate (Date date)
- Set the modified date for this catalog item
|
public void |
-
setName (String name)
- Set the name for this catalog item
|
public void |
-
setProperty (String key, Object value)
- Associate the specified value with the named key in the default scope.
|
public void |
-
setProperty (String propertySet, String propertyName, Object value)
- Associate the specified value with the named key in the specified
property set.
|
public void |
-
setPublisher (String publisher)
- Set the publisher for this catalog item
|
public void |
-
setRelation (String relation)
- Set the relation for this catalog item
|
public void |
-
setRights (String rights)
- Set the rights for this catalog item
|
public void |
-
setSource (String source)
- Set the source for this catalog item
|
public void |
-
setSuccessor (String scopeName, ConfigurableEntity successor)
- Set the successor for the specified scope.
|
public String |
-
toString ()
- Builds a string representation of this object.
|
Methods from interface com.beasys.commerce.ebusiness.catalog.CatalogItem |
getContributor , getCoverage , getCreationDate , getCreator , getDescription , getImage , getKey , getLanguage , getModifiedDate , getName , getPublisher , getRelation , getRights , getSource
|
Methods from interface com.beasys.commerce.ebusiness.catalog.MutableCatalogItem |
setContributor , setCoverage , setCreationDate , setCreator , setDescription , setImage , setLanguage , setModifiedDate , setName , setPublisher , setRelation , setRights , setSource
|
addBusinessPolicy(String, BusinessPolicy) Method
public void addBusinessPolicy(String
policyKey,
BusinessPolicy
businessPolicy)
throws SystemException
, RemoteException
Add a new business policy to the object with the specified key
Exceptions
-
SystemException
-
RemoteException
addPropertyValue(String, String, Object) Method
public void addPropertyValue(String
scopeName,
String
key,
Object
propertyValue)
throws SystemException
, 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.
Exceptions
-
SystemException
-
RemoteException
addPropertyValueMapped(String, String, String, Object) Method
public void addPropertyValueMapped(String
scopeName,
String
propertyKey,
String
mappedKey,
Object
propertyValue)
throws SystemException
, 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.
Exceptions
-
SystemException
-
RemoteException
clearPropertyModifications() Method
protected void clearPropertyModifications()
Clears any changes to attributes that have been tracked
for this object.
This is an advanced method.
getBusinessPolicy(String) Method
public BusinessPolicy
getBusinessPolicy(String
policyKey)
throws SystemException
, RemoteException
Retrieve the business policy with the specified key.
Exceptions
-
SystemException
-
RemoteException
getContributor() Method
public String
getContributor()
Get the contributor for this catalog item
Returns
- the new contributor for the item
getCoverage() Method
public String
getCoverage()
Get the coverage for this catalog item
Returns
- the coverage for the item
getCreationDate() Method
public Date
getCreationDate()
Get the creation date for this catalog item
Returns
- the creation date for the item
getCreator() Method
public String
getCreator()
Get the creator for this catalog item
Returns
- the creator for the item
getDescription(int) Method
public 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
getImage(int) Method
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
getJndiName() Method
public String
getJndiName()
throws 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
Exceptions
-
RemoteException
getKey() Method
public CatalogItemKey
getKey()
Get the primary key for this catalog item
Returns
- the primary key for the item
getLanguage() Method
public String
getLanguage()
Get the language for this catalog item
Returns
- the language for the item
getModificationMap() Method
protected 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.
getModifiedDate() Method
public Date
getModifiedDate()
Get the modified date for this catalog item
Returns
- the modified date for the item
getName() Method
public String
getName()
Get the name for this catalog item
Returns
- the name for the item
getPkString() Method
public String
getPkString()
throws 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
Exceptions
-
RemoteException
getProperties(String) Method
public Map
getProperties(String
scopeName)
throws SystemException
, RemoteException
Parameters
-
scopeName
- The name of the scope.
Exceptions
-
SystemException
-
RemoteException
getProperties() Method
public Map
getProperties()
throws SystemException
, RemoteException
Exceptions
-
SystemException
-
RemoteException
getProperty(String, Object) Method
public Object
getProperty(String
key,
Object
defaultValue)
throws SystemException
, 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.
Exceptions
-
SystemException
-
RemoteException
getProperty(String, String, ConfigurableEntity, Object) Method
public Object
getProperty(String
scopeName,
String
key,
ConfigurableEntity
successor,
Object
defaultValue)
throws SystemException
, 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.
Exceptions
-
SystemException
-
RemoteException
getProperty(String, String) Method
public Object
getProperty(String
propertySet,
String
propertyName)
throws 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
Exceptions
-
RemoteException
getPropertyAsString(String, String, ConfigurableEntity, String) Method
public String
getPropertyAsString(String
scopeName,
String
key,
ConfigurableEntity
successor,
String
defaultValue)
throws SystemException
, 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.
Exceptions
-
SystemException
-
RemoteException
Related Topics
ConfigurableEntity.getProperty(String, String)
getPropertyAsString(String, String) Method
public String
getPropertyAsString(String
propertySet,
String
propertyName)
throws 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
Exceptions
-
RemoteException
getPropertyDefault(String, String, ConfigurableEntity) Method
public Object
getPropertyDefault(String
scopeName,
String
key,
ConfigurableEntity
successor)
throws SystemException
, 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.
Exceptions
-
SystemException
-
RemoteException
getPropertyNoDefault(String, String, ConfigurableEntity) Method
public Object
getPropertyNoDefault(String
scopeName,
String
key,
ConfigurableEntity
successor)
throws SystemException
, 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.
Exceptions
-
SystemException
-
RemoteException
getPropertyNoDefault(String, String) Method
public Object
getPropertyNoDefault(String
propertySet,
String
propertyName)
throws 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
Exceptions
-
RemoteException
getPublisher() Method
public String
getPublisher()
Get the publisher for this catalog item
Returns
- the publisher for the item
getRelation() Method
public String
getRelation()
Get the relation for this catalog item
Returns
- the relation for the item
getRights() Method
public String
getRights()
Get the rights for this catalog item
Returns
- the rights for the item
getSource() Method
public String
getSource()
Get the source for this catalog item
Returns
- the source for the item
getSuccessor(String) Method
public ConfigurableEntity
getSuccessor(String
scopeName)
throws SystemException
, RemoteException
Retrieve the successor associated with this ConfigurableEntity
for the specified scope.
Parameters
-
scopeName
- The name of the scope.
Exceptions
-
SystemException
-
RemoteException
getUniqueId() Method
public long getUniqueId()
throws 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
Exceptions
-
RemoteException
initPropertyModifications() Method
protected void initPropertyModifications()
Initialize change tracking.
This is an advanced method.
isPropertyExplicit(String) Method
protected boolean isPropertyExplicit(String
fieldName)
Returns
- true if the named attribute is an
explicit property.
This is an advanced method.
isPropertyModified(String) Method
protected boolean isPropertyModified(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.
modifyProperty(String, Object) Method
protected void modifyProperty(String
fieldName,
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
removeBusinessPolicy(String) Method
public BusinessPolicy
removeBusinessPolicy(String
policyKey)
throws SystemException
, RemoteException
Remove the business policy with the specified key.
Exceptions
-
SystemException
-
RemoteException
removeProperties() Method
public void removeProperties()
throws SystemException
, RemoteException
Remove the property associated with the named key in the specified
scope.
Exceptions
-
SystemException
-
RemoteException
removeProperty(String) Method
public Object
removeProperty(String
key)
throws SystemException
, RemoteException
Remove the property associated with the named key in the default
scope.
Parameters
-
key
- The name of the property to remove.
Exceptions
-
SystemException
-
RemoteException
removeProperty(String, String) Method
public Object
removeProperty(String
propertySet,
String
propertyName)
throws 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.
Exceptions
-
RemoteException
removePropertyValue(String, String, Object) Method
public Object
removePropertyValue(String
scopeName,
String
key,
Object
propertyValue)
throws SystemException
, 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.
Exceptions
-
SystemException
-
RemoteException
removePropertyValueMapped(String, String, String) Method
public Object
removePropertyValueMapped(String
scopeName,
String
propertyKey,
String
mappedKey)
throws SystemException
, 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.
-
mappedKey
- The map key of the object to remove from the map.
Exceptions
-
SystemException
-
RemoteException
removeSuccessor(String) Method
public ConfigurableEntity
removeSuccessor(String
scopeName)
throws RemoteException
Remove the successor for the specified scope.
Parameters
-
scopeName
- The name of the scope.
Exceptions
-
RemoteException
setContributor(String) Method
public void setContributor(String
contributor)
Set the contributor for this catalog item
Parameters
-
contributor
- the new contributor for the item
setCoverage(String) Method
public void setCoverage(String
coverage)
Set the coverage for this catalog item
Parameters
-
coverage
- the new coverage for the item
setCreationDate(Date) Method
public void setCreationDate(Date
date)
Set the creation date for this catalog item
Parameters
-
date
- the new creation date for the item
setCreator(String) Method
public void setCreator(String
creator)
Set the creator for this catalog item
Parameters
-
creator
- the new creator for the item
setDescription(int, String) Method
public void setDescription(int index,
String
description)
Set the description for this catalog item
Parameters
-
index
- the description to set, either CatalogItem.SHORT_DESCRIPTION_INDEX or CatalogItem.LONG_DESCRIPTION_INDEX
-
description
- the new description for the item
setImage(int, ImageInfo) Method
public void setImage(int index,
ImageInfo
imageInfo)
Set an Image for this catalog item
Parameters
-
index
- the image to set, either SMALL_IMAGE_INDEX or LARGE_IMAGE_INDEX
-
imageInfo
- ImageInfo object for the image
setLanguage(String) Method
public void setLanguage(String
language)
Set the language for this catalog item
Parameters
-
language
- the new language for the item
setModifiedDate(Date) Method
public void setModifiedDate(Date
date)
Set the modified date for this catalog item
Parameters
-
date
- new modified date for the item
setName(String) Method
public void setName(String
name)
Set the name for this catalog item
Parameters
-
name
- new name for the item
setProperty(String, Object) Method
public void setProperty(String
key,
Object
value)
throws SystemException
, RemoteException
Associate the specified value with the named key in the default scope.
Parameters
-
key
- The name to associate the value with.
-
value
- The value to associate with the name.
Exceptions
-
SystemException
-
RemoteException
setProperty(String, String, Object) Method
public void setProperty(String
propertySet,
String
propertyName,
Object
value)
throws PropertyValidationException
, 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
Exceptions
-
PropertyValidationException
- If the property value does not match the PropertyDefinition for this property set
-
RemoteException
setPublisher(String) Method
public void setPublisher(String
publisher)
Set the publisher for this catalog item
Parameters
-
publisher
- the new publisher for the item
setRelation(String) Method
public void setRelation(String
relation)
Set the relation for this catalog item
Parameters
-
relation
- the new relation for the item
setRights(String) Method
public void setRights(String
rights)
Set the rights for this catalog item
Parameters
-
rights
- the new rights for the item
setSource(String) Method
public void setSource(String
source)
Set the source for this catalog item
Parameters
-
source
- the new source for the item
setSuccessor(String, ConfigurableEntity) Method
public void setSuccessor(String
scopeName,
ConfigurableEntity
successor)
throws SystemException
, 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.
Exceptions
-
SystemException
-
RemoteException
toString() Method
public String
toString()
Builds a string representation of this object.
-
Overrides
-
Object.toString()
Returns
- the string