|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap atg.commerce.catalog.comparison.ProductComparisonList.Entry
public static class ProductComparisonList.Entry
Entry is specifically designed for comparing catalog-based category/product/sku tuples rather than simple Java objects.
Entry will always contain at least the following set of properties:
id
- the unique id that identifies this list entry.
product
- the product repository item for this
list entry. This value should never be null in normal usage.
category
- the category repository item for this
list entry. This value may be null if no parent category was specified
when the list entry was created, and no default parent category exists
for the product in question.
sku
- the sku repository item for this list entry.
This value may be null if no sku was specified when the list entry was
created, and no default sku exists for the product in question.
siteId
- the site id, that entry belongs to
inventoryInfo
- inventory levels and status information
for the entry's sku, represented as an instance of the
InventoryData
class.
priceInfo
- an
ItemPriceInfo
object describing
the unit price of a single instance of the specified product and sku, or null
if no sku was specified and no default sku exists for the product.
productLink
- an HTML fragment that links to the
product's page in the catalog. The default format of the HTML returned
is <a href=product.template.url?id=product.repositoryId>product.displayName</a>
but this can be changed by setting productLinkFormat
.
The HTML is stored in a property of each list entry to make it easy to
display the link using a TableInfo
component.
categoryLink
- an HTML fragment that links to the
category's page in the catalog. The default format of the HTML returned
is <a href=category.template.url?id=category.repositoryId>category.displayName</a>
but this can be changed by setting productLinkFormat
.
As with productLink
, the HTML is stored in a property of
each list entry to make it easy to display the link using a
TableInfo
component.
Nested Class Summary | |
---|---|
static class |
ProductComparisonList.Entry.InventoryData
Inner class to capture and hold inventory data; returns the same readable properties as atg.commerce.inventory.InventoryInfo, but is serializable so it can participate in session failover. |
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
ProductComparisonList.Entry()
Create a new Entry and store its id in the hashtable so that entry.id works from jhtml pages. |
Method Summary | |
---|---|
protected boolean |
compareItems(RepositoryItem thisValue,
RepositoryItem thatValue)
Compare two repository items for equality, allowing for null values. |
protected boolean |
compareObjects(java.lang.Object thisValue,
java.lang.Object thatValue)
Compare two objects for equality, allowing for null values. |
boolean |
equals(java.lang.Object pObj)
Compare two Entries for equality, where equality is defined as both Entries having the same category, product, and sku. |
RepositoryItem |
getCategory()
Get the category for this comparison list entry. |
java.lang.String |
getCategoryLink()
Get the HTML that links to the category page for this comparison list entry. |
int |
getId()
Get an id that uniquely identifies this particular list entry. |
ProductComparisonList.Entry.InventoryData |
getInventoryInfo()
Get the InventoryData object for this comparison list entry. |
ItemPriceInfo |
getPriceInfo()
Get the ItemPriceInfo object for this comparison list entry. |
RepositoryItem |
getProduct()
Get the product for this comparison list entry. |
java.lang.String |
getProductLink()
Get the HTML that links to the product page for this comparison list entry. |
java.lang.String |
getSiteId()
Get the site id for this comparison list entry. |
RepositoryItem |
getSku()
Get the SKU for this comparison list entry. |
protected boolean |
match(RepositoryItem pProduct,
RepositoryItem pCategory,
RepositoryItem pSku,
java.lang.String pSiteId)
Compares entry's product, category, sku, and site id with pProduct, pCategory, pSku, and pSiteID accordingly. |
protected boolean |
match(java.lang.String pProductId,
java.lang.String pCategoryId,
java.lang.String pSkuId,
java.lang.String pSiteID)
Compares entry's product id, category id, sku id, site id with pProductId, pCategoryId, pSkuId, pSiteID accordingly |
void |
setCategory(RepositoryItem pCategory)
Set the category for this comparison list entry. |
void |
setCategoryLink(java.lang.String pHTML)
Set the HTML that links to the category page for this comparison list entry. |
void |
setInventoryFrom(InventoryInfo pInfo)
Set the InventoryData object for this comparison list entry using an InventoryInfo object as an exemplar. |
void |
setInventoryInfo(ProductComparisonList.Entry.InventoryData pInfo)
Set the InventoryData object for this comparison list entry. |
void |
setPriceInfo(ItemPriceInfo pPrice)
Set the ItemPriceInfo object for this comparison list entry. |
void |
setProduct(RepositoryItem pProduct)
Set the product for this comparison list entry. |
void |
setProductLink(java.lang.String pHTML)
Set the HTML that links to the product page for this comparison list entry. |
void |
setSiteId(java.lang.String pSiteId)
Set the site id for this comparison list entry. |
void |
setSku(RepositoryItem pSku)
Set the SKU for this comparison list entry. |
java.lang.String |
toString()
Return a string representation of this Entry for debugging purposes. |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
hashCode |
Constructor Detail |
---|
public ProductComparisonList.Entry()
Method Detail |
---|
public RepositoryItem getProduct()
public void setProduct(RepositoryItem pProduct)
public java.lang.String getProductLink()
public void setProductLink(java.lang.String pHTML)
public RepositoryItem getCategory()
public void setCategory(RepositoryItem pCategory)
public java.lang.String getCategoryLink()
public void setCategoryLink(java.lang.String pHTML)
public RepositoryItem getSku()
public void setSku(RepositoryItem pSku)
public java.lang.String getSiteId()
public void setSiteId(java.lang.String pSiteId)
public void setInventoryFrom(InventoryInfo pInfo)
public void setInventoryInfo(ProductComparisonList.Entry.InventoryData pInfo)
public ProductComparisonList.Entry.InventoryData getInventoryInfo()
public void setPriceInfo(ItemPriceInfo pPrice)
public ItemPriceInfo getPriceInfo()
public int getId()
public boolean equals(java.lang.Object pObj)
equals
in interface java.util.Map
equals
in class java.util.AbstractMap
protected boolean match(java.lang.String pProductId, java.lang.String pCategoryId, java.lang.String pSkuId, java.lang.String pSiteID)
pProductId
- product idpCategoryId
- category idpSkuId
- sku idpSiteID
- site id
protected boolean match(RepositoryItem pProduct, RepositoryItem pCategory, RepositoryItem pSku, java.lang.String pSiteId)
pProduct
- product repository itempCategory
- category repository itempSku
- SKU repository itempSiteId
- site Id
protected boolean compareObjects(java.lang.Object thisValue, java.lang.Object thatValue)
protected boolean compareItems(RepositoryItem thisValue, RepositoryItem thatValue)
public java.lang.String toString()
toString
in class java.util.AbstractMap
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |