public class Session extends Object
Use the notification methods to notify the eSales service about client-side activities. These notification will be used to
improve results from eSales with the use of machine learning algorithms, and for statistical reports.
A tutorial section describing the procedure for notifying client-side activities can be found in the tutorial section
Notifying Customer Actions on Apptus Zone (http://zone.apptus.com).
Use the panel(String)
method to get a Panel
object, from which you may retrieve content from the eSales
service.
You may (but need not) call the end()
method once the session is over. This will allow the eSales service to include
the information in statistical reports. If you don't call end the session will end automatically on the eSales server after two
hours.
Modifier and Type | Method | Description |
---|---|---|
String |
customerKey() |
|
DynamicPage |
dynamicPage(String name) |
Creates a dynamic page with the specified name.
|
boolean |
end() |
Notifies the eSales service that the session has ended.
|
String |
key() |
|
String |
market() |
|
void |
notifyAddingToCart(String ticketEnc) |
Sends a notification to the eSales service, about a product being added to the shopping cart by a user in the session.
|
void |
notifyClick(String ticketEnc) |
Sends a notification to the eSales service, about a click being made by the user in a session.
|
void |
notifyFavoriteAddition(String productKey,
String variantKey) |
Sends a notification to the eSales service, about a product being added to favorites.
|
void |
notifyFavoriteRemoval(String productKey,
String variantKey) |
Sends a notification to the eSales service, about a product being removed from favorites.
|
void |
notifyNonEsalesAddingToCart(String productKey,
String variantKey) |
Sends a notification to the eSales service, about a non-eSales product being added to the shopping cart by a user in the
session.
|
void |
notifyNonEsalesClick(String productKey,
String variantKey) |
Sends a notification to the eSales service, about a non-eSales product click being made by the user in a session.
|
void |
notifyPayment(Order order) |
Sends a notification to the eSales service, about products and variants being paid by a user in the session.
|
void |
notifyPayment(SKUList skus) |
Deprecated.
As of eSales 3.3, replaced by
notifyPayment(Order order). . |
void |
notifyPayment(SKUList skus,
double orderValue) |
Deprecated.
As of eSales 3.3, replaced by
notifyPayment(Order order) and Order.withSellingPrice(double). . |
void |
notifyPayment(Iterable<String> productKeys) |
Deprecated.
As of eSales 3.3, replaced by
notifyPayment(Order order) . |
void |
notifyPayment(Iterable<String> productKeys,
double orderValue) |
Deprecated.
As of eSales 3.3, replaced by
notifyPayment(Order order) . |
void |
notifyPayment(String ticketEnc) |
Deprecated.
As of eSales 3.3, replaced by
notifyPayment(Order order) and Order.addTicket(String). . |
void |
notifyPayment(String ticketEnc,
double orderValue) |
Deprecated.
As of eSales 3.3, replaced by
notifyPayment(Order order) and Order.addTicket(String),
Order.withSellingPrice(double). . |
void |
notifyProperty(String name,
String value) |
Sends a notification to the eSales service, about a session property being set.
Later calls will overwrite the previous values of the property. |
void |
notifyRating(String productKey,
int rating) |
Sends a notification to the eSales service, about a product being rated.
|
Panel |
panel(String path) |
Returns a panel specified by the path supplied as argument.
|
public Panel panel(String path)
path
- The path of the panelpublic DynamicPage dynamicPage(String name)
name
- The name of the dynamic pagepublic void notifyProperty(String name, String value) throws IOException
name
- The name of the property. Any valid Java identifier may be used.value
- The value of the property.IOException
- if the notification cannot be sent to the eSales serviceIllegalArgumentException
- if name or value is null or emptypublic void notifyClick(String ticketEnc) throws IOException
ticketEnc
- The ticked for the object that was clickedIOException
- if the notification cannot be sent to the eSales serviceIllegalArgumentException
- if ticketEnc is null or emptypublic void notifyAddingToCart(String ticketEnc) throws IOException
ticketEnc
- The ticked for the object that was added to the cartIOException
- if the notification cannot be sent to the eSales serviceIllegalArgumentException
- if ticketEnc is null or emptypublic void notifyNonEsalesClick(String productKey, String variantKey) throws IOException
productKey
- The product key of the clicked product or may be null if you have a variant key.variantKey
- The variant key of the clicked variant or null if it is a click on a product only.IOException
- If the notification cannot be sent to the eSales service.IllegalArgumentException
- If productKey or variantKey are empty or both are null.public void notifyNonEsalesAddingToCart(String productKey, String variantKey) throws IOException
productKey
- The product key of the added to cart product or may be null if you have a variant key.variantKey
- The variant key of the variant or null if it is an add to cart on a product only.IOException
- If the notification cannot be sent to the eSales service.IllegalArgumentException
- If productKey or variantKey are empty or both are null.public void notifyPayment(Order order) throws IOException
order
- Order containing the paid products and variantsIOException
- if the notification could not be sent to the eSales service or
if the eSales service failed to respondIllegalArgumentException
- if order is null or empty@Deprecated public void notifyPayment(Iterable<String> productKeys) throws IOException
notifyPayment(Order order)
.productKeys
- Iterable<String> product keys of the paid productsIOException
- if the notification cannot be sent to the eSales service@Deprecated public void notifyPayment(Iterable<String> productKeys, double orderValue) throws IOException
notifyPayment(Order order)
.productKeys
- Iterable<String> product keys of the paid productsorderValue
- A total value for this orderIOException
- if the notification cannot be sent to the eSales service@Deprecated public void notifyPayment(SKUList skus) throws IOException
notifyPayment(Order order).
.skus
- SKUList containing the paid products and variants, this list must not be emptyIOException
- if the notification cannot be sent to the eSales service@Deprecated public void notifyPayment(SKUList skus, double orderValue) throws IOException
notifyPayment(Order order) and Order.withSellingPrice(double).
.skus
- SKUList containing the paid products and variants, this list must not be emptyorderValue
- A total value for this orderIOException
- if the notification cannot be sent to the eSales service@Deprecated public void notifyPayment(String ticketEnc) throws IOException
notifyPayment(Order order) and Order.addTicket(String).
.ticketEnc
- The ticked for the object that was purchasedIOException
- if the notification cannot be sent to the eSales service@Deprecated public void notifyPayment(String ticketEnc, double orderValue) throws IOException
notifyPayment(Order order) and Order.addTicket(String),
Order.withSellingPrice(double).
.ticketEnc
- The ticked for the object that was purchasedorderValue
- A total value for this order.IOException
- if the notification cannot be sent to the eSales servicepublic void notifyRating(String productKey, int rating) throws IOException
productKey
- the key of the rated productrating
- the ratingIOException
- if the notification cannot be sent to the eSales serviceIllegalArgumentException
- if product_key is null or emptypublic void notifyFavoriteAddition(String productKey, String variantKey) throws IOException
productKey
- The product key of the favorite product or may be null if you have a variant key.variantKey
- The variant key of the favorite. Can be null if a product key is provided. The variant key should always be set if the product has variants.IOException
- If the notification cannot be sent to the eSales service.IllegalArgumentException
- If productKey or variantKey are empty or both are null.public void notifyFavoriteRemoval(String productKey, String variantKey) throws IOException
productKey
- The product key of the favorite product or may be null if you have a variant key.variantKey
- The variant key of the favorite. Can be null if a product key is provided. The variant key should always be set if the product has variants.IOException
- If the notification cannot be sent to the eSales service.IllegalArgumentException
- If productKey or variantKey are empty or both are null.public boolean end()
public final String key()
public final String market()
public final String customerKey()
Copyright © 2021 Apptus Technologies AB. All rights reserved.