com.konakartadmin.bl
Class AdminProductMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminProductMgr
All Implemented Interfaces:
AdminProductMgrIf

public class AdminProductMgr
extends AdminBaseMgr
implements AdminProductMgrIf

The AdminProductMgr - for Managing Product Objects for the Admin Application


Nested Class Summary
protected  class AdminProductMgr.AttributeSortOrderComparator
          Used to sort the AdminProductAttribute objects based on option id and then option value id
protected  class AdminProductMgr.OptionSortOrderComparator
          Used to sort the Option objects based on option id
 
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr
AdminBaseMgr.StaticData
 
Field Summary
static int ACCESSORY
          Accessories
static int BOOKABLE_PRODUCT_TYPE
          Bookable product
static int BUNDLED_PRODUCTS
          Bundled products
static int CROSS_SELL
          Cross Sell related products
static java.lang.Boolean customAttrAnOracleCLOB
          is Oracle CLOB used for custom_attrs column?
static int DEPENDENT_ITEM
          Dependent items, such as warranties
static int DIGITAL_DOWNLOAD
          Digital download product
static int DONT_INCLUDE
          Used to not include values in the query
static int GIFT_CERTIFICATE_PRODUCT_TYPE
          Gift Certificate product
protected static org.apache.commons.logging.Log log
          the log
static int UP_SELL
          Up Sell related products
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminProductMgr(KKAdminIf eng)
          Constructor
 
Method Summary
protected  void addDigitalDownloadOrderBy(com.konakart.bl.KKCriteria c, AdminDigitalDownloadSearch search)
           
protected  int addDigitalDownloadSearchCriteria(com.konakart.bl.KKCriteria c, AdminDigitalDownloadSearch search)
           
protected  void addProductOptionOrderBy(com.konakart.bl.KKCriteria c, AdminProductOptionSearch search)
          Add order by constraints for ProductOptions
protected  int addProductOptionSearchCriteria(com.konakart.bl.KKCriteria c, AdminProductOptionSearch search, int langId)
          Add search criteria for ProductOptions
 void addRelatedProducts(AdminProduct[] products, int productId, int relationType)
          Add the array of products to the product defined by productId.
protected  void copyProductPrices(AdminProduct prodFrom, AdminProduct prodTo)
          This copies the prices between two identical products.
 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 .
protected  java.lang.String createEncodedProductIdFromProductQuantityEncodedKey(int productId, java.lang.String productQuantityEncodedKey)
          Takes in a productQuantityEncodedKey and a productId and returns an encoded product Id.
protected  java.lang.String createProductQuantityEncodedKeyFromOptions(AdminOption[] opts)
          Takes in an an array of options and returns an encoded key for the products_quantity table
 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.
protected  void deleteExtPrice(int productId, int prodAttrId, int tierPriceId, java.lang.String catalogId, com.konakart.bl.KKCriteria deleteC, java.sql.Connection con)
          Used to delete a price in the external price table.
protected  void deleteExtQuantity(int productId, java.lang.String encodedOptionValues, java.lang.String catalogId, com.konakart.bl.KKCriteria deleteC, java.sql.Connection con)
          Used to delete and external quantity record
 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.
protected  boolean doesExtPriceExist(int productId, int prodAttrId, int tierPriceId, java.lang.String catalogId, com.konakart.bl.KKCriteria selectC)
          Returns true if the external price record exists
protected  boolean doesExtQuantityExist(int productId, java.lang.String encodedOptionValues, java.lang.String catalogId, com.konakart.bl.KKCriteria selectC)
          Returns true if the external quantity record exists
 boolean doesProductExist(int productId)
          Return true if the product exists.
protected  boolean doesSpecialExist(int productId)
          Determines whether a special exists for this product
protected  void editExtPrice(AdminProduct product, java.lang.String catalogId, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria updateC, java.sql.Connection con)
          Used to edit a price in the external price table.
protected  void editExtProdAttrPrice(AdminProductAttribute prodAttr, java.lang.String catalogId, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria updateC, java.sql.Connection con)
          Used to edit a product attribute price in the external price table.
protected  void editExtQuantity(AdminProductQuantity prodQ, java.lang.String catalogId, boolean setQuantity, boolean setDate, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria updateC, java.sql.Connection con)
          Used to edit a quantity in the external quantity table.
protected  void editExtTierPrice(AdminTierPrice tierPrice, java.lang.String catalogId, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria updateC, java.sql.Connection con)
          Used to edit a product tier price in the external price table.
 void editProduct(AdminProduct product)
          Edit a product and its product description objects
 void editProductAttribute(AdminProductAttribute prodAttr)
          Edits the product attribute
protected  void editProductAttributes(AdminProduct product, java.sql.Connection con, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria deleteC, com.konakart.bl.KKCriteria updateC, com.konakart.bl.KKCriteria insertC, AdminProductMgrOptions mgrOptions)
          protected method to edit the product attribute records
protected  void editProductDescriptions(AdminProduct product, java.sql.Connection con, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria deleteC, com.konakart.bl.KKCriteria updateC, com.konakart.bl.KKCriteria insertC)
          protected method to edit the product descriptions
 void editProductOption(AdminProductOption productOption)
          Edit a product option
 void editProductOptionValue(AdminProductOptionValue productOptionValue)
          Edit a product option value
protected  void editProductQuantities(AdminProduct product, java.sql.Connection con, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria deleteC, com.konakart.bl.KKCriteria updateC, com.konakart.bl.KKCriteria insertC, AdminProductMgrOptions mgrOptions)
          protected method to edit the product quantity records
protected  void editProductToCategory(AdminProduct product, java.sql.Connection con, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria deleteC, com.konakart.bl.KKCriteria insertC)
          Edit the product to category records
 void editProductWithOptions(AdminProduct product, AdminProductMgrOptions mgrOptions)
          Edit a product and its product description objects.
protected  void editProductWithOptions(AdminProduct product, AdminProductMgrOptions mgrOptions, boolean setMasterDate, boolean allStores, boolean manageSolr, java.sql.Connection con)
          Edit a product and its product description objects.
 void editSpecial(AdminSpecial special)
          Edit a special
protected  void editSpecial(AdminSpecial special, java.sql.Connection con)
          Edit a special using a transaction already open
protected  void editTierPrices(AdminProduct product, java.sql.Connection con, com.konakart.bl.KKCriteria selectC, com.konakart.bl.KKCriteria deleteC, com.konakart.bl.KKCriteria updateC, com.konakart.bl.KKCriteria insertC, AdminProductMgrOptions mgrOptions)
          protected method to edit the tier price records
protected  void formatProductPrices(AdminProduct product)
          Format the prices of the product object
 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
protected  int getCatalogCount(com.konakart.bl.KKCriteria c)
          Get the number of catalogs
 AdminCatalogSearchResult getCatalogs(AdminCatalogSearch search, int offset, int size)
          Get an array of catalogs matching the search criteria from the database
protected  int getCount(com.konakart.bl.KKCriteria c, boolean fixQuery)
          This method is mainly used for paging.
protected  java.lang.String getCustomAttrs(int productId)
          Get the custom_attrs for the product with the specified Id
protected  AdminDigitalDownload getDigitalDownload(int customerId, int productId)
          Returns a Digital Download object for the customerId and productId passed in as parameters.
protected  java.util.Date getExpiryDate(int maxDownloadDays)
          Common code to get the expiry date
protected  int getMappedProductId(int idFrom, java.lang.String storeIdTo)
          Returns the idTo if the product exists in storeIdTo.
protected  int getMaxDownloadDays(AdminProduct prod)
          Common code to get the maximum number of download days
protected  int getMaxNumDownloads(AdminProduct prod)
          Common code to get the maximum number of downloads
 AdminMiscItem[] getMiscItems(AdminSearch search)
          Get the MiscItems associated with the specified search criteria
 AdminMiscItem[] getMiscItems(int productId)
          Get the MiscItems associated with the specified productId
 java.util.HashMap<java.lang.Integer,java.util.ArrayList<AdminMiscItem>> getMiscItemsHash(AdminSearch search)
          Get the MiscItems associated with the specified search criteria
protected  int getNewQuantity(int currentQuantity, int newQuantity, int operation)
          Utility method used by setProductQuantity()
 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
protected  java.math.BigDecimal[] getPriceFromEncodedOptions(int productId, java.lang.String encodedOptionValues)
          For a product and a string containing encoded option values, this method returns an array of BigDecimal objects for price0 to price3.
 AdminProduct getProduct(int productId)
          Gets a product object with full details
