|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
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 |
|---|
LanguageIf[] getAllLanguages()
throws com.konakart.app.KKException
com.konakart.app.KKException
LanguageIf getDefaultLanguage()
throws com.konakart.app.KKException
com.konakart.app.KKException
LanguageIf getLanguagePerCode(java.lang.String code)
throws com.konakart.app.KKException
code - The two letter language code such as en, de, es etc.
com.konakart.app.KKException
LanguageIf getLanguagePerId(int languageId)
throws com.konakart.app.KKException
languageId - The numeric id of the language object
com.konakart.app.KKException
CategoryIf[] getCategoryTree(int languageId,
boolean getNumProducts)
throws com.konakart.app.KKException
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.
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.
com.konakart.app.KKException
ProductsIf getProductsPerCategory(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int categoryId,
boolean searchInSubCats,
int languageId)
throws com.konakart.app.KKException
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 :
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.
com.konakart.app.KKException
ProductsIf getProductsPerCategoryPerManufacturer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int categoryId,
int manufacturerId,
int languageId)
throws com.konakart.app.KKException
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 :
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 categorylanguageId - The id for the language that will be used. Value of -1 selects the default
language.manufacturerId - The numeric id of the manufacturer
com.konakart.app.KKException
ProductsIf getProductsPerManufacturer(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int manufacturerId,
int languageId)
throws com.konakart.app.KKException
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 :
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.
com.konakart.app.KKException
ProductIf getProduct(java.lang.String sessionId,
int productId,
int languageId)
throws com.konakart.app.KKException
productId and language.
Returns null if no product is found. The specialPrice is null if a special offer doesn't
exist for the product.
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.
com.konakart.app.KKException
CategoryIf[] getCategoriesPerManufacturer(int manufacturerId,
int languageId)
throws com.konakart.app.KKException
manufacturerId - The numeric id of the manufacturerlanguageId - The id for the language that will be used. Value of -1 selects the default
language.
com.konakart.app.KKException
ManufacturerIf[] getManufacturersPerCategory(int categoryId)
throws com.konakart.app.KKException
categoryId - The numeric id of the category
com.konakart.app.KKException
ManufacturerIf[] getAllManufacturers()
throws com.konakart.app.KKException
com.konakart.app.KKException
ManufacturerIf getManufacturerPerProduct(int productId,
int languageId)
throws com.konakart.app.KKException
productId and language.
productId - The numeric id of the productlanguageId - The id for the language that will be used. Value of -1 selects the default
language.
com.konakart.app.KKException
ManufacturerIf getManufacturer(int manufacturerId,
int languageId)
throws com.konakart.app.KKException
manufacturerId and
language.
manufacturerId - The numeric id of the manufacturerlanguageId - The id for the language that will be used. Value of -1 selects the default
language.
com.konakart.app.KKException
CategoryIf getCategory(int categoryId,
int languageId)
throws com.konakart.app.KKException
categoryId and
language. It does not populate the children even if they exist.
categoryId - The numeric id of the categorylanguageId - The id for the language that will be used. Value of -1 selects the default
language.
com.konakart.app.KKException
ProductsIf getSpecialsPerCategory(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int categoryId,
int languageId)
throws com.konakart.app.KKException
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 :
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 categorylanguageId - The id for the language that will be used. Value of -1 selects the default
language.
com.konakart.app.KKException
ProductsIf getAllSpecials(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int languageId)
throws com.konakart.app.KKException
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 :
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.
com.konakart.app.KKException
ProductsIf getAllProducts(java.lang.String sessionId,
DataDescriptorIf dataDesc,
int languageId)
throws com.konakart.app.KKException
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 :
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.
com.konakart.app.KKException
ReviewsIf getReviewsPerProduct(DataDescriptorIf dataDesc,
int productId)
throws com.konakart.app.KKException
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 :
dataDesc - Used to control the data offset, limit the number of items returned and set the
sort orderproductId - The numeric id of the product
com.konakart.app.KKException
ReviewsIf getAllReviews(DataDescriptorIf dataDesc)
throws com.konakart.app.KKException
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 :
dataDesc - Used to control the data offset, limit the number of items returned and set the
sort order
com.konakart.app.KKException
ProductsIf searchForProducts(java.lang.String sessionId,
DataDescriptorIf dataDesc,
ProductSearchIf prodSearch,
int languageId)
throws com.konakart.app.KKException
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 :
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.
com.konakart.app.KKException
int registerCustomer(CustomerRegistrationIf custReg)
throws com.konakart.app.KKException
custReg - Contains all the required data in order to register a new customer
com.konakart.app.KKException
int forceRegisterCustomer(CustomerRegistrationIf custReg)
throws com.konakart.app.KKException
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.
custReg - Contains all the required data in order to register a new customer
com.konakart.app.KKException
CountryIf[] getAllCountries()
throws com.konakart.app.KKException
com.konakart.app.KKException
java.lang.String login(java.lang.String emailAddr,
java.lang.String password)
throws com.konakart.app.KKException
emailAddr - The user name required to log inpassword - The log in password
com.konakart.app.KKException
void logout(java.lang.String sessionId)
throws com.konakart.app.KKException
sessionId - The session Id of the logged in user
com.konakart.app.KKException
AddressIf[] getAddressesPerCustomer(java.lang.String sessionId)
throws com.konakart.app.KKException
sessionId - The session id of the logged in user
com.konakart.app.KKException
AddressIf getDefaultAddressPerCustomer(java.lang.String sessionId)
throws com.konakart.app.KKException
sessionId - The session id of the logged in user
com.konakart.app.KKException
void setDefaultAddressPerCustomer(java.lang.String sessionId,
int addressId)
throws com.konakart.app.KKException
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.
sessionId - The session id of the logged in useraddressId - The numeric id of the address object
com.konakart.app.KKException
int addAddressToCustomer(java.lang.String sessionId,
AddressIf addr)
throws com.konakart.app.KKException
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.
sessionId - The session id of the logged in useraddr - The address object which will be added to the customer
com.konakart.app.KKException
void deleteAddressFromCustomer(java.lang.String sessionId,
int addressId)
throws com.konakart.app.KKException
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.
sessionId - The session id of the logged in useraddressId - The numeric id of the address object
com.konakart.app.KKException
void editCustomerAddress(java.lang.String sessionId,
AddressIf addr)
throws com.konakart.app.KKException
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.
sessionId - The session id of the logged in useraddr - The address object to edit
com.konakart.app.KKException
CustomerIf getCustomer(java.lang.String sessionId)
throws com.konakart.app.KKException
sessionId.
Throws an exception if the session has expired.
sessionId - The session id of the logged in user
com.konakart.app.KKException
void editCustomer(java.lang.String sessionId,
CustomerIf cust)
throws com.konakart.app.KKException
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 :
sessionId - The session id of the logged in usercust - The customer object to edit
com.konakart.app.KKException
java.util.Calendar getKonakartTimeStamp()
throws com.konakart.app.KKException
com.konakart.app.KKException
int writeReview(java.lang.String sessionId,
ReviewIf review)
throws com.konakart.app.KKException
sessionId.
The obligatory parameters are :
sessionId - The session id of the logged in userreview - The review that will be inserted
com.konakart.app.KKException
int checkSession(java.lang.String sessionId)
throws com.konakart.app.KKException
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.
sessionId - The session id of the logged in user
com.konakart.app.KKException
int addToBasket(java.lang.String sessionId,
int customerId,
BasketIf item)
throws com.konakart.app.KKException
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.
sessionId - The session id of the logged in usercustomerId - The numeric id of the customeritem - The basket item to add to the basket
com.konakart.app.KKException
int addToBasketWithOptions(java.lang.String sessionId,
int customerId,
BasketIf item,
AddToBasketOptionsIf options)
throws com.konakart.app.KKException
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:
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.
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.
com.konakart.app.KKException
void mergeBaskets(java.lang.String sessionId,
int customerFromId)
throws com.konakart.app.KKException
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.
sessionId - The session id of the logged in usercustomerFromId - The numeric id of the customer that has the temporary basket
com.konakart.app.KKException
void updateBasket(java.lang.String sessionId,
int customerId,
BasketIf item)
throws com.konakart.app.KKException
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.
sessionId - The session id of the logged in usercustomerId - The numeric id of the customeritem - The basket item to update
com.konakart.app.KKException
void removeFromBasket(java.lang.String sessionId,
int customerId,
BasketIf item)
throws com.konakart.app.KKException
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