com.konakart.appif
Interface KKEngIf


public interface KKEngIf

Describes all of the API calls to the the KonaKart server engine.


Method Summary
 int addAddressToCustomer(java.lang.String sessionId, AddressIf addr)
          The Address object is added to the customer defined by the sessionId.
 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().
 OrderIf 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)
          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 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 checkSession(java.lang.String sessionId)
          The given sessionId is checked to see whether it exists and whether it is has timed out.
 OrderIf 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.
 OrderIf 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.
 OrderIf createOrderWithOptions(java.lang.String sessionId, BasketIf[] basketItemArray, CreateOrderOptionsIf options, int languageId)
          If options is set to null, this method is identical to createOrder().
 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 deleteOrderIdForSecretKey(java.lang.String secretKey)
          The secret key is removed from the system.
 void deleteProductNotificationFromCustomer(java.lang.String sessionId, int productId)
          Deletes a product notification from the list of notifications for the customer.
 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)
          Edits an existing configuration.
 void editCustomer(java.lang.String sessionId, CustomerIf cust)
          The Customer object will replace the existing customer object in the database.
 void editCustomerAddress(java.lang.String sessionId, AddressIf addr)
          The Address object will replace the existing address object in the database with the same id.
 int forceRegisterCustomer(CustomerRegistrationIf custReg)
          This API Call is used rather than registerCustomer() when you want to provide a store that doesn't force customer registration.
 AddressIf[] getAddressesPerCustomer(java.lang.String sessionId)
          Returns all of the addresses registered for the given customer.
 CountryIf[] getAllCountries()
          Returns an array of Country objects for all of the countries in the system.
 CurrencyIf[] getAllCurrencies()
          Returns an array of currency objects for all the records in the currencies table.
 CustomerGroupIf[] getAllCustomerGroups(int languageId)
          Returns an array of customer groups for all customer groups that have been defined in the system.
 LanguageIf[] getAllLanguages()
          Returns an array of Language classes containing all of the languages that have been defined within the system.
 ManufacturerIf[] getAllManufacturers()
          Returns an array of Manufacturer objects for all of the manufacturers in the system.
 ProductsIf getAllProducts(java.lang.String sessionId, DataDescriptorIf dataDesc, int languageId)
          Returns all products using the given language.
 ReviewsIf getAllReviews(DataDescriptorIf dataDesc)
          An array of review objects is returned.
 ProductsIf getAllSpecials(java.lang.String sessionId, DataDescriptorIf dataDesc, int languageId)
          Returns all specials using the given language.
 ProductIf[] 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.
 BasketIf[] getBasketItemsPerCustomer(java.lang.String sessionId, int customerId, int languageId)
          Get the basket items for a customer and language.
 ProductIf[] getBestSellers(DataDescriptorIf dataDesc, int categoryId, int languageId)
          Returns an array of bestseller products for the category referenced by categoryId and its children.
 CategoryIf[] getCategoriesPerManufacturer(int manufacturerId, int languageId)
          Returns an array of leaf Category objects for the given manufacturer.
 CategoryIf getCategory(int categoryId, int languageId)
          Returns a complete single Category object for the given categoryId and language.
 CategoryIf[] 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.
 KKConfigurationIf getConfiguration(java.lang.String key)
          Returns a Configuration object referenced by the key passed in as a parameter
 KKConfigurationIf[] getConfigurations()
          Returns an array of Configuration objects containing all configurations that have been defined in the system.
 CountryIf getCountryPerName(java.lang.String countryName)
          Returns the country object for the countryName, or null if the country doesn't exist in the DB.
 CurrencyIf getCurrency(java.lang.String currencyCode)
          Returns the currency referenced by currencyCode.
 CustomerIf getCustomer(java.lang.String sessionId)
          Returns the customer object for the customer defined by the given sessionId.
 CustomerGroupIf getCustomerGroup(int customerGroupId, int languageId)
          Returns a customer group object for the customerGroupId passed in as a parameter.
 AddressIf getDefaultAddressPerCustomer(java.lang.String sessionId)
          Returns the default address for the given customer.
 CurrencyIf getDefaultCurrency()
          The default currency is referenced by a configuration variable called DEFAULT_CURRENCY.
 CustomerIf getDefaultCustomer()
          Returns the customer object for the default customer.
 LanguageIf getDefaultLanguage()
          The default language is referenced by a configuration variable called DEFAULT_LANGUAGE.
 DigitalDownloadIf[] getDigitalDownloads(java.lang.String sessionId)
          Returns an array of Digital Download objects for the customer identified by the 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.
 java.util.Calendar getKonakartTimeStamp()
          Get a Date Time Stamp from the server
 LanguageIf getLanguagePerCode(java.lang.String code)
          Retrieves the language object referenced by the two letter code (i.e.
 LanguageIf getLanguagePerId(int languageId)
          Retrieves the language object referenced by the id.
 ManufacturerIf getManufacturer(int manufacturerId, int languageId)
          Returns a complete Manufacturer object for the given manufacturerId and language.
 ManufacturerIf getManufacturerPerProduct(int productId, int languageId)
          Returns a complete Manufacturer object for the given productId and language.
 ManufacturerIf[] getManufacturersPerCategory(int categoryId)
          Returns an array of Manufacturer objects for the given category.
 OrderIf getOrder(java.lang.String sessionId, int orderId, int languageId)
          Gets on order for the customer referenced by the sessionId.
 ProductIf[] getOrderHistory(DataDescriptorIf dataDesc, java.lang.String sessionId, int languageId)
          Get a list of the products ordered by the customer referenced by sessionId.
 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.
 OrdersIf getOrdersPerCustomer(DataDescriptorIf dataDesc, java.lang.String sessionId, int languageId)
          Retrieve a number of orders for the customer referenced by the sessionId.
 OrderIf getOrderTotals(OrderIf order, int languageId)
          The order object is populated with an array of order totals.
 PaymentDetailsIf 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.
 PaymentDetailsIf 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.
 PaymentDetailsIf 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.
 PaymentDetailsIf[] getPaymentGateways(OrderIf order, int languageId)
          Each payment module is called and asked to return a PaymentDetails object.
 ProductIf getProduct(java.lang.String sessionId, int productId, int languageId)
          Returns a complete Product object for the given productId and language.
 ProductIf[] getProductNotificationsPerCustomer(java.lang.String sessionId, int languageId)
          Returns all products sorted by name, that the customer has asked to be notified about.
 int getProductQuantity(java.lang.String encodedProductId)
          The stock level of the product is returned.
 ProductsIf getProductsPerCategory(java.lang.String sessionId, DataDescriptorIf dataDesc, int categoryId, boolean searchInSubCats, int languageId)
          Returns a Products object for the given category and language.
 ProductsIf getProductsPerCategoryPerManufacturer(java.lang.String sessionId, DataDescriptorIf dataDesc, int categoryId, int manufacturerId, int languageId)
          Returns a Products object for the given category, language and manufacturer.
 ProductsIf getProductsPerManufacturer(java.lang.String sessionId, DataDescriptorIf dataDesc, int manufacturerId, int languageId)
          Returns a Products object for the given manufacturer and language.
 ProductsIf getRelatedProducts(java.lang.String sessionId, DataDescriptorIf dataDesc, int productId, int relationType, int languageId)
          Find products related to the product defined by the productId parameter.
 ReviewsIf getReviewsPerProduct(DataDescriptorIf dataDesc, int productId)
          An array of review objects is returned for the given productId.
 ShippingQuoteIf 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.
 ShippingQuoteIf[] 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)
          Get the SKU for an OrderProduct object.
 ProductsIf getSpecialsPerCategory(java.lang.String sessionId, DataDescriptorIf dataDesc, int categoryId, int languageId)
          Returns all specials for the given categoryId and language.
 java.lang.String getStatusText(int statusId, int languageId)
          Returns the text of a status from the orders_status table.
 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.
 TagGroupIf[] 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.
 ZoneIf[] getZonesPerCountry(int countryId)
          Returns an array of Zone objects for the country referenced by the countryId.
 void 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.
 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.
 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.
 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.
 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.
 ProductsIf searchForProducts(java.lang.String sessionId, DataDescriptorIf dataDesc, ProductSearchIf prodSearch, int languageId)
          Returns all products using the given language.
 void sendNewPassword(java.lang.String emailAddr, java.lang.String subject, java.lang.String countryCode)
          A mail is sent to emailAddr containing a new password.
 void sendOrderConfirmationEmail(java.lang.String sessionId, int orderId, java.lang.String mailSubject, int languageId)
          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)
          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)
          A welcome email is sent after registration of a new customer.
 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 updateBasket(java.lang.String sessionId, int customerId, BasketIf item)
          Updates the Basket object in the database.
 BasketIf[] updateBasketWithStockInfo(BasketIf[] basketItems)
          Receives an array of basket items and updates each one with the current stock level.
 void updateCachedConfigurations()
          Wherever in the engine any configurations have been cached, they are refreshed when this method is called.
 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.
 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 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 updateProductViewedCount(int productId, int languageId)
          It updates the number of times that the product referenced by productId, has been viewed.
 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.
 

Method Detail

getAllLanguages

LanguageIf[] getAllLanguages()
                             throws com.konakart.app.KKException
Returns an array of Language classes containing all of the languages that have been defined within the system.

Returns:
Array of Language objects
Throws:
com.konakart.app.KKException

getDefaultLanguage

LanguageIf getDefaultLanguage()
                              throws com.konakart.app.KKException
The default language is referenced by a configuration variable called DEFAULT_LANGUAGE. If this variable isn't set, then the method returns the language with the lowest sort order value. We assume that this language is the default language and will be used when no other language is specified.

Returns:
Returns a language object
Throws:
com.konakart.app.KKException

getLanguagePerCode

LanguageIf getLanguagePerCode(java.lang.String code)
                              throws com.konakart.app.KKException
Retrieves the language object referenced by the two letter code (i.e. en, de, es)

Parameters:
code - The two letter language code such as en, de, es etc.
Returns:
Returns a language object
Throws:
com.konakart.app.KKException

getLanguagePerId

LanguageIf getLanguagePerId(int languageId)
                            throws com.konakart.app.KKException
Retrieves the language object referenced by the id.

Parameters:
languageId - The numeric id of the language object
Returns:
Returns a language object
Throws:
com.konakart.app.KKException

getCategoryTree

CategoryIf[] getCategoryTree(int languageId,
                             boolean getNumProducts)
                             throws com.konakart.app.KKException
Returns a category tree structure consisting of an array of top level categories, each of which may contain an array of child categories.

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.

Parameters:
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.
Returns:
Array of Category objects
Throws:
com.konakart.app.KKException

getProductsPerCategory

ProductsIf getProductsPerCategory(java.lang.String sessionId,
                                  DataDescriptorIf dataDesc,
                                  int categoryId,
                                  boolean searchInSubCats,
                                  int languageId)
                                  throws com.konakart.app.KKException
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 :

Parameters:
sessionId - The session id of the logged in user
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order
categoryId - The numeric id of the category
searchInSubCats - Determines whether products are searched for in the sub-categories of the specified category
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Returns a Products object
Throws:
com.konakart.app.KKException

getProductsPerCategoryPerManufacturer

ProductsIf getProductsPerCategoryPerManufacturer(java.lang.String sessionId,
                                                 DataDescriptorIf dataDesc,
                                                 int categoryId,
                                                 int manufacturerId,
                                                 int languageId)
                                                 throws com.konakart.app.KKException
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 :

Parameters:
sessionId - The session id of the logged in user
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order
categoryId - The numeric id of the category
languageId - The id for the language that will be used. Value of -1 selects the default language.
manufacturerId - The numeric id of the manufacturer
Returns:
Returns a Products object
Throws:
com.konakart.app.KKException

getProductsPerManufacturer

ProductsIf getProductsPerManufacturer(java.lang.String sessionId,
                                      DataDescriptorIf dataDesc,
                                      int manufacturerId,
                                      int languageId)
                                      throws com.konakart.app.KKException
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 :

Parameters:
sessionId - The session id of the logged in user
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order
manufacturerId - The numeric id of the manufacturer
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Returns a Products object
Throws:
com.konakart.app.KKException

getProduct

ProductIf getProduct(java.lang.String sessionId,
                     int productId,
                     int languageId)
                     throws com.konakart.app.KKException
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.

Parameters:
sessionId - The session id of the logged in user
productId - The numeric id of the product
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
A Product object
Throws:
com.konakart.app.KKException

getCategoriesPerManufacturer

CategoryIf[] getCategoriesPerManufacturer(int manufacturerId,
                                          int languageId)
                                          throws com.konakart.app.KKException
Returns an array of leaf Category objects for the given manufacturer. They are sorted by name.

The Category objects are not complete. Only the name and the image are returned.

Parameters:
manufacturerId - The numeric id of the manufacturer
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Array of Category objects
Throws:
com.konakart.app.KKException

getManufacturersPerCategory

ManufacturerIf[] getManufacturersPerCategory(int categoryId)
                                             throws com.konakart.app.KKException
Returns an array of Manufacturer objects for the given category. They are sorted by name.

The Manufacturer objects are not complete. Only the name and the image are returned and these are language independent.

Parameters:
categoryId - The numeric id of the category
Returns:
Array of Manufacturer objects
Throws:
com.konakart.app.KKException

getAllManufacturers

ManufacturerIf[] getAllManufacturers()
                                     throws com.konakart.app.KKException
Returns an array of Manufacturer objects for all of the manufacturers in the system. They are sorted by name.

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.

Returns:
Array of Manufacturer objects
Throws:
com.konakart.app.KKException

getManufacturerPerProduct

ManufacturerIf getManufacturerPerProduct(int productId,
                                         int languageId)
                                         throws com.konakart.app.KKException
Returns a complete Manufacturer object for the given productId and language.

Parameters:
productId - The numeric id of the product
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Manufacturer object
Throws:
com.konakart.app.KKException

getManufacturer

ManufacturerIf getManufacturer(int manufacturerId,
                               int languageId)
                               throws com.konakart.app.KKException
Returns a complete Manufacturer object for the given manufacturerId and language.

Parameters:
manufacturerId - The numeric id of the manufacturer
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Manufacturer object
Throws:
com.konakart.app.KKException

getCategory

CategoryIf getCategory(int categoryId,
                       int languageId)
                       throws com.konakart.app.KKException
Returns a complete single Category object for the given categoryId and language. It does not populate the children even if they exist.

Parameters:
categoryId - The numeric id of the category
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Category object
Throws:
com.konakart.app.KKException

getSpecialsPerCategory

ProductsIf getSpecialsPerCategory(java.lang.String sessionId,
                                  DataDescriptorIf dataDesc,
                                  int categoryId,
                                  int languageId)
                                  throws com.konakart.app.KKException
Returns all specials for the given 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 :

Parameters:
sessionId - The session id of the logged in user
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order
categoryId - The numeric id of the category
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Returns a Products object
Throws:
com.konakart.app.KKException

getAllSpecials

ProductsIf getAllSpecials(java.lang.String sessionId,
                          DataDescriptorIf dataDesc,
                          int languageId)
                          throws com.konakart.app.KKException
Returns all specials 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 :

Parameters:
sessionId - The session id of the logged in user
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Returns a Products object
Throws:
com.konakart.app.KKException

getAllProducts

ProductsIf getAllProducts(java.lang.String sessionId,
                          DataDescriptorIf dataDesc,
                          int languageId)
                          throws com.konakart.app.KKException
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 :

Parameters:
sessionId - The session id of the logged in user
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Returns a Products object
Throws:
com.konakart.app.KKException

getReviewsPerProduct

ReviewsIf getReviewsPerProduct(DataDescriptorIf dataDesc,
                               int productId)
                               throws com.konakart.app.KKException
An array of review objects is returned for the given 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 :

Parameters:
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order
productId - The numeric id of the product
Returns:
Return a Reviews object
Throws:
com.konakart.app.KKException

getAllReviews

ReviewsIf getAllReviews(DataDescriptorIf dataDesc)
                        throws com.konakart.app.KKException
An array of review objects is returned. 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 :

Parameters:
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order
Returns:
Return a Reviews object
Throws:
com.konakart.app.KKException

searchForProducts

ProductsIf searchForProducts(java.lang.String sessionId,
                             DataDescriptorIf dataDesc,
                             ProductSearchIf prodSearch,
                             int languageId)
                             throws com.konakart.app.KKException
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 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 :

