com.konakartadmin.blif
Interface AdminProductMgrIf

All Known Implementing Classes:
AdminProductMgr

public interface AdminProductMgrIf

AdminProductMgrIf


Method Summary
 void addRelatedProducts(AdminProduct[] products, int productId, int relationType)
          Add the array of products to the product defined by productId.
 int copyProductToStore(int productId, java.lang.String storeIdFrom, java.lang.String storeIdTo, AdminCopyProductOptions options)
          Copies a product from the store referenced by storeIdFrom to the store referenced by storeIdTo .
 void deleteCatalog(int catalogId)
          Delete a Catalog definition from the database
 void deleteDirectProductsPerCategory(int categoryId)
          If the category has any products directly associated with it, then they are deleted.
 void deleteProduct(int productId)
          Delete the product referenced to by productId.
 void deleteProductAttribute(int productAttributeId)
          Delete the productAttribute
 void deleteProductAttributesPerProduct(int productId)
          Delete the productAttributes Per product
 void deleteProductOptions(int productOptionId)
          Delete a product option record for all languages and all of its records in the options values to options table and all of its values
 void deleteProductOptionValues(int productOptionValueId)
          Delete a product option value record for all languages and all of its records in the options values to options table
 void deleteProductsPerCategory(int categoryId)
          Products are deleted for the category and sub category.
 void deleteProductsPerManufacturer(int manufacturerId)
          If the manufacturer has any products directly associated with it, then they are deleted.
 void deleteSpecial(int specialId)
          Delete the special referenced to by specialId.
 boolean doesProductExist(int productId)
          Return true if the product exists.
 void editProduct(AdminProduct product)
          Edit a product and its product description objects
 void editProductAttribute(AdminProductAttribute prodAttr)
          Edits the product attribute
 void editProductOption(AdminProductOption productOption)
          Edit a product option
 void editProductOptionValue(AdminProductOptionValue productOptionValue)
          Edit a product option value
 void editProductWithOptions(AdminProduct product, AdminProductMgrOptions mgrOptions)
          Edit a product and its product description objects.
 void editSpecial(AdminSpecial special)
          Edit a special
 AdminProductOption[] getAllProductOptions(int languageId)
          Returns a list of product options.
 AdminProductOptionValue[] getAllProductOptionValues(int languageId)
          Get an array of all the product option value objects for the specified language
 AdminProducts getAllSpecials(AdminDataDescriptor dataDesc, int languageId)
          Return all products with a special price
 AdminProduct getBundleProductDetails(int bundleId, AdminProduct[] bundledProductsArray, AdminDiscount discount)
          This method is used to calculate some attributes of a bundle product based on the products that the bundle contains.
 AdminCatalog getCatalogById(int catalogId)
          Fetch a catalog from the database referenced by the catalog id
 AdminCatalogSearchResult getCatalogs(AdminCatalogSearch search, int offset, int size)
          Get an array of catalogs matching the search criteria from the database
 int getNextProductOptionId()
          Get the next id to use when inserting a ProductOption record
 int getNextProductOptionValuesId()
          Get the next id to use when inserting a ProductOptionValue record
 AdminProduct getProduct(int productId)
          Gets a product object with full details
 AdminProduct getProduct(int productId, boolean getBundleQuantity, AdminProductMgrOptions mgrOptions, boolean allStores)
          Gets a product object with full details.
 AdminProductAttribute[] getProductAttributesPerProduct(int productId)
          Gets all of the product attributes for the product
 java.util.Calendar getProductAvailability(java.lang.String sku, int id)
          A method that directly returns the date when a product will be available.
 java.util.Calendar getProductAvailabilityWithOptions(java.lang.String sku, int id, AdminProductMgrOptions mgrOptions)
          A method that directly returns the date when a product will be available.
 AdminProductOptionSearchResult getProductOptions(AdminProductOptionSearch search, int offset, int size)
          This returns an AdminProductOptionSearchResult object.
 AdminProductOption[] getProductOptionsPerId(int productOptionId)
          Returns an array of productOptions.
 AdminProductOption[] getProductOptionsPerName(java.lang.String name, int langId)
          Returns an array of productOptions with the specified name and languageId
 AdminProductOptionValue[] getProductOptionValuesPerId(int productOptionValueId)
          Returns an array of productOptionValues.
 AdminProductOptionValue[] getProductOptionValuesPerName(java.lang.String name, int languageId)
          Get an array of product option value objects with the specified name and language
 AdminProductOptionValue[] getProductOptionValuesPerOption(int productOptionId, int languageId)
          Get an array of product option value objects for a product option object
 AdminProdOptionValToProdOption[] getProductOptionValueToProductOptions(AdminProdOptionValToProdOption prodOptValToProdOpt)
          Gets an array of AdminProdOptionValToProdOption objects that have the specified optionId and OptionValueId.
 int getProductQuantity(java.lang.String sku, int id)
          A method that allows you to directly retrieve the quantity of a product.
 int getProductQuantityWithOptions(java.lang.String sku, int id, AdminProductMgrOptions mgrOptions)
          A method that allows you to directly retrieve the quantity of a product.
 AdminProducts getProductsPerCategory(AdminDataDescriptor dataDesc, int categoryId, int languageId)
          Get products for the category referenced by categoryId.
 AdminProducts getProductsPerCategoryWithOptions(AdminDataDescriptor dataDesc, int categoryId, int languageId, AdminProductMgrOptions mgrOptions)
          Get products for the category referenced by categoryId.
 AdminProducts getProductsPerManufacturer(AdminDataDescriptor dataDesc, int manufacturerId, int languageId)
          Get products for the manufacturer referenced by manufacturerId.
 AdminProducts getProductsPerManufacturerWithOptions(AdminDataDescriptor dataDesc, int manufacturerId, int languageId, AdminProductMgrOptions mgrOptions)
          Get products for the manufacturer referenced by manufacturerId.
 AdminProductToStore[] getProductsToStores(AdminDataDescriptor dataDesc, AdminSearch search)
          Returns an array of AdminProductToStore objects for the specified store
 AdminProducts getProductsToSynchronize(java.lang.String storeIdFrom, java.lang.String storeIdTo, AdminDataDescriptor dataDesc, int languageId, AdminSynchProductsOptions options, AdminProductMgrOptions mgrOptions)
          This API call is used to get a list of products that are out of sync between two stores.
 AdminProduct getProductWithOptions(int productId, AdminProductMgrOptions mgrOptions)
          Get the product referenced by this product id, from the database.
 AdminProducts getRelatedProducts(AdminDataDescriptor dataDesc, int productId, int relationType, int languageId)
          Find products related to the product defined by the productId parameter.
 AdminProducts getRelatedProductsWithOptions(AdminDataDescriptor dataDesc, int productId, int relationType, int languageId, AdminProductMgrOptions mgrOptions)
          Find products related to the product defined by the productId parameter.
 java.lang.String getSku(AdminOrderProduct orderProd)
          Get the SKU for an orderProduct object.
 java.lang.String[] getSkus(AdminOrderProduct[] orderProds)
          Get the SKUs for an array orderProduct objects.
 AdminSpecial getSpecial(int specialId)
          Gets a special object
 AdminProducts getSpecialsPerCategory(AdminDataDescriptor dataDesc, int categoryId, boolean searchInSubCats, int languageId)
          Return all products with a special price for a category referenced by categoryId
 int importDigitalDownload(AdminDigitalDownload digDownload)
          Import a new digital download record.
 int insertCatalog(AdminCatalog catalog)
          Insert a new catalog
 void insertDigitalDownload(int customerId, int productId)
          Create and insert a digital download record for the product identified by the productId and the customer identified by the customerId.
 int insertGiftCertificateDigitalDownload(int customerId, int productId, java.lang.String filePath)
          Create and insert a digital download record for the product identified by the productId and the customer identified by the customerId.
 int insertProduct(AdminProduct product)
          Insert a product
 int insertProductAttribute(AdminProductAttribute prodAttr)
          Inserts the product attribute
 void insertProductOption(AdminProductOption productOption)
          Insert a product option
 int insertProductOptions(AdminProductOption[] productOptions)
          Inserts an array of product options which will all have the same id but different languages.
 void insertProductOptionValue(AdminProductOptionValue productOptionValue, int productOptionId)
          Insert a product option value for a product option
 int insertProductOptionValues(AdminProductOptionValue[] productOptionValues, int productOptionId)
          Inserts an array of product option values which will all have the same id but different languages.
 int insertProductsOptionsValuesToProductsOptions(AdminProdOptionValToProdOption prodOptValToProdOpt)
          Insert a product option value to product option record
 void insertProductsToStores(AdminProductToStore[] productToStores)
          Inserts an array of AdminProductToStore objects
 int insertProductWithOptions(AdminProduct product, AdminProductMgrOptions mgrOptions)
          Insert a product
 int insertSpecial(AdminSpecial special)
          Insert a special
 void removeProductsToStores(AdminProductToStore[] productToStores)
          Removes an array of AdminProductToStore objects
 void removeRelatedProducts(int productId, int relationType)
          Removes related products from the product defined by productId.
 AdminDigitalDownloadSearchResult searchDigitalDownloads(AdminDigitalDownloadSearch search, int offset, int size)
          Retrieve the Digital Download records matching the search criteria
 AdminProducts searchForProducts(AdminDataDescriptor dataDesc, AdminProductSearch prodSearch, int languageId)
          Search for products
 AdminProducts searchForProductsWithOptions(AdminDataDescriptor dataDesc, AdminProductSearch prodSearch, int languageId, AdminProductMgrOptions mgrOptions)
          Search for products
 void setDigitalDownloadCriteria(org.apache.torque.util.Criteria c)
          Sets the criteria with the standard attributes so as not to have to repeat this code many times.
 void setProductAvailability(java.lang.String sku, int id, java.util.Calendar dateAvailable)
          A method that allows you to modify the date when a product will be available, through the API without needing to fetch the complete product and edit it.
 void setProductAvailabilityWithOptions(java.lang.String sku, int id, java.util.Calendar dateAvailable, AdminProductMgrOptions mgrOptions)
          A method that allows you to modify the date when a product will be available, through the API without needing to fetch the complete product and edit it.
 void setProductQuantity(java.lang.String sku, int id, int quantity, int operation)
          A method that allows you to modify the quantity of a product through the API without needing to fetch the complete product and edit it.
 void setProductQuantityWithOptions(java.lang.String sku, int id, int quantity, int operation, AdminProductMgrOptions mgrOptions)
          A method that allows you to modify the quantity of a product through the API without needing to fetch the complete product and edit it.
 void updateCatalog(AdminCatalog catalog)
          Update an existing catalog
 

Method Detail

insertProduct

int insertProduct(AdminProduct product)
                  throws java.lang.Exception
Insert a product

Parameters:
product -
Returns:
Returns the product Id
Throws:
java.lang.Exception

insertProductWithOptions

int insertProductWithOptions(AdminProduct product,
                             AdminProductMgrOptions mgrOptions)
                             throws java.lang.Exception
Insert a product

Parameters:
product -
mgrOptions - It defines whether to insert prices and quantity for the catalog defined by the catalogId.
Returns:
Returns the product Id
Throws:
java.lang.Exception

insertSpecial

int insertSpecial(AdminSpecial special)
                  throws java.lang.Exception
Insert a special

Parameters:
special -
Returns:
Returns the special Id
Throws:
java.lang.Exception

editSpecial

void editSpecial(AdminSpecial special)
                 throws java.lang.Exception
Edit a special

Parameters:
special -
Throws:
java.lang.Exception

editProduct

void editProduct(AdminProduct product)
                 throws java.lang.Exception
Edit a product and its product description objects

Parameters:
product -
Throws:
java.lang.Exception

editProductWithOptions

void editProductWithOptions(AdminProduct product,
                            AdminProductMgrOptions mgrOptions)
                            throws java.lang.Exception
Edit a product and its product description objects. The AdminProductMgrOptions object contains options to enable the prices and quantity to be set independently for different catalogs.

Parameters:
product -
mgrOptions - Allows you to define whether the quantity and prices can have different values depending on the catalogId. May be set to null.
Throws:
java.lang.Exception

doesProductExist

boolean doesProductExist(int productId)
                         throws org.apache.torque.TorqueException,
                                KKAdminException
Return true if the product exists. Otherwise false.

Parameters:
productId -
Returns:
Returns true if the product exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getProduct

AdminProduct getProduct(int productId)
                        throws java.lang.Exception
Gets a product object with full details

Parameters:
productId -
Returns:
A product object with full details
Throws:
java.lang.Exception

getProduct

AdminProduct getProduct(int productId,
                        boolean getBundleQuantity,
                        AdminProductMgrOptions mgrOptions,
                        boolean allStores)
                        throws java.lang.Exception
Gets a product object with full details. Options defines whether to use prices and quantity per catalog.

Parameters:
productId -
getBundleQuantity - When set to true we calculate the quantity of a product if it is a bundle
mgrOptions -
allStores - When set to true we don't put in the store constraints in multi store shared product mode
Returns:
A product object with full details
Throws:
java.lang.Exception

getProductWithOptions

AdminProduct getProductWithOptions(int productId,
                                   AdminProductMgrOptions mgrOptions)
                                   throws java.lang.Exception
Get the product referenced by this product id, from the database. The MgrOptions object defines whether to use prices and quantity for the catalog defined by the catalogId.

Parameters:
productId -
mgrOptions - It defines whether to use prices and quantity for the catalog defined by the catalogId.
Returns:
A product object with full details
Throws:
java.lang.Exception

getSpecial

AdminSpecial getSpecial(int specialId)
                        throws java.lang.Exception
Gets a special object

Parameters:
specialId -
Returns:
A special
Throws:
java.lang.Exception

deleteSpecial

void deleteSpecial(int specialId)
                   throws java.lang.Exception
Delete the special referenced to by specialId.

Parameters:
specialId -
Throws:
java.lang.Exception

deleteProduct

void deleteProduct(int productId)
                   throws java.lang.Exception
Delete the product referenced to by productId.

Parameters:
productId -
Throws:
java.lang.Exception

getProductsPerCategory

AdminProducts getProductsPerCategory(AdminDataDescriptor dataDesc,
                                     int categoryId,
                                     int languageId)
                                     throws java.lang.Exception
Get products for the category referenced by categoryId.

Parameters:
dataDesc -
categoryId -
languageId -
Returns:
Products object
Throws:
java.lang.Exception

getProductsPerCategoryWithOptions

AdminProducts getProductsPerCategoryWithOptions(AdminDataDescriptor dataDesc,
                                                int categoryId,
                                                int languageId,
                                                AdminProductMgrOptions mgrOptions)
                                                throws java.lang.Exception
Get products for the category referenced by categoryId.

Parameters:
dataDesc -
categoryId -
languageId -
mgrOptions - Allows you to define whether the quantity and prices can have different values depending on the catalogId. May be set to null.
Returns:
Products object
Throws:
java.lang.Exception

getProductsPerManufacturer

AdminProducts getProductsPerManufacturer(AdminDataDescriptor dataDesc,
                                         int manufacturerId,
                                         int languageId)
                                         throws java.lang.Exception
Get products for the manufacturer referenced by manufacturerId.

Parameters:
dataDesc -
manufacturerId -
languageId -
Returns:
Products object
Throws:
java.lang.Exception

getProductsPerManufacturerWithOptions

AdminProducts getProductsPerManufacturerWithOptions(AdminDataDescriptor dataDesc,
                                                    int manufacturerId,
                                                    int languageId,
                                                    AdminProductMgrOptions mgrOptions)
                                                    throws java.lang.Exception
Get products for the manufacturer referenced by manufacturerId.

Parameters:
dataDesc -
manufacturerId -
languageId -
mgrOptions - Allows you to define whether the quantity and prices can have different values depending on the catalogId. May be set to null.
Returns:
Products object
Throws:
java.lang.Exception

searchForProducts

AdminProducts searchForProducts(AdminDataDescriptor dataDesc,
                                AdminProductSearch prodSearch,
                                int languageId)
                                throws java.lang.Exception
Search for products

Parameters:
dataDesc -
prodSearch -
languageId -
Returns:
Return a Products object
Throws:
java.lang.Exception

searchForProductsWithOptions

AdminProducts searchForProductsWithOptions(AdminDataDescriptor dataDesc,
                                           AdminProductSearch prodSearch,
                                           int languageId,
                                           AdminProductMgrOptions mgrOptions)
                                           throws java.lang.Exception
Search for products

Parameters:
dataDesc -
prodSearch -
languageId -
mgrOptions - It defines whether to use prices and quantity for the catalog defined by the catalogId.
Returns:
Return a Products object
Throws:
java.lang.Exception

deleteProductsPerCategory

void deleteProductsPerCategory(int categoryId)
                               throws java.lang.Exception
Products are deleted for the category and sub category. If the product belongs to multiple categories and one of these categories is outside of the category tree, it isn't deleted but the category is removed from its category array.

Parameters:
categoryId -
Throws:
java.lang.Exception

deleteDirectProductsPerCategory

void deleteDirectProductsPerCategory(int categoryId)
                                     throws java.lang.Exception
If the category has any products directly associated with it, then they are deleted. If the product belongs to multiple categories, it isn't deleted but the category is removed from its category array.

Parameters:
categoryId -
Throws:
java.lang.Exception

deleteProductsPerManufacturer

void deleteProductsPerManufacturer(int manufacturerId)
                                   throws java.lang.Exception
If the manufacturer has any products directly associated with it, then they are deleted.

Parameters:
manufacturerId -
Throws:
java.lang.Exception

getAllSpecials

AdminProducts getAllSpecials(AdminDataDescriptor dataDesc,
                             int languageId)
                             throws java.lang.Exception
Return all products with a special price

Parameters:
dataDesc -
languageId -
Returns:
Array of products
Throws:
java.lang.Exception

getSpecialsPerCategory

AdminProducts getSpecialsPerCategory(AdminDataDescriptor dataDesc,
                                     int categoryId,
                                     boolean searchInSubCats,
                                     int languageId)
                                     throws java.lang.Exception
Return all products with a special price for a category referenced by categoryId

Parameters:
dataDesc -
categoryId -
searchInSubCats -
languageId -
Returns:
Return an array of products
Throws:
java.lang.Exception

getAllProductOptions

AdminProductOption[] getAllProductOptions(int languageId)
                                          throws java.lang.Exception
Returns a list of product options.

Parameters:
languageId - specifies that the product options should be returned for this language. Can specify AdminLanguageMgr.DEFAULT_LANG to specify the default language, or specify AdminLanguageMgr.ALL_LANGUAGES to specify all languages
Returns:
An array of all product options, each containing an array of product values
Throws:
java.lang.Exception

getAllProductOptionValues

AdminProductOptionValue[] getAllProductOptionValues(int languageId)
                                                    throws java.lang.Exception
Get an array of all the product option value objects for the specified language

Parameters:
languageId - specifies that the product option values should be returned for this language. Can specify AdminLanguageMgr.DEFAULT_LANG to specify the default language, or specify AdminLanguageMgr.ALL_LANGUAGES to specify all languages
Returns:
Return an array of productOptionValue objects
Throws:
java.lang.Exception

getProductOptions

AdminProductOptionSearchResult getProductOptions(AdminProductOptionSearch search,
                                                 int offset,
                                                 int size)
                                                 throws java.lang.Exception
This returns an AdminProductOptionSearchResult object. Each ProductOption object may have an array of ProductOptionValues which are populated by this API call if the populateValues attribute of the search object is set.

Parameters:
search - The search parameters. The languageId determines in which language the product options are returned. It can be set to AdminLanguageMgr.DEFAULT_LANG to specify the default language, or to AdminLanguageMgr.ALL_LANGUAGES to specify all languages.
offset - the offset in the db
size - the number of records from the specified offset
Returns:
Returns an AdminProductOptionSearchResult object
Throws:
java.lang.Exception

getProductOptionValuesPerOption

AdminProductOptionValue[] getProductOptionValuesPerOption(int productOptionId,
                                                          int languageId)
                                                          throws java.lang.Exception
Get an array of product option value objects for a product option object

Parameters:
productOptionId -
languageId - specifies that the product option values should be returned for this language. Can specify AdminLanguageMgr.DEFAULT_LANG to specify the default language, or specify AdminLanguageMgr.ALL_LANGUAGES to specify all languages
Returns:
Return an array of productOptionValue objects
Throws:
java.lang.Exception

getProductOptionValuesPerName

AdminProductOptionValue[] getProductOptionValuesPerName(java.lang.String name,
                                                        int languageId)
                                                        throws java.lang.Exception
Get an array of product option value objects with the specified name and language

Parameters:
name - product option value name
languageId - language id (can use AdminLanguageMgr.DEFAULT_LANG to get the default language)
Returns:
Return an array of productOptionValue objects
Throws:
java.lang.Exception

getProductAttributesPerProduct

AdminProductAttribute[] getProductAttributesPerProduct(int productId)
                                                       throws java.lang.Exception
Gets all of the product attributes for the product

Parameters:
productId -
Returns:
Returns an array of AdminProductAttributes
Throws:
java.lang.Exception

deleteProductAttribute

void deleteProductAttribute(int productAttributeId)
                            throws java.lang.Exception
Delete the productAttribute

Parameters:
productAttributeId -
Throws:
java.lang.Exception

deleteProductAttributesPerProduct

void deleteProductAttributesPerProduct(int productId)
                                       throws java.lang.Exception
Delete the productAttributes Per product

Parameters:
productId -
Throws:
java.lang.Exception

editProductAttribute

void editProductAttribute(AdminProductAttribute prodAttr)
                          throws java.lang.Exception
Edits the product attribute

Parameters:
prodAttr -
Throws:
java.lang.Exception

insertProductAttribute

int insertProductAttribute(AdminProductAttribute prodAttr)
                           throws java.lang.Exception
Inserts the product attribute

Parameters:
prodAttr -
Returns:
Returns the primary key of the new product attribute
Throws:
java.lang.Exception

deleteProductOptions

void deleteProductOptions(int productOptionId)
                          throws java.lang.Exception
Delete a product option record for all languages and all of its records in the options values to options table and all of its values

Parameters:
productOptionId -
Throws:
java.lang.Exception

deleteProductOptionValues

void deleteProductOptionValues(int productOptionValueId)
                               throws java.lang.Exception
Delete a product option value record for all languages and all of its records in the options values to options table

Parameters:
productOptionValueId -
Throws:
java.lang.Exception

getProductOptionsPerId

AdminProductOption[] getProductOptionsPerId(int productOptionId)
                                            throws com.workingdogs.village.DataSetException,
                                                   org.apache.torque.TorqueException,
                                                   KKAdminException
Returns an array of productOptions. One for each language.

Parameters:
productOptionId -
Returns:
An array of all product options, for each language
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

getProductOptionsPerName

AdminProductOption[] getProductOptionsPerName(java.lang.String name,
                                              int langId)
                                              throws com.workingdogs.village.DataSetException,
                                                     org.apache.torque.TorqueException,
                                                     KKAdminException
Returns an array of productOptions with the specified name and languageId

Parameters:
name - Product Option Name
langId - Language Id
Returns:
An array of all product options for the specified language with the specified name
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

getProductOptionValueToProductOptions

AdminProdOptionValToProdOption[] getProductOptionValueToProductOptions(AdminProdOptionValToProdOption prodOptValToProdOpt)
                                                                       throws java.lang.Exception
Gets an array of AdminProdOptionValToProdOption objects that have the specified optionId and OptionValueId.

Parameters:
prodOptValToProdOpt - the AdminProdOptionValToProdOption to look up. Only uses the optionId and OptionValueId in this object
Returns:
Returns an array of AdminProdOptionValToProdOption objects
Throws:
java.lang.Exception

getProductOptionValuesPerId

AdminProductOptionValue[] getProductOptionValuesPerId(int productOptionValueId)
                                                      throws org.apache.torque.TorqueException,
                                                             com.workingdogs.village.DataSetException,
                                                             KKAdminException
Returns an array of productOptionValues. One for each language.

Parameters:
productOptionValueId -
Returns:
Return an array of productOptionValues objects
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

insertProductOptions

int insertProductOptions(AdminProductOption[] productOptions)
                         throws java.lang.Exception
Inserts an array of product options which will all have the same id but different languages. It is assumed that the input array all have different languages. The next available id is found and used to insert all of the records.

Parameters:
productOptions -
Returns:
id of inserted options
Throws:
java.lang.Exception

insertProductOption

void insertProductOption(AdminProductOption productOption)
                         throws java.lang.Exception
Insert a product option

Parameters:
productOption -
Throws:
java.lang.Exception

editProductOption

void editProductOption(AdminProductOption productOption)
                       throws java.lang.Exception
Edit a product option

Parameters:
productOption -
Throws:
java.lang.Exception

insertProductOptionValues

int insertProductOptionValues(AdminProductOptionValue[] productOptionValues,
                              int productOptionId)
                              throws java.lang.Exception
Inserts an array of product option values which will all have the same id but different languages. It is assumed that the input array all have different languages. The next available id is found and used to insert all of the records.

Parameters:
productOptionValues -
productOptionId -
Returns:
Id of inserted option values
Throws:
java.lang.Exception

insertProductOptionValue

void insertProductOptionValue(AdminProductOptionValue productOptionValue,
                              int productOptionId)
                              throws java.lang.Exception
Insert a product option value for a product option

Parameters:
productOptionValue -
productOptionId - The product option id for inserting a record into the Products_Options_Values_To_Products_Options table. If this is set to -1, no such join record is inserted.
Throws:
java.lang.Exception

insertProductsOptionsValuesToProductsOptions

int insertProductsOptionsValuesToProductsOptions(AdminProdOptionValToProdOption prodOptValToProdOpt)
                                                 throws java.lang.Exception
Insert a product option value to product option record

Parameters:
prodOptValToProdOpt - a AdminProdOptionValToProdOption object to insert. The optionId and optionValueId defined in the object must be valid otherwise an exception is thrown.
Returns:
the key created for the inserted record
Throws:
java.lang.Exception

editProductOptionValue

void editProductOptionValue(AdminProductOptionValue productOptionValue)
                            throws java.lang.Exception
Edit a product option value

Parameters:
productOptionValue -
Throws:
java.lang.Exception

getNextProductOptionId

int getNextProductOptionId()
                           throws org.apache.torque.TorqueException,
                                  com.workingdogs.village.DataSetException,
                                  KKAdminException
Get the next id to use when inserting a ProductOption record

Returns:
The next id
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getNextProductOptionValuesId

int getNextProductOptionValuesId()
                                 throws org.apache.torque.TorqueException,
                                        com.workingdogs.village.DataSetException,
                                        KKAdminException
Get the next id to use when inserting a ProductOptionValue record

Returns:
The next id
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getRelatedProducts

AdminProducts getRelatedProducts(AdminDataDescriptor dataDesc,
                                 int productId,
                                 int relationType,
                                 int languageId)
                                 throws java.lang.Exception
Find products related to the product defined by the productId parameter. The relationType defines the relation. Valid values for relationType are:

Parameters:
dataDesc -
productId -
relationType -
languageId -
Returns:
AdminProducts
Throws:
java.lang.Exception

getRelatedProductsWithOptions

AdminProducts getRelatedProductsWithOptions(AdminDataDescriptor dataDesc,
                                            int productId,
                                            int relationType,
                                            int languageId,
                                            AdminProductMgrOptions mgrOptions)
                                            throws java.lang.Exception
Find products related to the product defined by the productId parameter. The relationType defines the relation. Valid values for relationType are:

Parameters:
dataDesc -
productId -
relationType -
languageId -
mgrOptions - It defines whether to use prices and quantity for the catalog defined by the catalogId.
Returns:
AdminProducts
Throws:
java.lang.Exception

removeRelatedProducts

void removeRelatedProducts(int productId,
                           int relationType)
                           throws java.lang.Exception
Removes related products from the product defined by productId. If relationType == 0, then all related products are removed.

Parameters:
productId -
relationType -
Throws:
java.lang.Exception

addRelatedProducts

void addRelatedProducts(AdminProduct[] products,
                        int productId,
                        int relationType)
                        throws org.apache.torque.TorqueException,
                               KKAdminException
Add the array of products to the product defined by productId. The relation type is specified by relationType.

Parameters:
products -
productId -
relationType -
Throws:
org.apache.torque.TorqueException
KKAdminException

getSkus

java.lang.String[] getSkus(AdminOrderProduct[] orderProds)
                           throws KKAdminException,
                                  org.apache.torque.TorqueException,
                                  com.workingdogs.village.DataSetException
Get the SKUs for an array orderProduct objects. If a product has no options we look directly for the SKU in the product table. Otherwise we look in the productQuantities table. If we can't find it there, then we look in the product table.

Parameters:
orderProds -
Returns:
Returns an array of SKUs for the OrderProduct array
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

getSku

java.lang.String getSku(AdminOrderProduct orderProd)
                        throws KKAdminException,
                               org.apache.torque.TorqueException,
                               com.workingdogs.village.DataSetException
Get the SKU for an orderProduct object. If it has no options we look directly for the SKU in the product table. Otherwise we look in the productQuantities table. If we can't find it there, then we look in the product table.

Parameters:
orderProd -
Returns:
Returns the SKU for the OrderProduct
Throws:
KKAdminException
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException

insertDigitalDownload

void insertDigitalDownload(int customerId,
                           int productId)
                           throws java.lang.Exception
Create and insert a digital download record for the product identified by the productId and the customer identified by the customerId. If the digital download already exists, then we overwrite it with the new one.

Parameters:
customerId -
productId -
Throws:
java.lang.Exception

setDigitalDownloadCriteria

void setDigitalDownloadCriteria(org.apache.torque.util.Criteria c)
Sets the criteria with the standard attributes so as not to have to repeat this code many times.

Parameters:
c -

searchDigitalDownloads

AdminDigitalDownloadSearchResult searchDigitalDownloads(AdminDigitalDownloadSearch search,
                                                        int offset,
                                                        int size)
                                                        throws java.lang.Exception
Retrieve the Digital Download records matching the search criteria

Parameters:
search - search definition for digital downloads
offset - offset in results (for paging)
size - maximum number of records to return from the offset (for paging)
Returns:
an AdminDigitalDownloadSearchResult object
Throws:
java.lang.Exception

importDigitalDownload

int importDigitalDownload(AdminDigitalDownload digDownload)
                          throws java.lang.Exception
Import a new digital download record. If the record already exists (a record exists with the same customerId and productId) the record is updated. Before inserting, the record is validated to ensure that the product referred to by the productId is indeed a Digital Download or Gift Certificate product.

Parameters:
digDownload - the Digital Download object to import
Returns:
returns the id of the newly inserted or updated record
Throws:
java.lang.Exception - if the digital download record specified is invalid or there are database problems

getBundleProductDetails

AdminProduct getBundleProductDetails(int bundleId,
                                     AdminProduct[] bundledProductsArray,
                                     AdminDiscount discount)
                                     throws org.apache.torque.TorqueException,
                                            com.workingdogs.village.DataSetException,
                                            java.lang.Exception
This method is used to calculate some attributes of a bundle product based on the products that the bundle contains.

Parameters:
bundleId - If set to a positive value we search for all of the products in the bundle, starting from this id of the bundle product.
bundledProductsArray - If bundleId is less than zero, we use the products in this array otherwise it is ignored.
discount - The discount to apply which can be an amount or a percentage
Returns:
Returns an AdminProduct object which has calculated values for prices, weight and quantity.
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception

setProductQuantity

void setProductQuantity(java.lang.String sku,
                        int id,
                        int quantity,
                        int operation)
                        throws java.lang.Exception
A method that allows you to modify the quantity of a product through the API without needing to fetch the complete product and edit it. The product may be identified by the product id or the SKU. When set to a valid value, the SKU is used and the product id is ignored. When the SKU is set to null, the product id is used to identify the product. Note that the SKU should always be used in cases where a single product has many variations such as color and size. The quantity parameter may be used to set the new quantity, to reduce the quantity by its value or to increase the quantity by its value. In other words it can replace the current quantity, be subtracted or added to the current quantity. The operation parameter determines which operation is performed. Valid values are:

Parameters:
sku - The SKU of the product. If set to null, the product id is used.
id - The product id. Only used if the SKU is set to null.
quantity - The new quantity
operation - Determines whether to set, add or subtract the quantity. See above for valid values.
Throws:
java.lang.Exception

setProductQuantityWithOptions

void setProductQuantityWithOptions(java.lang.String sku,
                                   int id,
                                   int quantity,
                                   int operation,
                                   AdminProductMgrOptions mgrOptions)
                                   throws java.lang.Exception
A method that allows you to modify the quantity of a product through the API without needing to fetch the complete product and edit it. The product may be identified by the product id or the SKU. When set to a valid value, the SKU is used and the product id is ignored. When the SKU is set to null, the product id is used to identify the product. Note that the SKU should always be used in cases where a single product has many variations such as color and size. The quantity parameter may be used to set the new quantity, to reduce the quantity by its value or to increase the quantity by its value. In other words it can replace the current quantity, be subtracted or added to the current quantity. The operation parameter determines which operation is performed. Valid values are: The mgrOptions object allows you to define whether the quantity can have different values depending on the catalogId. It may be set to null.

Parameters:
sku - The SKU of the product. If set to null, the product id is used.
id - The product id. Only used if the SKU is set to null.
quantity - The new quantity
operation - Determines whether to set, add or subtract the quantity. See above for valid values.
mgrOptions - Allows you to define whether the quantity can have different values depending on the catalogId. May be set to null.
Throws:
java.lang.Exception

getProductQuantity

int getProductQuantity(java.lang.String sku,
                       int id)
                       throws java.lang.Exception
A method that allows you to directly retrieve the quantity of a product. In the case of a simple product, an alternative way could be to find the product and read the quantity attribute. However, when the product has variations such as color and size, identified by different SKUs, the procedure for retrieving the quantity is more complicated and so this API call comes to the rescue. The product may be identified by the product id or the SKU. When set to a valid value, the SKU is used and the product id is ignored. When the SKU is set to null, the product id is used to identify the product. Note that the SKU should always be used in cases where a single product has many variations such as color and size.

Parameters:
sku - The SKU of the product. If set to null, the product id is used.
id - The product id. Only used if the SKU is set to null.
Returns:
Returns the product quantity
Throws:
java.lang.Exception

getProductQuantityWithOptions

int getProductQuantityWithOptions(java.lang.String sku,
                                  int id,
                                  AdminProductMgrOptions mgrOptions)
                                  throws java.lang.Exception
A method that allows you to directly retrieve the quantity of a product. In the case of a simple product, an alternative way could be to find the product and read the quantity attribute. However, when the product has variations such as color and size, identified by different SKUs, the procedure for retrieving the quantity is more complicated and so this API call comes to the rescue. The product may be identified by the product id or the SKU. When set to a valid value, the SKU is used and the product id is ignored. When the SKU is set to null, the product id is used to identify the product. Note that the SKU should always be used in cases where a single product has many variations such as color and size. The mgrOptions object allows you to define whether the quantity can have different values depending on the catalogId. It may be set to null.

Parameters:
sku - The SKU of the product. If set to null, the product id is used.
id - The product id. Only used if the SKU is set to null.
mgrOptions - Allows you to define whether the quantity can have different values depending on the catalogId. May be set to null.
Returns:
Returns the product quantity
Throws:
java.lang.Exception

setProductAvailability

void setProductAvailability(java.lang.String sku,
                            int id,
                            java.util.Calendar dateAvailable)
                            throws java.lang.Exception
A method that allows you to modify the date when a product will be available, through the API without needing to fetch the complete product and edit it. The product may be identified by the product id or the SKU. When set to a valid value, the SKU is used and the product id is ignored. When the SKU is set to null, the product id is used to identify the product. Note that the SKU should always be used in cases where a single product has many variations such as color and size.

Parameters:
sku - The SKU of the product. If set to null, the product id is used.
id - The product id. Only used if the SKU is set to null.
dateAvailable - The date when the product will be available
Throws:
java.lang.Exception

setProductAvailabilityWithOptions

void setProductAvailabilityWithOptions(java.lang.String sku,
                                       int id,
                                       java.util.Calendar dateAvailable,
                                       AdminProductMgrOptions mgrOptions)
                                       throws java.lang.Exception
A method that allows you to modify the date when a product will be available, through the API without needing to fetch the complete product and edit it. The product may be identified by the product id or the SKU. When set to a valid value, the SKU is used and the product id is ignored. When the SKU is set to null, the product id is used to identify the product. Note that the SKU should always be used in cases where a single product has many variations such as color and size. The mgrOptions object allows you to define whether the availability date can have different values depending on the catalogId. It may be set to null.

Parameters:
sku - The SKU of the product. If set to null, the product id is used.
id - The product id. Only used if the SKU is set to null.
dateAvailable - The date when the product will be available
mgrOptions - Allows you to define whether the availability date can have different values depending on the catalogId. May be set to null.
Throws:
java.lang.Exception

getProductAvailability

java.util.Calendar getProductAvailability(java.lang.String sku,
                                          int id)
                                          throws java.lang.Exception
A method that directly returns the date when a product will be available. In the case of a simple product, an alternative way could be to find the product and read the dateAvailable attribute. However, when the product has variations such as color and size, identified by different SKUs, the procedure for retrieving the date available is more complicated and so this API call comes to the rescue. The product may be identified by the product id or the SKU. When set to a valid value, the SKU is used and the product id is ignored. When the SKU is set to null, the product id is used to identify the product. Note that the SKU should always be used in cases where a single product has many variations such as color and size.

Parameters:
sku - The SKU of the product. If set to null, the product id is used.
id - The product id. Only used if the SKU is set to null.
Returns:
Returns the the date when a product will be available
Throws:
java.lang.Exception

getProductAvailabilityWithOptions

java.util.Calendar getProductAvailabilityWithOptions(java.lang.String sku,
                                                     int id,
                                                     AdminProductMgrOptions mgrOptions)
                                                     throws java.lang.Exception
A method that directly returns the date when a product will be available. In the case of a simple product, an alternative way could be to find the product and read the dateAvailable attribute. However, when the product has variations such as color and size, identified by different SKUs, the procedure for retrieving the date available is more complicated and so this API call comes to the rescue. The product may be identified by the product id or the SKU. When set to a valid value, the SKU is used and the product id is ignored. When the SKU is set to null, the product id is used to identify the product. Note that the SKU should always be used in cases where a single product has many variations such as color and size. The mgrOptions object allows you to define whether the availability date can have different values depending on the catalogId. It may be set to null.

Parameters:
sku - The SKU of the product. If set to null, the product id is used.
id - The product id. Only used if the SKU is set to null.
mgrOptions - Allows you to define whether the availability date can have different values depending on the catalogId. May be set to null.
Returns:
Returns the the date when a product will be available
Throws:
java.lang.Exception

getProductsToStores

AdminProductToStore[] getProductsToStores(AdminDataDescriptor dataDesc,
                                          AdminSearch search)
                                          throws java.lang.Exception
Returns an array of AdminProductToStore objects for the specified store

Parameters:
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order. You can specify any two of the following to define the sort order: AdminDataDescriptor.ORDER_BY_STOREID_ASCENDING, AdminDataDescriptor.ORDER_BY_STOREID_DESCENDING, AdminDataDescriptor.ORDER_BY_ID_ASCENDING, AdminDataDescriptor.ORDER_BY_ID_DESCENDING
search - Defines the records to be returned. Populate the id with the productId (or set to KonaKartAdminConstant.NOT_SET to get all products) and the name with the storeId (or leave null for all stores).
Returns:
an array of AdminProductToStore objects for the specified store (or all records if the storeId is null). If no AdminProductToStore records exist for the specified store an empty array is returned.
Throws:
java.lang.Exception

insertProductsToStores

void insertProductsToStores(AdminProductToStore[] productToStores)
                            throws java.lang.Exception
Inserts an array of AdminProductToStore objects

Parameters:
productToStores - an array of AdminProductToStore objects to insert into the database
Throws:
java.lang.Exception

removeProductsToStores

void removeProductsToStores(AdminProductToStore[] productToStores)
                            throws java.lang.Exception
Removes an array of AdminProductToStore objects

Parameters:
productToStores - an array of AdminProductToStore objects to delete from the database
Throws:
java.lang.Exception

insertGiftCertificateDigitalDownload

int insertGiftCertificateDigitalDownload(int customerId,
                                         int productId,
                                         java.lang.String filePath)
                                         throws java.lang.Exception
Create and insert a digital download record for the product identified by the productId and the customer identified by the customerId. The file path of the digital download will be used instead of the file path in the product object, to download the certificate.

Parameters:
customerId -
productId -
filePath -
Returns:
Returns the key of the inserted Digital Download
Throws:
java.lang.Exception

deleteCatalog

void deleteCatalog(int catalogId)
                   throws org.apache.torque.TorqueException,
                          KKAdminException
Delete a Catalog definition from the database

Parameters:
catalogId -
Throws:
org.apache.torque.TorqueException
KKAdminException

getCatalogs

AdminCatalogSearchResult getCatalogs(AdminCatalogSearch search,
                                     int offset,
                                     int size)
                                     throws org.apache.torque.TorqueException,
                                            com.workingdogs.village.DataSetException,
                                            KKAdminException
Get an array of catalogs matching the search criteria from the database

Parameters:
search -
offset -
size -
Returns:
Returns an AdminCatalogSearchResult object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

insertCatalog

int insertCatalog(AdminCatalog catalog)
                  throws KKAdminException,
                         org.apache.torque.TorqueException
Insert a new catalog

Parameters:
catalog -
Returns:
Returns the numeric id of the inserted catalog
Throws:
KKAdminException
org.apache.torque.TorqueException

updateCatalog

void updateCatalog(AdminCatalog catalog)
                   throws java.lang.Exception
Update an existing catalog

Parameters:
catalog -
Throws:
java.lang.Exception

getCatalogById

AdminCatalog getCatalogById(int catalogId)
                            throws java.lang.Exception
Fetch a catalog from the database referenced by the catalog id

Parameters:
catalogId -
Returns:
Returns an AdminCatalog object
Throws:
java.lang.Exception

copyProductToStore

int copyProductToStore(int productId,
                       java.lang.String storeIdFrom,
                       java.lang.String storeIdTo,
                       AdminCopyProductOptions options)
                       throws java.lang.Exception
Copies a product from the store referenced by storeIdFrom to the store referenced by storeIdTo . This API call can only be used when in multi-store shared product and shared category mode.
The options parameter defines the type of copy. Valid operations are:

Parameters:
productId - The numeric id of the product to copy
storeIdFrom - The id of the source store
storeIdTo - The id of the destination store
options - Options to configure the copy operation
Returns:
Returns the copied product id in mode MODE_COPY_CREATING_NEW_PRODUCT. Otherwise returns 0
Throws:
java.lang.Exception

getProductsToSynchronize

AdminProducts getProductsToSynchronize(java.lang.String storeIdFrom,
                                       java.lang.String storeIdTo,
                                       AdminDataDescriptor dataDesc,
                                       int languageId,
                                       AdminSynchProductsOptions options,
                                       AdminProductMgrOptions mgrOptions)
                                       throws java.lang.Exception
This API call is used to get a list of products that are out of sync between two stores. It can only be used when in multi-store shared product / shared category mode and is useful when stores are used as staging environments to display pre-production product information.
The options parameter defines the the type of search which may be: It also allows you to define two search constraints to filter the returned products: The dataDesc parameter is used to control the data offset, limit the number of items returned and set the sort order. The only sort orders used are:

Parameters:
storeIdFrom - The id of the source store
storeIdTo - The id of the destination store
dataDesc - Used to control the data offset, limit the number of items returned and set the sort order. May be null.
languageId - the language Id - or it could be com.konakartadmin.bl.AdminLanguageMgr.DEFAULT_LANG to use the default language
options - Defines the type of search and constraints.
mgrOptions - It defines whether to use prices and quantity for the catalog defined by the catalogId. May be null.
Returns:
Returns an AdminProducts object containing the products
Throws:
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.