protected  AdminProduct getProduct(int productId, boolean getBundleQuantity)
          Gets a product object with full details
 AdminProduct getProduct(int productId, boolean getBundleQuantity, AdminProductMgrOptions mgrOptions, boolean allStores)
          Gets a product object with full details.
protected  AdminProductAttribute getProductAttribute(int productId, int optionId, int optionValueId)
          Gets the product attributes object for the parameters.
 AdminProductAttribute[] getProductAttributesPerProduct(int productId)
          Gets all of the product attributes for the product
protected  AdminProductAttribute[] getProductAttributesPerProduct(int productId, AdminProductMgrOptions mgrOptions)
          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.
protected  int getProductIdFromUUIDAndStore(java.lang.String uuid, java.lang.String storeId)
          Get the id of a product in a store based on its UUID
protected  int getProductOptionCount(AdminProductOptionSearch search, int languageId)
          Returns a count of the number of ProductOptions
 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.
protected  AdminProductQuantity[] getProductQuantitiesPerProduct(int productId, AdminProductAttribute[] prodAttrs, AdminProductMgrOptions mgrOptions)
          Create an array of AdminProductQuantity objects with zero quantity for all combinations of options.
protected  AdminProductQuantity[] getProductQuantitiesPerSKU(java.lang.String sku, int rule)
          Get a list of productQuantity objects for an SKU
 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.
protected  AdminProducts getProductsAllCasesWithOptions(AdminDataDescriptor dataDesc, int categoryId, int languageId, int manufacturerId, AdminProductMgrOptions mgrOptions)
          This protected method gets called by various flavours of public methods to get an array of products with differing criteria.
 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)
          Gets a product object with full details.
 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.
protected  AdminProducts getRelatedProductsWithOptions(AdminDataDescriptor dataDesc, int productId, int relationType, int languageId, java.util.HashMap<java.lang.String,AdminProduct> bundleProductMap, int loopCounter, int quantity, AdminProductMgrOptions mgrOptions)
          A protected version of getRelatedProducts with a hash map passed in for recursion
 java.lang.String getSku(AdminOrderProduct orderProd)
          Get the SKU for an orderProduct object.
protected  java.lang.String getSku(int productId)
          Gets the SKU for a product directly from the product table.
 java.lang.String[] getSkus(AdminOrderProduct[] orderProds)
          Get the SKUs for an array orderProduct objects.
 AdminSpecial getSpecial(int specialId)
          Gets a special object for a specialId
protected  AdminSpecial getSpecialForProductId(int productId)
          Gets a special object for a productId
protected  AdminSpecial getSpecialForSpecialOrProductId(int specialId, int productId)
          Gets a special object for a specialId or productId.
 AdminProducts getSpecialsPerCategory(AdminDataDescriptor dataDesc, int categoryId, boolean searchInSubCats, int languageId)
          Return all products with a special price for a category referenced by categoryId
 AdminTierPrice[] getTierPricesPerProduct(int productId, AdminProductMgrOptions mgrOptions)
          Gets all of the tier prices for the product
 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.
protected  void insertExtPrice(AdminProduct product, java.lang.String catalogId, com.konakart.bl.KKCriteria insertC, java.sql.Connection con)
          Used to insert a price in the external price table.
protected  void insertExtProdAttrPrice(AdminProductAttribute prodAttr, java.lang.String catalogId, com.konakart.bl.KKCriteria insertC, java.sql.Connection con)
          Used to insert a product attribute price in the external price table.
protected  void insertExtQuantity(AdminProductQuantity prodQ, java.lang.String catalogId, boolean setQuantity, boolean setDate, com.konakart.bl.KKCriteria insertC, java.sql.Connection con)
          Used to insert a quantity in the external quantity table.
protected  void insertExtTierPrice(AdminTierPrice tierPrice, java.lang.String catalogId, com.konakart.bl.KKCriteria insertC, java.sql.Connection con)
          Used to insert a product tier price in the external price table.
 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
protected  void insertProductIntoExternalSystems(AdminProduct product, boolean manageSolr)
          Insert the product into external systems
 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
protected  int insertProductWithOptions(AdminProduct product, AdminProductMgrOptions mgrOptions, boolean setMasterDate, boolean manageSolr, java.lang.String storeId, java.sql.Connection con)
          Insert a product.
 int insertSpecial(AdminSpecial special)
          Insert a special
protected  int insertSpecial(AdminSpecial special, java.sql.Connection con)
          Insert a special using a transaction already open
static boolean isCustomAttrAnOracleCLOB()
          Is the custom_attrs column is an Oracle CLOB? We only check once and save the result in a static variable.
protected  void manageDataDescriptor(AdminDataDescriptor dataDesc, com.konakart.bl.KKCriteria c, java.lang.String price)
          Provides common code to deal with the management of the DataDescriptor.
protected  void manageProductToStoreDataDescriptor(AdminDataDescriptor dataDesc, com.konakart.bl.KKCriteria c)
          Provides common code to deal with the management of the DataDescriptor for ProductToStore calls.
protected  void removeProductFromExternalSystems(int productId)
          Remove the product from external systems
 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
protected  AdminProducts searchForProductsPrivateWithOptions(AdminDataDescriptor dataDesc, AdminProductSearch prodSearch, java.util.ArrayList<java.lang.Integer> prodIdList, int languageId, AdminProductMgrOptions mgrOptions)
          Returns products matching the search criteria in the format defined by the data descriptor.
 AdminProducts searchForProductsWithOptions(AdminDataDescriptor dataDesc, AdminProductSearch prodSearch, int languageId, AdminProductMgrOptions mgrOptions)
          Search for products
protected  void setBundleQuantity(AdminProduct prod)
          Calculates the quantity if this product is a bundle and sets the quantity of the product
protected  void setCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c, int languageId, AdminProductMgrOptions options, AdminDataDescriptor dataDesc)
          Initializes the criteria with the standard attributes for the product.
protected  void setCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c, int languageId, boolean manuOuterJoin, boolean catOuterJoin, AdminProductMgrOptions options, AdminDataDescriptor dataDesc)
          Initializes the criteria with the standard attributes for the product.
 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.
protected  void setExtPriceProductCriteria(com.konakart.bl.KKCriteria c, AdminProductMgrOptions options)
          Add criteria for getting the prices from another table based on the catalog id .
protected  void setExtQuantityProductCriteria(com.konakart.bl.KKCriteria c, AdminProductMgrOptions options)
          Add criteria for getting the quantity from another table based on the catalog id .
protected  void setProductAttributeCriteria(com.konakart.bl.KKCriteria c, int langId)
          Sets the product attribute criteria with standard attributes
 void setProductAvailability(java.lang.String sku, int id, java.util.Calendar dateAvailable)
          Sets the date when the product will be available
 void setProductAvailabilityWithOptions(java.lang.String sku, int id, java.util.Calendar dateAvailable, AdminProductMgrOptions mgrOptions)
          Sets the date when the product will be available
protected  void setProductOptionCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
          Add product option attributes to Criteria
protected  void setProductOptionValueCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
          Add product option value attributes to Criteria
 void setProductQuantity(java.lang.String sku, int id, int quantity, int operation)
          Sets the quantity of the product.
 void setProductQuantityWithOptions(java.lang.String sku, int id, int quantity, int operation, AdminProductMgrOptions mgrOptions)
          Sets the quantity of the product in an external table if the catalogId has a non null value.
protected  void setProductsSharedCriteria(com.konakart.bl.KKCriteria c)
          Add criteria to get shared products from the database
protected  void setProductsSharedCriteria(com.konakart.bl.KKCriteria c, boolean addSelectPriceId)
          Add criteria to get shared products from the database
 void updateCatalog(AdminCatalog catalog)
          Update an existing catalog
protected  void updateProductInExternalSystems(AdminProduct product, boolean manageSolr)
          Update the product in external systems
protected  boolean useExternalPrices(AdminProductMgrOptions mgrOptions)
          Utility method for determining whether to use external prices
protected  boolean useExternalQuantity(AdminProductMgrOptions mgrOptions)
          Utility method for determining whether to use external quantity
protected  AdminProduct validateDigitalDownload(int productId)
          Validate the digital download productId
protected  void validateProdOptionValToProdOption(AdminProdOptionValToProdOption productOptionValueToProductOption)
          Used to validate a AdminProdOptionValToProdOption object before editing or inserting
protected  void validateProduct(AdminProduct product)
          Used to validate a product before editing or inserting
protected  void validateProductAttribute(AdminProductAttribute productAttr, boolean testProdId)
          Used to validate a productAttribute before editing or inserting
protected  void validateProductOption(AdminProductOption productOption)
          Used to validate a productOption before editing or inserting
protected  void validateProductOptionValue(AdminProductOptionValue productOptionValue)
          Used to validate a productOptionValue before editing or inserting
protected  void validateProductQuantity(AdminProductQuantity productQuantity)
          Used to validate a productQuantity before editing or inserting
protected  void validateSpecial(AdminSpecial special, boolean checkProduct)
          Used to validate a special before editing or inserting
protected  void validateTierPrices(AdminTierPrice[] tierPrices)
          Used to validate TierPrices before editing or inserting
 
Methods inherited from class com.konakartadmin.bl.AdminBaseMgr
addInsertAttr, addInsertAttr, checkIntIsSet, checkRequired, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminHtmlMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminPublishProdMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getExportXMLData, getIntFromString, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getPostSearchText, getPreSearchText, getPropertyValue, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, manageException, refreshConfigs, removeCData, setAdminEng, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log


DONT_INCLUDE

public static final int DONT_INCLUDE
Used to not include values in the query

See Also:
Constant Field Values

UP_SELL

public static final int UP_SELL
Up Sell related products

See Also:
Constant Field Values

CROSS_SELL

public static final int CROSS_SELL
Cross Sell related products

See Also:
Constant Field Values

ACCESSORY

public static final int ACCESSORY
Accessories

See Also:
Constant Field Values

DEPENDENT_ITEM

public static final int DEPENDENT_ITEM
Dependent items, such as warranties

See Also:
Constant Field Values

BUNDLED_PRODUCTS

public static final int BUNDLED_PRODUCTS
Bundled products

See Also:
Constant Field Values

DIGITAL_DOWNLOAD

public static final int DIGITAL_DOWNLOAD
Digital download product

See Also:
Constant Field Values

GIFT_CERTIFICATE_PRODUCT_TYPE

public static final int GIFT_CERTIFICATE_PRODUCT_TYPE
Gift Certificate product

See Also:
Constant Field Values

BOOKABLE_PRODUCT_TYPE

public static final int BOOKABLE_PRODUCT_TYPE
Bookable product

See Also:
Constant Field Values

customAttrAnOracleCLOB

public static java.lang.Boolean customAttrAnOracleCLOB
is Oracle CLOB used for custom_attrs column?

Constructor Detail

AdminProductMgr

public AdminProductMgr(KKAdminIf eng)
                throws java.lang.Exception
Constructor

Parameters:
eng - KKAdmin engine
Throws:
java.lang.Exception
Method Detail

insertProduct

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

Specified by:
insertProduct in interface AdminProductMgrIf
Parameters:
product -
Returns:
Returns the product Id
Throws:
java.lang.Exception

insertProductWithOptions

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

Specified by:
insertProductWithOptions in interface AdminProductMgrIf
Parameters:
product -
mgrOptions -
Returns:
Returns the product Id
Throws:
java.lang.Exception

insertProductWithOptions

protected int insertProductWithOptions(AdminProduct product,
                                       AdminProductMgrOptions mgrOptions,
                                       boolean setMasterDate,
                                       boolean manageSolr,
                                       java.lang.String storeId,
                                       java.sql.Connection con)
                                throws java.lang.Exception
Insert a product. Allows you to insert it within a transaction.

Parameters:
product -
mgrOptions -
setMasterDate - When set to true, the master date of the product is set. If a product is being copied from one store to another then we don't want to change this since it shows the last modified date of the master data.
manageSolr - If false, then inserts are not replicated in SOLR
storeId - The store where to insert the product
con -
Returns:
Returns the product Id
Throws:
java.lang.Exception

insertProductIntoExternalSystems

protected void insertProductIntoExternalSystems(AdminProduct product,
                                                boolean manageSolr)
                                         throws java.lang.Exception
Insert the product into external systems

Parameters:
product - the product to insert
manageSolr - If false, then inserts are not replicated in SOLR
Throws:
java.lang.Exception

insertSpecial

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

Specified by:
insertSpecial in interface AdminProductMgrIf
Parameters:
special -
Returns:
Returns the special Id
Throws:
java.lang.Exception

insertSpecial

protected int insertSpecial(AdminSpecial special,
                            java.sql.Connection con)
                     throws java.lang.Exception
Insert a special using a transaction already open

Parameters:
special -
con -
Returns:
Primary key of new special
Throws:
java.lang.Exception

editSpecial

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

Specified by:
editSpecial in interface AdminProductMgrIf
Parameters:
special -
Throws:
java.lang.Exception

editSpecial

protected void editSpecial(AdminSpecial special,
                           java.sql.Connection con)
                    throws java.lang.Exception
Edit a special using a transaction already open

Parameters:
special -
con -
Throws:
java.lang.Exception

editProduct

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

Specified by:
editProduct in interface AdminProductMgrIf
Parameters:
product -
Throws:
java.lang.Exception

editProductWithOptions

public void editProductWithOptions(AdminProduct product,
                                   AdminProductMgrOptions mgrOptions)
                            throws java.lang.Exception
Edit a product and its product description objects. Options defines whether to use prices and quantity per catalog.

Specified by:
editProductWithOptions in interface AdminProductMgrIf
Parameters:
product -
mgrOptions -
Throws:
java.lang.Exception

editProductWithOptions

protected void editProductWithOptions(AdminProduct product,
                                      AdminProductMgrOptions mgrOptions,
                                      boolean setMasterDate,
                                      boolean allStores,
                                      boolean manageSolr,
                                      java.sql.Connection con)
                               throws java.lang.Exception
Edit a product and its product description objects. Options defines whether to use prices and quantity per catalog. This internal version of the method allows you to call it within a transaction.

Parameters:
product -
mgrOptions -
setMasterDate - When set to true, the master date of the product is set. If a product is being copied from one store to another then we don't want to change this since it shows the last modified date of the master data.
allStores - When set to true we don't check that the product exists in this store. It has to exist but in shared products mode it could be attached to any store
manageSolr - If false, then inserts are not replicated in SOLR
con -
Throws:
java.lang.Exception

editProductQuantities

protected void editProductQuantities(AdminProduct product,
                                     java.sql.Connection con,
                                     com.konakart.bl.KKCriteria selectC,
                                     com.konakart.bl.KKCriteria deleteC,
                                     com.konakart.bl.KKCriteria updateC,
                                     com.konakart.bl.KKCriteria insertC,
                                     AdminProductMgrOptions mgrOptions)
                              throws java.lang.Exception
protected method to edit the product quantity records

Parameters:
product -
con -
selectC -
deleteC -
updateC -
insertC -
mgrOptions -
Throws:
java.lang.Exception

editTierPrices

protected void editTierPrices(AdminProduct product,
                              java.sql.Connection con,
                              com.konakart.bl.KKCriteria selectC,
                              com.konakart.bl.KKCriteria deleteC,
                              com.konakart.bl.KKCriteria updateC,
                              com.konakart.bl.KKCriteria insertC,
                              AdminProductMgrOptions mgrOptions)
                       throws java.lang.Exception
protected method to edit the tier price records

Parameters:
product -
con -
selectC -
deleteC -
updateC -
insertC -
mgrOptions -
Throws:
java.lang.Exception

editProductAttributes

protected void editProductAttributes(AdminProduct product,
                                     java.sql.Connection con,
                                     com.konakart.bl.KKCriteria selectC,
                                     com.konakart.bl.KKCriteria deleteC,
                                     com.konakart.bl.KKCriteria updateC,
                                     com.konakart.bl.KKCriteria insertC,
                                     AdminProductMgrOptions mgrOptions)
                              throws java.lang.Exception
protected method to edit the product attribute records

Parameters:
product -
con -
selectC -
deleteC -
updateC -
insertC -
mgrOptions -
Throws:
java.lang.Exception

editProductToCategory

protected void editProductToCategory(AdminProduct product,
                                     java.sql.Connection con,
                                     com.konakart.bl.KKCriteria selectC,
                                     com.konakart.bl.KKCriteria deleteC,
                                     com.konakart.bl.KKCriteria insertC)
                              throws java.lang.Exception
Edit the product to category records

Parameters:
product -
con -
selectC -
deleteC -
insertC -
Throws:
java.lang.Exception

editProductDescriptions

protected void editProductDescriptions(AdminProduct product,
                                       java.sql.Connection con,
                                       com.konakart.bl.KKCriteria selectC,
                                       com.konakart.bl.KKCriteria deleteC,
                                       com.konakart.bl.KKCriteria updateC,
                                       com.konakart.bl.KKCriteria insertC)
                                throws java.lang.Exception
protected method to edit the product descriptions

Parameters:
product -
con -
selectC -
deleteC -
updateC -
insertC -
Throws:
java.lang.Exception

updateProductInExternalSystems

protected void updateProductInExternalSystems(AdminProduct product,
                                              boolean manageSolr)
                                       throws java.lang.Exception