Parameters:
sessionId - The session id of the logged in user
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order
prodSearch - Contains information used to search the catalog for a product
languageId - The id for the language that will be used. Value of -1 selects the default language.
Returns:
Returns a Products object
Throws:
com.konakart.app.KKException

registerCustomer

int registerCustomer(CustomerRegistrationIf custReg)
                     throws com.konakart.app.KKException
Receives all of the necessary parameters from the Customer Registration object to create a new customer in the database. If the customer already exists, an exception is thrown 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.

Parameters:
custReg - Contains all the required data in order to register a new customer
Returns:
Id of the customer that was created.
Throws:
com.konakart.app.KKException

forceRegisterCustomer

int forceRegisterCustomer(CustomerRegistrationIf custReg)
                          throws com.konakart.app.KKException
This API Call is used rather than registerCustomer() when you want to provide a store that doesn't force customer registration. KonaKart requires a customer to be present in its database even if the store doesn't require registration. If a customer with the same eMail address already exists then the customer details and the primary address details are edited but the method doesn't throw an exception unlike registerCustomer(). 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 at some other time, the user decides to register, then the registerCustomer() method can be used which will throw an exception. At that point the customer can decide to have a new password sent to him in order to enable him to log in. Once logged in he will see all of his order history even for orders that were placed when he wan't registered. 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.

Parameters:
custReg - Contains all the required data in order to register a new customer
Returns:
Id of the customer that was created.
Throws:
com.konakart.app.KKException

getAllCountries

CountryIf[] getAllCountries()
                            throws com.konakart.app.KKException
Returns an array of Country objects for all of the countries in the system. They are sorted by name. This method is used to create the drop list of countries during the customer registration process.

The Country objects are not complete. Only the name and the id are returned.

Returns:
Array of Country objects
Throws:
com.konakart.app.KKException

login

java.lang.String login(java.lang.String emailAddr,
                       java.lang.String password)
                       throws com.konakart.app.KKException
Returns a 16 byte long session key is the login is successful, otherwise it returns null.

Parameters:
emailAddr - The user name required to log in
password - The log in password
Returns:
sessionId The sessionId which must be used in subsequent API calls to identify the user
Throws:
com.konakart.app.KKException

logout

void logout(java.lang.String sessionId)
            throws com.konakart.app.KKException
Logs out the user with the specified session Id.

Parameters:
sessionId - The session Id of the logged in user
Throws:
com.konakart.app.KKException

getAddressesPerCustomer

AddressIf[] getAddressesPerCustomer(java.lang.String sessionId)
                                    throws com.konakart.app.KKException
Returns all of the addresses registered for the given customer. An exception is thrown if the sessionId isn't valid.

Parameters:
sessionId - The session id of the logged in user
Returns:
An array of address objects where the first one is the primary address. Returns an empty array if no addresses exist.
Throws:
com.konakart.app.KKException

getDefaultAddressPerCustomer

AddressIf getDefaultAddressPerCustomer(java.lang.String sessionId)
                                       throws com.konakart.app.KKException
Returns the default address for the given customer. An exception is thrown if the sessionId isn't valid.

Parameters:
sessionId - The session id of the logged in user
Returns:
An address object or null if it doesn't exist.
Throws:
com.konakart.app.KKException

setDefaultAddressPerCustomer

void setDefaultAddressPerCustomer(java.lang.String sessionId,
                                  int addressId)
                                  throws com.konakart.app.KKException
Sets the default address for this customer to be the address identified by 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.

Parameters:
sessionId - The session id of the logged in user
addressId - The numeric id of the address object
Throws:
com.konakart.app.KKException

addAddressToCustomer

int addAddressToCustomer(java.lang.String sessionId,
                         AddressIf addr)
                         throws com.konakart.app.KKException
The Address object is added to the customer defined by the sessionId. The zoneId and id of the address object are ignored since they are calculated during the insertion process. The customerId of the address object is also ignored. An exception is thrown if the sessionId isn't valid.

Parameters:
sessionId - The session id of the logged in user
addr - The address object which will be added to the customer
Returns:
Id of the new address object. A negative return value indicates an error.
Throws:
com.konakart.app.KKException

deleteAddressFromCustomer

