Class ProductList
Represents a list of products (and optionally a gift certificate) that is
typically maintained by a customer. This class can be used to implement
a number of different storefront features, e.g. shopping list, wish list and gift registry.
A product list is always owned by a customer. The owner can be anonymous or a registered customer.
The owner can be the person for which items from that list will be purchased (wish list).
Or it can be a person who maintains the list, for example a gift registry, on behalf of the bridal couple.
Each product list can have a registrant and a co-registrant. A registrant is typically associated with an event related product list
such as a gift registry. It holds information about a person associated with the
event such as a bride or groom.
A shipping address can be associated with this product list to ship the items,
e.g. to an event location. A post-event shipping address can be associated to
ship items to which could not be delivered on event date.
The product list can also hold information about the event date and event location.
Constant Summary
Property Summary
Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
Methods inherited from class ExtensibleObject
describe , getCustom
Methods inherited from class PersistentObject
getCreationDate , getLastModified , getUUID
Methods inherited from class Object
assign , create , create , defineProperties , defineProperty , entries , freeze , fromEntries , getOwnPropertyDescriptor , getOwnPropertyNames , getOwnPropertySymbols , getPrototypeOf , hasOwnProperty , is , isExtensible , isFrozen , isPrototypeOf , isSealed , keys , preventExtensions , propertyIsEnumerable , seal , setPrototypeOf , toLocaleString , toString , valueOf , values
Constant Details
EXPORT_STATUS_EXPORTED
EXPORT_STATUS_EXPORTED: Number = 1
Constant for when Export Status is Exported
EXPORT_STATUS_NOTEXPORTED
EXPORT_STATUS_NOTEXPORTED: Number = 0
Constant for when Export Status is Not Exported
TYPE_CUSTOM_1
TYPE_CUSTOM_1: Number = 100
Constant representing a custom list type attribute.
TYPE_CUSTOM_2
TYPE_CUSTOM_2: Number = 101
Constant representing a custom list type attribute.
TYPE_CUSTOM_3
TYPE_CUSTOM_3: Number = 102
Constant representing a custom list type attribute.
TYPE_GIFT_REGISTRY
TYPE_GIFT_REGISTRY: Number = 11
Constant representing the gift registry type attribute.
TYPE_SHOPPING_LIST
TYPE_SHOPPING_LIST: Number = 12
Constant representing the shopping list type attribute.
TYPE_WISH_LIST
TYPE_WISH_LIST: Number = 10
Constant representing the wish list registry type attribute.
Property Details
ID
ID: String (read-only)
Returns the unique system generated ID of the object.
anonymous
anonymous: Boolean (read-only)
Returns true if this product list is owned by an anonymous customer.
coRegistrant
coRegistrant: ProductListRegistrant (read-only)
Returns the ProductListRegistrant assigned to the coRegistrant attribute or null
if this list has no co-registrant.
currentShippingAddress
currentShippingAddress: CustomerAddress (read-only)
This is a helper method typically used with an event related list.
It provides the appropriate shipping address based on the eventDate.
If the current date is after the eventDate, then the postEventShippingAddress
is returned, otherwise the shippingAddress is returned. If the eventDate
is null, then null is returned.
description
description: String
Returns a description text that, for example, explains the purpose of this product list.
eventCity
eventCity: String
For event related uses (e.g. gift registry), this holds the event city.
eventCountry
eventCountry: String
For event related uses (e.g. gift registry), this holds the event country.
eventDate
eventDate: Date
For event related uses (e.g. gift registry), this holds the date
of the event.
eventState
eventState: String
For event related uses (e.g. gift registry), this holds the event state.
eventType
eventType: String
For event related uses (e.g. gift registry), this holds the type
of event, e.g. Wedding, Baby Shower.
exportStatus
exportStatus: EnumValue (read-only)
Returns the export status of the product list.
Possible values are: EXPORT_STATUS_NOTEXPORTED ,
EXPORT_STATUS_EXPORTED .
giftCertificateItem
giftCertificateItem: ProductListItem (read-only)
Returns the item in the list that represents a gift certificate.
items
items: Collection (read-only)
Returns a collection containing all items in the list.
lastExportTime
lastExportTime: Date (read-only)
Returns the date where this product list has been exported successfully
the last time.
name
name: String
Returns the name of this product list given by its owner.
owner
owner: Customer (read-only)
Returns the customer that created and owns the product list.
postEventShippingAddress
postEventShippingAddress: CustomerAddress
Returns the shipping address for purchases made after the event date.
productItems
productItems: Collection (read-only)
Returns a collection containing all items in the list that reference products.
public
public: Boolean
A flag, typically used to determine if the object is searchable
by other customers.
publicItems
publicItems: Collection (read-only)
Returns a collection containing all items in the list that are flagged as public.
purchases
purchases: Collection (read-only)
Returns the aggregated purchases from all the individual items.
registrant
registrant: ProductListRegistrant (read-only)
Returns the ProductListRegistrant assigned to the registrant attribute or null
if this list has no registrant.
shippingAddress
shippingAddress: CustomerAddress
Return the address that should be used as the shipping address for purchases
made from the list.
type
type: Number (read-only)
Returns an int representing the type of object (e.g. wish list,
gift registry). This is set at object creation time.
Method Details
createCoRegistrant()
createCoRegistrant(): ProductListRegistrant
Create a ProductListRegistrant and assign it to the coRegistrant attribute
of the list. An exception is thrown if the list already has a coRegistrant
assigned to it.
Returns:
the created ProductListRegistrant instance.
Throws:
CreateException - if one already exists
createGiftCertificateItem()
createGiftCertificateItem(): ProductListItem
Create an item in the list that represents a gift certificate.
A list may only contain a single gift certificate, so an exception
is thrown if one already exists in the list.
Returns:
Throws:
CreateException - if a gift certificate item already exists in the list.
createProductItem(Product)
createProductItem(product: Product ): ProductListItem
Create an item in the list that references the specified product.
Parameters:
product - the product to use to create the list item.
Returns:
createRegistrant()
createRegistrant(): ProductListRegistrant
Create a ProductListRegistrant and assign it to the registrant attribute
of the list. An exception is thrown if the list already has a registrant
assigned to it.
Returns:
the created ProductListRegistrant instance.
Throws:
CreateException - if one already exists
getCoRegistrant()
getCoRegistrant(): ProductListRegistrant
Returns the ProductListRegistrant assigned to the coRegistrant attribute or null
if this list has no co-registrant.
Returns:
the ProductListRegistrant assigned to the coRegistrant attribute or null
if this list has no co-registrant.
getCurrentShippingAddress()
getCurrentShippingAddress(): CustomerAddress
This is a helper method typically used with an event related list.
It provides the appropriate shipping address based on the eventDate.
If the current date is after the eventDate, then the postEventShippingAddress
is returned, otherwise the shippingAddress is returned. If the eventDate
is null, then null is returned.
Returns:
the appropriate address, as described above.
getDescription()
getDescription(): String
Returns a description text that, for example, explains the purpose of this product list.
Returns:
a description text explaining the purpose of this product list.
Returns an empty string if the description is not set.
getEventCity()
getEventCity(): String
For event related uses (e.g. gift registry), this holds the event city.
Returns:
the event city. The event city or an empty string if no event city is set.
getEventCountry()
getEventCountry(): String
For event related uses (e.g. gift registry), this holds the event country.
Returns:
the event country. The event country or an empty string if no event country is set.
getEventDate()
getEventDate(): Date
For event related uses (e.g. gift registry), this holds the date
of the event.
Returns:
getEventState()
getEventState(): String
For event related uses (e.g. gift registry), this holds the event state.
Returns:
the event state. The event state or an empty string if no event state is set.
getEventType()
getEventType(): String
For event related uses (e.g. gift registry), this holds the type
of event, e.g. Wedding, Baby Shower.
Returns:
the type of event. Returns an empty string, if not set.
getExportStatus()
getExportStatus(): EnumValue
Returns the export status of the product list.
Possible values are: EXPORT_STATUS_NOTEXPORTED ,
EXPORT_STATUS_EXPORTED .
Returns:
Product list export status
getGiftCertificateItem()
getGiftCertificateItem(): ProductListItem
Returns the item in the list that represents a gift certificate.
Returns:
the gift certificate item, or null if it doesn't exist.
getID()
getID(): String
Returns the unique system generated ID of the object.
Returns:
getItem(String)
getItem(ID: String ): ProductListItem
Returns the item from the list that has the specified ID.
Parameters:
ID - the product list item identifier.
Returns:
the specified item, or null if it's not found in the list.
getItems()
getItems(): Collection
Returns a collection containing all items in the list.
Returns:
getLastExportTime()
getLastExportTime(): Date
Returns the date where this product list has been exported successfully
the last time.
Returns:
The time of the last successful export or null if this product list
was not exported yet.
getName()
getName(): String
Returns the name of this product list given by its owner.
Returns:
the name of this product list. Returns an empty string if the name is not set.
getOwner()
getOwner(): Customer
Returns the customer that created and owns the product list.
Returns:
getPostEventShippingAddress()
getPostEventShippingAddress(): CustomerAddress
Returns the shipping address for purchases made after the event date.
Returns:
the shipping address for purchases made after the event date.
Returns null if no post-event shipping address is associated.
getProductItems()
getProductItems(): Collection
Returns a collection containing all items in the list that reference products.
Returns:
getPublicItems()
getPublicItems(): Collection
Returns a collection containing all items in the list that are flagged as public.
Returns:
getPurchases()
getPurchases(): Collection
Returns the aggregated purchases from all the individual items.
Returns:
getRegistrant()
getRegistrant(): ProductListRegistrant
Returns the ProductListRegistrant assigned to the registrant attribute or null
if this list has no registrant.
Returns:
the ProductListRegistrant assigned to the registrant attribute or null
if this list has no registrant.
getShippingAddress()
getShippingAddress(): CustomerAddress
Return the address that should be used as the shipping address for purchases
made from the list.
Returns:
the shipping address. The shipping address of this list or null
if no address is associated.
getType()
getType(): Number
Returns an int representing the type of object (e.g. wish list,
gift registry). This is set at object creation time.
Returns:
isAnonymous()
isAnonymous(): Boolean
Returns true if this product list is owned by an anonymous customer.
Returns:
true if the owner of this product list is anonymous, false otherwise.
isPublic()
isPublic(): Boolean
A flag, typically used to determine if the object is searchable
by other customers.
Returns:
true if the product list is public. False otherwise.
removeCoRegistrant()
removeCoRegistrant(): void
Removes the ProductListRegistrant assigned to the coRegistrant attribute.
removeItem(ProductListItem)
removeItem(item: ProductListItem ): void
Removes the specified item from the list. This will also cause
all purchase information associated with that item to be removed.
Parameters:
item - The item to remove.
removeRegistrant()
removeRegistrant(): void
Removes the ProductListRegistrant assigned to the registrant attribute.
setDescription(String)
setDescription(description: String ): void
Set the description of this product list.
Parameters:
description - The description of this product list. The description can have up to 256 characters, longer descriptions get truncated. If an empty string is provided, the description gets set to null.
setEventCity(String)
setEventCity(eventCity: String ): void
Set the event city to which this product list is related.
Parameters:
eventCity - The event city can have up to 256 characters, longer event city get truncated. If an empty string is provided, the event city gets set to null.
setEventCountry(String)
setEventCountry(eventCountry: String ): void
Set the event country to which this product list is related.
Parameters:
eventCountry - The event country can have up to 256 characters, longer event country get truncated. If an empty string is provided, the event country gets set to null.
setEventDate(Date)
setEventDate(eventDate: Date ): void
Set the date of the event to which this product list is related.
Parameters:
eventDate - The event date or null if no event date should be available.
setEventState(String)
setEventState(eventState: String ): void
Set the event state to which this product list is related.
Parameters:
eventState - The event state can have up to 256 characters, longer event state get truncated. If an empty string is provided, the event state gets set to null.
setEventType(String)
setEventType(eventType: String ): void
Set the event type for which this product list was created by the owner.
Parameters:
eventType - The event type can have up to 256 characters, longer event type get truncated. If an empty string is provided, the event type gets set to null.
setName(String)
setName(name: String ): void
Set the name of this product list.
Parameters:
name - The name of this product list. The name can have up to 256 characters, longer names get truncated. If an empty string is provided, the name gets set to null.
setPostEventShippingAddress(CustomerAddress)
setPostEventShippingAddress(address: CustomerAddress ): void
This is typically used by an event related list (e.g. gift registry) to
specify a shipping address for purchases made after the event date.
Parameters:
address - The shipping address.
setPublic(Boolean)
setPublic(flag: Boolean ): void
Makes this product list visible to other customers or hides it.
Parameters:
flag - If true, this product list becomes visible to other customers. If false, this product list can only be seen and searched by its owner.
setShippingAddress(CustomerAddress)
setShippingAddress(address: CustomerAddress ): void
Associate an address, used as the shipping address for purchases
made from the list.
Parameters:
address - The shipping address.