Update the product in external systems

Parameters:
product - the product to update
manageSolr - If false, then updates are not replicated in SOLR
Throws:
java.lang.Exception

validateProduct

protected void validateProduct(AdminProduct product)
                        throws java.lang.Exception
Used to validate a product before editing or inserting

Parameters:
product - the product to validate
Throws:
java.lang.Exception

validateSpecial

protected void validateSpecial(AdminSpecial special,
                               boolean checkProduct)
                        throws java.lang.Exception
Used to validate a special before editing or inserting

Parameters:
special -
checkProduct -
Throws:
java.lang.Exception

doesProductExist

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

Specified by:
doesProductExist in interface AdminProductMgrIf
Parameters:
productId -
Returns:
Returns true if the product exists
Throws:
org.apache.torque.TorqueException
KKAdminException

getProduct

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

Specified by:
getProduct in interface AdminProductMgrIf
Parameters:
productId -
Returns:
A product object with full details
Throws:
java.lang.Exception

getProductWithOptions

public AdminProduct getProductWithOptions(int productId,
                                          AdminProductMgrOptions mgrOptions)
                                   throws java.lang.Exception
Gets a product object with full details. The MgrOptions object defines whether to use prices and quantity for the catalog defined by the catalogId.

Specified by:
getProductWithOptions in interface AdminProductMgrIf
Parameters:
productId -
mgrOptions -
Returns:
A product object with full details
Throws:
java.lang.Exception

getProduct

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

Parameters:
productId -
getBundleQuantity - When set to true we calculate the quantity of a product if it is a bundle
Returns:
A product object with full details
Throws:
java.lang.Exception

getProduct

public 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.

Specified by:
getProduct in interface AdminProductMgrIf
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

getSpecial

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

Specified by:
getSpecial in interface AdminProductMgrIf
Parameters:
specialId -
Returns:
A special
Throws:
java.lang.Exception

getSpecialForProductId

protected AdminSpecial getSpecialForProductId(int productId)
                                       throws java.lang.Exception
Gets a special object for a productId

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

getSpecialForSpecialOrProductId

protected AdminSpecial getSpecialForSpecialOrProductId(int specialId,
                                                       int productId)
                                                throws java.lang.Exception
Gets a special object for a specialId or productId. Used to avoid duplicating code.

Parameters:
specialId - Used if greater than 0
productId - Used if greater than 0
Returns:
A special
Throws:
java.lang.Exception

doesSpecialExist

protected boolean doesSpecialExist(int productId)
                            throws java.lang.Exception
Determines whether a special exists for this product

Parameters:
productId -
Returns:
Returns true if a special already exists for the product
Throws:
java.lang.Exception

deleteSpecial

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

Specified by:
deleteSpecial in interface AdminProductMgrIf
Parameters:
specialId -
Throws:
java.lang.Exception

deleteProduct

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

Specified by:
deleteProduct in interface AdminProductMgrIf
Parameters:
productId -
Throws:
java.lang.Exception

removeProductFromExternalSystems

protected void removeProductFromExternalSystems(int productId)
                                         throws KKAdminException
Remove the product from external systems

Parameters:
productId - the Id of the product to remove
Throws:
KKAdminException

getProductsPerCategory

public AdminProducts getProductsPerCategory(AdminDataDescriptor dataDesc,
                                            int categoryId,
                                            int languageId)
                                     throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Get products for the category referenced by categoryId.

Specified by:
getProductsPerCategory in interface AdminProductMgrIf
Parameters:
dataDesc -
categoryId -
languageId -
Returns:
Products object
Throws:
java.lang.Exception

getProductsPerCategoryWithOptions

public AdminProducts getProductsPerCategoryWithOptions(AdminDataDescriptor dataDesc,
                                                       int categoryId,
                                                       int languageId,
                                                       AdminProductMgrOptions mgrOptions)
                                                throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Get products for the category referenced by categoryId.

Specified by:
getProductsPerCategoryWithOptions in interface AdminProductMgrIf
Parameters:
dataDesc -
categoryId -
languageId -
mgrOptions -
Returns:
Products object
Throws:
java.lang.Exception

getProductsPerManufacturerWithOptions

public AdminProducts getProductsPerManufacturerWithOptions(AdminDataDescriptor dataDesc,
                                                           int manufacturerId,
                                                           int languageId,
                                                           AdminProductMgrOptions mgrOptions)
                                                    throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Get products for the manufacturer referenced by manufacturerId.

Specified by:
getProductsPerManufacturerWithOptions in interface AdminProductMgrIf
Parameters:
dataDesc -
manufacturerId -
languageId -
mgrOptions -
Returns:
Products object
Throws:
java.lang.Exception

getProductsPerManufacturer

public AdminProducts getProductsPerManufacturer(AdminDataDescriptor dataDesc,
                                                int manufacturerId,
                                                int languageId)
                                         throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Get products for the manufacturer referenced by manufacturerId.

Specified by:
getProductsPerManufacturer in interface AdminProductMgrIf
Parameters:
dataDesc -
manufacturerId -
languageId -
Returns:
Products object
Throws:
java.lang.Exception

getProductsAllCasesWithOptions

protected AdminProducts getProductsAllCasesWithOptions(AdminDataDescriptor dataDesc,
                                                       int categoryId,
                                                       int languageId,
                                                       int manufacturerId,
                                                       AdminProductMgrOptions mgrOptions)
                                                throws java.lang.Exception
This protected method gets called by various flavours of public methods to get an array of products with differing criteria.

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

searchForProducts

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

Specified by:
searchForProducts in interface AdminProductMgrIf
Parameters:
dataDesc -
prodSearch -
languageId -
Returns:
Return a Products object
Throws:
java.lang.Exception

searchForProductsWithOptions

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

Specified by:
searchForProductsWithOptions in interface AdminProductMgrIf
Parameters:
dataDesc -
prodSearch -
languageId -
mgrOptions -
Returns:
Return a Products object
Throws:
java.lang.Exception

searchForProductsPrivateWithOptions

protected AdminProducts searchForProductsPrivateWithOptions(AdminDataDescriptor dataDesc,
                                                            AdminProductSearch prodSearch,
                                                            java.util.ArrayList<java.lang.Integer> prodIdList,
                                                            int languageId,
                                                            AdminProductMgrOptions mgrOptions)
                                                     throws java.lang.Exception
Returns products matching the search criteria in the format defined by the data descriptor. N.B.B:B When in Torque you use an outer join and inner join in the same query, it is very important to write the inner join using Criteria.INNER_JOIN, otherwise there is a risk of the query syntax being wrong.

Parameters:
dataDesc -
prodSearch -
prodIdList - If not null, it must contain a list of productIds which will be added to an IN clause.
languageId -
mgrOptions -
Returns:
Return a Products object
Throws:
java.lang.Exception

getCustomAttrs

protected java.lang.String getCustomAttrs(int productId)
                                   throws java.lang.Exception
Get the custom_attrs for the product with the specified Id

Parameters:
productId -
Returns:
the custom_attrs as a String
Throws:
java.lang.Exception

setCriteriaWithStandardAttributes

protected void setCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c,
                                                 int languageId,
                                                 AdminProductMgrOptions options,
                                                 AdminDataDescriptor dataDesc)
                                          throws KKAdminException
Initializes the criteria with the standard attributes for the product.

Parameters:
c -
languageId -
options -
Throws:
KKAdminException

setCriteriaWithStandardAttributes

protected void setCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c,
                                                 int languageId,
                                                 boolean manuOuterJoin,
                                                 boolean catOuterJoin,
                                                 AdminProductMgrOptions options,
                                                 AdminDataDescriptor dataDesc)
                                          throws KKAdminException
Initializes the criteria with the standard attributes for the product. Depending on the value of manuOuterJoin we do a normal or outer join with the manufacturers table.

Parameters:
c -
languageId -
manuOuterJoin -
catOuterJoin -
options -
Throws:
KKAdminException

setProductsSharedCriteria

protected void setProductsSharedCriteria(com.konakart.bl.KKCriteria c)
                                  throws KKAdminException
Add criteria to get shared products from the database

Parameters:
c -
Throws:
KKAdminException

setProductsSharedCriteria

protected void setProductsSharedCriteria(com.konakart.bl.KKCriteria c,
                                         boolean addSelectPriceId)
                                  throws KKAdminException
Add criteria to get shared products from the database

Parameters:
c -
addSelectPriceId - if true BaseProductToStoresPeer.PRICE_ID and custom fields will be added as select columns
Throws:
KKAdminException

setExtPriceProductCriteria

protected void setExtPriceProductCriteria(com.konakart.bl.KKCriteria c,
                                          AdminProductMgrOptions options)
Add criteria for getting the prices from another table based on the catalog id .

Parameters:
c -
options -

setExtQuantityProductCriteria

protected void setExtQuantityProductCriteria(com.konakart.bl.KKCriteria c,
                                             AdminProductMgrOptions options)
Add criteria for getting the quantity from another table based on the catalog id .

Parameters:
c -
options -

setProductAttributeCriteria

protected void setProductAttributeCriteria(com.konakart.bl.KKCriteria c,
                                           int langId)
Sets the product attribute criteria with standard attributes

Parameters:
c -
langId -

manageDataDescriptor

protected void manageDataDescriptor(AdminDataDescriptor dataDesc,
                                    com.konakart.bl.KKCriteria c,
                                    java.lang.String price)
Provides common code to deal with the management of the DataDescriptor. The price is passed in because in the case of specials, we use the specials price. In the case of products that may not have the special price set, we use a virtual column that is either set to the price or the special price if it exists.

Parameters:
dataDesc -
c -
price -

getCount

protected int getCount(com.konakart.bl.KKCriteria c,
                       boolean fixQuery)
                throws org.apache.torque.TorqueException,
                       com.workingdogs.village.DataSetException,
                       KKAdminException
This method is mainly used for paging.

Parameters:
c -
fixQuery -
Returns:
The number of records present in the database matching the given criteria
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

deleteProductsPerCategory

public 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.

Specified by:
deleteProductsPerCategory in interface AdminProductMgrIf
Parameters:
categoryId -
Throws:
java.lang.Exception

deleteDirectProductsPerCategory

public 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.

Specified by:
deleteDirectProductsPerCategory in interface AdminProductMgrIf
Parameters:
categoryId -
Throws:
java.lang.Exception

deleteProductsPerManufacturer

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

Specified by:
deleteProductsPerManufacturer in interface AdminProductMgrIf
Parameters:
manufacturerId -
Throws:
java.lang.Exception

getAllSpecials

public AdminProducts getAllSpecials(AdminDataDescriptor dataDesc,
                                    int languageId)
                             throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Return all products with a special price

Specified by:
getAllSpecials in interface AdminProductMgrIf
Parameters:
dataDesc -
languageId -
Returns:
Array of products
Throws:
java.lang.Exception

getSpecialsPerCategory

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

Specified by:
getSpecialsPerCategory in interface AdminProductMgrIf
Parameters:
dataDesc -
categoryId -
searchInSubCats -
languageId -
Returns:
Return an array of products
Throws:
java.lang.Exception

getAllProductOptions

public AdminProductOption[] getAllProductOptions(int languageId)
                                          throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Returns a list of product options.

Specified by:
getAllProductOptions in interface AdminProductMgrIf
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

getProductOptions

public 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.

Specified by:
getProductOptions in interface AdminProductMgrIf
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

getAllProductOptionValues

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

Specified by:
getAllProductOptionValues in interface AdminProductMgrIf
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

getProductOptionValuesPerOption

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

Specified by:
getProductOptionValuesPerOption in interface AdminProductMgrIf
Parameters:
productOptionId -
languageId -
Returns:
Return an array of productOptionValue objects
Throws:
java.lang.Exception

getProductOptionValuesPerName

public 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

Specified by:
getProductOptionValuesPerName in interface AdminProductMgrIf
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

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

Specified by:
getProductAttributesPerProduct in interface AdminProductMgrIf
Parameters:
productId -
Returns:
Returns an array of AdminProductAttributes
Throws:
java.lang.Exception

getProductAttributesPerProduct

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

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

getTierPricesPerProduct

public AdminTierPrice[] getTierPricesPerProduct(int productId,
                                                AdminProductMgrOptions mgrOptions)
                                         throws org.apache.torque.TorqueException,
                                                com.workingdogs.village.DataSetException,
                                                KKAdminException
Gets all of the tier prices for the product

Parameters:
productId -
mgrOptions -
Returns:
Returns an array of AdminTierPrice objects
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

deleteProductAttribute

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

Specified by:
deleteProductAttribute in interface AdminProductMgrIf
Parameters:
productAttributeId -
Throws:
java.lang.Exception

deleteProductAttributesPerProduct

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

Specified by:
deleteProductAttributesPerProduct in interface AdminProductMgrIf
Parameters:
productId -
Throws:
java.lang.Exception

editProductAttribute

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

Specified by:
editProductAttribute in interface AdminProductMgrIf
Parameters:
prodAttr -
Throws:
java.lang.Exception

insertProductAttribute

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

Specified by:
insertProductAttribute in interface AdminProductMgrIf
Parameters:
prodAttr -
Returns:
Returns the primary key of the new product attribute
Throws:
java.lang.Exception

deleteProductOptions

public 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

Specified by:
deleteProductOptions in interface AdminProductMgrIf
Parameters:
productOptionId -
Throws:
java.lang.Exception

deleteProductOptionValues

public 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

Specified by:
deleteProductOptionValues in interface AdminProductMgrIf
Parameters:
productOptionValueId -
Throws:
java.lang.Exception

getProductOptionsPerId

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

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

getProductOptionsPerName

public AdminProductOption[] getProductOptionsPerName(java.lang.String name,
                                                     int langId)
                                              throws KKAdminException
Returns an array of productOptions with the specified name and languageId

Specified by:
getProductOptionsPerName in interface AdminProductMgrIf
Parameters:
name - Product Option Name
langId - Language Id
Returns:
An array of all product options for the specified language with the specified name
Throws:
KKAdminException

getProductOptionValuesPerId

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

Specified by:
getProductOptionValuesPerId in interface AdminProductMgrIf
Parameters:
productOptionValueId -
Returns:
Return an array of productOptionValues objects
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

insertProductOptions

public 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.

Specified by:
insertProductOptions in interface AdminProductMgrIf
Parameters:
productOptions -
Returns:
id of inserted options
Throws:
java.lang.Exception

insertProductOption

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

Specified by:
insertProductOption in interface AdminProductMgrIf
Parameters:
productOption -
Throws:
java.lang.Exception

editProductOption

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

Specified by:
editProductOption in interface AdminProductMgrIf
Parameters:
productOption -
Throws:
java.lang.Exception

insertProductOptionValues

public 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.

Specified by:
insertProductOptionValues in interface AdminProductMgrIf
Parameters:
productOptionValues -
productOptionId -
Returns:
Id of inserted option values
Throws:
java.lang.Exception

insertProductsOptionsValuesToProductsOptions

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

Specified by:
insertProductsOptionsValuesToProductsOptions in interface AdminProductMgrIf
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

getProductOptionValueToProductOptions

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

Specified by:
getProductOptionValueToProductOptions in interface AdminProductMgrIf
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

editProductOptionValue

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

Specified by:
editProductOptionValue in interface AdminProductMgrIf
Parameters:
productOptionValue -
Throws:
java.lang.Exception

validateProductOption

protected void validateProductOption(AdminProductOption productOption)
                              throws java.lang.Exception
Used to validate a productOption before editing or inserting

Parameters:
productOption -
Throws:
java.lang.Exception

validateProductQuantity

protected void validateProductQuantity(AdminProductQuantity productQuantity)
                                throws java.lang.Exception
Used to validate a productQuantity before editing or inserting

Parameters:
productQuantity -
Throws:
java.lang.Exception

validateProductAttribute

protected void validateProductAttribute(AdminProductAttribute productAttr,
                                        boolean testProdId)
                                 throws java.lang.Exception
Used to validate a productAttribute before editing or inserting

Parameters:
productAttr -
testProdId -
Throws:
java.lang.Exception

validateTierPrices

protected void validateTierPrices(AdminTierPrice[] tierPrices)
                           throws java.lang.Exception
Used to validate TierPrices before editing or inserting

Parameters:
tierPrices -
Throws:
java.lang.Exception

validateProductOptionValue

protected void validateProductOptionValue(AdminProductOptionValue productOptionValue)
                                   throws java.lang.Exception
Used to validate a productOptionValue before editing or inserting

Parameters:
productOptionValue -
Throws:
java.lang.Exception

validateProdOptionValToProdOption

protected void validateProdOptionValToProdOption(AdminProdOptionValToProdOption productOptionValueToProductOption)
                                          throws java.lang.Exception
Used to validate a AdminProdOptionValToProdOption object before editing or inserting

Parameters:
productOptionValueToProductOption -
Throws:
java.lang.Exception

getNextProductOptionId

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

Specified by:
getNextProductOptionId in interface AdminProductMgrIf
Returns:
The next id
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getNextProductOptionValuesId

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

Specified by:
getNextProductOptionValuesId in interface AdminProductMgrIf
Returns:
The next id
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

