|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakart.app.KKEng
public class KKEng
The KonaKart Engine
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_KONAKART_PROPERTIES_FILE_NAME
Properties file |
static int |
DEFAULT_LOGGING_FILE_WATCH_TIME_SECS
Default logging file watch time in seconds |
static java.lang.String |
KK_STATS_DB_NAME
Statistics DB Name where customer events are written |
protected static org.apache.commons.logging.Log |
log
the log |
Constructor Summary | |
---|---|
KKEng()
Deprecated. From version 2.2.7.0, you should use the constructor that receives an EngineConfigIf object |
|
KKEng(EngineConfigIf engConf)
Constructor with an EngineConfig object. |
|
KKEng(java.lang.String propertiesFile)
Deprecated. From version 2.2.7.0, you should use the constructor that receives an EngineConfigIf object |
Method Summary | |
---|---|
int |
addAddressToCustomer(java.lang.String sessionId,
AddressIf addr)
The Address object is added to the customer defined by the sessionId . |
void |
addCustomDataToSession(java.lang.String sessionId,
java.lang.String data,
int position)
A sessionId is created when a customer logs in to KonaKart using the login() API call. |
int |
addPoints(java.lang.String sessionId,
int points,
java.lang.String code,
java.lang.String description)
Adds a number of reward points to the total for customer identified by the sessionId parameter. |
void |
addProductNotificationToCustomer(java.lang.String sessionId,
int productId)
Adds a product notification to the list of notifications for the customer. |
java.math.BigDecimal |
addTax(java.math.BigDecimal cost,
int countryId,
int zoneId,
int taxClassId)
Calculates the final cost (including tax) for a product with a certain taxClassId and cost , delivered to a country (countryId
) and zone (zoneId ). |
int |
addToBasket(java.lang.String sessionId,
int customerId,
BasketIf item)
Saves the Basket object in the database for a customer. |
int |
addToBasketWithOptions(java.lang.String sessionId,
int customerId,
BasketIf item,
AddToBasketOptionsIf options)
If options is set to null, this method is identical to
addToBasket() . |
void |
addToCustomerTag(java.lang.String sessionId,
java.lang.String tagName,
int tagValue)
This method is used for customer tags where the value is of type com.konakart.app.CustomerTag.MULTI_INT_TYPE . |
void |
addToCustomerTagForGuest(int customerId,
java.lang.String tagName,
int tagValue)
This method is used for customer tags where the value is of type com.konakart.app.CustomerTag.MULTI_INT_TYPE . |
int |
addToWishList(java.lang.String sessionId,
WishListItemIf wishListItem)
Add a WishListItem object to the wish list referenced by wishListId. |
int |
addToWishListWithOptions(java.lang.String sessionId,
WishListItemIf wishListItem,
AddToWishListOptionsIf options)
If options is set to null, this method is identical to
addToWishList() . |
Order |
changeDeliveryAddress(java.lang.String sessionId,
OrderIf order,
AddressIf deliveryAddress)
The delivery address of the order is changed and the tax rates for the various products within the order are re-calculated. |
void |
changeOrderStatus(java.lang.String sessionId,
int orderId,
int status,
boolean customerNotified,
java.lang.String comments)
Deprecated. |
void |
changePassword(java.lang.String sessionId,
java.lang.String currentPassword,
java.lang.String newPassword)
Ensures that the current password is correct, and then changes it to the new password. |
int |
checkCoupon(java.lang.String couponCode)
This method is used to verify whether a coupon code actually exists and if it does, whether the coupon is still active. |
int |
checkSession(java.lang.String sessionId)
The given sessionId is checked to see whether it exists and whether it is has
timed out. |
Order |
createAndSaveOrder(java.lang.String emailAddr,
java.lang.String password,
CustomerRegistrationIf custReg,
BasketIf[] basketItemArray,
java.lang.String shippingModule,
java.lang.String paymentModule,
int languageId)
A high level call to simplify the process of creating a KonaKart order. |
Order |
createOrder(java.lang.String sessionId,
BasketIf[] basketItemArray,
int languageId)
An order object is returned with all addresses populated with the default address of the customer referenced by sessionId . |
Order |
createOrderWithOptions(java.lang.String sessionId,
BasketIf[] basketItemArray,
CreateOrderOptionsIf options,
int languageId)
If options is set to null, this method is identical to
createOrder() . |
int |
createWishList(java.lang.String sessionId,
WishListIf wishList)
Create a wish list from a WishList object. |
int |
createWishListWithOptions(java.lang.String sessionId,
WishListIf wishList,
AddToWishListOptionsIf options)
Create a wish list from a WishList object. |
java.lang.String |
custom(java.lang.String input1,
java.lang.String input2)
A custom interface that you have to provide an implementation for. |
java.lang.String |
customSecure(java.lang.String sessionId,
java.lang.String input1,
java.lang.String input2)
A custom interface that you have to provide an implementation for. |
void |
deleteAddressFromCustomer(java.lang.String sessionId,
int addressId)
The address defined by the sessionId and addressId is deleted. |
void |
deleteCookie(java.lang.String customerUuid,
java.lang.String attrId)
Deletes the cookie object from the database that is referenced by the customerUuid and attrId parameters. |
void |
deleteCustomerTag(java.lang.String sessionId,
java.lang.String tagName)
This method deletes the customer tag referenced by the parameter tagName and for
the customer referenced by the sessionId . |
void |
deleteCustomerTagForGuest(int customerId,
java.lang.String tagName)
This method deletes the customer tag referenced by the parameter tagName and for
the guest customer referenced by the negative customerId . |
void |
deleteOrderIdForSecretKey(java.lang.String secretKey)
The secret key is removed from the system. |
int |
deletePoints(java.lang.String sessionId,
int points,
java.lang.String code,
java.lang.String description)
Deletes a number of reward points from the total for the customer identified by the sessionId parameter. |
void |
deleteProductNotificationFromCustomer(java.lang.String sessionId,
int productId)
Deletes a product notification from the list of notifications for the customer. |
void |
deleteReservedPoints(java.lang.String sessionId,
int reservationId,
java.lang.String code,
java.lang.String description)
Verifies that the reservationId parameter exists and that it belongs to the
customer identified by the sessionId parameter. |
void |
deleteWishList(java.lang.String sessionId,
int wishListId)
The wish list referenced by wishListId and all of the items contained by the wish list, will be deleted. |
void |
deleteWishListWithOptions(java.lang.String sessionId,
int wishListId,
AddToWishListOptionsIf options)
The wish list referenced by wishListId and all of the items contained by the wish list, will be deleted. |
boolean |
doesCustomerExistForEmail(java.lang.String emailAddr)
Determine whether a customer has already registered with a certain eMail address as their user name. |
void |
editConfiguration(java.lang.String key,
java.lang.String value)
Deprecated. |
void |
editCustomer(java.lang.String sessionId,
CustomerIf cust)
Deprecated. |
void |
editCustomerAddress(java.lang.String sessionId,
AddressIf addr)
The Address object will replace the existing address object in the database with the same id. |
void |
editDigitalDownload(java.lang.String sessionId,
DigitalDownloadIf digitalDownload)
Edits the digital download object if it belongs to the customer identified by the sessionId. |
void |
editWishList(java.lang.String sessionId,
WishListIf wishList)
Edit an existing wish list object. |
void |
editWishListWithOptions(java.lang.String sessionId,
WishListIf wishList,
AddToWishListOptionsIf options)
Edit an existing wish list object. |
void |
enableCustomer(java.lang.String secretKey)
This method reads the SSO token using the Secret Key. |
boolean |
evaluateExpression(java.lang.String sessionId,
int expressionId,
java.lang.String expressionName)
An expression object is retrieved from the database and evaluated for the customer referenced by the sessionId . |
boolean |
evaluateExpressionForGuest(int customerId,
int expressionId,
java.lang.String expressionName)
An expression object is retrieved from the database and evaluated for the guest customer referenced by the negative customerId . |
int |
forceRegisterCustomer(CustomerRegistrationIf custReg)
This API Call is used rather than registerCustomer() when you want to provide a
store that doesn't force a customer to register. |
int |
freeReservedPoints(java.lang.String sessionId,
int reservationId)
Verifies that the reservationId parameter exists and that it belongs to the
customer identified by the sessionId parameter. |
Address[] |
getAddressesPerCustomer(java.lang.String sessionId)
Returns all of the addresses registered for the given customer. |
Address[] |
getAddressesPerManufacturer(int manufacturerId)
Gets an array of Address objects that have been defined for the manufacturer referenced by the manufacturerId. |
Address[] |
getAddressesPerProduct(int productId)
Gets an array of Address objects that have been defined for the product referenced by the productId. |
KKCookieIf[] |
getAllCookies(java.lang.String customerUuid)
Fetches all of the cookie object from the database that are referenced by the customerUuid parameter. |
Country[] |
getAllCountries()
Returns an array of Country objects for all of the countries in the system. |
Currency[] |
getAllCurrencies()
Returns an array of currency objects for all the records in the currencies table. |
CustomerGroup[] |
getAllCustomerGroups(int languageId)
Returns an array of customer groups for all customer groups that have been defined in the system. |
Language[] |
getAllLanguages()
Returns an array of Language classes containing all of the languages that have been defined within the system. |
Manufacturer[] |
getAllManufacturers()
Returns an array of Manufacturer objects for all of the manufacturers in the system. |
OrderStatus[] |
getAllOrderStatuses(int languageId)
Returns an array of order status objects for the language defined by languageId. |
Products |
getAllProducts(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int languageId)
Returns all products using the given language. |
Products |
getAllProductsWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
Promotion[] |
getAllPromotions()
Returns an array of all active promotions. |
Reviews |
getAllReviews(DataDescriptorIf dataDesc)
An array of review objects is returned. |
Products |
getAllSpecials(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int languageId)
Returns all specials using the given language. |
Product[] |
getAlsoPurchased(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int productId,
int languageId)
Find products that were in the same order as orders containing the product referenced by productId . |
Product[] |
getAlsoPurchasedWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int productId,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
Basket[] |
getBasketItemsPerCustomer(java.lang.String sessionId,
int customerId,
int languageId)
Get the basket items for a customer and language. |
Basket[] |
getBasketItemsPerCustomerWithOptions(java.lang.String sessionId,
int customerId,
int languageId,
AddToBasketOptionsIf options)
Get the basket items for a customer and language. |
Product[] |
getBestSellers(DataDescriptorIf dataDesc,
int categoryId,
int languageId)
Returns an array of bestseller products for the category referenced by categoryId and its children. |
Product[] |
getBestSellersWithOptions(DataDescriptorIf dataDesc,
int categoryId,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
ProductIf[] |
getBookableProductConflict(java.lang.String sessionId,
ProductIf bookableProd,
BookableProductOptionsIf options)
This method checks to see whether the bookable product passed in as a parameter conflicts with any bookable products that the customer identified by the sessionId has already signed up for. If no conflicts are found, null is returned. |
Bookings |
getBookingsPerCustomer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
BookableProductOptionsIf options)
Get an array of bookings for a logged in customer. |
Bookings |
getBookingsPerProduct(DataDescriptorIf dataDesc,
int productId,
BookableProductOptionsIf options)
Get an array of bookings for a bookable product. |
Category[] |
getCategoriesPerManufacturer(int manufacturerId,
int languageId)
Returns an array of leaf Category objects for the given manufacturer. |
Category[] |
getCategoriesPerProduct(int productId,
int languageId)
Returns an array of Category objects for the given product. |
Category |
getCategory(int categoryId,
int languageId)
Returns a complete single Category object for the given categoryId and language. |
Category[] |
getCategoryTree(int languageId,
boolean getNumProducts)
Returns a category tree structure consisting of an array of top level categories, each of which may contain an array of child categories. |
ConfigDataIf[] |
getConfigData(java.lang.String sessionId,
java.lang.String key)
Returns the ConfigData items with the specified key or all ConfigData items if the key is null |
KKConfiguration |
getConfiguration(java.lang.String key)
Returns a Configuration object referenced by the key passed in as a parameter. |
KKConfiguration[] |
getConfigurations()
Returns an array of Configuration objects containing all configurations that have been defined in the system and that have been defined to be returned via the API. |
java.lang.String |
getConfigurationValue(java.lang.String key)
Returns a Configuration Value referenced by the key passed in as a parameter. |
java.math.BigDecimal |
getConfigurationValueAsBigDecimal(java.lang.String key)
Returns a Configuration Value as a BigDecimal for the key passed in as a parameter. |
java.math.BigDecimal |
getConfigurationValueAsBigDecimalWithDefault(java.lang.String key,
java.math.BigDecimal def)
Returns a Configuration Value as a BigDecimal for the key passed in as a parameter. |
java.lang.Boolean |
getConfigurationValueAsBool(java.lang.String key,
java.lang.Boolean def)
Returns a Configuration Value as a Boolean for the key passed in as a parameter. |
int |
getConfigurationValueAsInt(java.lang.String key)
Returns a Configuration Value as an integer for the key passed in as a parameter. |
int |
getConfigurationValueAsIntWithDefault(java.lang.String key,
int def)
Returns a Configuration Value as an integer for the key passed in as a parameter. |
KKCookieIf |
getCookie(java.lang.String customerUuid,
java.lang.String attrId)
Fetches the cookie object from the database that is referenced by the customerUuid and attrId parameters. |
Country |
getCountry(int countryId)
Returns the country object for the countryId , or null if the country doesn't
exist in the DB. |
Country |
getCountryPerName(java.lang.String countryName)
Returns the country object for the countryName , or null if the country doesn't
exist in the DB. |
Currency |
getCurrency(java.lang.String currencyCode)
Returns the currency referenced by currencyCode . |
java.lang.String |
getCustomDataFromSession(java.lang.String sessionId,
int position)
A sessionId is created when a customer logs in to KonaKart using the login() API call. |
Customer |
getCustomer(java.lang.String sessionId)
Returns the customer object for the customer defined by the given sessionId . |
CustomerGroup |
getCustomerGroup(int customerGroupId,
int languageId)
Returns a customer group object for the customerGroupId passed in as a parameter. |
CustomerTagIf |
getCustomerTag(java.lang.String sessionId,
java.lang.String tagName)
A CustomerTag object referenced by the parameter tagName is returned. |
CustomerTagIf |
getCustomerTagForGuest(int customerId,
java.lang.String tagName)
A CustomerTag object referenced by the parameter tagName is returned. |
CustomerTagIf[] |
getCustomerTags(java.lang.String sessionId)
This method fetches all of the customer tags for the customer referenced by the sessionId . |
CustomerTagIf[] |
getCustomerTagsForGuest(int customerId)
This method fetches all of the customer tags for the guest customer referenced by the customerId which must have a negative value. |
java.lang.String |
getCustomerTagValue(java.lang.String sessionId,
java.lang.String tagName)
A string is returned containing the value of the customer tag referenced by the parameter tagName and for the customer referenced by the sessionId . |
java.lang.String |
getCustomerTagValueForGuest(int customerId,
java.lang.String tagName)
A string is returned containing the value of the customer tag referenced by the parameter tagName and for the guest customer referenced by the negative
customerId . |
java.lang.String |
getDbVersion()
Returns the current DB version according to the value in the kk_config table with the VERSION key |
Address |
getDefaultAddressPerCustomer(java.lang.String sessionId)
Returns the default address for the given customer. |
Currency |
getDefaultCurrency()
The default currency is referenced by a configuration variable called DEFAULT_CURRENCY. |
Customer |
getDefaultCustomer()
Returns the customer object for the default customer. |
Language |
getDefaultLanguage()
The default language is referenced by a configuration variable called DEFAULT_LANGUAGE. |
DigitalDownloadIf |
getDigitalDownloadById(java.lang.String sessionId,
int digitalDownloadId)
Returns a Digital Download object for the digital download id. |
DigitalDownload[] |
getDigitalDownloads(java.lang.String sessionId)
Returns an array of Digital Download objects for the customer identified by the sessionId parameter. |
EngineConfigIf |
getEngConf()
The EngineConfig is the configuration object passed to the engine at the time of instantiation. |
ExpressionIf |
getExpression(java.lang.String sessionId,
int expressionId,
java.lang.String expressionName)
An Expression object, fully populated with an array of Expression Variables is returned. |
ExpressionIf |
getExpressionForGuest(int customerId,
int expressionId,
java.lang.String expressionName)
An Expression object, fully populated with an array of Expression Variables is returned. |
GeoZone[] |
getGeoZonesPerZone(ZoneIf zone)
Returns an array of GeoZone objects (tax areas) for the zone passed in as a parameter. |
IpnHistory[] |
getIpnHistory(java.lang.String sessionId,
int orderId)
Retrieve an array of IpnHistory objects for an order. |
static org.apache.commons.configuration.Configuration |
getKonakartConfig()
|
java.util.Calendar |
getKonakartTimeStamp()
Get a Date Time Stamp from the server |
java.lang.String |
getKonaKartVersion()
Return the version number of KonaKart that is contained within the konakart.jar |
Language |
getLanguagePerCode(java.lang.String code)
Retrieves the language object referenced by the two letter code (i.e. |
Language |
getLanguagePerId(int languageId)
Retrieves the language object referenced by the id. |
Language[] |
getLanguages(LanguageSearchIf search)
Returns an array of Language classes containing all of the languages that satisfy the search criteria. |
Manufacturer |
getManufacturer(int manufacturerId,
int languageId)
Returns a complete Manufacturer object for the given manufacturerId and
language. |
Manufacturer |
getManufacturerPerProduct(int productId,
int languageId)
Returns a complete Manufacturer object for the given productId and language. |
Manufacturer[] |
getManufacturersPerCategory(int categoryId)
Returns an array of Manufacturer objects for the given category. |
NameValueIf[] |
getMessages(int type,
java.lang.String locale)
Used to fetch a message catalog for a locale and message type. |
MgrFactory |
getMgrFactory()
|
java.lang.String |
getMsgValue(java.lang.String key,
int type,
java.lang.String locale)
Get an Application Message Value. |
Order |
getOrder(java.lang.String sessionId,
int orderId,
int languageId)
Gets on order with the specified order Id, for the customer referenced by the sessionId . |
Product[] |
getOrderHistory(DataDescriptorIf dataDesc,
java.lang.String sessionId,
int languageId)
Get a list of the products ordered by the customer referenced by sessionId . |
Product[] |
getOrderHistoryWithOptions(DataDescriptorIf dataDesc,
java.lang.String sessionId,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
int |
getOrderIdFromSecretKey(java.lang.String secretKey)
When an order is created, a secret key is generated that may be used to send to the payment gateway if the payment gateway uses a callback mechanism. |
Orders |
getOrdersPerCustomer(DataDescriptorIf dataDesc,
java.lang.String sessionId,
int languageId)
Retrieve a number of orders for the customer referenced by the sessionId . |
int |
getOrderStatus(java.lang.String sessionId,
int orderId)
Get the order status for an order. |
Order |
getOrderTotals(OrderIf order,
int languageId)
The order object is populated with an array of order totals. |
PaymentDetails |
getPaymentDetails(java.lang.String sessionId,
java.lang.String moduleCode,
int orderId,
java.lang.String hostAndPort,
int languageId)
This method is called once a payment gateway has been selected and an order has been saved in the database. |
PaymentDetails |
getPaymentDetailsPerOrder(java.lang.String sessionId,
java.lang.String moduleCode,
OrderIf order,
java.lang.String hostAndPort,
int languageId)
This method is called once a payment gateway has been selected even if the order has not been saved in the database. |
PaymentDetails |
getPaymentGateway(OrderIf order,
java.lang.String moduleName,
int languageId)
The payment module called moduleName is called to get a PaymentDetails object
for the order passed in as a parameter. |
PaymentDetails[] |
getPaymentGateways(OrderIf order,
int languageId)
Each payment module is called and asked to return a PaymentDetails object. |
PaymentSchedule |
getPaymentSchedule(int id)
Returns the payment schedule object for the id parameter, or Null if the payment
schedule object doesn't exist in the DB. |
PdfResultIf |
getPdf(java.lang.String sessionId,
PdfOptionsIf options)
Creates a PDF document. |
Product |
getProduct(java.lang.String sessionId,
int productId,
int languageId)
Returns a complete Product object for the given productId and language. |
Product[] |
getProductNotificationsPerCustomer(java.lang.String sessionId,
int languageId)
Returns all products sorted by name, that the customer has asked to be notified about. |
Product[] |
getProductNotificationsPerCustomerWithOptions(java.lang.String sessionId,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
ProductIf |
getProductPerSku(java.lang.String sessionId,
java.lang.String sku,
int languageId)
Get a product from its SKU. |
ProductIf |
getProductPerSkuWithOptions(java.lang.String sessionId,
java.lang.String sku,
int languageId,
FetchProductOptionsIf options)
Get a product from its SKU. |
ProductQuantityIf |
getProductQuantity(java.lang.String encodedProductId)
The stock level of the product and the date available are returned within a ProductQuantity object. |
ProductQuantityIf |
getProductQuantityWithOptions(java.lang.String encodedProductId,
FetchProductOptionsIf options)
The stock level of the product and the date available are returned within a ProductQuantity object. |
ProductIf[] |
getProductsFromIdsWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int[] prodIdArray,
int languageId,
FetchProductOptionsIf options)
An array of products is returned that corresponds to an array of productIds passed in as a parameter. |
Products |
getProductsPerCategory(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int categoryId,
boolean searchInSubCats,
int languageId)
Returns a Products object for the given category and language. |
Products |
getProductsPerCategoryPerManufacturer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int categoryId,
int manufacturerId,
int languageId)
Returns a Products object for the given category, language and manufacturer. |
Products |
getProductsPerCategoryPerManufacturerWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int categoryId,
int manufacturerId,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
Products |
getProductsPerCategoryWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int categoryId,
boolean searchInSubCats,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
Products |
getProductsPerManufacturer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int manufacturerId,
int languageId)
Returns a Products object for the given manufacturer and language. |
Products |
getProductsPerManufacturerWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int manufacturerId,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
Product |
getProductWithOptions(java.lang.String sessionId,
int productId,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
ProductIf[] |
getPromotionsPerProducts(java.lang.String sessionId,
int customerId,
ProductIf[] products,
PromotionIf[] promotions,
java.lang.String[] couponCodes,
PromotionOptionsIf options)
This method is used to calculate a discount on individual products so that the discount can be displayed without having to add the product to the cart. The method receives an array of products and returns an array of products with attached PromotionResult objects that contain the results of one or more of the promotions passed in as a parameter. |
java.lang.String |
getPunchOutMessage(java.lang.String sessionId,
OrderIf order,
PunchOutOptionsIf options)
Creates a punch out message from an order. |
Products |
getRelatedProducts(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int productId,
int relationType,
int languageId)
Find products related to the product defined by the productId parameter. |
Products |
getRelatedProductsWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int productId,
int relationType,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
Review |
getReview(int reviewId)
An review object is returned for the given reviewId . |
Reviews |
getReviewsPerProduct(DataDescriptorIf dataDesc,
int productId)
An array of review objects is returned for the given productId . |
RewardPoints |
getRewardPoints(java.lang.String sessionId,
DataDescriptorIf dataDesc)
Gets an array of reward point objects for a customer identified by the sessionId
parameter. |
java.lang.String |
getSecretKeyForOrderId(int orderId)
A secret key is generated and stored in the database for the orderId passed as a parameter. |
ShippingQuote |
getShippingQuote(OrderIf order,
java.lang.String moduleName,
int languageId)
The shipping module called moduleName is called to get a shipping quote for the
order passed in as a parameter. |
ShippingQuote[] |
getShippingQuotes(OrderIf order,
int languageId)
All active installed shipping modules are called in order to get an array of shipping quotes. |
java.lang.String |
getSku(OrderProductIf orderProd)
Deprecated. |
Products |
getSpecialsPerCategory(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int categoryId,
boolean searchInSubCats,
int languageId)
Returns all specials for the given categoryId and language. |
SSOTokenIf |
getSSOToken(java.lang.String secretKey,
boolean deleteToken)
Returns an SSOToken object for the secretKey (UUID). |
java.lang.String |
getStatusText(int statusId,
int languageId)
Returns the text of a status from the orders_status table. |
StoreIf |
getStore()
Returns the store that this KonaKart engine is connected to. |
java.lang.String[] |
getStoreIds()
Returns an array of strings containing the store ids for the stores being used in a multi-store / multi-database environment. |
protected java.lang.String[] |
getStoreIds(boolean refresh)
Returns the set of storeIds but only if we're in Multi-Store Single DB mode |
Subscription[] |
getSubscriptionsPerCustomer(java.lang.String sessionId)
Returns an array of Subscription objects for a customer referred to by the sessionId parameter. |
SuggestedSearchItemIf[] |
getSuggestedSearchItems(java.lang.String sessionId,
SuggestedSearchOptionsIf options)
An array of SuggestedSearchItems is returned for search text within the options parameter. |
TagIf |
getTag(int tagId,
boolean getProdCount,
int languageId)
Returns a Tag object for the id passed in as a parameter. |
TagGroupIf |
getTagGroup(int tagGroupId,
boolean getProdCount,
int languageId)
Returns a TagGroup object for the id passed in as a parameter. |
TagGroup[] |
getTagGroupsPerCategory(int categoryId,
boolean getProdCount,
int languageId)
Return an array of TagGroup objects for a category. |
TagIf[] |
getTagsPerCategory(int categoryId,
boolean getProdCount,
int languageId)
Return an array of Tag objects for a category. |
java.math.BigDecimal |
getTax(java.math.BigDecimal cost,
int countryId,
int zoneId,
int taxClassId)
Calculates the tax for a product with a taxClassId and cost ,
delivered to a country (countryId ) and zone (zoneId ). |
java.math.BigDecimal |
getTaxRate(int countryId,
int zoneId,
int taxClassId)
Calculates the tax rate for a product with a taxClassId delivered to a country (
countryId ) and zone (zoneId ). |
int |
getTempCustomerId()
When a customer that hasn't logged in adds products to the shopping cart, we use a temporary customer id which is always negative and unique. |
WishListIf |
getWishList(java.lang.String sessionId,
int wishListId)
Returns a WishList object not populated with an array of WishListItem objects. |
WishListItems |
getWishListItems(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int wishListId,
int languageId)
Returns a WishListItems object containing an array of items and the number of items returned. |
WishListItems |
getWishListItemsWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int wishListId,
int languageId,
AddToWishListOptionsIf options)
Returns a WishListItems object containing an array of items and the number of items returned. |
WishList |
getWishListWithItems(java.lang.String sessionId,
int wishListId,
int languageId)
Returns a fully populated WishList object that may contain an array of WishListItem objects. |
WishList |
getWishListWithItemsWithOptions(java.lang.String sessionId,
int wishListId,
int languageId,
AddToWishListOptionsIf options)
If options is set to null, this method is identical to
getWishListWithItems() . |
WishListIf |
getWishListWithOptions(java.lang.String sessionId,
int wishListId,
AddToWishListOptionsIf options)
Returns a WishList object not populated with an array of WishListItem objects. |
Zone[] |
getZonesPerCountry(int countryId)
Returns an array of Zone objects for the country referenced by the countryId . |
int |
insertBooking(java.lang.String sessionId,
BookingIf booking,
BookableProductOptionsIf options)
Inserts a Booking object into the database. |
void |
insertCustomerEvent(CustomerEventIf event)
The customer event is written to a queue and control is immediately returned to the caller. |
void |
insertCustomerTag(java.lang.String sessionId,
CustomerTagIf tag)
Assigns a customer tag to the customer referenced by the sessionId . |
void |
insertCustomerTagForGuest(int customerId,
CustomerTagIf tag)
Assigns a customer tag to the guest customer referenced by the customerId which
must have a negative value. |
int |
insertDigitalDownload(java.lang.String sessionId,
int productId)
Create and insert a digital download record for the product identified by the productId and the customer identified by the sessionId . |
int |
insertSubscription(java.lang.String sessionId,
SubscriptionIf subscription)
A Subscription object is inserted into the database. |
boolean |
isEmailValid(java.lang.String emailAddr)
Determines whether the eMail address is valid |
java.lang.String |
login(java.lang.String emailAddr,
java.lang.String password)
Returns a 16 byte long session key is the login is successful, otherwise it returns null. |
java.lang.String |
loginByAdmin(java.lang.String adminSession,
int customerId)
Used to log in to the application as a customer by an Administrator. |
void |
logout(java.lang.String sessionId)
Logs out the user with the specified session Id. |
protected KKException |
manageThrowable(java.lang.Throwable e)
Common code to manage exceptions in the KKEng engine |
void |
mergeBaskets(java.lang.String sessionId,
int customerFromId)
Add all items from the basket of customerFrom to the basket of the customer associated to the sessionId . |
void |
mergeBasketsWithOptions(java.lang.String sessionId,
int customerFromId,
AddToBasketOptionsIf options)
Add all items from the basket of customerFrom to the basket of the customer associated to the sessionId . |
void |
mergeWishListsWithOptions(java.lang.String sessionId,
int customerFromId,
int languageId,
AddToWishListOptionsIf options)
Add all items from the wish list of customerFrom to the wish list of customerTo which is retrieved from the sessionId. |
int |
pointsAvailable(java.lang.String sessionId)
Calculates the number of reward points available for the customer identified by the sessionId parameter. |
void |
postMessageToQueue(java.lang.String sessionId,
MqOptionsIf options)
Post a message to a specified queue. |
MqResponseIf |
readMessageFromQueue(java.lang.String sessionId,
MqOptionsIf options)
Read a single message from a specified queue. |
int |
registerCustomer(CustomerRegistrationIf custReg)
Receives all of the necessary parameters from the Customer Registration object to create a new customer in the database. |
void |
removeBasketItemsPerCustomer(java.lang.String sessionId,
int customerId)
All Basket objects that exist for this customer are deleted. |
void |
removeFromBasket(java.lang.String sessionId,
int customerId,
BasketIf item)
The Basket object is deleted. |
void |
removeFromWishList(java.lang.String sessionId,
int wishListItemId)
Remove the WishListItem object referenced by wishListItemId. |
void |
removeFromWishListWithOptions(java.lang.String sessionId,
int wishListItemId,
AddToWishListOptionsIf options)
Remove the WishListItem object referenced by wishListItemId. |
int |
reservePoints(java.lang.String sessionId,
int points)
Removes a number of reward points from the total for the customer identified by the sessionId parameter. |
int |
saveIpnHistory(java.lang.String sessionId,
IpnHistoryIf ipnHistory)
A new IpnHistory (Instant Product Notification) record is created in the database. |
int |
saveOrder(java.lang.String sessionId,
OrderIf order,
int languageId)
A new order is created in the DB. |
java.lang.String |
saveSSOToken(SSOTokenIf token)
Saves the SSOToken in the database and returns a UUID secret key identifier. |
Orders |
searchForOrdersPerCustomer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
OrderSearchIf orderSearch,
int languageId)
Retrieve a number of orders for the customer referenced by the sessionId for the
given language. |
Products |
searchForProducts(java.lang.String sessionId,
DataDescriptorIf dataDesc,
ProductSearchIf prodSearch,
int languageId)
Returns all products using the given language. |
Products |
searchForProductsWithOptions(java.lang.String sessionId,
DataDescriptorIf dataDesc,
ProductSearchIf prodSearch,
int languageId,
FetchProductOptionsIf options)
An options object is passed in to customize from where some of the product attributes (such as price and quantity) are fetched from. |
Subscriptions |
searchForSubscriptionsPerCustomer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
SubscriptionSearchIf subscriptionSearch)
Retrieve a number of subscriptions for the customer referenced by the sessionId . |
WishLists |
searchForWishLists(java.lang.String sessionId,
DataDescriptorIf dataDesc,
CustomerSearchIf customerSearch)
All wish lists matching the search criteria will be returned. |
Zone[] |
searchForZones(ZoneSearchIf search)
Search for zones using various search criteria |
void |
sendNewPassword(java.lang.String emailAddr,
java.lang.String subject,
java.lang.String countryCode)
Deprecated. |
EmailIf |
sendNewPassword1(java.lang.String emailAddr,
EmailOptionsIf options)
A mail is sent to emailAddr containing a new password. |
void |
sendOrderConfirmationEmail(java.lang.String sessionId,
int orderId,
java.lang.String mailSubject,
int languageId)
Deprecated. |
EmailIf |
sendOrderConfirmationEmail1(java.lang.String sessionId,
int orderId,
int langIdForOrder,
EmailOptionsIf options)
A confirmation mail is sent after submitting an order. |
void |
sendTemplateEmailToCustomer(int customerId,
java.lang.String templateName,
java.lang.String message,
java.lang.String countryCode)
Deprecated. |
EmailIf |
sendTemplateEmailToCustomer1(int customerId,
java.lang.String message,
EmailOptionsIf options)
This method is used to send a template based eMail to a customer identified by the customerId. |
void |
sendWelcomeEmail(int customerId,
java.lang.String mailSubject,
java.lang.String countryCode)
Deprecated. |
EmailIf |
sendWelcomeEmail1(int customerId,
EmailOptionsIf options)
A welcome email is sent after registration of a new customer. |
void |
setCookie(KKCookieIf cookie)
Saves the cookie in the database. |
void |
setCreditCardDetailsOnOrder(java.lang.String sessionId,
int orderId,
CreditCardIf card)
The credit card details in the CreditCard object passed in as a parameter, are saved in the database for an existing order. |
void |
setDefaultAddressPerCustomer(java.lang.String sessionId,
int addressId)
Sets the default address for this customer to be the address identified by addressId . |
void |
setEndpoint(java.lang.String wsEndpoint)
Set the Web Service endpoint for the engine. |
void |
setRewardPointReservationId(java.lang.String sessionId,
int orderId,
int reservationId)
Verifies that the order belongs to the customer identified by the sessionId
parameter and then updates the reservation id on the order. |
java.lang.String |
testService(java.lang.String in)
Simple method to test that the service is responding. |
void |
updateBasket(java.lang.String sessionId,
int customerId,
BasketIf item)
Updates the Basket object in the database. |
void |
updateBasketWithOptions(java.lang.String sessionId,
int customerId,
BasketIf item,
AddToBasketOptionsIf options)
Updates the Basket object in the database. |
Basket[] |
updateBasketWithStockInfo(BasketIf[] basketItems)
Receives an array of basket items and updates each one with the current stock level. |
Basket[] |
updateBasketWithStockInfoWithOptions(BasketIf[] basketItems,
AddToBasketOptionsIf options)
Receives an array of basket items and updates each one with the current stock level. |
void |
updateCachedConfigurations()
Call the various places within the application where we need to update cached data |
int |
updateDigitalDownloadCount(java.lang.String sessionId,
int productId)
Updates the count of the Digital Download identified by the productId and the
customer identified by the sessionId . |
int |
updateDigitalDownloadCountById(java.lang.String sessionId,
int digitalDownloadId)
Updates the count of the Digital Download identified by the digitalDownloadId
and the customer identified by the sessionId . |
void |
updateInventory(java.lang.String sessionId,
int orderId)
If the STOCK_LIMITED configuration variable is set to true, we subtract the products in stock by the product orders. |
void |
updateInventoryWithOptions(java.lang.String sessionId,
int orderId,
CreateOrderOptionsIf options)
If options is set to null, this method is identical to
updateInventory() . |
void |
updateManufacturerViewedCount(int manufacturerId,
int languageId)
It updates the number of times that the manufacturer referenced by manufacturerId , has been clicked on, to view the home page. |
void |
updateOrder(java.lang.String sessionId,
int orderId,
int status,
boolean customerNotified,
java.lang.String comments,
OrderUpdateIf updateOrder)
The state of the order referenced by the orderId parameter is changed, and an orders_status_history record is added to the order to keep track of the change. |
void |
updateProductViewedCount(int productId,
int languageId)
It updates the number of times that the product referenced by productId , has
been viewed. |
void |
updateSubscription(java.lang.String sessionId,
SubscriptionIf subscription)
A Subscription object identified by the subscription passed in as a parameter is updated in the database. |
int |
writeReview(java.lang.String sessionId,
ReviewIf review)
Receives all of the necessary parameters from the Review object to create a new review in the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
public static final java.lang.String DEFAULT_KONAKART_PROPERTIES_FILE_NAME
public static final java.lang.String KK_STATS_DB_NAME
public static final int DEFAULT_LOGGING_FILE_WATCH_TIME_SECS
Constructor Detail |
---|
public KKEng(EngineConfigIf engConf) throws KKException
engConf
-
KKException
@Deprecated public KKEng() throws KKException
KKException
@Deprecated public KKEng(java.lang.String propertiesFile) throws KKException
propertiesFile
-
KKException
Method Detail |
---|
public java.lang.String getDbVersion()
protected KKException manageThrowable(java.lang.Throwable e)
e
-
public java.lang.String testService(java.lang.String in)
in
-
public static org.apache.commons.configuration.Configuration getKonakartConfig()
protected java.lang.String[] getStoreIds(boolean refresh) throws KKException
refresh
-
KKException
public MgrFactory getMgrFactory()
public java.lang.String[] getStoreIds() throws KKException
KKEngIf
getStoreIds
in interface KKEngIf
KKException
public void updateCachedConfigurations() throws KKException
updateCachedConfigurations
in interface KKEngIf
KKException
public Language[] getAllLanguages() throws KKException
KKEngIf
getAllLanguages
in interface KKEngIf
KKException
public Language[] getLanguages(LanguageSearchIf search) throws KKException
KKEngIf
getLanguages
in interface KKEngIf
search
- criteria
KKException
public Language getDefaultLanguage() throws KKException
KKEngIf
getDefaultLanguage
in interface KKEngIf
KKException
public Language getLanguagePerCode(java.lang.String code) throws KKException
KKEngIf
getLanguagePerCode
in interface KKEngIf
code
- The two letter language code such as en, de, es etc.
KKException
public Language getLanguagePerId(int languageId) throws KKException
KKEngIf
getLanguagePerId
in interface KKEngIf
languageId
- The numeric id of the language object
KKException
public Category[] getCategoryTree(int languageId, boolean getNumProducts) throws KKException
KKEngIf
The name of the category is language dependent and will be returned in the language defined
by the languageId
parameter.
Each Category class contains a numberOfProducts
field that describes how many
products exist for that category. It is only calculated if the getNumProducts
input parameter is set to true. For performance reasons this parameter should be set to false
if numberOfProducts
is not required.
getCategoryTree
in interface KKEngIf
languageId
- The id for the language that will be used to determine the Category name. Value of
-1 selects the default language.getNumProducts
- A boolean that specifies whether the Category objects should have the
numberOfProducts attribute set.
KKException
public Category[] getCategoriesPerManufacturer(int manufacturerId, int languageId) throws KKException
KKEngIf
getCategoriesPerManufacturer
in interface KKEngIf
manufacturerId
- The numeric id of the manufacturerlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Category[] getCategoriesPerProduct(int productId, int languageId) throws KKException
KKEngIf
getCategoriesPerProduct
in interface KKEngIf
productId
- The numeric id of the productlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Products getProductsPerCategory(java.lang.String sessionId, DataDescriptorIf dataDesc, int categoryId, boolean searchInSubCats, int languageId) throws KKException
KKEngIf
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getProductsPerCategory
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordercategoryId
- The numeric id of the categorysearchInSubCats
- Determines whether products are searched for in the sub-categories of the
specified categorylanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Products getProductsPerCategoryWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, int categoryId, boolean searchInSubCats, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Returns a Products object for the given category and language.
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getProductsPerCategoryWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordercategoryId
- The numeric id of the categorysearchInSubCats
- Determines whether products are searched for in the sub-categories of the
specified categorylanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Products getProductsPerCategoryPerManufacturer(java.lang.String sessionId, DataDescriptorIf dataDesc, int categoryId, int manufacturerId, int languageId) throws KKException
KKEngIf
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getProductsPerCategoryPerManufacturer
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordercategoryId
- The numeric id of the categorymanufacturerId
- The numeric id of the manufacturerlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Products getProductsPerCategoryPerManufacturerWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, int categoryId, int manufacturerId, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Returns a Products object for the given category, language and manufacturer.
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getProductsPerCategoryPerManufacturerWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordercategoryId
- The numeric id of the categorymanufacturerId
- The numeric id of the manufacturerlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Product getProduct(java.lang.String sessionId, int productId, int languageId) throws KKException
KKEngIf
productId
and language.
Returns null if no product is found. The specialPrice is null if a special offer doesn't exist for the product.
getProduct
in interface KKEngIf
sessionId
- The session id of the logged in userproductId
- The numeric id of the productlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Product getProductWithOptions(java.lang.String sessionId, int productId, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Returns a complete Product object for the given productId
and language.
Returns null if no product is found. The specialPrice is null if a special offer doesn't exist for the product.
getProductWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userproductId
- The numeric id of the productlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Manufacturer[] getManufacturersPerCategory(int categoryId) throws KKException
KKEngIf
The Manufacturer objects are not complete. Only the name and the image are returned and these are language independent.
getManufacturersPerCategory
in interface KKEngIf
categoryId
- The numeric id of the category
KKException
public Manufacturer getManufacturerPerProduct(int productId, int languageId) throws KKException
KKEngIf
productId
and language.
getManufacturerPerProduct
in interface KKEngIf
productId
- The numeric id of the productlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Manufacturer getManufacturer(int manufacturerId, int languageId) throws KKException
KKEngIf
manufacturerId
and
language.
getManufacturer
in interface KKEngIf
manufacturerId
- The numeric id of the manufacturerlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Category getCategory(int categoryId, int languageId) throws KKException
KKEngIf
categoryId
and language.
It does not populate the children even if they exist. It does populate the MiscItem array.
getCategory
in interface KKEngIf
categoryId
- The numeric id of the categorylanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Products getSpecialsPerCategory(java.lang.String sessionId, DataDescriptorIf dataDesc, int categoryId, boolean searchInSubCats, int languageId) throws KKException
KKEngIf
categoryId
and language.
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getSpecialsPerCategory
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordercategoryId
- The numeric id of the categorysearchInSubCats
- Determines whether products are searched for in the sub-categories of the
specified categorylanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Products getAllSpecials(java.lang.String sessionId, DataDescriptorIf dataDesc, int languageId) throws KKException
KKEngIf
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getAllSpecials
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Products getProductsPerManufacturer(java.lang.String sessionId, DataDescriptorIf dataDesc, int manufacturerId, int languageId) throws KKException
KKEngIf
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getProductsPerManufacturer
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordermanufacturerId
- The numeric id of the manufacturerlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Products getProductsPerManufacturerWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, int manufacturerId, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Returns a Products object for the given manufacturer and language.
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getProductsPerManufacturerWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordermanufacturerId
- The numeric id of the manufacturerlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Reviews getReviewsPerProduct(DataDescriptorIf dataDesc, int productId) throws KKException
KKEngIf
productId
.
The averageRating
attribute of the reviews is calculated and set by the method.
All reviews are retrieved, regardless of the language. dataDesc
may be null. In
this case, the number of retrieved reviews is limited to a default number, the reviews are
ordered by the ReviewId and the offset is set to zero. However, by setting the attributes of
dataDesc
, the following functionality may be controlled :
getReviewsPerProduct
in interface KKEngIf
dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderproductId
- The numeric id of the product
KKException
public Reviews getAllReviews(DataDescriptorIf dataDesc) throws KKException
KKEngIf
dataDesc
may be null. In this case, the number of retrieved reviews is limited
to a default number, the reviews are ordered by the ReviewId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getAllReviews
in interface KKEngIf
dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort order
KKException
public Products getAllProducts(java.lang.String sessionId, DataDescriptorIf dataDesc, int languageId) throws KKException
KKEngIf
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getAllProducts
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Products getAllProductsWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Returns all products using the given language.
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getAllProductsWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Manufacturer[] getAllManufacturers() throws KKException
KKEngIf
The Manufacturer objects are not complete. Only the name and the image and custom fields 1 and 2 are returned, and these are language independent.
getAllManufacturers
in interface KKEngIf
KKException
public Products searchForProductsWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, ProductSearchIf prodSearch, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Returns all products using the given language. The ProductSearch class contains the search criteria.
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The description will only be set if specified in the ProductSearch object passed in as a parameter. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
searchForProductsWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderprodSearch
- Contains information used to search the catalog for a productlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Products searchForProducts(java.lang.String sessionId, DataDescriptorIf dataDesc, ProductSearchIf prodSearch, int languageId) throws KKException
KKEngIf
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
dataDesc
may be null. In this case, the number of retrieved products is limited
to a default number, the products are ordered by the ProductId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
searchForProducts
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderprodSearch
- Contains information used to search the catalog for a productlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public int registerCustomer(CustomerRegistrationIf custReg) throws KKException
KKEngIf
If the country has at least one zone defined in the database, then we verify that the State attribute of the CustomerRegistration object matches one of the defined zones, otherwise a kkInvalidZoneException is thrown. If a match is found, then the zoneId is saved in the database table. If no zones are defined for the country, then we don't make the check and save the State attribute directly in the database.
registerCustomer
in interface KKEngIf
custReg
- Contains all the required data in order to register a new customer
KKException
public int forceRegisterCustomer(CustomerRegistrationIf custReg) throws KKException
KKEngIf
registerCustomer()
when you want to provide a
store that doesn't force a customer to register. It registers a customer as a temporary
customer and allows you to register this customer more than once as long as the customer
remains temporary. i.e. Doesn't go through a proper registration process.
KonaKart requires a temporary customer (one that has never registered) to be present in its database even if the store doesn't require registration. If a temporary customer with the same eMail address already exists, then this customer is deleted. An exception is thrown if a non-temporary customer (one that has registered) exists with the same eMail. You must still supply a password (which can be randomly generated) which you must then use to log in the customer so that he can checkout.
If your online store lets users choose whether to register or not, this method should be used if a user decides not to register since you still require to gather the user's personal details such as name and address.
If the country has at least one zone defined in the database, then we verify that the State attribute of the CustomerRegistration object matches one of the defined zones, otherwise a kkInvalidZoneException is thrown. If a match is found, then the zoneId is saved in the database table. If no zones are defined for the country, then we don't make the check and save the State attribute directly in the database.
forceRegisterCustomer
in interface KKEngIf
custReg
- Contains all the required data in order to register a new customer
KKException
public Country[] getAllCountries() throws KKException
KKEngIf
getAllCountries
in interface KKEngIf
KKException
public java.lang.String login(java.lang.String emailAddr, java.lang.String password) throws KKException
KKEngIf
login
in interface KKEngIf
emailAddr
- The user name required to log inpassword
- The log in password
KKException
public void logout(java.lang.String sessionId) throws KKException
KKEngIf
logout
in interface KKEngIf
sessionId
- The session Id of the logged in user
KKException
public int writeReview(java.lang.String sessionId, ReviewIf review) throws KKException
KKEngIf
sessionId
.
The obligatory parameters are :
writeReview
in interface KKEngIf
sessionId
- The session id of the logged in userreview
- The review that will be inserted
KKException
public int checkSession(java.lang.String sessionId) throws KKException
KKEngIf
sessionId
is checked to see whether it exists and whether it is has
timed out. If it is valid, the expiry attribute is updated. An exception is thrown if it is
not valid.
checkSession
in interface KKEngIf
sessionId
- The session id of the logged in user
KKException
public Customer getCustomer(java.lang.String sessionId) throws KKException
KKEngIf
sessionId
.
Throws an exception if the session has expired.
getCustomer
in interface KKEngIf
sessionId
- The session id of the logged in user
KKException
public int addToBasket(java.lang.String sessionId, int customerId, BasketIf item) throws KKException
KKEngIf
The Basket object does not have to be fully populated. The compulsory attributes are:
If the customer is logged in to the application, then a valid sessionId
is
required and the customerId
is ignored. Otherwise, the sessionId
may be set to null and the method will use the customerId
, ensuring that the
customer is not a registered customer by checking that the customerId
is
negative. All registered customers have positive ids.
addToBasket
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerId
- The numeric id of the customeritem
- The basket item to add to the basket
KKException
public int addToBasketWithOptions(java.lang.String sessionId, int customerId, BasketIf item, AddToBasketOptionsIf options) throws KKException
KKEngIf
options
is set to null, this method is identical to
addToBasket()
. Otherwise the functionality differs depending on the combination
of options set.
Saves the Basket object in the database for a customer. If the Basket object already exists with exactly the same options etc, then we either just increase the quantity of the existing object or we add a new object. This depends on the options.
The Basket object does not have to be fully populated. The compulsory attributes are:
If the customer is logged in to the application, then a valid sessionId
is
required and the customerId
is ignored. Otherwise, the sessionId
may be set to null and the method will use the customerId
, ensuring that the
customer is not a registered customer by checking that the customerId
is
negative. All registered customers have positive ids.
addToBasketWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerId
- The numeric id of the customeritem
- The basket item to add to the basketoptions
- An object containing options for the method. It may be set to null.
KKException
public void mergeBaskets(java.lang.String sessionId, int customerFromId) throws KKException
KKEngIf
sessionId
. The customer receiving the basket items, must be logged on, which is
why the method parameter is a sessionId
and not a customerId
. This
method is normally called when a customer logs on, in order to move his temporary basket to
his permanent basket. The items are merged into the target basket. i.e. If a similar item
already exists, then the quantity is increased.
mergeBaskets
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerFromId
- The numeric id of the customer that has the temporary basket
KKException
public void mergeBasketsWithOptions(java.lang.String sessionId, int customerFromId, AddToBasketOptionsIf options) throws KKException
KKEngIf
sessionId
. The customer receiving the basket items, must be logged on, which is
why the method parameter is a sessionId
and not a customerId
. This
method is normally called when a customer logs on, in order to move his temporary basket to
his permanent basket. The items are merged into the target basket. i.e. If a similar item
already exists, then the quantity is increased.
If options is set to null then this call is identical to mergeBaskets(). The options may determine from where we read the price and quantity of the basket items.
mergeBasketsWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerFromId
- The numeric id of the customer that has the temporary basketoptions
- An object containing options for the method. It may be set to null.
KKException
public void updateBasketWithOptions(java.lang.String sessionId, int customerId, BasketIf item, AddToBasketOptionsIf options) throws KKException
KKEngIf
The only attributes that may be changed are:
If the customer is logged in to the application, then a valid sessionId
is
required and the customerId
is ignored. Otherwise, the sessionId
may be set to null and the method will use the customerId
, ensuring that the
customer is not a registered customer by checking that the customerId
is
negative. All registered customers have positive ids.
A check is also made to ensure that the basket item being modified, actually belongs to the customer.
If options is set to null, this method is identical to updateBasket(). Otherwise the functionality differs depending on the combination of options set.
updateBasketWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerId
- The numeric id of the customeritem
- The basket item to updateoptions
- An object containing options for the method. It may be set to null.
KKException
public void updateBasket(java.lang.String sessionId, int customerId, BasketIf item) throws KKException
KKEngIf
The only attributes that may be changed are:
If the customer is logged in to the application, then a valid sessionId
is
required and the customerId
is ignored. Otherwise, the sessionId
may be set to null and the method will use the customerId
, ensuring that the
customer is not a registered customer by checking that the customerId
is
negative. All registered customers have positive ids.
A check is also made to ensure that the basket item being modified, actually belongs to the customer.
updateBasket
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerId
- The numeric id of the customeritem
- The basket item to update
KKException
public void removeFromBasket(java.lang.String sessionId, int customerId, BasketIf item) throws KKException
KKEngIf
If the customer is logged in to the application, then a valid sessionId
is
required and the customerId
is ignored. Otherwise, the sessionId
may be set to null and the method will use the customerId
, ensuring that the
customer is not a registered customer by checking that the customerId
is
negative. All registered customers have positive ids.
A check is also made to ensure that the basket item being deleted, actually belongs to the customer.
removeFromBasket
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerId
- The numeric id of the customeritem
- The basket item to delete
KKException
public void removeBasketItemsPerCustomer(java.lang.String sessionId, int customerId) throws KKException
KKEngIf
If the customer is logged in to the application, then a valid sessionId
is
required and the customerId
is ignored. Otherwise, the sessionId
may be set to null and the method will use the customerId
, ensuring that the
customer is not a registered customer by checking that the customerId
is
negative. All registered customers have positive ids.
removeBasketItemsPerCustomer
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerId
- The numeric id of the customer
KKException
public Basket[] getBasketItemsPerCustomer(java.lang.String sessionId, int customerId, int languageId) throws KKException
KKEngIf
Each basket item has an instantiated product object.
If the customer is logged in to the application, then a valid sessionId
is
required and the customerId
is ignored. Otherwise, the sessionId
may be set to null and the method will use the customerId
, ensuring that the
customer is not a registered customer by checking that the customerId
is
negative. All registered customers have positive ids.
getBasketItemsPerCustomer
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerId
- The numeric id of the customerlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Basket[] getBasketItemsPerCustomerWithOptions(java.lang.String sessionId, int customerId, int languageId, AddToBasketOptionsIf options) throws KKException
KKEngIf
If the customer is logged in to the application, then a valid sessionId
is
required and the customerId
is ignored. Otherwise, the sessionId
may be set to null and the method will use the customerId
, ensuring that the
customer is not a registered customer by checking that the customerId
is
negative. All registered customers have positive ids.
If options is set to null then this call is identical to getBasketItemsPerCustomer(). The options may determine from where we read the price and quantity of the basket items.
getBasketItemsPerCustomerWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in usercustomerId
- The numeric id of the customerlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Currency getDefaultCurrency() throws KKException
KKEngIf
getDefaultCurrency
in interface KKEngIf
KKException
public Currency[] getAllCurrencies() throws KKException
KKEngIf
getAllCurrencies
in interface KKEngIf
KKException
public KKConfiguration[] getConfigurations() throws KKException
KKEngIf
getConfigurations
in interface KKEngIf
KKException
public KKConfiguration getConfiguration(java.lang.String key) throws KKException
KKEngIf
getConfiguration
in interface KKEngIf
key
- The key of the configuration object
KKException
public java.lang.String getConfigurationValue(java.lang.String key) throws KKException
KKEngIf
getConfigurationValue
in interface KKEngIf
key
- The key of the configuration object
KKException
public int getConfigurationValueAsInt(java.lang.String key) throws KKException
KKEngIf
getConfigurationValueAsInt
in interface KKEngIf
key
- the Configuration Key
KKException
- if there is a problem converting the configuration value into an integer.public int getConfigurationValueAsIntWithDefault(java.lang.String key, int def) throws KKException
KKEngIf
getConfigurationValueAsIntWithDefault
in interface KKEngIf
key
- the Configuration Keydef
- default value to return if the key isn't found.
KKException
- if there is a problem converting the configuration value into an integer.public java.math.BigDecimal getConfigurationValueAsBigDecimal(java.lang.String key) throws KKException
KKEngIf
getConfigurationValueAsBigDecimal
in interface KKEngIf
key
- the Configuration Key
KKException
- if there is a problem converting the configuration value into a BigDecimal.public java.math.BigDecimal getConfigurationValueAsBigDecimalWithDefault(java.lang.String key, java.math.BigDecimal def) throws KKException
KKEngIf
getConfigurationValueAsBigDecimalWithDefault
in interface KKEngIf
key
- the Configuration Keydef
- default value to use if the key doesn't exist.
KKException
- if there is a problem converting the configuration value into a BigDecimal.public java.lang.Boolean getConfigurationValueAsBool(java.lang.String key, java.lang.Boolean def) throws KKException
KKEngIf
getConfigurationValueAsBool
in interface KKEngIf
key
- the Configuration Keydef
- the default value to be returned if there's a problem
KKException
@Deprecated public void editCustomer(java.lang.String sessionId, CustomerIf cust) throws KKException
KKEngIf
cust
has to be the same customer logged in with a valid sessionId
.
Only non null attributes or integers not equal to -1 will be used (i.e. set an integer field
to -1 if you do not want to change it).
The attributes from the Customer object that are used are :
editCustomer
in interface KKEngIf
sessionId
- The session id of the logged in usercust
- The customer object to edit
KKException
public void changePassword(java.lang.String sessionId, java.lang.String currentPassword, java.lang.String newPassword) throws KKException
KKEngIf
changePassword
in interface KKEngIf
sessionId
- The session id of the logged in usercurrentPassword
- The current password of the logged in usernewPassword
- The new password of the logged in user
KKException
public Address[] getAddressesPerCustomer(java.lang.String sessionId) throws KKException
KKEngIf
getAddressesPerCustomer
in interface KKEngIf
sessionId
- The session id of the logged in user
KKException
public Address[] getAddressesPerManufacturer(int manufacturerId) throws KKException
KKEngIf
getAddressesPerManufacturer
in interface KKEngIf
KKException
public Address[] getAddressesPerProduct(int productId) throws KKException
KKEngIf
getAddressesPerProduct
in interface KKEngIf
KKException
public Address getDefaultAddressPerCustomer(java.lang.String sessionId) throws KKException
KKEngIf
getDefaultAddressPerCustomer
in interface KKEngIf
sessionId
- The session id of the logged in user
KKException
public void setDefaultAddressPerCustomer(java.lang.String sessionId, int addressId) throws KKException
KKEngIf
addressId
. A check is made to determine whether an address exists with that id
and that it belongs to the customer logged in with this sessionId
.
setDefaultAddressPerCustomer
in interface KKEngIf
sessionId
- The session id of the logged in useraddressId
- The numeric id of the address object
KKException
public int addAddressToCustomer(java.lang.String sessionId, AddressIf addr) throws KKException
KKEngIf
sessionId
. The id of
the address object is ignored since it is calculated during the insertion process. The zoneId
is also calculated unless addr.isUseZoneId()is set to true. In this case the zoneId from the
address object is used. The customerId of the address object is also ignored. An exception is
thrown if the sessionId isn't valid.
addAddressToCustomer
in interface KKEngIf
sessionId
- The session id of the logged in useraddr
- The address object which will be added to the customer
KKException
public void deleteAddressFromCustomer(java.lang.String sessionId, int addressId) throws KKException
KKEngIf
sessionId
and addressId
is deleted. The
customerId is retrieved from the session. An exception is thrown if the session isn't valid
and if the address referenced by the addressId
doesn't belong to the customer
referenced by the sessionId
. An exception is also thrown if we attempt to delete
the default address.
deleteAddressFromCustomer
in interface KKEngIf
sessionId
- The session id of the logged in useraddressId
- The numeric id of the address object
KKException
public void editCustomerAddress(java.lang.String sessionId, AddressIf addr) throws KKException
KKEngIf
sessionId
passed in as a parameter. The zoneId is ignored since it is calculated
during the insertion process, unless addr.isUseZoneId()is set to true. In this case the
zoneId from the address object is used. The addressId
is used to identify the
address object. The customerId attribute of the address object is ignored since it is
obtained from the sessionId
. An exception is thrown if the session isn't valid.
editCustomerAddress
in interface KKEngIf
sessionId
- The session id of the logged in useraddr
- The address object to edit
KKException
public java.util.Calendar getKonakartTimeStamp() throws KKException
KKEngIf
getKonakartTimeStamp
in interface KKEngIf
KKException
public void addProductNotificationToCustomer(java.lang.String sessionId, int productId) throws KKException
KKEngIf
sessionId
isn't valid.
addProductNotificationToCustomer
in interface KKEngIf
sessionId
- The session id of the logged in userproductId
- The numeric id of the product
KKException
public void deleteProductNotificationFromCustomer(java.lang.String sessionId, int productId) throws KKException
KKEngIf
sessionId
isn't valid.
deleteProductNotificationFromCustomer
in interface KKEngIf
sessionId
- The session id of the logged in userproductId
- The numeric id of the product
KKException
public Product[] getProductNotificationsPerCustomer(java.lang.String sessionId, int languageId) throws KKException
KKEngIf
sessionId
isn't valid.
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
getProductNotificationsPerCustomer
in interface KKEngIf
sessionId
- The session id of the logged in userlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Product[] getProductNotificationsPerCustomerWithOptions(java.lang.String sessionId, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Returns all products sorted by name, that the customer has asked to be notified about. An
exception is thrown if the sessionId
isn't valid.
Only Products with a non zero status and non zero invisible are returned. The description (which can be very long) and the array of options are not set. The specialPrice is null if a special offer doesn't exist for the product.
getProductNotificationsPerCustomerWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public void updateProductViewedCount(int productId, int languageId) throws KKException
KKEngIf
productId
, has
been viewed. The languageId
is required because a separate count is kept for how
many times the product has been viewed in each supported language.
updateProductViewedCount
in interface KKEngIf
productId
- The numeric id of the productlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Product[] getBestSellers(DataDescriptorIf dataDesc, int categoryId, int languageId) throws KKException
KKEngIf
categoryId
and its children. The products are returned in the language
referenced by languageId
. If the categoryId
is equal to 0, then it
is not used as a constraint for the query.
dataDesc
defines the ordering of the products and the number of products
returned.
getBestSellers
in interface KKEngIf
dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordercategoryId
- The numeric id of the categorylanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Product[] getBestSellersWithOptions(DataDescriptorIf dataDesc, int categoryId, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Returns an array of bestseller products for the category referenced by
categoryId
and its children. The products are returned in the language
referenced by languageId
. If the categoryId
is equal to 0, then it
is not used as a constraint for the query.
dataDesc
defines the ordering of the products and the number of products
returned.
getBestSellersWithOptions
in interface KKEngIf
dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordercategoryId
- The numeric id of the categorylanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Orders getOrdersPerCustomer(DataDescriptorIf dataDesc, java.lang.String sessionId, int languageId) throws KKException
KKEngIf
sessionId
. The
orders are always returned sorted by date (most recent orders first). dataDesc
is used to retrieve offset and limit information. If null, the offset defaults to 0 and a
default limit is used.
getOrdersPerCustomer
in interface KKEngIf
dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordersessionId
- The session id of the logged in userlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Orders searchForOrdersPerCustomer(java.lang.String sessionId, DataDescriptorIf dataDesc, OrderSearchIf orderSearch, int languageId) throws KKException
KKEngIf
sessionId
for the
given language. The OrderSearch class contains the search criteria although it may be null.
dataDesc
may be null. In this case, the number of retrieved orders is limited to
a default number, the orders are ordered by the OrderId and the offset is set to zero.
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
searchForOrdersPerCustomer
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderorderSearch
- Contains information used to add search constraintslanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Order getOrder(java.lang.String sessionId, int orderId, int languageId) throws KKException
KKEngIf
sessionId
.
getOrder
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the orderlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Currency getCurrency(java.lang.String currencyCode) throws KKException
KKEngIf
currencyCode
.
getCurrency
in interface KKEngIf
currencyCode
- The 3 letter currency code (i.e. USD, EUR ..)
KKException
public Order createOrder(java.lang.String sessionId, BasketIf[] basketItemArray, int languageId) throws KKException
KKEngIf
sessionId
. The products added to the order are retrieved
from the basketItemArray. The returned object has not been saved in the DB and so an Order Id
has not yet been assigned.
Null is returned if the products and/or product options referenced by the array of basket items are no longer available.
createOrder
in interface KKEngIf
sessionId
- The session id of the logged in userbasketItemArray
- The array of basket items to add to the orderlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Order createOrderWithOptions(java.lang.String sessionId, BasketIf[] basketItemArray, CreateOrderOptionsIf options, int languageId) throws KKException
KKEngIf
options
is set to null, this method is identical to
createOrder()
. Otherwise the functionality differs depending on the combination
of options set.
An order object is returned with all addresses populated with the default address of the
customer referenced by sessionId
. The products added to the order are retrieved
from the basketItemArray. The returned object has not been saved in the DB and so an Order Id
has not yet been assigned.
Null is returned if the products and/or product options referenced by the array of basket items are no longer available.
One available option is to automatically copy all of the basket
custom fields to
the orderProduct
custom fields which are generated from the basket items.
Another option allows you to leave the seesionId null and to use a default customer. This default customer needs to be setup using the Admin App and is used to create a temporary order even before the customer logs in or registers, so that he can view the order totals in the window that shows him the cart details. These order totals give an indication of the shipping cost and also show any discounts available. The Administrator can create a default customer that matches his typical customer. For example if a store normally ships overseas, then the default customer can be set up with an overseas address so that the shipping costs are calculated at overseas rates.
A further option is to use the shipping address retrieved from a wish list if the wish list id of any one of the basket items is set to a valid wish list. This is useful in the case of gift registries to ship the gifts directly to the owner of the registry.
createOrderWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userbasketItemArray
- The array of basket items to add to the orderoptions
- An object containing options for the method. It may be set to null.languageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Product[] getOrderHistory(DataDescriptorIf dataDesc, java.lang.String sessionId, int languageId) throws KKException
KKEngIf
sessionId
. The
number of products returned and the return order is determined by the dataDesc
parameter. The default OrderBy is "ORDER_BY_NAME_ASCENDING".
getOrderHistory
in interface KKEngIf
dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordersessionId
- The session id of the logged in userlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Product[] getOrderHistoryWithOptions(DataDescriptorIf dataDesc, java.lang.String sessionId, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Get a list of the products ordered by the customer referenced by sessionId
. The
number of products returned and the return order is determined by the dataDesc
parameter. The default OrderBy is "ORDER_BY_NAME_ASCENDING".
getOrderHistoryWithOptions
in interface KKEngIf
dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordersessionId
- The session id of the logged in userlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Product[] getAlsoPurchased(java.lang.String sessionId, DataDescriptorIf dataDesc, int productId, int languageId) throws KKException
KKEngIf
productId
. The return order of the products is by purchase date.
dataDesc
determines the number of products returned.
sessionId
may be set to null. If it is valid, then the customer information is
used to calculate the tax. Otherwise the store location is used.
getAlsoPurchased
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderproductId
- The numeric id of the productlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Product[] getAlsoPurchasedWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, int productId, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Find products that were in the same order as orders containing the product referenced by
productId
. The return order of the products is by purchase date.
dataDesc
determines the number of products returned.
sessionId
may be set to null. If it is valid, then the customer information is
used to calculate the tax. Otherwise the store location is used.
getAlsoPurchasedWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderproductId
- The numeric id of the productlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Country getCountryPerName(java.lang.String countryName) throws KKException
KKEngIf
countryName
, or null if the country doesn't
exist in the DB. If there is more than one country with the same name, we return the first
one that we find.
getCountryPerName
in interface KKEngIf
countryName
- The name of the country
KKException
public Country getCountry(int countryId) throws KKException
KKEngIf
countryId
, or null if the country doesn't
exist in the DB.
getCountry
in interface KKEngIf
countryId
- The id of the country object
KKException
public java.math.BigDecimal addTax(java.math.BigDecimal cost, int countryId, int zoneId, int taxClassId) throws KKException
KKEngIf
taxClassId
and cost
, delivered to a country (countryId
) and zone (zoneId
).
addTax
in interface KKEngIf
cost
- The cost of the productcountryId
- The numeric id of the countryzoneId
- The numeric id of the zonetaxClassId
- The numeric id of the taxClass
KKException
public java.math.BigDecimal getTax(java.math.BigDecimal cost, int countryId, int zoneId, int taxClassId) throws KKException
KKEngIf
taxClassId
and cost
,
delivered to a country (countryId
) and zone (zoneId
).
getTax
in interface KKEngIf
cost
- The cost of the productcountryId
- The numeric id of the countryzoneId
- The numeric id of the zonetaxClassId
- The numeric id of the taxClass
KKException
public java.math.BigDecimal getTaxRate(int countryId, int zoneId, int taxClassId) throws KKException
KKEngIf
taxClassId
delivered to a country (
countryId
) and zone (zoneId
). There may be multiple tax rates which
are added and / or compounded as appropriate.
getTaxRate
in interface KKEngIf
countryId
- The numeric id of the countryzoneId
- The numeric id of the zonetaxClassId
- The numeric id of the taxClass
KKException
public ShippingQuote[] getShippingQuotes(OrderIf order, int languageId) throws KKException
KKEngIf
getShippingQuotes
in interface KKEngIf
order
- The order objectlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public ShippingQuote getShippingQuote(OrderIf order, java.lang.String moduleName, int languageId) throws KKException
KKEngIf
moduleName
is called to get a shipping quote for the
order passed in as a parameter. Null is returned if the shipping module isn't available.
getShippingQuote
in interface KKEngIf
order
- The order objectmoduleName
- e.g. flat or item or table etc.languageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Order changeDeliveryAddress(java.lang.String sessionId, OrderIf order, AddressIf deliveryAddress) throws KKException
KKEngIf
changeDeliveryAddress
in interface KKEngIf
sessionId
- The session id of the logged in userorder
- The order objectdeliveryAddress
- The address object containing the delivery address
KKException
public Order getOrderTotals(OrderIf order, int languageId) throws KKException
KKEngIf
getOrderTotals
in interface KKEngIf
order
- The order objectlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public PaymentDetails[] getPaymentGateways(OrderIf order, int languageId) throws KKException
KKEngIf
Based on the zone of the billing address, the module may decide that it cannot process payment for that zone and so not even return a PaymentDetails object.
getPaymentGateways
in interface KKEngIf
order
- The order objectlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public PaymentDetails getPaymentGateway(OrderIf order, java.lang.String moduleName, int languageId) throws KKException
KKEngIf
moduleName
is called to get a PaymentDetails object
for the order passed in as a parameter. Null is returned if the PaymentDetails object isn't
available.
Based on the zone of the billing address, the module may decide that it cannot process payment for that zone and so in this case, null is returned.
getPaymentGateway
in interface KKEngIf
order
- The order objectmoduleName
- This is the name of the payment module in lower case. Examples are cod, paypal,
usaepay, worldpay etc.languageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public int saveOrder(java.lang.String sessionId, OrderIf order, int languageId) throws KKException
KKEngIf
To save an order we have to write into a few DB tables: orders, orders_products, orders_products_attributes, orders_total, orders_status_history. We do this in a single transaction.
saveOrder
in interface KKEngIf
sessionId
- The session id of the logged in userorder
- The order objectlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public java.lang.String getStatusText(int statusId, int languageId) throws KKException
KKEngIf
getStatusText
in interface KKEngIf
statusId
- The numeric id of the OrderStatus objectlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public void updateOrder(java.lang.String sessionId, int orderId, int status, boolean customerNotified, java.lang.String comments, OrderUpdateIf updateOrder) throws KKException
KKEngIf
updateOrder
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the orderstatus
- The new numeric state of the order. Valid states are defined in the database.customerNotified
- If you send an eMail to the customer to notify him of the state change then set
this to true to register the fact that an eMail has been sentcomments
- These comments are written into the orders_status_history recordupdateOrder
- contains order update data such as who updated the order
KKException
@Deprecated public void changeOrderStatus(java.lang.String sessionId, int orderId, int status, boolean customerNotified, java.lang.String comments) throws KKException
KKEngIf
changeOrderStatus
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the orderstatus
- The new numeric state of the order. Valid states are defined in the database.customerNotified
- If you send an eMail to the customer to notify him of the state change then set
this to true to register the fact that an eMail has been sentcomments
- These comments are written into the orders_status_history record
KKException
public void updateInventory(java.lang.String sessionId, int orderId) throws KKException
KKEngIf
updateInventory
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the order
KKException
public void updateInventoryWithOptions(java.lang.String sessionId, int orderId, CreateOrderOptionsIf options) throws KKException
KKEngIf
options
is set to null, this method is identical to
updateInventory()
. Otherwise the functionality differs depending on the
combination of options set.
If the STOCK_LIMITED configuration variable is set to true, we subtract the products in stock by the product orders. If we hit the STOCK_REORDER_LEVEL, then we instantiate a class defined by the STOCK_REORDER_CLASS and call it. If STOCK_ALLOW_CHECKOUT is set to true, when we hit zero items in stock we don't touch the status, otherwise we disable the product when the quantity reaches zero by setting the status to zero.
updateInventoryWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the orderoptions
- An object containing options for the method. It may be set to null.
KKException
@Deprecated public void sendNewPassword(java.lang.String emailAddr, java.lang.String subject, java.lang.String countryCode) throws KKException
KKEngIf
sendNewPassword
in interface KKEngIf
emailAddr
- Address of the emailsubject
- Subject of the emailcountryCode
- Two letter code used to pick correct template
KKException
public EmailIf sendNewPassword1(java.lang.String emailAddr, EmailOptionsIf options) throws KKException
KKEngIf
Valid options are:
templateName
: The name of the template used to send the mail without the
country code and the .vm extension. e.g. If the name of the template is myTemplate and the
two letter country code is en, then KonaKart will search for a template called
myTemplate_en.vm .countryCode
: The two letter (lower case) country code used to search for the
template. e.g. en, de, es etc.customAttrs
: An array of name value pairs used to pass custom information to
the Velocity engine. The value can be retrieved from the template using the name preceded by
the $ sign. e.g. If a name value pair contains StoreId and 22, the value 22 will be displayed
in the eMail where the template contains $StoreId.fullAttachmentFilename
: The complete filename of an attachment.friendlyAttachmentName
: The friendly filename of an attachment that can be
viewed from the eMail.deleteAttachmentAfterSend
: When set to true
, the attachment is
deleted after being sent. The default value is false
.The Velocity context contains the following data:
emailAddr
: The email address of the recipientnewPassword
: The new passwordcustomerName
: The name of the customer in the format firstName lastNamecustomer
: The CustomerIf objectstoreOwner
: The name of the store owner.storeName
: The name of the store.storeOwnerEmailAddr
: The email address of the store owner.dateTool
: org.apache.velocity.tools.generic.DateTool object used to format
dates.locale
: java.util.Locale objectcurrencyMgr
: Used to format prices
sendNewPassword1
in interface KKEngIf
emailAddr
- Address of the emailoptions
- Options for the email
KKException
@Deprecated public void sendWelcomeEmail(int customerId, java.lang.String mailSubject, java.lang.String countryCode) throws KKException
KKEngIf
sendWelcomeEmail
in interface KKEngIf
customerId
- The numeric id of the customermailSubject
- The subject of the emailcountryCode
- The two letter country code used to select the velocity template that creates the
mail
KKException
public EmailIf sendWelcomeEmail1(int customerId, EmailOptionsIf options) throws KKException
KKEngIf
Valid options are:
templateName
: The name of the template used to send the mail without the
country code and the .vm extension. e.g. If the name of the template is myTemplate and the
two letter country code is en, then KonaKart will search for a template called
myTemplate_en.vm .countryCode
: The two letter (lower case) country code used to search for the
template. e.g. en, de, es etc.customAttrs
: An array of name value pairs used to pass custom information to
the Velocity engine. The value can be retrieved from the template using the name preceded by
the $ sign. e.g. If a name value pair contains StoreId and 22, the value 22 will be displayed
in the eMail where the template contains $StoreId.fullAttachmentFilename
: The complete filename of an attachment.friendlyAttachmentName
: The friendly filename of an attachment that can be
viewed from the eMail.deleteAttachmentAfterSend
: When set to true
, the attachment is
deleted after being sent. The default value is false
.The Velocity context contains the following data:
customerName
: The name of the customer in the format firstName lastNamecustomer
: The CustomerIf objectstoreOwner
: The name of the store owner.storeName
: The name of the store.storeOwnerEmailAddr
: The email address of the store owner.dateTool
: org.apache.velocity.tools.generic.DateTool object used to format
dates.locale
: java.util.Locale objectcurrencyMgr
: Used to format prices
sendWelcomeEmail1
in interface KKEngIf
customerId
- The numeric id of the customeroptions
- Options for the email
KKException
@Deprecated public void sendOrderConfirmationEmail(java.lang.String sessionId, int orderId, java.lang.String mailSubject, int languageId) throws KKException
KKEngIf
sendOrderConfirmationEmail
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the ordermailSubject
- The subject of the emaillanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public EmailIf sendOrderConfirmationEmail1(java.lang.String sessionId, int orderId, int langIdForOrder, EmailOptionsIf options) throws KKException
KKEngIf
Valid options are:
templateName
: The name of the template used to send the mail without the
country code and the .vm extension. e.g. If the name of the template is myTemplate and the
two letter country code is en, then KonaKart will search for a template called
myTemplate_en.vm .countryCode
: The two letter (lower case) country code used to search for the
template. e.g. en, de, es etc.customAttrs
: An array of name value pairs used to pass custom information to
the Velocity engine. The value can be retrieved from the template using the name preceded by
the $ sign. e.g. If a name value pair contains StoreId and 22, the value 22 will be displayed
in the eMail where the template contains $StoreId.The Velocity context contains the following data:
order
: The OrderIf objectcustomerName
: The name of the customer in the format firstName lastNamecustomer
: The CustomerIf objectstoreOwner
: The name of the store owner.storeName
: The name of the store.storeOwnerEmailAddr
: The email address of the store owner.dateTool
: org.apache.velocity.tools.generic.DateTool object used to format
dates.locale
: java.util.Locale objectcurrencyMgr
: Used to format prices
sendOrderConfirmationEmail1
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the orderlangIdForOrder
- The languageId used for retrieving the order, to translate things such as order
status. Value of -1 selects the default language.options
- Options for the email
KKException
public PaymentDetails getPaymentDetails(java.lang.String sessionId, java.lang.String moduleCode, int orderId, java.lang.String hostAndPort, int languageId) throws KKException
KKEngIf
The module matching the moduleCode
is called in order to get a fully populated
PaymentDetails object containing all of the required parameters etc. for the payment gateway.
getPaymentDetails
in interface KKEngIf
sessionId
- The session id of the logged in usermoduleCode
- This is the name of the payment module in lower case. Examples are cod, paypal,
usaepay, worldpay etc.orderId
- The numeric id of the orderhostAndPort
- The host and port in the format "host:port" for the KonaKart servlet engine.languageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public PaymentDetails getPaymentDetailsPerOrder(java.lang.String sessionId, java.lang.String moduleCode, OrderIf order, java.lang.String hostAndPort, int languageId) throws KKException
KKEngIf
The module matching the moduleCode
is called in order to get a fully populated
PaymentDetails object containing all of the required parameters etc. for the payment gateway.
getPaymentDetailsPerOrder
in interface KKEngIf
sessionId
- The session id of the logged in usermoduleCode
- This is the name of the payment module in lower case. Examples are cod, paypal,
usaepay, worldpay etc.order
- The order objecthostAndPort
- The host and port in the format "host:port" for the KonaKart servlet engine.languageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public void deleteOrderIdForSecretKey(java.lang.String secretKey) throws KKException
KKEngIf
deleteOrderIdForSecretKey
in interface KKEngIf
secretKey
- A string representing the secret key
KKException
public java.lang.String getSecretKeyForOrderId(int orderId) throws KKException
KKEngIf
getSecretKeyForOrderId
in interface KKEngIf
KKException
public int getOrderIdFromSecretKey(java.lang.String secretKey) throws KKException
KKEngIf
getOrderIdFromSecretKey
in interface KKEngIf
secretKey
- A string representing the secret key
KKException
public int saveIpnHistory(java.lang.String sessionId, IpnHistoryIf ipnHistory) throws KKException
KKEngIf
saveIpnHistory
in interface KKEngIf
sessionId
- The session id of the logged in useripnHistory
- The IpnHistory object to save
KKException
public void updateManufacturerViewedCount(int manufacturerId, int languageId) throws KKException
KKEngIf
manufacturerId
, has been clicked on, to view the home page. The
languageId
is required because a separate count is kept for how many times the
manufacturer home page has been viewed in each supported language.
updateManufacturerViewedCount
in interface KKEngIf
manufacturerId
- The numeric id of the manufacturerlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Zone[] getZonesPerCountry(int countryId) throws KKException
KKEngIf
countryId
.
getZonesPerCountry
in interface KKEngIf
countryId
- The numeric id of the country
KKException
public Zone[] searchForZones(ZoneSearchIf search) throws KKException
KKEngIf
searchForZones
in interface KKEngIf
KKException
@Deprecated public void editConfiguration(java.lang.String key, java.lang.String value) throws KKException
KKEngIf
Previously this call allowed the edit of an existing configuration parameter. It threw an exception if the configuration didn't exist.
editConfiguration
in interface KKEngIf
key
- The key of the configuration objectvalue
- The new value for the configuration
KKException
- in all cases warning that the API call should no longer be used.public Products getRelatedProducts(java.lang.String sessionId, DataDescriptorIf dataDesc, int productId, int relationType, int languageId) throws KKException
KKEngIf
productId
parameter.
The relationType
defines the relation. Valid values for
relationType
are:
When all relationships are returned by setting relationType
to 0, the
prodRelationType
attribute of the returned products is set, so that the
information about the type of relationship is not lost.
getRelatedProducts
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort order. It may be null, in which case, the number of retrieved products is
limited to a default number, the products are ordered by the ProductId and the
offset is set to zero.productId
- The numeric id of the productrelationType
- The numeric relation type defining up selling, cross selling etc.languageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public Products getRelatedProductsWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, int productId, int relationType, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
Find products related to the product defined by the productId
parameter. The
relationType
defines the relation. Valid values for relationType
are:
When all relationships are returned by setting relationType
to 0, the
prodRelationType
attribute of the returned products is set, so that the
information about the type of relationship is not lost.
getRelatedProductsWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sort order. It may be null, in which case, the number of retrieved products is
limited to a default number, the products are ordered by the ProductId and the
offset is set to zero.productId
- The numeric id of the productrelationType
- The numeric relation type defining up selling, cross selling etc.languageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null. This object
contains an attribute called invertRelatedProductDirection
which If
true, inverts the direction of the related product link. This is especially useful
for bundled products, so rather than discovering the products within a bundle, you
can determine which bundles a product belongs to by setting this attribute to
true.
KKException
public boolean doesCustomerExistForEmail(java.lang.String emailAddr) throws KKException
KKEngIf
doesCustomerExistForEmail
in interface KKEngIf
emailAddr
- The user name in the format of an email address
KKException
public boolean isEmailValid(java.lang.String emailAddr) throws KKException
KKEngIf
isEmailValid
in interface KKEngIf
emailAddr
- A string representing an email address
KKException
public Basket[] updateBasketWithStockInfo(BasketIf[] basketItems) throws KKException
KKEngIf
If the product or any of the product attributes of a basket item no longer exist, then that basket item is not returned. This means that the size of the returned array may be smaller than the size of the array passed in as a parameter.
updateBasketWithStockInfo
in interface KKEngIf
basketItems
- An array of basket items
KKException
public Basket[] updateBasketWithStockInfoWithOptions(BasketIf[] basketItems, AddToBasketOptionsIf options) throws KKException
KKEngIf
If the product or any of the product attributes of a basket item no longer exist, then that basket item is not returned. This means that the size of the returned array may be smaller than the size of the array passed in as a parameter.
If options is set to null, this method is identical to updateBasketWithStockInfo(). Otherwise the functionality differs depending on the combination of options set.
updateBasketWithStockInfoWithOptions
in interface KKEngIf
basketItems
- An array of basket itemsoptions
- An object containing options for the method. It may be set to null.
KKException
public ProductQuantityIf getProductQuantity(java.lang.String encodedProductId) throws KKException
KKEngIf
If there are no option / value pairs then we use the stock level from the product object. If there is at least one option / value pair, we attempt to find the quantity in the product quantity table. If we can't find it in the product_quantity table we look for at least one record in the product_quantity table for this product id. If we find something then we assume that the quantity is zero. If we find no records, we use the quantity from the product object.
getProductQuantity
in interface KKEngIf
encodedProductId
- The encoded product id which can reference a particular configuration of a
product. i.e. A green shirt rather than a blue shirt.
KKException
public ProductQuantityIf getProductQuantityWithOptions(java.lang.String encodedProductId, FetchProductOptionsIf options) throws KKException
KKEngIf
If there are no option / value pairs then we use the stock level from the product object. If there is at least one option / value pair, we attempt to find the quantity in the product quantity table. If we can't find it in the product_quantity table we look for at least one record in the product_quantity table for this product id. If we find something then we assume that the quantity is zero. If we find no records, we use the quantity from the product object.
The options object is used to set whether the quantity and available date should be fetched from an external table based on the catalogId.
getProductQuantityWithOptions
in interface KKEngIf
encodedProductId
- The encoded product id which can reference a particular configuration of a
product. i.e. A green shirt rather than a blue shirt.options
- An object containing options for the method. It may be set to null.
KKException
public Order createAndSaveOrder(java.lang.String emailAddr, java.lang.String password, CustomerRegistrationIf custReg, BasketIf[] basketItemArray, java.lang.String shippingModule, java.lang.String paymentModule, int languageId) throws KKException
KKEngIf
The caller supplies the user name (email address) and password of the KonaKart user. If the user has not yet been registered, then the caller must also supply a populated CustomerRegistration object, otherwise this can be set to null. The registration is done automatically if the email address doesn't exist in the KonaKart database.
The shipping and payment module names must be names of modules that have been installed in the KonaKart engine.
createAndSaveOrder
in interface KKEngIf
emailAddr
- The user name of the customer creating the orderpassword
- The password of the customer creating the ordercustReg
- Object that contains all necessary details to register a new customer. Can be set
to null if user has already been registered.basketItemArray
- Array of basket items to add to the ordershippingModule
- Shipping module to use (null if no shipping required). This parameter must contain
the name of the module (i.e. flat or item or table..)paymentModule
- Payment module to use. This parameter must contain the name of the module (i.e.
chronopay or cod or worldpay..)languageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
@Deprecated public java.lang.String getSku(OrderProductIf orderProd) throws KKException
KKEngIf
getSku
in interface KKEngIf
orderProd
- The OrderProduct object. An order normally contains an array of order product
objects.
KKException
public void setEndpoint(java.lang.String wsEndpoint) throws KKException
KKEngIf
The effect will be to set the web service endpoint for the proxy to the KonaKart engine.
setEndpoint
in interface KKEngIf
wsEndpoint
- A String representing the web service endpoint
KKException
public int insertDigitalDownload(java.lang.String sessionId, int productId) throws KKException
KKEngIf
productId
and the customer identified by the sessionId
. If the
digital download already exists, then we overwrite it with the new one.
The attributes of the digital download product such as the maximum number of days that it is valid and how many times it can be downloaded, are retrieved from configuration variables or from the product directly.
insertDigitalDownload
in interface KKEngIf
sessionId
- The session id of the logged in userproductId
- The numeric id of the product
KKException
public DigitalDownload[] getDigitalDownloads(java.lang.String sessionId) throws KKException
KKEngIf
sessionId
parameter.
If the DD_DELETE_ON_EXPIRATION configuration variable is set to "true", then the objects read from the database that have expired, are automatically deleted. This avoids having to maintain the database table. Regardless of the setting of DD_DELETE_ON_EXPIRATION, only valid (not expired) objects are ever returned.
getDigitalDownloads
in interface KKEngIf
sessionId
- The session id of the logged in user
KKException
public int updateDigitalDownloadCount(java.lang.String sessionId, int productId) throws KKException
KKEngIf
productId
and the
customer identified by the sessionId
. The count defines how many times it has
been downloaded.
updateDigitalDownloadCount
in interface KKEngIf
sessionId
- The session id of the logged in userproductId
- The numeric id of the product
KKException
public int updateDigitalDownloadCountById(java.lang.String sessionId, int digitalDownloadId) throws KKException
KKEngIf
digitalDownloadId
and the customer identified by the sessionId
. The count defines how many times
it has been downloaded. This is used when there may be many digital downloads for the same
product pointing to different files. i.e. Tickets
updateDigitalDownloadCountById
in interface KKEngIf
sessionId
- The session id of the logged in userdigitalDownloadId
- The numeric id of the digital download object
KKException
public int getTempCustomerId() throws KKException
KKEngIf
getTempCustomerId
in interface KKEngIf
KKException
public CustomerGroup[] getAllCustomerGroups(int languageId) throws KKException
KKEngIf
getAllCustomerGroups
in interface KKEngIf
languageId
- The id for the language that will be used to determine the customer group name and
description. Value of -1 selects the default language.
KKException
public CustomerGroup getCustomerGroup(int customerGroupId, int languageId) throws KKException
KKEngIf
getCustomerGroup
in interface KKEngIf
languageId
- The id for the language that will be used to determine the customer group name and
description. Value of -1 selects the default language.
KKException
@Deprecated public void sendTemplateEmailToCustomer(int customerId, java.lang.String templateName, java.lang.String message, java.lang.String countryCode) throws KKException
KKEngIf
We ship an example template called GenericCustEmail_en.vm . Note that the first line of the template is used to generate the subject of the eMail.
sendTemplateEmailToCustomer
in interface KKEngIf
customerId
- The numeric id of the customertemplateName
- The name of the template, not including "_countryCode.vm". If the template file
name is CustomEmail_en.vm, the parameter must be set to CustomEmail.message
- The information within the message may be used by the template.countryCode
- The two letter country code used to select the velocity template that creates the
mail.
KKException
public EmailIf sendTemplateEmailToCustomer1(int customerId, java.lang.String message, EmailOptionsIf options) throws KKException
KKEngIf
Valid options are:
templateName
: The name of the template used to send the mail without the
country code and the .vm extension. e.g. If the name of the template is myTemplate and the
two letter country code is en, then KonaKart will search for a template called
myTemplate_en.vm .countryCode
: The two letter (lower case) country code used to search for the
template. e.g. en, de, es etc.customAttrs
: An array of name value pairs used to pass custom information to
the Velocity engine. The value can be retrieved from the template using the name preceded by
the $ sign. e.g. If a name value pair contains StoreId and 22, the value 22 will be displayed
in the eMail where the template contains $StoreId.fullAttachmentFilename
: The complete filename of an attachment.friendlyAttachmentName
: The friendly filename of an attachment that can be
viewed from the eMail.deleteAttachmentAfterSend
: When set to true
, the attachment is
deleted after being sent. The default value is false
.The Velocity context contains the following data:
customerName
: The name of the customer in the format firstName lastNamecustomer
: The CustomerIf objectmessage
: The message that may be used by the templatestoreOwner
: The name of the store owner.storeName
: The name of the store.storeOwnerEmailAddr
: The email address of the store owner.dateTool
: org.apache.velocity.tools.generic.DateTool object used to format
dates.locale
: java.util.Locale objectcurrencyMgr
: Used to format prices
sendTemplateEmailToCustomer1
in interface KKEngIf
customerId
- The numeric id of the customermessage
- The information within the message may be used by the template.options
- Options for the email
KKException
public java.lang.String loginByAdmin(java.lang.String adminSession, int customerId) throws KKException
KKEngIf
The adminSession must contain the session of a logged in Administrator User. The customerId must contain the Id of the customer to login as.
loginByAdmin
in interface KKEngIf
adminSession
- The session of a logged in administrator usercustomerId
- The id of the customer to login as
KKException
public java.lang.String custom(java.lang.String input1, java.lang.String input2) throws KKException
KKEngIf
There are two versions, one that requires a valid sessionId (customSecure) and one that does not (custom).
You are free to use the two input String parameters in any way you choose, for example you may wish to use one to indicate which of your custom functions to run, and the other might contain XML to give you a great deal of flexibility - but it's up to you!
custom
in interface KKEngIf
input1
- The first input String - can be anything you chooseinput2
- The second input String - can be anything you choose
KKException
public java.lang.String customSecure(java.lang.String sessionId, java.lang.String input1, java.lang.String input2) throws KKException
KKEngIf
There are two versions, one that requires a valid sessionId (customSecure) and one that does not (custom).
You are free to use the two input String parameters in any way you choose, for example you may wish to use one to indicate which of your custom functions to run, and the other might contain XML to give you a great deal of flexibility - but it's up to you!
customSecure
in interface KKEngIf
sessionId
- The session id of the logged in userinput1
- The first input String - can be anything you chooseinput2
- The second input String - can be anything you choose
KKException
public TagGroup[] getTagGroupsPerCategory(int categoryId, boolean getProdCount, int languageId) throws KKException
KKEngIf
getTagGroupsPerCategory
in interface KKEngIf
categoryId
- The numeric id of the categorygetProdCount
- If true, the Tag objects are populated with the number of productslanguageId
- The id for the language that will be used to determine the tag group name and
description. Value of -1 selects the default language.
KKException
public TagIf[] getTagsPerCategory(int categoryId, boolean getProdCount, int languageId) throws KKException
KKEngIf
getTagsPerCategory
in interface KKEngIf
categoryId
- The numeric id of the categorygetProdCount
- If true, the Tag objects are populated with the number of productslanguageId
- The id for the language that will be used to determine the tag name. Value of -1
selects the default language.
KKException
public TagGroupIf getTagGroup(int tagGroupId, boolean getProdCount, int languageId) throws KKException
KKEngIf
getTagGroup
in interface KKEngIf
tagGroupId
- The numeric Id of the tag groupgetProdCount
- If true, the Tag objects are populated with the number of productslanguageId
- The id for the language that will be used to determine the tag group name and
description. Value of -1 selects the default language.
KKException
public TagIf getTag(int tagId, boolean getProdCount, int languageId) throws KKException
KKEngIf
getTag
in interface KKEngIf
tagId
- The numeric Id of the taggetProdCount
- If true, the Tag object is populated with the number of productslanguageId
- The id for the language that will be used to determine the tag name. Value of -1
selects the default language.
KKException
public Customer getDefaultCustomer() throws KKException
KKEngIf
The default customer can be configured in the Admin App. It is a fictitious customer with a real address that is used to create a temporary order even when a customer is not logged in or hasn't registered yet. The order totals of this temporary order are displayed in the cart details screen to give an indication of shipping costs and to display any available discounts.
getDefaultCustomer
in interface KKEngIf
KKException
public EngineConfigIf getEngConf()
KKEngIf
getEngConf
in interface KKEngIf
public void setCreditCardDetailsOnOrder(java.lang.String sessionId, int orderId, CreditCardIf card) throws KKException
KKEngIf
No update or insert is done for attributes of the CreditCard object that are set to null. The credit card details are mapped as follows to attributes in the order object:
setCreditCardDetailsOnOrder
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the ordercard
- CreditCard object containing the credit card details
KKException
public void mergeWishListsWithOptions(java.lang.String sessionId, int customerFromId, int languageId, AddToWishListOptionsIf options) throws KKException
KKEngIf
The currently logged in customer may have more than one wish list. The one used is the first one found of listType == 0.
mergeWishListsWithOptions
in interface KKEngIf
KKException
public WishLists searchForWishLists(java.lang.String sessionId, DataDescriptorIf dataDesc, CustomerSearchIf customerSearch) throws KKException
KKEngIf
getWishListWithItems()
method, passing it the id of the wish list. This will
also populate the final price attributes of the wish list.
If customerSearch is null, then only the wish lists of the logged in customer will be returned. If dataDesc is set to null, a default DataDescriptor will be used.
Only the following attributes of the CustomerSearchIf object will be used to search:
The custom fields of the dataDesc object will also be used in the search if not set to null.
searchForWishLists
in interface KKEngIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort ordercustomerSearch
- Used to search for customers
KKException
public int addToWishList(java.lang.String sessionId, WishListItemIf wishListItem) throws KKException
KKEngIf
The compulsory attributes for the WishListItem are:
The WishListItem may also contain an array of options if these are applicable for the chosen product.
addToWishList
in interface KKEngIf
sessionId
- The session id of the logged in userwishListItem
- The wish list item to be added to the wish list
KKException
public int addToWishListWithOptions(java.lang.String sessionId, WishListItemIf wishListItem, AddToWishListOptionsIf options) throws KKException
KKEngIf
options
is set to null, this method is identical to
addToWishList()
. Otherwise the functionality differs depending on the
combination of options set.
Add a WishListItem object to the wish list referenced by wishListId. The sessionId may be left null if a temporary customer id (negative number) is added to the options object. If the wish list doesn't belong to the logged in customer or the customer referenced by the customer id, an exception is thrown. If the WishListItem already exists, then it is updated.
The compulsory attributes for the WishListItem are:
The WishListItem may also contain an array of options if these are applicable for the chosen product.
addToWishListWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userwishListItem
- The wish list item to be added to the wish listoptions
- An object containing options for the method. It may be set to null.
KKException
public int createWishList(java.lang.String sessionId, WishListIf wishList) throws KKException
KKEngIf
addToWishList()
can be called to add wish list items to the wish list. The
customer must be logged in with a valid sessionId when this method is called.
The compulsory attributes for the WishListItem are:
createWishList
in interface KKEngIf
sessionId
- The session id of the logged in userwishList
- The wish list to be created
KKException
public int createWishListWithOptions(java.lang.String sessionId, WishListIf wishList, AddToWishListOptionsIf options) throws KKException
KKEngIf
addToWishList()
can be called to add wish list items to the wish list. This
method may be called even when a customer isn't logged in. In this case the
customerId
attribute of the options object must be set to the id of the
temporary customer which is negative.
The compulsory attributes for the WishListItem are:
createWishListWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userwishList
- The wish list to be createdoptions
- An object containing options for the method. It may be set to null.
KKException
public void editWishList(java.lang.String sessionId, WishListIf wishList) throws KKException
KKEngIf
editWishList
in interface KKEngIf
sessionId
- The session id of the logged in userwishList
- The wish list to be edited
KKException
public void editWishListWithOptions(java.lang.String sessionId, WishListIf wishList, AddToWishListOptionsIf options) throws KKException
KKEngIf
editWishListWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userwishList
- The wish list to be editedoptions
- An object containing options for the method. It may be set to null.
KKException
public void deleteWishList(java.lang.String sessionId, int wishListId) throws KKException
KKEngIf
deleteWishList
in interface KKEngIf
sessionId
- The session id of the logged in userwishListId
- The numeric id of the wish list
KKException
public void deleteWishListWithOptions(java.lang.String sessionId, int wishListId, AddToWishListOptionsIf options) throws KKException
KKEngIf
deleteWishListWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userwishListId
- The numeric id of the wish listoptions
- An object containing options for the method. It may be set to null.
KKException
public WishList getWishListWithItems(java.lang.String sessionId, int wishListId, int languageId) throws KKException
KKEngIf
Each WishListItem object will have a populated product
attribute and populated
opts
attribute if the WishListItem contains options. The items will be ordered
by priority with the highest priority first.
getWishListWithItems
in interface KKEngIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.wishListId
- The numeric id of the wish listlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public WishList getWishListWithItemsWithOptions(java.lang.String sessionId, int wishListId, int languageId, AddToWishListOptionsIf options) throws KKException
KKEngIf
options
is set to null, this method is identical to
getWishListWithItems()
. Otherwise the functionality differs depending on the
combination of options set. The sessionId may be left null if a temporary customer id
(negative number) is added to the options object. An exception will be thrown if the wish
list doesn't belong to the logged in customer or customer referenced by customer id, and is
private.
Returns a fully populated WishList object that may contain an array of WishListItem objects. An exception will be thrown if the wish list doesn't belong to the logged in customer and is private.
Each WishListItem object will have a populated product
attribute and populated
opts
attribute if the WishListItem contains options. The items will be ordered
by priority with the highest priority first.
getWishListWithItemsWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.wishListId
- The numeric id of the wish listlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public WishListItems getWishListItems(java.lang.String sessionId, DataDescriptorIf dataDesc, int wishListId, int languageId) throws KKException
KKEngIf
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
getWishListItems
in interface KKEngIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderwishListId
- The numeric id of the WishList object that the wish list items belong tolanguageId
- The numeric id of the language object
KKException
public WishListItems getWishListItemsWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, int wishListId, int languageId, AddToWishListOptionsIf options) throws KKException
KKEngIf
However, by setting the attributes of dataDesc
, the following functionality may
be controlled :
If the onlyShowAvailable
attribute of the options object is set, then the wish
list items that have quantity received equal to quantity desired, are not returned.
getWishListItemsWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.dataDesc
- Used to control the data offset, limit the number of items returned and set the
sort orderwishListId
- The numeric id of the WishList object that the wish list items belong tolanguageId
- The numeric id of the language objectoptions
- An object containing options for the method. It may be set to null.
KKException
public WishListIf getWishList(java.lang.String sessionId, int wishListId) throws KKException
KKEngIf
getWishList
in interface KKEngIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.wishListId
- The numeric id of the wish list
KKException
public WishListIf getWishListWithOptions(java.lang.String sessionId, int wishListId, AddToWishListOptionsIf options) throws KKException
KKEngIf
getWishListWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in user. It may be null if the user isn't logged in.wishListId
- The numeric id of the wish listoptions
- An object containing options for the method. It may be set to null.
KKException
public void removeFromWishList(java.lang.String sessionId, int wishListItemId) throws KKException
KKEngIf
removeFromWishList
in interface KKEngIf
sessionId
- The session id of the logged in userwishListItemId
- The numeric id of the wish list item
KKException
public void removeFromWishListWithOptions(java.lang.String sessionId, int wishListItemId, AddToWishListOptionsIf options) throws KKException
KKEngIf
removeFromWishListWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in userwishListItemId
- The numeric id of the wish list itemoptions
- An object containing options for the method. It may be set to null.
KKException
public StoreIf getStore() throws KKException
KKEngIf
getStore
in interface KKEngIf
KKException
public void addCustomDataToSession(java.lang.String sessionId, java.lang.String data, int position) throws KKException
KKEngIf
addCustomDataToSession
in interface KKEngIf
sessionId
- The sessionIddata
- The data to be savedposition
- This must be in the range of 1-5 to identify custom1 to custom5
KKException
public java.lang.String getCustomDataFromSession(java.lang.String sessionId, int position) throws KKException
KKEngIf
getCustomDataFromSession
in interface KKEngIf
sessionId
- The sessionIdposition
- This must be in the range of 1-5 to identify custom1 to custom5
KKException
public void setCookie(KKCookieIf cookie) throws KKException
KKEngIf
The cookie object passed in as a parameter must have the following attributes set:
The unique key for the cookie is the customerUuid together with the attributeId. The customerUuid is the value that should be saved and retrieved from the browser cookie and then used to look up the attributes saved in the KonaKart database. It can be created using the java.util.UUID class.
setCookie
in interface KKEngIf
cookie
- A KKCookie object to be persisted in the database
KKException
public KKCookieIf getCookie(java.lang.String customerUuid, java.lang.String attrId) throws KKException
KKEngIf
When this method is called, the last_read date of the returned cookie in the database, is updated.
getCookie
in interface KKEngIf
customerUuid
- A random string used to identify the customer that owns the cookiesattrId
- An identifier for the cookie
KKException
public KKCookieIf[] getAllCookies(java.lang.String customerUuid) throws KKException
KKEngIf
When this method is called, the last_read date for each returned cookies in the database, is updated.
getAllCookies
in interface KKEngIf
customerUuid
- A random string used to identify the customer that owns the cookies
KKException
public void deleteCookie(java.lang.String customerUuid, java.lang.String attrId) throws KKException
KKEngIf
deleteCookie
in interface KKEngIf
customerUuid
- A random string used to identify the customer that owns the cookiesattrId
- An identifier for the cookie
KKException
public GeoZone[] getGeoZonesPerZone(ZoneIf zone) throws KKException
KKEngIf
getGeoZonesPerZone
in interface KKEngIf
zone
- The physical zone
KKException
public Review getReview(int reviewId) throws KKException
KKEngIf
reviewId
. The
averageRating
attribute of the review is calculated and set by the method.
getReview
in interface KKEngIf
reviewId
- The numeric id of the review
KKException
public void addToCustomerTag(java.lang.String sessionId, java.lang.String tagName, int tagValue) throws KKException
KKEngIf
com.konakart.app.CustomerTag.MULTI_INT_TYPE
. This customer tag type is used to
store a series of integers and is useful for cases where you want to store information such
as the last 5 product ids that a customer looked at.
If the customer tag doesn't yet exist for the customer referenced by the
sessionId
, then a new customer tag is added with the value in the
tagValue
parameter. Otherwise the new value is added. When the number of
integers stored reaches the maximum value defined for the customer tag, then the new value is
added and the oldest value is removed.
addToCustomerTag
in interface KKEngIf
sessionId
- The session id of the logged in usertagName
- Name of the customer tagtagValue
- Value of the customer tag
KKException
public void addToCustomerTagForGuest(int customerId, java.lang.String tagName, int tagValue) throws KKException
KKEngIf
com.konakart.app.CustomerTag.MULTI_INT_TYPE
. This customer tag type is used to
store a series of integers and is useful for cases where you want to store information such
as the last 5 product ids that a customer looked at.
If the customer tag doesn't yet exist for the guest customer referenced by the
customerId
(negative value), then a new customer tag is added with the value in
the tagValue
parameter. Otherwise the new value is added. When the number of
integers stored reaches the maximum value defined for the customer tag, then the new value is
added and the oldest value is removed.
addToCustomerTagForGuest
in interface KKEngIf
customerId
- The id of the guest customer which has a negative value.tagName
- Name of the customer tagtagValue
- Value of the customer tag
KKException
public void deleteCustomerTag(java.lang.String sessionId, java.lang.String tagName) throws KKException
KKEngIf
tagName
and for
the customer referenced by the sessionId
.
deleteCustomerTag
in interface KKEngIf
sessionId
- The session id of the logged in usertagName
- Name of the customer tag
KKException
public void deleteCustomerTagForGuest(int customerId, java.lang.String tagName) throws KKException
KKEngIf
tagName
and for
the guest customer referenced by the negative customerId
.
deleteCustomerTagForGuest
in interface KKEngIf
customerId
- The id of the guest customer which has a negative value.tagName
- Name of the customer tag
KKException
public CustomerTagIf getCustomerTag(java.lang.String sessionId, java.lang.String tagName) throws KKException
KKEngIf
tagName
is returned. The value
attribute of the tag is populated for the customer referenced by the sessionId
.
If sessionId
is set to null, then a customer tag object with a null value is
returned.
The CustomerTag object contains utility methods to convert the tag string into its original type (i.e. Date, boolean, int etc.).
getCustomerTag
in interface KKEngIf
sessionId
- The session id of the logged in usertagName
- Name of the customer tag
KKException
public CustomerTagIf getCustomerTagForGuest(int customerId, java.lang.String tagName) throws KKException
KKEngIf
tagName
is returned. The value
attribute of the tag is populated for the guest customer referenced by the negative
customerId
.
The CustomerTag object contains utility methods to convert the tag string into its original type (i.e. Date, boolean, int etc.).
getCustomerTagForGuest
in interface KKEngIf
customerId
- The id of the guest customer which has a negative value.tagName
- Name of the customer tag
KKException
public java.lang.String getCustomerTagValue(java.lang.String sessionId, java.lang.String tagName) throws KKException
KKEngIf
tagName
and for the customer referenced by the sessionId
. This
method is faster than the getCustomerTag
method, but the actual CustomerTag
object isn't available to convert the String into a more usable form such as boolean or date.
getCustomerTagValue
in interface KKEngIf
sessionId
- The session id of the logged in usertagName
- Name of the customer tag
KKException
public java.lang.String getCustomerTagValueForGuest(int customerId, java.lang.String tagName) throws KKException
KKEngIf
tagName
and for the guest customer referenced by the negative
customerId
. This method is faster than the getCustomerTag
method,
but the actual CustomerTag object isn't available to convert the String into a more usable
form such as boolean or date.
getCustomerTagValueForGuest
in interface KKEngIf
customerId
- The id of the guest customer which has a negative value.tagName
- Name of the customer tag
KKException
public CustomerTagIf[] getCustomerTags(java.lang.String sessionId) throws KKException
KKEngIf
sessionId
.
An empty array is returned if no tags exist.
getCustomerTags
in interface KKEngIf
sessionId
- The session id of the logged in user
KKException
public CustomerTagIf[] getCustomerTagsForGuest(int customerId) throws KKException
KKEngIf
customerId
which must have a negative value.
An empty array is returned if no tags exist.
getCustomerTagsForGuest
in interface KKEngIf
customerId
- The id of the guest customer which has a negative value.
KKException
public void insertCustomerTag(java.lang.String sessionId, CustomerTagIf tag) throws KKException
KKEngIf
sessionId
.
If a tag already exists with this name, then the value is replaced with the new value. The compulsory tag fields are:
Note that a customer tag with name tag.getName()
must exist in the database
since it is used to validate tag.getValue()
.
insertCustomerTag
in interface KKEngIf
sessionId
- The session id of the logged in usertag
- Customer Tag
KKException
public void insertCustomerTagForGuest(int customerId, CustomerTagIf tag) throws KKException
KKEngIf
customerId
which
must have a negative value.
If a tag already exists with this name, then the value is replaced with the new value. The compulsory tag fields are:
Note that a customer tag with name tag.getName()
must exist in the database
since it is used to validate tag.getValue()
.
insertCustomerTagForGuest
in interface KKEngIf
customerId
- The id of the guest customer which has a negative value.tag
- Customer Tag
KKException
public boolean evaluateExpression(java.lang.String sessionId, int expressionId, java.lang.String expressionName) throws KKException
KKEngIf
sessionId
. If the expressionName
parameter is not set to
null, then the Expression is searched for by name. Otherwise it is searched for by the id
contained in the expressionId
parameter.
evaluateExpression
in interface KKEngIf
sessionId
- The session id of the logged in userexpressionId
- Numeric Id of the expressionexpressionName
- Name of expression
KKException
public boolean evaluateExpressionForGuest(int customerId, int expressionId, java.lang.String expressionName) throws KKException
KKEngIf
customerId
. If the expressionName
parameter is not set to null, then the Expression is searched for by name. Otherwise it is
searched for by the id contained in the expressionId
parameter.
evaluateExpressionForGuest
in interface KKEngIf
customerId
- The id of the guest customer which has a negative value.expressionId
- Numeric Id of the expressionexpressionName
- Name of expression
KKException
public ExpressionIf getExpression(java.lang.String sessionId, int expressionId, java.lang.String expressionName) throws KKException
KKEngIf
expressionName
parameter is not set to null, then the Expression is searched
for by name. Otherwise it is searched for by the id contained in the
expressionId
parameter.
If the sessionId
parameter is null we get the expression variables without any
customer tag values. Otherwise the expression variables will be populated with the customer
tag values for the customer referenced by sessionId
. other
getExpression
in interface KKEngIf
sessionId
- The session id of the logged in userexpressionId
- Numeric Id of the expressionexpressionName
- Name of expression
KKException
public ExpressionIf getExpressionForGuest(int customerId, int expressionId, java.lang.String expressionName) throws KKException
KKEngIf
expressionName
parameter is not set to null, then the Expression is searched
for by name. Otherwise it is searched for by the id contained in the
expressionId
parameter.
The expression variables will be populated with the customer tag values for the guest
customer referenced by customerId
.
getExpressionForGuest
in interface KKEngIf
customerId
- The id of the guest customer which has a negative value.expressionId
- Numeric Id of the expressionexpressionName
- Name of expression
KKException
public int addPoints(java.lang.String sessionId, int points, java.lang.String code, java.lang.String description) throws KKException
KKEngIf
sessionId
parameter.
addPoints
in interface KKEngIf
sessionId
- The session id of the logged in userpoints
- Number of points to addcode
- An optional code to categorize the reason for awarding the pointsdescription
- An optional description describing why the points were awarded
KKException
public int deletePoints(java.lang.String sessionId, int points, java.lang.String code, java.lang.String description) throws KKException
KKEngIf
sessionId
parameter.
deletePoints
in interface KKEngIf
sessionId
- The session id of the logged in userpoints
- Number of points to deletecode
- An optional code to categorize the reason for redeeming the pointsdescription
- An optional description describing how the points were redeemed
KKException
public void deleteReservedPoints(java.lang.String sessionId, int reservationId, java.lang.String code, java.lang.String description) throws KKException
KKEngIf
reservationId
parameter exists and that it belongs to the
customer identified by the sessionId
parameter. The reserved points are normally
deleted once the order has been paid for or shipped. If the order is never fulfilled, then
the reserved points may be freed and returned to the available total. Once deleted. the
points can no longer be returned to the total.
deleteReservedPoints
in interface KKEngIf
sessionId
- The session id of the logged in userreservationId
- Numeric identifier of the reservationcode
- An optional code to categorize the reason for redeeming the pointsdescription
- An optional description describing how the points were redeemed
KKException
public int freeReservedPoints(java.lang.String sessionId, int reservationId) throws KKException
KKEngIf
reservationId
parameter exists and that it belongs to the
customer identified by the sessionId
parameter. The reserved points may be freed
and returned to the available total using this API call. The method checks to see whether
some or all of the points have expired while they were in the reserved state.
freeReservedPoints
in interface KKEngIf
sessionId
- The session id of the logged in userreservationId
- Numeric identifier of the reservation
KKException
public int pointsAvailable(java.lang.String sessionId) throws KKException
KKEngIf
sessionId
parameter.
pointsAvailable
in interface KKEngIf
sessionId
- The session id of the logged in user
KKException
public int reservePoints(java.lang.String sessionId, int points) throws KKException
KKEngIf
sessionId
parameter. The removed points are not deleted but reserved, so that
they are no longer available for spending but may be deleted once the order has been paid for
or shipped. If the order is never fulfilled, then the reserved points may be freed and
returned to the available total.
reservePoints
in interface KKEngIf
sessionId
- The session id of the logged in userpoints
- Number of points to reserve
KKException
public void setRewardPointReservationId(java.lang.String sessionId, int orderId, int reservationId) throws KKException
KKEngIf
sessionId
parameter and then updates the reservation id on the order.
setRewardPointReservationId
in interface KKEngIf
KKException
public RewardPoints getRewardPoints(java.lang.String sessionId, DataDescriptorIf dataDesc) throws KKException
KKEngIf
sessionId
parameter. The most recent objects are returned first.
getRewardPoints
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset and limit the number of items returned
KKException
public void updateSubscription(java.lang.String sessionId, SubscriptionIf subscription) throws KKException
KKEngIf
updateSubscription
in interface KKEngIf
sessionId
- The session id of the logged in usersubscription
- The subscription object to be updated
KKException
public int insertSubscription(java.lang.String sessionId, SubscriptionIf subscription) throws KKException
KKEngIf
insertSubscription
in interface KKEngIf
sessionId
- The session id of the logged in usersubscription
- The subscription object to be inserted
KKException
public PaymentSchedule getPaymentSchedule(int id) throws KKException
KKEngIf
id
parameter, or Null if the payment
schedule object doesn't exist in the DB.
getPaymentSchedule
in interface KKEngIf
id
- The id of the payment schedule object
KKException
public Subscription[] getSubscriptionsPerCustomer(java.lang.String sessionId) throws KKException
KKEngIf
getSubscriptionsPerCustomer
in interface KKEngIf
sessionId
- The session id of the logged in user
KKException
public Subscriptions searchForSubscriptionsPerCustomer(java.lang.String sessionId, DataDescriptorIf dataDesc, SubscriptionSearchIf subscriptionSearch) throws KKException
KKEngIf
sessionId
.
The SubscriptionSearch class contains the search criteria although it may be null.
dataDesc
may be null. In this case, the number of retrieved subscriptions is
limited to a default number, the subscriptions are ordered by the SubscriptionId and the
offset is set to zero. However, by setting the attributes of dataDesc
, the
following functionality may be controlled :
searchForSubscriptionsPerCustomer
in interface KKEngIf
sessionId
- The session id of the logged in userdataDesc
- Used to control the data offset, limit the number of items returned and set the
sortsubscriptionSearch
- Contains information used to add search constraints
KKException
public ProductIf getProductPerSkuWithOptions(java.lang.String sessionId, java.lang.String sku, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
getProductPerSkuWithOptions
in interface KKEngIf
sessionId
- The session id of the logged in usersku
- The product SKUlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public ProductIf getProductPerSku(java.lang.String sessionId, java.lang.String sku, int languageId) throws KKException
KKEngIf
getProductPerSku
in interface KKEngIf
sessionId
- The session id of the logged in usersku
- The product SKUlanguageId
- The id for the language that will be used. Value of -1 selects the default
language.
KKException
public DigitalDownloadIf getDigitalDownloadById(java.lang.String sessionId, int digitalDownloadId) throws KKException
KKEngIf
getDigitalDownloadById
in interface KKEngIf
sessionId
- The session id of the logged in userdigitalDownloadId
- The numeric id of the digital download object
KKException
public void editDigitalDownload(java.lang.String sessionId, DigitalDownloadIf digitalDownload) throws KKException
KKEngIf
editDigitalDownload
in interface KKEngIf
sessionId
- The session id of the logged in userdigitalDownload
- The digital download object to be edited
KKException
public IpnHistory[] getIpnHistory(java.lang.String sessionId, int orderId) throws KKException
KKEngIf
getIpnHistory
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the order
KKException
public PdfResultIf getPdf(java.lang.String sessionId, PdfOptionsIf options) throws KKException
KKEngIf
getPdf
in interface KKEngIf
sessionId
- The session id of the logged in useroptions
- The PdfOptions object that defines the PDF document to create
KKException
public java.lang.String getMsgValue(java.lang.String key, int type, java.lang.String locale) throws KKException
KKEngIf
getMsgValue
in interface KKEngIf
key
- the message keytype
- the message type (should use KKConstants.MSG_TYP_APPLICATION for application
messages)locale
- the message locale (eg. "en_GB"). Default is used if left null.
KKException
public NameValueIf[] getMessages(int type, java.lang.String locale) throws KKException
KKEngIf
getMessages
in interface KKEngIf
type
- the message type (should use KKConstants.MSG_TYP_APPLICATION for application
messages)locale
- the message locale (eg. "en_GB"). Default is used if left null.
KKException
public void postMessageToQueue(java.lang.String sessionId, MqOptionsIf options) throws KKException
KKEngIf
postMessageToQueue
in interface KKEngIf
sessionId
- the sessionIdoptions
- the MQ options
KKException
public MqResponseIf readMessageFromQueue(java.lang.String sessionId, MqOptionsIf options) throws KKException
KKEngIf
readMessageFromQueue
in interface KKEngIf
sessionId
- the sessionIdoptions
- the MQ options
KKException
public void insertCustomerEvent(CustomerEventIf event) throws KKException
KKEngIf
The DateAdded attribute of the event object is added by the engine if left null. The storeId attribute of the event object is added by the engine.
insertCustomerEvent
in interface KKEngIf
event
- A customer event object
KKException
public SuggestedSearchItemIf[] getSuggestedSearchItems(java.lang.String sessionId, SuggestedSearchOptionsIf options) throws KKException
KKEngIf
getSuggestedSearchItems
in interface KKEngIf
sessionId
- the sessionId which may be left null if the customer isn't logged inoptions
- A SuggestedSearchOptions object containing all parameters necessary to configure
the SuggestedSearch operation
KKException
public ProductIf[] getProductsFromIdsWithOptions(java.lang.String sessionId, DataDescriptorIf dataDesc, int[] prodIdArray, int languageId, FetchProductOptionsIf options) throws KKException
KKEngIf
getProductsFromIdsWithOptions
in interface KKEngIf
sessionId
- the sessionId which may be left null if the customer isn't logged indataDesc
- Can be used to add sort by information and to set whether to return the
description of the products.prodIdArray
- An array of product idslanguageId
- The id for the language that will be used. Value of -1 selects the default
language.options
- An object containing options for the method. It may be set to null.
KKException
public Bookings getBookingsPerProduct(DataDescriptorIf dataDesc, int productId, BookableProductOptionsIf options) throws KKException
KKEngIf
getBookingsPerProduct
in interface KKEngIf
dataDesc
- Can be used to add sort by information and constraints on the custom fieldsproductId
- The numeric id of the productoptions
- Not used at the moment. May be left null.
KKException
public ProductIf[] getBookableProductConflict(java.lang.String sessionId, ProductIf bookableProd, BookableProductOptionsIf options) throws KKException
KKEngIf
getBookableProductConflict
in interface KKEngIf
sessionId
- The sessionId of the logged in customerbookableProd
- The bookable product being checkedoptions
- Not used at the moment. May be left null.
KKException
public Bookings getBookingsPerCustomer(java.lang.String sessionId, DataDescriptorIf dataDesc, BookableProductOptionsIf options) throws KKException
KKEngIf
getBookingsPerCustomer
in interface KKEngIf
sessionId
- The sessionId of the logged in customerdataDesc
- Can be used to add sort by information and constraints on the custom fieldsoptions
- Not used at the moment. May be left null.
KKException
public int insertBooking(java.lang.String sessionId, BookingIf booking, BookableProductOptionsIf options) throws KKException
KKEngIf
insertBooking
in interface KKEngIf
sessionId
- The sessionId of the logged in customerbooking
- A booking objectoptions
- Options allowing an exception to be thrown for exceeding the maximum number of
bookings
KKException
public int getOrderStatus(java.lang.String sessionId, int orderId) throws KKException
KKEngIf
getOrderStatus
in interface KKEngIf
sessionId
- The session id of the logged in userorderId
- The numeric id of the order
KKException
public OrderStatus[] getAllOrderStatuses(int languageId) throws KKException
KKEngIf
getAllOrderStatuses
in interface KKEngIf
languageId
- The id for the language that will be used to determine the customer group name and
description. Value of -1 selects the default language.
KKException
public java.lang.String saveSSOToken(SSOTokenIf token) throws KKException
KKEngIf
saveSSOToken
in interface KKEngIf
token
- The SSO token to be saved
KKException
public SSOTokenIf getSSOToken(java.lang.String secretKey, boolean deleteToken) throws KKException
KKEngIf
deleteToken
parameter is set to true, the token is deleted from the
database after having been read.
getSSOToken
in interface KKEngIf
secretKey
- The UUID secretKey used to identify the tokendeleteToken
- The token is deleted from the database after being read
KKException
public void enableCustomer(java.lang.String secretKey) throws KKException
KKEngIf
enableCustomer
in interface KKEngIf
KKException
public int checkCoupon(java.lang.String couponCode) throws KKException
KKEngIf
checkCoupon
in interface KKEngIf
couponCode
- The coupon code
KKException
public Promotion[] getAllPromotions() throws KKException
KKEngIf
getAllPromotions
in interface KKEngIf
KKException
public ProductIf[] getPromotionsPerProducts(java.lang.String sessionId, int customerId, ProductIf[] products, PromotionIf[] promotions, java.lang.String[] couponCodes, PromotionOptionsIf options) throws KKException
KKEngIf
getPromotionsPerProducts
in interface KKEngIf
sessionId
- Only used if the customer is logged in. Otherwise set to null.customerId
- If the sessionId is set to null then the customerId should contain the id of the
temporary user which is a negative number. The temporary user id can be used for
evaluating expression rules.products
- An array of products to be processedpromotions
- The promotions which will be applied to the products if all rules are matched.couponCodes
- Coupon codes to use. If none of the promotions require coupons, it should be set
to nulloptions
- An object containing information to configure the calculation for applying one or
more promotion results to the product price.
KKException
public ConfigDataIf[] getConfigData(java.lang.String sessionId, java.lang.String key) throws KKException
KKEngIf
getConfigData
in interface KKEngIf
sessionId
- Session Id of the customer.key
- Only return the ConfigData items with this key (if null all ConfigData items are
returned)
KKException
public java.lang.String getKonaKartVersion() throws KKException
KKEngIf
getKonaKartVersion
in interface KKEngIf
KKException
public java.lang.String getPunchOutMessage(java.lang.String sessionId, OrderIf order, PunchOutOptionsIf options) throws KKException
KKEngIf
getPunchOutMessage
in interface KKEngIf
sessionId
- Session Id of the customer.order
- Order used to create messageoptions
- Options to configure the call by defining things such as the standard used for the
message and the version of the standard.
KKException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |