public class InventoryAvailabilityPropertyDescriptor extends RepositoryPropertyDescriptor
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
isIdProperty
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION |
EMPTY_LIST, EMPTY_MAP, EMPTY_SET, FOREIGN_REPOSITORY_NAME, FOREIGN_REPOSITORY_PATH, mCollectionOrMap
PORTABLE_VALUE_KEY
BUNDLE_ATTRIBUTE_NAME, LOCALE_ATTRIBUTE_NAME
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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. |
clone, createPropertyDescriptorFromType, getCascadeDelete, getCascadeInsert, getCascadeUpdate, getComponentItemDescriptor, getComponentPropertyBeanInfo, getDefaultValue, getDefaultValueString, getEnumeratedValues, getItemDescriptor, getLocalizedResourceBundle, getPropertyBeanInfo, getPropertyItemDescriptor, getResourceBundle, getResourceBundleName, getSecureLogging, getSecureLoggingFormatter, getSecureLoggingString, getUnmodifiableDefaultValue, isAssignableFrom, isCacheable, isCollectionOrMap, isDerived, isIdProperty, isIgnoreNullValue, isLoggingDebug, isMultiValued, isPersistent, isSecureLogging, isValidValue, isVersionable, isVersionableSet, registerPropertyDescriptorClass, setCacheable, setCascadeDelete, setCascadeInsert, setCascadeUpdate, setComponentItemDescriptor, setDefaultValue, setDefaultValueString, setDerived, setIdProperty, setIgnoreNullValue, setItemDescriptor, setLoggingDebug, setPersistent, setPropertyItemDescriptor, setPropertyType, setPropertyValue, setQueryable, setResourceBundleName, setSecureLogging, setSecureLoggingFormatter, setVersionable, toString
createLocalePropertyEditor, createLocalePropertyEditor, createPropertyEditor, getComponentPropertyType, getLocale, getPropertyEditorClass, getPropertyType, getUIPropertyEditor, isReadable, isRequired, setComponentPropertyType, setPropertyEditorClass, setReadable, setRequired, setWritable
copyFeatureDescriptor, getDisplayName, getDisplayNameResource, getDisplaySortString, getShortDescription, getShortDescriptionResource, getSortString, setDisplayNameResource, setShortDescriptionResource
public InventoryAvailabilityPropertyDescriptor()
public InventoryAvailabilityPropertyDescriptor(java.lang.String pPropertyName)
pPropertyName
- the name of the propertypublic InventoryAvailabilityPropertyDescriptor(java.lang.String pPropertyName, java.lang.Class pPropertyType, java.lang.String pShortDescription)
pPropertyName
- the property namepPropertyType
- the property typepShortDescription
- the property short descriptionpublic InventoryManager getInventoryManager()
public void setInventoryManager(InventoryManager pInventoryManager)
pInventoryManager
- the inventory managerpublic java.lang.String getItemListIdentifier()
public void setItemListIdentifier(java.lang.String pItemListIdentifier)
pItemListIdentifier
- the property that contains a list of RepositoryItemspublic void setInventoryStatus(int pInventoryStatus)
pInventoryStatus
- should be one of the four Inventory Status types from the InventoryManager classpublic int getInventoryStatus()
public java.lang.Object getPropertyValue(RepositoryItemImpl pItem, java.lang.Object pValue)
mItemListIdentifier
. Take this list and filter out the items
whose inventoryStatus does not match that of mInventoryStatus
. Return
the resulting items.getPropertyValue
in class RepositoryPropertyDescriptor
pItem
- RepositoryItem representing an object that contains a list of RepositoryItemspValue
- not usedpublic java.lang.String getTypeName()
getTypeName
in class RepositoryPropertyDescriptor
public void setValue(java.lang.String pAttributeName, java.lang.Object pValue)
inventoryManagerPath
or
itemListIdentifier
and set the property.setValue
in class RepositoryPropertyDescriptor
pAttributeName
- the name of the attribute to be setpValue
- the value of the attribute that should be setpublic boolean isQueryable()
isQueryable
in class RepositoryPropertyDescriptor
public boolean isWritable()
isWritable
in class DynamicPropertyDescriptor