formatProductPrices

protected void formatProductPrices(AdminProduct product)
                            throws java.lang.Exception
Format the prices of the product object

Parameters:
product -
Throws:
java.lang.Exception

getRelatedProducts

public 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:

Specified by:
getRelatedProducts in interface AdminProductMgrIf
Parameters:
dataDesc -
productId -
relationType -
languageId -
Returns:
AdminProducts
Throws:
java.lang.Exception

getRelatedProductsWithOptions

public 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:

Specified by:
getRelatedProductsWithOptions in interface AdminProductMgrIf
Parameters:
dataDesc -
productId -
relationType -
languageId -
mgrOptions -
Returns:
AdminProducts
Throws:
java.lang.Exception

getRelatedProductsWithOptions

protected AdminProducts getRelatedProductsWithOptions(AdminDataDescriptor dataDesc,
                                                      int productId,
                                                      int relationType,
                                                      int languageId,
                                                      java.util.HashMap<java.lang.String,AdminProduct> bundleProductMap,
                                                      int loopCounter,
                                                      int quantity,
                                                      AdminProductMgrOptions mgrOptions)
                                               throws java.lang.Exception
A protected version of getRelatedProducts with a hash map passed in for recursion

Parameters:
dataDesc -
productId -
relationType -
languageId -
bundleProductMap - HashMap used to keep track of products during recursion.
loopCounter - Used to stop recursion forever. Throws an exception if recursion occurs when a bundle product is set to be a product within the bundle.
quantity - Used to multiply quantity during recursion. i.e. A bundled product may have a quantity of two and itself be a bundle. This means that all of the products in its bundle have to be multiplied by two.
mgrOptions -
Returns:
AdminProducts
Throws:
java.lang.Exception

createEncodedProductIdFromProductQuantityEncodedKey

protected java.lang.String createEncodedProductIdFromProductQuantityEncodedKey(int productId,
                                                                               java.lang.String productQuantityEncodedKey)
Takes in a productQuantityEncodedKey and a productId and returns an encoded product Id. for the products_quantity table

The format of the encoded product id is 1{2}3{4}5 where the product id = 1, the first optionId / valueId pair have ids of 2,3 and the 2nd optionId / valueId pair have ids of 4,5.

The format of the encoded key for the products_quantitytable is 3{4}4{6} which means product_options of id==3 and product_options_values of id==4 followed by product_options of id==4 and product_options_values of id==6. The order is very important since the product option ids must be in ascending order.

Parameters:
productId -
productQuantityEncodedKey -
Returns:
Returns the encoded productId

removeRelatedProducts

public 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.

Specified by:
removeRelatedProducts in interface AdminProductMgrIf
Parameters:
productId -
relationType -
Throws:
java.lang.Exception

addRelatedProducts

public 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.

Specified by:
addRelatedProducts in interface AdminProductMgrIf
Parameters:
products -
productId -
relationType -
Throws:
org.apache.torque.TorqueException
KKAdminException

getProductQuantitiesPerSKU

protected AdminProductQuantity[] getProductQuantitiesPerSKU(java.lang.String sku,
                                                            int rule)
                                                     throws org.apache.torque.TorqueException,
                                                            com.workingdogs.village.DataSetException,
                                                            KKAdminException
Get a list of productQuantity objects for an SKU

Parameters:
sku -
rule -
Returns:
A list of product quantity objects
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getProductQuantitiesPerProduct

protected AdminProductQuantity[] getProductQuantitiesPerProduct(int productId,
                                                                AdminProductAttribute[] prodAttrs,
                                                                AdminProductMgrOptions mgrOptions)
                                                         throws org.apache.torque.TorqueException,
                                                                com.workingdogs.village.DataSetException,
                                                                KKAdminException
Create an array of AdminProductQuantity objects with zero quantity for all combinations of options. i.e. If we have Size S, M ,L and Colour Red, Blue we have to create 6 objects. Then we read from the products_quantity table and fill in the array with the real quantities. Where there isn't an entry we assume that the quantity is zero.

Parameters:
productId -
mgrOptions -
prodAttrs -
Returns:
Array of Product Quantity objects
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getSkus

public 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.

Specified by:
getSkus in interface AdminProductMgrIf
Parameters:
orderProds -
Returns:
Returns an array of SKUs for the OrderProduct array
Throws:
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException

getSku

public 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.

Specified by:
getSku in interface AdminProductMgrIf
Parameters:
orderProd -
Returns:
Returns the SKU for the OrderProduct
Throws:
KKAdminException
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException

getSku

protected java.lang.String getSku(int productId)
                           throws org.apache.torque.TorqueException,
                                  com.workingdogs.village.DataSetException,
                                  KKAdminException
Gets the SKU for a product directly from the product table.

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

createProductQuantityEncodedKeyFromOptions

protected java.lang.String createProductQuantityEncodedKeyFromOptions(AdminOption[] opts)
Takes in an an array of options and returns an encoded key for the products_quantity table

The format of the encoded key for the products_quantitytable is 3{4}4{6} which means product_options of id==3 and product_options_values of id==4 followed by product_options of id==4 and product_options_values of id==6. The order is very important since the product option ids must be in ascending order.

Parameters:
opts -
Returns:
Returns the encoded key for the products_quantity table

insertDigitalDownload

public 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.

Specified by:
insertDigitalDownload in interface AdminProductMgrIf
Parameters:
customerId -
productId -
Throws:
java.lang.Exception

insertGiftCertificateDigitalDownload

public 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.

Specified by:
insertGiftCertificateDigitalDownload in interface AdminProductMgrIf
Parameters:
customerId -
productId -
filePath -
Returns:
Returns the key of the inserted Digital Download
Throws:
java.lang.Exception

getMaxDownloadDays

protected int getMaxDownloadDays(AdminProduct prod)
                          throws org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException,
                                 KKAdminException,
                                 java.lang.Exception
Common code to get the maximum number of download days

Parameters:
prod -
Returns:
Returns the maximum number of download days
Throws:
java.lang.Exception
KKAdminException
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException

getExpiryDate

protected java.util.Date getExpiryDate(int maxDownloadDays)
Common code to get the expiry date

Parameters:
maxDownloadDays -
Returns:
Returns the expiry date

getMaxNumDownloads

protected int getMaxNumDownloads(AdminProduct prod)
                          throws org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException,
                                 KKAdminException,
                                 java.lang.Exception
Common code to get the maximum number of downloads

Parameters:
prod -
Returns:
Returns the maximum number of downloads
Throws:
java.lang.Exception
KKAdminException
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException

validateDigitalDownload

protected AdminProduct validateDigitalDownload(int productId)
                                        throws java.lang.Exception
Validate the digital download productId

Parameters:
productId -
Returns:
returns the product with the specified productId
Throws:
java.lang.Exception - Returns an exception if the product does not exist or is not a digital download or gift certificate product.

getDigitalDownload

protected AdminDigitalDownload getDigitalDownload(int customerId,
                                                  int productId)
                                           throws org.apache.torque.TorqueException,
                                                  com.workingdogs.village.DataSetException,
                                                  KKAdminException
Returns a Digital Download object for the customerId and productId passed in as parameters. Returns null if no object exists.

Parameters:
customerId -
productId -
Returns:
Returns an DigitalDownload object
Throws:
org.apache.torque.TorqueException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

setDigitalDownloadCriteria

public 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.

Specified by:
setDigitalDownloadCriteria in interface AdminProductMgrIf
Parameters:
c -

getBundleProductDetails

public 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.

Specified by:
getBundleProductDetails in interface AdminProductMgrIf
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

setBundleQuantity

protected void setBundleQuantity(AdminProduct prod)
                          throws org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException,
                                 java.lang.Exception
Calculates the quantity if this product is a bundle and sets the quantity of the product

Parameters:
prod -
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException

getMiscItems

public AdminMiscItem[] getMiscItems(int productId)
                             throws org.apache.torque.TorqueException,
                                    KKAdminException,
                                    com.workingdogs.village.DataSetException,
                                    java.lang.Exception
Get the MiscItems associated with the specified productId

Parameters:
productId -
Returns:
An array of MiscItems which could be null
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException

getMiscItems

public AdminMiscItem[] getMiscItems(AdminSearch search)
                             throws org.apache.torque.TorqueException,
                                    KKAdminException,
                                    com.workingdogs.village.DataSetException,
                                    java.lang.Exception
Get the MiscItems associated with the specified search criteria

Parameters:
search -
Returns:
An array of MiscItems which could be null
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException

getMiscItemsHash

public java.util.HashMap<java.lang.Integer,java.util.ArrayList<AdminMiscItem>> getMiscItemsHash(AdminSearch search)
                                                                                         throws org.apache.torque.TorqueException,
                                                                                                KKAdminException,
                                                                                                com.workingdogs.village.DataSetException,
                                                                                                java.lang.Exception
Get the MiscItems associated with the specified search criteria

Parameters:
search -
Returns:
A HashMap mapped by the object Ids onto a list of MiscItems for each object Id.
Throws:
java.lang.Exception
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException

getPriceFromEncodedOptions

protected java.math.BigDecimal[] getPriceFromEncodedOptions(int productId,
                                                            java.lang.String encodedOptionValues)
                                                     throws java.lang.NumberFormatException,
                                                            org.apache.torque.TorqueException,
                                                            com.workingdogs.village.DataSetException,
                                                            KKAdminException
For a product and a string containing encoded option values, this method returns an array of BigDecimal objects for price0 to price3. The prices are fetched for each option / value pair and added to the previous prices.

Parameters:
productId -
encodedOptionValues -
Returns:
Returns an array of prices
Throws:
java.lang.NumberFormatException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

getProductAttribute

protected AdminProductAttribute getProductAttribute(int productId,
                                                    int optionId,
                                                    int optionValueId)
                                             throws org.apache.torque.TorqueException,
                                                    com.workingdogs.village.DataSetException,
                                                    KKAdminException
Gets the product attributes object for the parameters.

Parameters:
productId -
optionId -
optionValueId -
Returns:
Returns an AdminProductAttribute object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

setProductQuantity

public void setProductQuantity(java.lang.String sku,
                               int id,
                               int quantity,
                               int operation)
                        throws java.lang.Exception
Sets the quantity of the product.

Specified by:
setProductQuantity in interface AdminProductMgrIf
Parameters:
sku -
id -
quantity -
operation -
Throws:
java.lang.Exception

setProductQuantityWithOptions

public void setProductQuantityWithOptions(java.lang.String sku,
                                          int id,
                                          int quantity,
                                          int operation,
                                          AdminProductMgrOptions mgrOptions)
                                   throws java.lang.Exception
Sets the quantity of the product in an external table if the catalogId has a non null value.

Specified by:
setProductQuantityWithOptions in interface AdminProductMgrIf
Parameters:
sku -
id -
quantity -
operation -
mgrOptions -
Throws:
java.lang.Exception

getProductQuantity

public int getProductQuantity(java.lang.String sku,
                              int id)
                       throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
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.

Specified by:
getProductQuantity in interface AdminProductMgrIf
Parameters:
sku -
id -
Returns:
Returns the product quantity
Throws:
java.lang.Exception

getProductQuantityWithOptions

public int getProductQuantityWithOptions(java.lang.String sku,
                                         int id,
                                         AdminProductMgrOptions mgrOptions)
                                  throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
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.

Specified by:
getProductQuantityWithOptions in interface AdminProductMgrIf
Parameters:
sku -
id -
mgrOptions -
Returns:
Returns the product quantity
Throws:
java.lang.Exception

setProductAvailability

public void setProductAvailability(java.lang.String sku,
                                   int id,
                                   java.util.Calendar dateAvailable)
                            throws java.lang.Exception
Sets the date when the product will be available

Specified by:
setProductAvailability in interface AdminProductMgrIf
Parameters:
sku -
id -
dateAvailable -
Throws:
java.lang.Exception

setProductAvailabilityWithOptions

public void setProductAvailabilityWithOptions(java.lang.String sku,
                                              int id,
                                              java.util.Calendar dateAvailable,
                                              AdminProductMgrOptions mgrOptions)
                                       throws java.lang.Exception
Sets the date when the product will be available

Specified by:
setProductAvailabilityWithOptions in interface AdminProductMgrIf
Parameters:
sku -
id -
dateAvailable -
mgrOptions -
Throws:
java.lang.Exception

getProductAvailability

public java.util.Calendar getProductAvailability(java.lang.String sku,
                                                 int id)
                                          throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
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.

Specified by:
getProductAvailability in interface AdminProductMgrIf
Parameters:
sku -
id -
Returns:
Returns the product availability date
Throws:
java.lang.Exception

getProductAvailabilityWithOptions

public java.util.Calendar getProductAvailabilityWithOptions(java.lang.String sku,
                                                            int id,
                                                            AdminProductMgrOptions mgrOptions)
                                                     throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
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.

Specified by:
getProductAvailabilityWithOptions in interface AdminProductMgrIf
Parameters:
sku -
id -
mgrOptions -
Returns:
Returns the product availability date
Throws:
java.lang.Exception

getNewQuantity

protected int getNewQuantity(int currentQuantity,
                             int newQuantity,
                             int operation)
Utility method used by setProductQuantity()

Parameters:
currentQuantity -
newQuantity -
operation -
Returns:
Returns the result based on the operation

insertProductOptionValue

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

Specified by:
insertProductOptionValue in interface AdminProductMgrIf
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

getProductsToStores

public AdminProductToStore[] getProductsToStores(AdminDataDescriptor dataDesc,
                                                 AdminSearch search)
                                          throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Returns an array of AdminProductToStore objects for the specified store

Specified by:
getProductsToStores in interface AdminProductMgrIf
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

manageProductToStoreDataDescriptor

protected void manageProductToStoreDataDescriptor(AdminDataDescriptor dataDesc,
                                                  com.konakart.bl.KKCriteria c)
Provides common code to deal with the management of the DataDescriptor for ProductToStore calls.

Parameters:
dataDesc -
c -

insertProductsToStores

public void insertProductsToStores(AdminProductToStore[] productToStores)
                            throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Inserts an array of AdminProductToStore objects

Specified by:
insertProductsToStores in interface AdminProductMgrIf
Parameters:
productToStores - an array of AdminProductToStore objects to insert into the database
Throws:
java.lang.Exception

removeProductsToStores

public void removeProductsToStores(AdminProductToStore[] productToStores)
                            throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Removes an array of AdminProductToStore objects

Specified by:
removeProductsToStores in interface AdminProductMgrIf
Parameters:
productToStores - an array of AdminProductToStore objects to delete from the database
Throws:
java.lang.Exception

searchDigitalDownloads

public AdminDigitalDownloadSearchResult searchDigitalDownloads(AdminDigitalDownloadSearch search,
                                                               int offset,
                                                               int size)
                                                        throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
Retrieve the Digital Download records matching the search criteria

Specified by:
searchDigitalDownloads in interface AdminProductMgrIf
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

addDigitalDownloadSearchCriteria

protected int addDigitalDownloadSearchCriteria(com.konakart.bl.KKCriteria c,
                                               AdminDigitalDownloadSearch search)
Parameters:
c -
search -
Returns:
the number of constraints added

addDigitalDownloadOrderBy

protected void addDigitalDownloadOrderBy(com.konakart.bl.KKCriteria c,
                                         AdminDigitalDownloadSearch search)
Parameters:
c -
search -

importDigitalDownload

public int importDigitalDownload(AdminDigitalDownload digDownload)
                          throws java.lang.Exception
Description copied from interface: AdminProductMgrIf
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.

Specified by:
importDigitalDownload in interface AdminProductMgrIf
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

doesExtPriceExist

protected boolean doesExtPriceExist(int productId,
                                    int prodAttrId,
                                    int tierPriceId,
                                    java.lang.String catalogId,
                                    com.konakart.bl.KKCriteria selectC)
                             throws org.apache.torque.TorqueException
Returns true if the external price record exists

Parameters:
productId -
prodAttrId -
tierPriceId -
catalogId -
selectC -
Returns:
Return true if the external price record exists
Throws:
org.apache.torque.TorqueException

insertExtPrice

protected void insertExtPrice(AdminProduct product,
                              java.lang.String catalogId,
                              com.konakart.bl.KKCriteria insertC,
                              java.sql.Connection con)
                       throws org.apache.torque.TorqueException
Used to insert a price in the external price table.

Parameters:
product -
catalogId -
insertC -
con -
Throws:
org.apache.torque.TorqueException

insertExtProdAttrPrice

protected void insertExtProdAttrPrice(AdminProductAttribute prodAttr,
                                      java.lang.String catalogId,
                                      com.konakart.bl.KKCriteria insertC,
                                      java.sql.Connection con)
                               throws org.apache.torque.TorqueException
Used to insert a product attribute price in the external price table.

Parameters:
prodAttr -
catalogId -
insertC -
con -
Throws:
org.apache.torque.TorqueException

insertExtTierPrice

protected void insertExtTierPrice(AdminTierPrice tierPrice,
                                  java.lang.String catalogId,
                                  com.konakart.bl.KKCriteria insertC,
                                  java.sql.Connection con)
                           throws org.apache.torque.TorqueException
