atg.commerce.inventory
Class InventoryAvailabilityPropertyDescriptor

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

public class InventoryAvailabilityPropertyDescriptor
extends RepositoryPropertyDescriptor

In the most general case, this property descriptor can take a RepositoryItem and extract out of it a list of RepositoryItems. It will then iterate through this list of RepositoryItems to check their Inventory Status. It will return all the RepositoryItems whose inventory status is equal to the configured inventoryStatus. It is flexible enough to use any inventory manager to query for availability status, can extract a list of RepositoryItems from any property and check for any inventory status.

In the out of the box state, this implementation will look for a list of Sku items and check each sku to see if it has a status of InventoryManager.AVAILABILITY_STATUS_IN_STOCK. For those that are available it will return this list. One example of this usage would be if a list of alternate skus was defined for a sku item. This could be a list of upsell items or replacement skus. This property descriptor would allow only those skus that are currently available.

Properties that can be configured via the attribute tags in the GSA template

See Also:
RepositoryPropertyDescriptor, InventoryManager, Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
           
 
Fields inherited from class atg.repository.RepositoryPropertyDescriptor
EMPTY_LIST, EMPTY_MAP, EMPTY_SET, FOREIGN_REPOSITORY_NAME, 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
InventoryAvailabilityPropertyDescriptor()
          Constructs a new InventoryAvailabilityPropertyDescriptor
InventoryAvailabilityPropertyDescriptor(java.lang.String pPropertyName)
          Constructs a new InventoryAvailabilityPropertyDescriptor property descriptor with the given name
InventoryAvailabilityPropertyDescriptor(java.lang.String pPropertyName, java.lang.Class pPropertyType, java.lang.String pShortDescription)
          Constructs a new InventoryAvailabilityPropertyDescriptor property descriptor with the given name, property type and short description.
 
Method Summary
 InventoryManager getInventoryManager()
          Return the InventoryManager that is used to query for the availability of a particular item.
 int getInventoryStatus()
          Get the inventory status that is being checked for
 java.lang.String getItemListIdentifier()
          Get the the property of a RepositoryItem that contains a list of RepositoryItems that will be checked for availability.
 java.lang.Object getPropertyValue(RepositoryItemImpl pItem, java.lang.Object pValue)
          From the parameter pItem, obtain a list of RepositoryItems.
 java.lang.String getTypeName()
          Returns the type of property descriptor that this class defines.
 boolean isQueryable()
          Return the property queryable
 boolean isWritable()
          Return the property writable
 void setInventoryManager(InventoryManager pInventoryManager)
          Set the InventoryManger that is going to be used to query the availability of a item.
 void setInventoryStatus(int pInventoryStatus)
          Set the inventory status that is going to be checked for.
 void setItemListIdentifier(java.lang.String pItemListIdentifier)
          Set the property that contains a list of RepositoryItems that will be checked for availability.
 void setValue(java.lang.String pAttributeName, java.lang.Object pValue)
          Looks for an attribute named either inventoryManagerPath or itemListIdentifier and set the property.
 
Methods inherited from class atg.repository.RepositoryPropertyDescriptor
clone, createPropertyDescriptorFromType, getCascadeDelete, getCascadeInsert, getCascadeUpdate, getComponentItemDescriptor, getComponentPropertyBeanInfo, getDefaultValue, getDefaultValueString, getItemDescriptor, getPropertyBeanInfo, getPropertyItemDescriptor, getResourceBundle, getResourceBundleName, getUnmodifiableDefaultValue, isAssignableFrom, isCacheable, isCollectionOrMap, isDerived, isIdProperty, isIgnoreNullValue, isLoggingDebug, isMultiValued, isPersistent, isValidValue, isVersionable, isVersionableSet, registerPropertyDescriptorClass, setCacheable, setCascadeDelete, setCascadeInsert, setCascadeUpdate, setComponentItemDescriptor, setDefaultValue, setDefaultValueString, setDerived, setIdProperty, setIgnoreNullValue, setItemDescriptor, setLoggingDebug, setPersistent, setPropertyItemDescriptor, setPropertyType, setPropertyValue, setQueryable, setResourceBundleName, setVersionable, toString
 