void deleteAddressFromCustomer(java.lang.String sessionId,
                               int addressId)
                               throws com.konakart.app.KKException
The address defined by the 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.

Parameters:
sessionId - The session id of the logged in user
addressId - The numeric id of the address object
Throws:
com.konakart.app.KKException

editCustomerAddress

void editCustomerAddress(java.lang.String sessionId,
                         AddressIf addr)
                         throws com.konakart.app.KKException
The Address object will replace the existing address object in the database with the same id. A check is made to verify that the address object belongs to the customer logged in with the sessionId passed in as a parameter. The zoneId is ignored since it is calculated during the insertion process. 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.

Parameters:
sessionId - The session id of the logged in user
addr - The address object to edit
Throws:
com.konakart.app.KKException

getCustomer

CustomerIf getCustomer(java.lang.String sessionId)
                       throws com.konakart.app.KKException
Returns the customer object for the customer defined by the given sessionId. Throws an exception if the session has expired.

Parameters:
sessionId - The session id of the logged in user
Returns:
Customer Object or Null if the customer doesn't exist.
Throws:
com.konakart.app.KKException

editCustomer

void editCustomer(java.lang.String sessionId,
                  CustomerIf cust)
                  throws com.konakart.app.KKException
The Customer object will replace the existing customer object in the database. 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 :

Parameters:
sessionId - The session id of the logged in user
cust - The customer object to edit
Throws:
com.konakart.app.KKException

getKonakartTimeStamp

java.util.Calendar getKonakartTimeStamp()
                                        throws com.konakart.app.KKException
Get a Date Time Stamp from the server

Returns:
Calendar
Throws:
com.konakart.app.KKException

writeReview

int writeReview(java.lang.String sessionId,
                ReviewIf review)
                throws com.konakart.app.KKException
Receives all of the necessary parameters from the Review object to create a new review in the database. The new review is associated to the customer logged in with sessionId. The obligatory parameters are :

Parameters:
sessionId - The session id of the logged in user
review - The review that will be inserted
Returns:
Id of the review that was created.
Throws:
com.konakart.app.KKException

checkSession

int checkSession(java.lang.String sessionId)
                 throws com.konakart.app.KKException
The given 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.

Parameters:
sessionId - The session id of the logged in user
Returns:
Returns customerId of customer pointed to by session
Throws:
com.konakart.app.KKException

addToBasket

int addToBasket(java.lang.String sessionId,
                int customerId,
                BasketIf item)
                throws com.konakart.app.KKException
Saves the Basket object in the database for a customer. If the Basket object already exists with exactly the same options etc, then we just increase the quantity of the existing object.

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.

Parameters:
sessionId - The session id of the logged in user
customerId - The numeric id of the customer
item - The basket item to add to the basket
Returns:
Returns the id of the newly created Basket object
Throws:
com.konakart.app.KKException

addToBasketWithOptions

int addToBasketWithOptions(java.lang.String sessionId,
                           int customerId,
                           BasketIf item,
                           AddToBasketOptionsIf options)
                           throws com.konakart.app.KKException
If 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.

Parameters:
sessionId - The session id of the logged in user
customerId - The numeric id of the customer
item - The basket item to add to the basket
options - An object containing options for the method. It may be set to null.
Returns:
Returns the id of the newly created Basket object
Throws:
com.konakart.app.KKException

mergeBaskets

void mergeBaskets(java.lang.String sessionId,
                  int customerFromId)
                  throws com.konakart.app.KKException
Add all items from the basket of customerFrom to the basket of the customer associated to the 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.

Parameters:
sessionId - The session id of the logged in user
customerFromId - The numeric id of the customer that has the temporary basket
Throws:
com.konakart.app.KKException

updateBasket

void updateBasket(java.lang.String sessionId,
                  int customerId,
                  BasketIf item)
                  throws com.konakart.app.KKException
Updates the Basket object in the database. 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.

Parameters:
sessionId - The session id of the logged in user
customerId - The numeric id of the customer
item - The basket item to update
Throws:
com.konakart.app.KKException

removeFromBasket

void removeFromBasket(java.lang.String sessionId,
                      int customerId,
                      BasketIf item)
                      throws com.konakart.app.KKException
The Basket object is deleted.

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</