Used to insert a product tier price in the external price table.

Parameters:
tierPrice -
catalogId -
insertC -
con -
Throws:
org.apache.torque.TorqueException

editExtPrice

protected void editExtPrice(AdminProduct product,
                            java.lang.String catalogId,
                            com.konakart.bl.KKCriteria selectC,
                            com.konakart.bl.KKCriteria updateC,
                            java.sql.Connection con)
                     throws org.apache.torque.TorqueException
Used to edit a price in the external price table.

Parameters:
product -
catalogId -
selectC -
updateC -
con -
Throws:
org.apache.torque.TorqueException

editExtProdAttrPrice

protected void editExtProdAttrPrice(AdminProductAttribute prodAttr,
                                    java.lang.String catalogId,
                                    com.konakart.bl.KKCriteria selectC,
                                    com.konakart.bl.KKCriteria updateC,
                                    java.sql.Connection con)
                             throws org.apache.torque.TorqueException
Used to edit a product attribute price in the external price table.

Parameters:
prodAttr -
catalogId -
selectC -
updateC -
con -
Throws:
org.apache.torque.TorqueException

editExtTierPrice

protected void editExtTierPrice(AdminTierPrice tierPrice,
                                java.lang.String catalogId,
                                com.konakart.bl.KKCriteria selectC,
                                com.konakart.bl.KKCriteria updateC,
                                java.sql.Connection con)
                         throws org.apache.torque.TorqueException
Used to edit a product tier price in the external price table.

Parameters:
tierPrice -
catalogId -
selectC -
updateC -
con -
Throws:
org.apache.torque.TorqueException

deleteExtPrice

protected void deleteExtPrice(int productId,
                              int prodAttrId,
                              int tierPriceId,
                              java.lang.String catalogId,
                              com.konakart.bl.KKCriteria deleteC,
                              java.sql.Connection con)
                       throws org.apache.torque.TorqueException
Used to delete a price in the external price table.

Parameters:
productId -
prodAttrId -
tierPriceId -
catalogId -
deleteC -
con -
Throws:
org.apache.torque.TorqueException

doesExtQuantityExist

protected boolean doesExtQuantityExist(int productId,
                                       java.lang.String encodedOptionValues,
                                       java.lang.String catalogId,
                                       com.konakart.bl.KKCriteria selectC)
                                throws org.apache.torque.TorqueException
Returns true if the external quantity record exists

Parameters:
productId -
encodedOptionValues -
catalogId -
selectC -
Returns:
Return true if the external quantity record exists
Throws:
org.apache.torque.TorqueException

insertExtQuantity

protected void insertExtQuantity(AdminProductQuantity prodQ,
                                 java.lang.String catalogId,
                                 boolean setQuantity,
                                 boolean setDate,
                                 com.konakart.bl.KKCriteria insertC,
                                 java.sql.Connection con)
                          throws org.apache.torque.TorqueException
Used to insert a quantity in the external quantity table.

Parameters:
prodQ -
catalogId -
setQuantity -
setDate -
insertC -
con -
Throws:
org.apache.torque.TorqueException

editExtQuantity

protected void editExtQuantity(AdminProductQuantity prodQ,
                               java.lang.String catalogId,
                               boolean setQuantity,
                               boolean setDate,
                               com.konakart.bl.KKCriteria selectC,
                               com.konakart.bl.KKCriteria updateC,
                               java.sql.Connection con)
                        throws org.apache.torque.TorqueException
Used to edit a quantity in the external quantity table.

Parameters:
prodQ -
catalogId -
setQuantity -
setDate -
selectC -
updateC -
con -
Throws:
org.apache.torque.TorqueException

deleteExtQuantity

protected void deleteExtQuantity(int productId,
                                 java.lang.String encodedOptionValues,
                                 java.lang.String catalogId,
                                 com.konakart.bl.KKCriteria deleteC,
                                 java.sql.Connection con)
                          throws org.apache.torque.TorqueException
Used to delete and external quantity record

Parameters:
productId -
encodedOptionValues -
catalogId -
deleteC -
con -
Throws:
org.apache.torque.TorqueException

useExternalPrices

protected boolean useExternalPrices(AdminProductMgrOptions mgrOptions)
Utility method for determining whether to use external prices

Parameters:
mgrOptions -
Returns:
return true if external prices should be used

useExternalQuantity

protected boolean useExternalQuantity(AdminProductMgrOptions mgrOptions)
Utility method for determining whether to use external quantity

Parameters:
mgrOptions -
Returns:
return true if external quantities should be used

setProductOptionCriteriaWithStandardAttributes

protected void setProductOptionCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
Add product option attributes to Criteria

Parameters:
c -

setProductOptionValueCriteriaWithStandardAttributes

protected void setProductOptionValueCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
Add product option value attributes to Criteria

Parameters:
c -

getProductOptionCount

protected int getProductOptionCount(AdminProductOptionSearch search,
                                    int languageId)
                             throws org.apache.torque.TorqueException,
                                    com.workingdogs.village.DataSetException,
                                    KKAdminException
Returns a count of the number of ProductOptions

Parameters:
search - Search criteria
languageId -
Returns:
A count of the number of ProductOptions
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

addProductOptionSearchCriteria

protected int addProductOptionSearchCriteria(com.konakart.bl.KKCriteria c,
                                             AdminProductOptionSearch search,
                                             int langId)
Add search criteria for ProductOptions

Parameters:
c -
search -
langId -
Returns:
Returns the number of constraints added

addProductOptionOrderBy

protected void addProductOptionOrderBy(com.konakart.bl.KKCriteria c,
                                       AdminProductOptionSearch search)
Add order by constraints for ProductOptions

Parameters:
c -
search -

deleteCatalog

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

Specified by:
deleteCatalog in interface AdminProductMgrIf
Parameters:
catalogId -
Throws:
org.apache.torque.TorqueException
KKAdminException

getCatalogs

public 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

Specified by:
getCatalogs in interface AdminProductMgrIf
Parameters:
search -
offset -
size -
Returns:
Returns an AdminCatalogSearchResult object
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

insertCatalog

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

Specified by:
insertCatalog in interface AdminProductMgrIf
Parameters:
catalog -
Returns:
Returns the numeric id of the inserted catalog
Throws:
KKAdminException
org.apache.torque.TorqueException

updateCatalog

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

Specified by:
updateCatalog in interface AdminProductMgrIf
Parameters:
catalog -
Throws:
java.lang.Exception

getCatalogById

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

Specified by:
getCatalogById in interface AdminProductMgrIf
Parameters:
catalogId -
Returns:
Returns an AdminCatalog object
Throws:
java.lang.Exception

getCatalogCount

protected int getCatalogCount(com.konakart.bl.KKCriteria c)
                       throws org.apache.torque.TorqueException,
                              com.workingdogs.village.DataSetException,
                              KKAdminException
Get the number of catalogs

Parameters:
c -
Returns:
Returns the number of catalogs
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException

isCustomAttrAnOracleCLOB

public static boolean isCustomAttrAnOracleCLOB()
Is the custom_attrs column is an Oracle CLOB? We only check once and save the result in a static variable.

Returns:
the customAttrAnOracleCLOB

copyProductToStore

public 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:

Specified by:
copyProductToStore in interface AdminProductMgrIf
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

getProductIdFromUUIDAndStore

protected int getProductIdFromUUIDAndStore(java.lang.String uuid,
                                           java.lang.String storeId)
                                    throws org.apache.torque.TorqueException,
                                           com.workingdogs.village.DataSetException
Get the id of a product in a store based on its UUID

Parameters:
uuid -
storeId -
Returns:
Returns the id of the product. -1 if the product doesn't exist
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getMappedProductId

protected int getMappedProductId(int idFrom,
                                 java.lang.String storeIdTo)
                          throws org.apache.torque.TorqueException,
                                 com.workingdogs.village.DataSetException
Returns the idTo if the product exists in storeIdTo. Otherwise returns -1. We know it exists if there is a product in storeIdTo with the same UUID as the product with id = idFrom

Parameters:
idFrom -
storeIdTo -
Returns:
Returns the idTo if the product exists in storeIdTo. Otherwise returns -1.
Throws:
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

copyProductPrices

protected void copyProductPrices(AdminProduct prodFrom,
                                 AdminProduct prodTo)
                          throws KKAdminException
This copies the prices between two identical products. It is used to transfer catalog prices from one product to another product once the products have been copied.

Parameters:
prodFrom -
prodTo -
Throws:
KKAdminException

getProductsToSynchronize

public 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:

Specified by:
getProductsToSynchronize in interface AdminProductMgrIf
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.