Methods inherited from class atg.beans.DynamicPropertyDescriptor
createLocalePropertyEditor, createLocalePropertyEditor, createPropertyEditor, getComponentPropertyType, getPropertyEditorClass, getPropertyType, getUIPropertyEditor, isReadable, isRequired, setComponentPropertyType, setPropertyEditorClass, setReadable, setRequired, setWritable
 
Methods inherited from class atg.beans.SerializableFeatureDescriptor
copyFeatureDescriptor, getDisplayName, getDisplayNameResource, getDisplaySortString, getShortDescription, getShortDescriptionResource, getSortString, setDisplayNameResource, setShortDescriptionResource
 
Methods inherited from class java.beans.FeatureDescriptor
attributeNames, getName, getValue, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Constructor Detail

InventoryAvailabilityPropertyDescriptor

public InventoryAvailabilityPropertyDescriptor()
Constructs a new InventoryAvailabilityPropertyDescriptor


InventoryAvailabilityPropertyDescriptor

public InventoryAvailabilityPropertyDescriptor(java.lang.String pPropertyName)
Constructs a new InventoryAvailabilityPropertyDescriptor property descriptor with the given name

Parameters:
pPropertyName - the name of the property

InventoryAvailabilityPropertyDescriptor

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

Parameters:
pPropertyName - the property name
pPropertyType - the property type
pShortDescription - the property short description
Method Detail

getInventoryManager

public InventoryManager getInventoryManager()
Return the InventoryManager that is used to query for the availability of a particular item.

Returns:
the inventory manager

setInventoryManager

public void setInventoryManager(InventoryManager pInventoryManager)
Set the InventoryManger that is going to be used to query the availability of a item.

Parameters:
pInventoryManager - the inventory manager

getItemListIdentifier

public java.lang.String getItemListIdentifier()
Get the the property of a RepositoryItem that contains a list of RepositoryItems that will be checked for availability.

Returns:
the property that contains the item list

setItemListIdentifier

public void setItemListIdentifier(java.lang.String pItemListIdentifier)
Set the property that contains a list of RepositoryItems that will be checked for availability.

Parameters:
pItemListIdentifier - the property that contains a list of RepositoryItems

setInventoryStatus

public void setInventoryStatus(int pInventoryStatus)
Set the inventory status that is going to be checked for.

Parameters:
pInventoryStatus - should be one of the four Inventory Status types from the InventoryManager class

getInventoryStatus

public int getInventoryStatus()
Get the inventory status that is being checked for

Returns:
the inventory status

getPropertyValue

public java.lang.Object getPropertyValue(RepositoryItemImpl pItem,
                                         java.lang.Object pValue)
From the parameter pItem, obtain a list of RepositoryItems. This list is a property of pItem as defined by mItemListIdentifier. Take this list and filter out the items whose inventoryStatus does not match that of mInventoryStatus. Return the resulting items.

Overrides:
getPropertyValue in class RepositoryPropertyDescriptor
Parameters:
pItem - RepositoryItem representing an object that contains a list of RepositoryItems
pValue - not used
Returns:
the list of available items

getTypeName

public java.lang.String getTypeName()
Returns the type of property descriptor that this class defines. It is type TYPE_NAME

Overrides:
getTypeName in class RepositoryPropertyDescriptor
Returns:
the property descriptor type that this class defines

setValue

public void setValue(java.lang.String pAttributeName,
                     java.lang.Object pValue)
Looks for an attribute named either inventoryManagerPath or itemListIdentifier and set the property.

Overrides:
setValue in class RepositoryPropertyDescriptor
Parameters:
pAttributeName - the name of the attribute to be set
pValue - the value of the attribute that should be set

isQueryable

public boolean isQueryable()
Return the property queryable

Overrides:
isQueryable in class RepositoryPropertyDescriptor
Returns:
true if this property can be queried

isWritable

public boolean isWritable()
Return the property writable

Overrides:
isWritable in class DynamicPropertyDescriptor
Returns:
true if this property can be written to