com.elasticpath.domain.catalog
Interface ProductAssociation

All Superinterfaces:
EpDomain, Persistence, java.io.Serializable, ValueObject
All Known Implementing Classes:
ProductAssociationImpl

public interface ProductAssociation
extends ValueObject

Represents a link between two products for the purpose of displaying information about related products when viewing a particular product.

Terminology:

Source Product - The product that the user is viewing when additional products are to be displayed, e.g. for upselling to a more expensive product.

Target Product - The other product that is to be displayed when viewing the source product.


Field Summary
static int ACCESSORY
          Accessory product association.
static java.lang.String[] ALL_ASSOCIATION_TYPE_NAMES
          All possible association type string names.
static int[] ALL_ASSOCIATION_TYPES
          All possible association types.
static int CROSS_SELL
          Cross-sell association.
static int RECOMMENDATION
          Computed product recommentation association.
static int REPLACEMENT
          Replacement product association.
static int UP_SELL
          Up-sell association.
static int WARRANTY
          Warranty item.
 
Method Summary
 int getAssociationType()
          Get the type of this ProductAssociation.
 int getDefaultQuantity()
          Get the default quantity of the product targeted by this MerchandiseAssociation.
 java.util.Date getEndDate()
          Get the end date after which this MerchandiseAssociation is no longer valid for display.
 int getOrdering()
          Get the order in which this product should appear on the page relative to other products having the same source product.
 java.util.Date getStartDate()
          Get the starting date on which this MerchandiseAssociation is valid for display.
 Product getTargetProduct()
          Get the product targeted by this association.
 ProductSku getTargetSku()
          Get the specific SKU targeted by this association.
 boolean isSourceProductDependent()
          Returns true if the product targeted by this MerchandiseAssociation depends on the source product such that it should be removed from the cart if the source product is removed.
 boolean isValid()
          Returns true if this association is valid because the current date is within the start and end dates.
 boolean isValidAssociationType(int associationType)
          Returns true if the given association type is valid.
 void setAssociationType(int associationType)
          Set the type of this ProductAssociation.
 void setDefaultQuantity(int defaultQuantity)
          Set the default quantity of the product targeted by this MerchandiseAssociation.
 void setEndDate(java.util.Date endDate)
          Set the end date after which this MerchandiseAssociation is no longer valid for display.
 void setOrdering(int ordering)
          Set the order in which this product should appear on the page relative to other products having the same source product.
 void setSourceProductDependent(boolean sourceProductDependent)
          Set to true if the product targeted by this MerchandiseAssociation depends on the source product such that it should be removed from the cart if the source product is removed.
 void setStartDate(java.util.Date startDate)
          Set the starting date on which this MerchandiseAssociation is valid for display.
 void setTargetProduct(Product targetProduct)
          Set the target product.
 void setTargetSku(ProductSku targetSku)
          Set the specific SKU to be targeted by this association.
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

ACCESSORY

static final int ACCESSORY
Accessory product association.

See Also:
Constant Field Values

ALL_ASSOCIATION_TYPE_NAMES

static final java.lang.String[] ALL_ASSOCIATION_TYPE_NAMES
All possible association type string names. Used in CM UI only.


ALL_ASSOCIATION_TYPES

static final int[] ALL_ASSOCIATION_TYPES
All possible association types.


CROSS_SELL

static final int CROSS_SELL
Cross-sell association.

See Also:
Constant Field Values

RECOMMENDATION

static final int RECOMMENDATION
Computed product recommentation association.

See Also:
Constant Field Values

REPLACEMENT

static final int REPLACEMENT
Replacement product association.

See Also:
Constant Field Values

UP_SELL

static final int UP_SELL
Up-sell association.

See Also:
Constant Field Values

WARRANTY

static final int WARRANTY
Warranty item.

See Also:
Constant Field Values
Method Detail

getAssociationType

int getAssociationType()
Get the type of this ProductAssociation.

Returns:
the association type

getDefaultQuantity

int getDefaultQuantity()
Get the default quantity of the product targeted by this MerchandiseAssociation. If no default quantity has been set, the default defaultQuantity is 1. If the target product is added to the cart automatically, it should be added in this default quantity.

Returns:
the default quantity of the target product

getEndDate

java.util.Date getEndDate()
Get the end date after which this MerchandiseAssociation is no longer valid for display.

Returns:
the end date

getOrdering

int getOrdering()
Get the order in which this product should appear on the page relative to other products having the same source product.

Returns:
the ordering

getStartDate

java.util.Date getStartDate()
Get the starting date on which this MerchandiseAssociation is valid for display.

Returns:
the start date

getTargetProduct

Product getTargetProduct()
Get the product targeted by this association. This is the product that is to be displayed when viewing the source product.

Returns:
the target product

getTargetSku

ProductSku getTargetSku()
Get the specific SKU targeted by this association. If no SKU is specified, the product's default SKU will be returned.

Returns:
the ProductSku

isSourceProductDependent

boolean isSourceProductDependent()
Returns true if the product targeted by this MerchandiseAssociation depends on the source product such that it should be removed from the cart if the source product is removed.

Returns:
true if the target product depends on the source product

isValid

boolean isValid()
Returns true if this association is valid because the current date is within the start and end dates.

Returns:
true if the product association is available at today's date.

isValidAssociationType

boolean isValidAssociationType(int associationType)
Returns true if the given association type is valid.

Parameters:
associationType - the association type
Returns:
true if the given association type is valid

setAssociationType

void setAssociationType(int associationType)
Set the type of this ProductAssociation.

Parameters:
associationType - one of the association type constants defined in this interface

setDefaultQuantity

void setDefaultQuantity(int defaultQuantity)
Set the default quantity of the product targeted by this MerchandiseAssociation.

Parameters:
defaultQuantity - the default quantity

setEndDate

void setEndDate(java.util.Date endDate)
Set the end date after which this MerchandiseAssociation is no longer valid for display.

Parameters:
endDate - the end date

setOrdering

void setOrdering(int ordering)
Set the order in which this product should appear on the page relative to other products having the same source product.

Parameters:
ordering - the ordering

setSourceProductDependent

void setSourceProductDependent(boolean sourceProductDependent)
Set to true if the product targeted by this MerchandiseAssociation depends on the source product such that it should be removed from the cart if the source product is removed.

Parameters:
sourceProductDependent - sets whether the target product depends on the source product

setStartDate

void setStartDate(java.util.Date startDate)
Set the starting date on which this MerchandiseAssociation is valid for display.

Parameters:
startDate - the start date

setTargetProduct

void setTargetProduct(Product targetProduct)
Set the target product.

Parameters:
targetProduct - the target product

setTargetSku

void setTargetSku(ProductSku targetSku)
Set the specific SKU to be targeted by this association.

Parameters:
targetSku - the ProductSku