|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.bl.AdminBaseMgr
com.konakartadmin.bl.AdminProductMgr
public class AdminProductMgr
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
public static final int DONT_INCLUDE
public static final int UP_SELL
public static final int CROSS_SELL
public static final int ACCESSORY
public static final int DEPENDENT_ITEM
public static final int BUNDLED_PRODUCTS
public static final int DIGITAL_DOWNLOAD
public static final int GIFT_CERTIFICATE_PRODUCT_TYPE
public static final int BOOKABLE_PRODUCT_TYPE
public static java.lang.Boolean customAttrAnOracleCLOB
Constructor Detail |
---|
public AdminProductMgr(KKAdminIf eng) throws java.lang.Exception
eng
- KKAdmin engine
java.lang.Exception
Method Detail |
---|
public int insertProduct(AdminProduct product) throws java.lang.Exception
insertProduct
in interface AdminProductMgrIf
product
-
java.lang.Exception
public int insertProductWithOptions(AdminProduct product, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
insertProductWithOptions
in interface AdminProductMgrIf
product
- mgrOptions
-
java.lang.Exception
protected int insertProductWithOptions(AdminProduct product, AdminProductMgrOptions mgrOptions, boolean setMasterDate, boolean manageSolr, java.lang.String storeId, java.sql.Connection con) throws java.lang.Exception
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 SOLRstoreId
- The store where to insert the productcon
-
java.lang.Exception
protected void insertProductIntoExternalSystems(AdminProduct product, boolean manageSolr) throws java.lang.Exception
product
- the product to insertmanageSolr
- If false, then inserts are not replicated in SOLR
java.lang.Exception
public int insertSpecial(AdminSpecial special) throws java.lang.Exception
insertSpecial
in interface AdminProductMgrIf
special
-
java.lang.Exception
protected int insertSpecial(AdminSpecial special, java.sql.Connection con) throws java.lang.Exception
special
- con
-
java.lang.Exception
public void editSpecial(AdminSpecial special) throws java.lang.Exception
editSpecial
in interface AdminProductMgrIf
special
-
java.lang.Exception
protected void editSpecial(AdminSpecial special, java.sql.Connection con) throws java.lang.Exception
special
- con
-
java.lang.Exception
public void editProduct(AdminProduct product) throws java.lang.Exception
editProduct
in interface AdminProductMgrIf
product
-
java.lang.Exception
public void editProductWithOptions(AdminProduct product, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
editProductWithOptions
in interface AdminProductMgrIf
product
- mgrOptions
-
java.lang.Exception
protected void editProductWithOptions(AdminProduct product, AdminProductMgrOptions mgrOptions, boolean setMasterDate, boolean allStores, boolean manageSolr, java.sql.Connection con) throws java.lang.Exception
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 storemanageSolr
- If false, then inserts are not replicated in SOLRcon
-
java.lang.Exception
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
product
- con
- selectC
- deleteC
- updateC
- insertC
- mgrOptions
-
java.lang.Exception
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
product
- con
- selectC
- deleteC
- updateC
- insertC
- mgrOptions
-
java.lang.Exception
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
product
- con
- selectC
- deleteC
- updateC
- insertC
- mgrOptions
-
java.lang.Exception
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
product
- con
- selectC
- deleteC
- insertC
-
java.lang.Exception
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
product
- con
- selectC
- deleteC
- updateC
- insertC
-
java.lang.Exception
protected void updateProductInExternalSystems(AdminProduct product, boolean manageSolr) throws java.lang.Exception
product
- the product to updatemanageSolr
- If false, then updates are not replicated in SOLR
java.lang.Exception
protected void validateProduct(AdminProduct product) throws java.lang.Exception
product
- the product to validate
java.lang.Exception
protected void validateSpecial(AdminSpecial special, boolean checkProduct) throws java.lang.Exception
special
- checkProduct
-
java.lang.Exception
public boolean doesProductExist(int productId) throws org.apache.torque.TorqueException, KKAdminException
doesProductExist
in interface AdminProductMgrIf
productId
-
org.apache.torque.TorqueException
KKAdminException
public AdminProduct getProduct(int productId) throws java.lang.Exception
getProduct
in interface AdminProductMgrIf
productId
-
java.lang.Exception
public AdminProduct getProductWithOptions(int productId, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
getProductWithOptions
in interface AdminProductMgrIf
productId
- mgrOptions
-
java.lang.Exception
protected AdminProduct getProduct(int productId, boolean getBundleQuantity) throws java.lang.Exception
productId
- getBundleQuantity
- When set to true we calculate the quantity of a product if it is a bundle
java.lang.Exception
public AdminProduct getProduct(int productId, boolean getBundleQuantity, AdminProductMgrOptions mgrOptions, boolean allStores) throws java.lang.Exception
getProduct
in interface AdminProductMgrIf
productId
- getBundleQuantity
- When set to true we calculate the quantity of a product if it is a bundlemgrOptions
- allStores
- When set to true we don't put in the store constraints in multi store shared
product mode
java.lang.Exception
public AdminSpecial getSpecial(int specialId) throws java.lang.Exception
getSpecial
in interface AdminProductMgrIf
specialId
-
java.lang.Exception
protected AdminSpecial getSpecialForProductId(int productId) throws java.lang.Exception
productId
-
java.lang.Exception
protected AdminSpecial getSpecialForSpecialOrProductId(int specialId, int productId) throws java.lang.Exception
specialId
- Used if greater than 0productId
- Used if greater than 0
java.lang.Exception
protected boolean doesSpecialExist(int productId) throws java.lang.Exception
productId
-
java.lang.Exception
public void deleteSpecial(int specialId) throws java.lang.Exception
deleteSpecial
in interface AdminProductMgrIf
specialId
-
java.lang.Exception
public void deleteProduct(int productId) throws java.lang.Exception
deleteProduct
in interface AdminProductMgrIf
productId
-
java.lang.Exception
protected void removeProductFromExternalSystems(int productId) throws KKAdminException
productId
- the Id of the product to remove
KKAdminException
public AdminProducts getProductsPerCategory(AdminDataDescriptor dataDesc, int categoryId, int languageId) throws java.lang.Exception
AdminProductMgrIf
getProductsPerCategory
in interface AdminProductMgrIf
dataDesc
- categoryId
- languageId
-
java.lang.Exception
public AdminProducts getProductsPerCategoryWithOptions(AdminDataDescriptor dataDesc, int categoryId, int languageId, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
AdminProductMgrIf
getProductsPerCategoryWithOptions
in interface AdminProductMgrIf
dataDesc
- categoryId
- languageId
- mgrOptions
-
java.lang.Exception
public AdminProducts getProductsPerManufacturerWithOptions(AdminDataDescriptor dataDesc, int manufacturerId, int languageId, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
AdminProductMgrIf
getProductsPerManufacturerWithOptions
in interface AdminProductMgrIf
dataDesc
- manufacturerId
- languageId
- mgrOptions
-
java.lang.Exception
public AdminProducts getProductsPerManufacturer(AdminDataDescriptor dataDesc, int manufacturerId, int languageId) throws java.lang.Exception
AdminProductMgrIf
getProductsPerManufacturer
in interface AdminProductMgrIf
dataDesc
- manufacturerId
- languageId
-
java.lang.Exception
protected AdminProducts getProductsAllCasesWithOptions(AdminDataDescriptor dataDesc, int categoryId, int languageId, int manufacturerId, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
dataDesc
- categoryId
- languageId
- manufacturerId
- mgrOptions
-
java.lang.Exception
public AdminProducts searchForProducts(AdminDataDescriptor dataDesc, AdminProductSearch prodSearch, int languageId) throws java.lang.Exception
searchForProducts
in interface AdminProductMgrIf
dataDesc
- prodSearch
- languageId
-
java.lang.Exception
public AdminProducts searchForProductsWithOptions(AdminDataDescriptor dataDesc, AdminProductSearch prodSearch, int languageId, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
searchForProductsWithOptions
in interface AdminProductMgrIf
dataDesc
- prodSearch
- languageId
- mgrOptions
-
java.lang.Exception
protected AdminProducts searchForProductsPrivateWithOptions(AdminDataDescriptor dataDesc, AdminProductSearch prodSearch, java.util.ArrayList<java.lang.Integer> prodIdList, int languageId, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
dataDesc
- prodSearch
- prodIdList
- If not null, it must contain a list of productIds which will be added to an IN
clause.languageId
- mgrOptions
-
java.lang.Exception
protected java.lang.String getCustomAttrs(int productId) throws java.lang.Exception
productId
-
java.lang.Exception
protected void setCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c, int languageId, AdminProductMgrOptions options, AdminDataDescriptor dataDesc) throws KKAdminException
c
- languageId
- options
-
KKAdminException
protected void setCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c, int languageId, boolean manuOuterJoin, boolean catOuterJoin, AdminProductMgrOptions options, AdminDataDescriptor dataDesc) throws KKAdminException
c
- languageId
- manuOuterJoin
- catOuterJoin
- options
-
KKAdminException
protected void setProductsSharedCriteria(com.konakart.bl.KKCriteria c) throws KKAdminException
c
-
KKAdminException
protected void setProductsSharedCriteria(com.konakart.bl.KKCriteria c, boolean addSelectPriceId) throws KKAdminException
c
- addSelectPriceId
- if true BaseProductToStoresPeer.PRICE_ID and custom fields will be added as select
columns
KKAdminException
protected void setExtPriceProductCriteria(com.konakart.bl.KKCriteria c, AdminProductMgrOptions options)
c
- options
- protected void setExtQuantityProductCriteria(com.konakart.bl.KKCriteria c, AdminProductMgrOptions options)
c
- options
- protected void setProductAttributeCriteria(com.konakart.bl.KKCriteria c, int langId)
c
- langId
- protected void manageDataDescriptor(AdminDataDescriptor dataDesc, com.konakart.bl.KKCriteria c, java.lang.String price)
dataDesc
- c
- price
- protected int getCount(com.konakart.bl.KKCriteria c, boolean fixQuery) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
c
- fixQuery
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public void deleteProductsPerCategory(int categoryId) throws java.lang.Exception
deleteProductsPerCategory
in interface AdminProductMgrIf
categoryId
-
java.lang.Exception
public void deleteDirectProductsPerCategory(int categoryId) throws java.lang.Exception
deleteDirectProductsPerCategory
in interface AdminProductMgrIf
categoryId
-
java.lang.Exception
public void deleteProductsPerManufacturer(int manufacturerId) throws java.lang.Exception
deleteProductsPerManufacturer
in interface AdminProductMgrIf
manufacturerId
-
java.lang.Exception
public AdminProducts getAllSpecials(AdminDataDescriptor dataDesc, int languageId) throws java.lang.Exception
AdminProductMgrIf
getAllSpecials
in interface AdminProductMgrIf
dataDesc
- languageId
-
java.lang.Exception
public AdminProducts getSpecialsPerCategory(AdminDataDescriptor dataDesc, int categoryId, boolean searchInSubCats, int languageId) throws java.lang.Exception
AdminProductMgrIf
getSpecialsPerCategory
in interface AdminProductMgrIf
dataDesc
- categoryId
- searchInSubCats
- languageId
-
java.lang.Exception
public AdminProductOption[] getAllProductOptions(int languageId) throws java.lang.Exception
AdminProductMgrIf
getAllProductOptions
in interface AdminProductMgrIf
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
java.lang.Exception
public AdminProductOptionSearchResult getProductOptions(AdminProductOptionSearch search, int offset, int size) throws java.lang.Exception
getProductOptions
in interface AdminProductMgrIf
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 dbsize
- the number of records from the specified offset
java.lang.Exception
public AdminProductOptionValue[] getAllProductOptionValues(int languageId) throws java.lang.Exception
getAllProductOptionValues
in interface AdminProductMgrIf
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
java.lang.Exception
public AdminProductOptionValue[] getProductOptionValuesPerOption(int productOptionId, int languageId) throws java.lang.Exception
getProductOptionValuesPerOption
in interface AdminProductMgrIf
productOptionId
- languageId
-
java.lang.Exception
public AdminProductOptionValue[] getProductOptionValuesPerName(java.lang.String name, int languageId) throws java.lang.Exception
getProductOptionValuesPerName
in interface AdminProductMgrIf
name
- product option value namelanguageId
- language id (can use AdminLanguageMgr.DEFAULT_LANG to get the default language)
java.lang.Exception
public AdminProductAttribute[] getProductAttributesPerProduct(int productId) throws java.lang.Exception
getProductAttributesPerProduct
in interface AdminProductMgrIf
productId
-
java.lang.Exception
protected AdminProductAttribute[] getProductAttributesPerProduct(int productId, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
productId
- mgrOptions
-
java.lang.Exception
public AdminTierPrice[] getTierPricesPerProduct(int productId, AdminProductMgrOptions mgrOptions) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
productId
- mgrOptions
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public void deleteProductAttribute(int productAttributeId) throws java.lang.Exception
deleteProductAttribute
in interface AdminProductMgrIf
productAttributeId
-
java.lang.Exception
public void deleteProductAttributesPerProduct(int productId) throws java.lang.Exception
deleteProductAttributesPerProduct
in interface AdminProductMgrIf
productId
-
java.lang.Exception
public void editProductAttribute(AdminProductAttribute prodAttr) throws java.lang.Exception
editProductAttribute
in interface AdminProductMgrIf
prodAttr
-
java.lang.Exception
public int insertProductAttribute(AdminProductAttribute prodAttr) throws java.lang.Exception
insertProductAttribute
in interface AdminProductMgrIf
prodAttr
-
java.lang.Exception
public void deleteProductOptions(int productOptionId) throws java.lang.Exception
deleteProductOptions
in interface AdminProductMgrIf
productOptionId
-
java.lang.Exception
public void deleteProductOptionValues(int productOptionValueId) throws java.lang.Exception
deleteProductOptionValues
in interface AdminProductMgrIf
productOptionValueId
-
java.lang.Exception
public AdminProductOption[] getProductOptionsPerId(int productOptionId) throws com.workingdogs.village.DataSetException, org.apache.torque.TorqueException, KKAdminException
getProductOptionsPerId
in interface AdminProductMgrIf
productOptionId
-
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException
public AdminProductOption[] getProductOptionsPerName(java.lang.String name, int langId) throws KKAdminException
getProductOptionsPerName
in interface AdminProductMgrIf
name
- Product Option NamelangId
- Language Id
KKAdminException
public AdminProductOptionValue[] getProductOptionValuesPerId(int productOptionValueId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getProductOptionValuesPerId
in interface AdminProductMgrIf
productOptionValueId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public int insertProductOptions(AdminProductOption[] productOptions) throws java.lang.Exception
insertProductOptions
in interface AdminProductMgrIf
productOptions
-
java.lang.Exception
public void insertProductOption(AdminProductOption productOption) throws java.lang.Exception
insertProductOption
in interface AdminProductMgrIf
productOption
-
java.lang.Exception
public void editProductOption(AdminProductOption productOption) throws java.lang.Exception
editProductOption
in interface AdminProductMgrIf
productOption
-
java.lang.Exception
public int insertProductOptionValues(AdminProductOptionValue[] productOptionValues, int productOptionId) throws java.lang.Exception
insertProductOptionValues
in interface AdminProductMgrIf
productOptionValues
- productOptionId
-
java.lang.Exception
public int insertProductsOptionsValuesToProductsOptions(AdminProdOptionValToProdOption prodOptValToProdOpt) throws java.lang.Exception
insertProductsOptionsValuesToProductsOptions
in interface AdminProductMgrIf
prodOptValToProdOpt
- a AdminProdOptionValToProdOption object to insert. The optionId and optionValueId
defined in the object must be valid otherwise an exception is thrown.
java.lang.Exception
public AdminProdOptionValToProdOption[] getProductOptionValueToProductOptions(AdminProdOptionValToProdOption prodOptValToProdOpt) throws java.lang.Exception
getProductOptionValueToProductOptions
in interface AdminProductMgrIf
prodOptValToProdOpt
- the AdminProdOptionValToProdOption to look up. Only uses the optionId and
OptionValueId in this object
java.lang.Exception
public void editProductOptionValue(AdminProductOptionValue productOptionValue) throws java.lang.Exception
editProductOptionValue
in interface AdminProductMgrIf
productOptionValue
-
java.lang.Exception
protected void validateProductOption(AdminProductOption productOption) throws java.lang.Exception
productOption
-
java.lang.Exception
protected void validateProductQuantity(AdminProductQuantity productQuantity) throws java.lang.Exception
productQuantity
-
java.lang.Exception
protected void validateProductAttribute(AdminProductAttribute productAttr, boolean testProdId) throws java.lang.Exception
productAttr
- testProdId
-
java.lang.Exception
protected void validateTierPrices(AdminTierPrice[] tierPrices) throws java.lang.Exception
tierPrices
-
java.lang.Exception
protected void validateProductOptionValue(AdminProductOptionValue productOptionValue) throws java.lang.Exception
productOptionValue
-
java.lang.Exception
protected void validateProdOptionValToProdOption(AdminProdOptionValToProdOption productOptionValueToProductOption) throws java.lang.Exception
productOptionValueToProductOption
-
java.lang.Exception
public int getNextProductOptionId() throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getNextProductOptionId
in interface AdminProductMgrIf
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public int getNextProductOptionValuesId() throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getNextProductOptionValuesId
in interface AdminProductMgrIf
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
protected void formatProductPrices(AdminProduct product) throws java.lang.Exception
product
-
java.lang.Exception
public AdminProducts getRelatedProducts(AdminDataDescriptor dataDesc, int productId, int relationType, int languageId) throws java.lang.Exception
getRelatedProducts
in interface AdminProductMgrIf
dataDesc
- productId
- relationType
- languageId
-
java.lang.Exception
public AdminProducts getRelatedProductsWithOptions(AdminDataDescriptor dataDesc, int productId, int relationType, int languageId, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
getRelatedProductsWithOptions
in interface AdminProductMgrIf
dataDesc
- productId
- relationType
- languageId
- mgrOptions
-
java.lang.Exception
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
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
-
java.lang.Exception
protected java.lang.String createEncodedProductIdFromProductQuantityEncodedKey(int productId, java.lang.String productQuantityEncodedKey)
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.
productId
- productQuantityEncodedKey
-
public void removeRelatedProducts(int productId, int relationType) throws java.lang.Exception
removeRelatedProducts
in interface AdminProductMgrIf
productId
- relationType
-
java.lang.Exception
public void addRelatedProducts(AdminProduct[] products, int productId, int relationType) throws org.apache.torque.TorqueException, KKAdminException
addRelatedProducts
in interface AdminProductMgrIf
products
- productId
- relationType
-
org.apache.torque.TorqueException
KKAdminException
protected AdminProductQuantity[] getProductQuantitiesPerSKU(java.lang.String sku, int rule) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
sku
- rule
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
protected AdminProductQuantity[] getProductQuantitiesPerProduct(int productId, AdminProductAttribute[] prodAttrs, AdminProductMgrOptions mgrOptions) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
productId
- mgrOptions
- prodAttrs
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public java.lang.String[] getSkus(AdminOrderProduct[] orderProds) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
getSkus
in interface AdminProductMgrIf
orderProds
-
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException
public java.lang.String getSku(AdminOrderProduct orderProd) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
getSku
in interface AdminProductMgrIf
orderProd
-
KKAdminException
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
protected java.lang.String getSku(int productId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
productId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
protected java.lang.String createProductQuantityEncodedKeyFromOptions(AdminOption[] opts)
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.
opts
-
public void insertDigitalDownload(int customerId, int productId) throws java.lang.Exception
insertDigitalDownload
in interface AdminProductMgrIf
customerId
- productId
-
java.lang.Exception
public int insertGiftCertificateDigitalDownload(int customerId, int productId, java.lang.String filePath) throws java.lang.Exception
insertGiftCertificateDigitalDownload
in interface AdminProductMgrIf
customerId
- productId
- filePath
-
java.lang.Exception
protected int getMaxDownloadDays(AdminProduct prod) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException, java.lang.Exception
prod
-
java.lang.Exception
KKAdminException
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
protected java.util.Date getExpiryDate(int maxDownloadDays)
maxDownloadDays
-
protected int getMaxNumDownloads(AdminProduct prod) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException, java.lang.Exception
prod
-
java.lang.Exception
KKAdminException
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
protected AdminProduct validateDigitalDownload(int productId) throws java.lang.Exception
productId
-
java.lang.Exception
- Returns an exception if the product does not exist or is not a digital download
or gift certificate product.protected AdminDigitalDownload getDigitalDownload(int customerId, int productId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
customerId
- productId
-
org.apache.torque.TorqueException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public void setDigitalDownloadCriteria(org.apache.torque.util.Criteria c)
setDigitalDownloadCriteria
in interface AdminProductMgrIf
c
- public AdminProduct getBundleProductDetails(int bundleId, AdminProduct[] bundledProductsArray, AdminDiscount discount) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
getBundleProductDetails
in interface AdminProductMgrIf
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
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
protected void setBundleQuantity(AdminProduct prod) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
prod
-
java.lang.Exception
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
public AdminMiscItem[] getMiscItems(int productId) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException, java.lang.Exception
productId
-
java.lang.Exception
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException
public AdminMiscItem[] getMiscItems(AdminSearch search) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException, java.lang.Exception
search
-
java.lang.Exception
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException
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
search
-
java.lang.Exception
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException
protected java.math.BigDecimal[] getPriceFromEncodedOptions(int productId, java.lang.String encodedOptionValues) throws java.lang.NumberFormatException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
productId
- encodedOptionValues
-
java.lang.NumberFormatException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
protected AdminProductAttribute getProductAttribute(int productId, int optionId, int optionValueId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
productId
- optionId
- optionValueId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public void setProductQuantity(java.lang.String sku, int id, int quantity, int operation) throws java.lang.Exception
setProductQuantity
in interface AdminProductMgrIf
sku
- id
- quantity
- operation
-
java.lang.Exception
public void setProductQuantityWithOptions(java.lang.String sku, int id, int quantity, int operation, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
setProductQuantityWithOptions
in interface AdminProductMgrIf
sku
- id
- quantity
- operation
- mgrOptions
-
java.lang.Exception
public int getProductQuantity(java.lang.String sku, int id) throws java.lang.Exception
AdminProductMgrIf
getProductQuantity
in interface AdminProductMgrIf
sku
- id
-
java.lang.Exception
public int getProductQuantityWithOptions(java.lang.String sku, int id, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
AdminProductMgrIf
getProductQuantityWithOptions
in interface AdminProductMgrIf
sku
- id
- mgrOptions
-
java.lang.Exception
public void setProductAvailability(java.lang.String sku, int id, java.util.Calendar dateAvailable) throws java.lang.Exception
setProductAvailability
in interface AdminProductMgrIf
sku
- id
- dateAvailable
-
java.lang.Exception
public void setProductAvailabilityWithOptions(java.lang.String sku, int id, java.util.Calendar dateAvailable, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
setProductAvailabilityWithOptions
in interface AdminProductMgrIf
sku
- id
- dateAvailable
- mgrOptions
-
java.lang.Exception
public java.util.Calendar getProductAvailability(java.lang.String sku, int id) throws java.lang.Exception
AdminProductMgrIf
getProductAvailability
in interface AdminProductMgrIf
sku
- id
-
java.lang.Exception
public java.util.Calendar getProductAvailabilityWithOptions(java.lang.String sku, int id, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
AdminProductMgrIf
getProductAvailabilityWithOptions
in interface AdminProductMgrIf
sku
- id
- mgrOptions
-
java.lang.Exception
protected int getNewQuantity(int currentQuantity, int newQuantity, int operation)
currentQuantity
- newQuantity
- operation
-
public void insertProductOptionValue(AdminProductOptionValue productOptionValue, int productOptionId) throws java.lang.Exception
insertProductOptionValue
in interface AdminProductMgrIf
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.
java.lang.Exception
public AdminProductToStore[] getProductsToStores(AdminDataDescriptor dataDesc, AdminSearch search) throws java.lang.Exception
AdminProductMgrIf
getProductsToStores
in interface AdminProductMgrIf
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_DESCENDINGsearch
- 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).
java.lang.Exception
protected void manageProductToStoreDataDescriptor(AdminDataDescriptor dataDesc, com.konakart.bl.KKCriteria c)
dataDesc
- c
- public void insertProductsToStores(AdminProductToStore[] productToStores) throws java.lang.Exception
AdminProductMgrIf
insertProductsToStores
in interface AdminProductMgrIf
productToStores
- an array of AdminProductToStore objects to insert into the database
java.lang.Exception
public void removeProductsToStores(AdminProductToStore[] productToStores) throws java.lang.Exception
AdminProductMgrIf
removeProductsToStores
in interface AdminProductMgrIf
productToStores
- an array of AdminProductToStore objects to delete from the database
java.lang.Exception
public AdminDigitalDownloadSearchResult searchDigitalDownloads(AdminDigitalDownloadSearch search, int offset, int size) throws java.lang.Exception
AdminProductMgrIf
searchDigitalDownloads
in interface AdminProductMgrIf
search
- search definition for digital downloadsoffset
- offset in results (for paging)size
- maximum number of records to return from the offset (for paging)
java.lang.Exception
protected int addDigitalDownloadSearchCriteria(com.konakart.bl.KKCriteria c, AdminDigitalDownloadSearch search)
c
- search
-
protected void addDigitalDownloadOrderBy(com.konakart.bl.KKCriteria c, AdminDigitalDownloadSearch search)
c
- search
- public int importDigitalDownload(AdminDigitalDownload digDownload) throws java.lang.Exception
AdminProductMgrIf
importDigitalDownload
in interface AdminProductMgrIf
digDownload
- the Digital Download object to import
java.lang.Exception
- if the digital download record specified is invalid or there are database
problemsprotected boolean doesExtPriceExist(int productId, int prodAttrId, int tierPriceId, java.lang.String catalogId, com.konakart.bl.KKCriteria selectC) throws org.apache.torque.TorqueException
productId
- prodAttrId
- tierPriceId
- catalogId
- selectC
-
org.apache.torque.TorqueException
protected void insertExtPrice(AdminProduct product, java.lang.String catalogId, com.konakart.bl.KKCriteria insertC, java.sql.Connection con) throws org.apache.torque.TorqueException
product
- catalogId
- insertC
- con
-
org.apache.torque.TorqueException
protected void insertExtProdAttrPrice(AdminProductAttribute prodAttr, java.lang.String catalogId, com.konakart.bl.KKCriteria insertC, java.sql.Connection con) throws org.apache.torque.TorqueException
prodAttr
- catalogId
- insertC
- con
-
org.apache.torque.TorqueException
protected void insertExtTierPrice(AdminTierPrice tierPrice, java.lang.String catalogId, com.konakart.bl.KKCriteria insertC, java.sql.Connection con) throws org.apache.torque.TorqueException
tierPrice
- catalogId
- insertC
- con
-
org.apache.torque.TorqueException
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
product
- catalogId
- selectC
- updateC
- con
-
org.apache.torque.TorqueException
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
prodAttr
- catalogId
- selectC
- updateC
- con
-
org.apache.torque.TorqueException
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
tierPrice
- catalogId
- selectC
- updateC
- con
-
org.apache.torque.TorqueException
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
productId
- prodAttrId
- tierPriceId
- catalogId
- deleteC
- con
-
org.apache.torque.TorqueException
protected boolean doesExtQuantityExist(int productId, java.lang.String encodedOptionValues, java.lang.String catalogId, com.konakart.bl.KKCriteria selectC) throws org.apache.torque.TorqueException
productId
- encodedOptionValues
- catalogId
- selectC
-
org.apache.torque.TorqueException
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
prodQ
- catalogId
- setQuantity
- setDate
- insertC
- con
-
org.apache.torque.TorqueException
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
prodQ
- catalogId
- setQuantity
- setDate
- selectC
- updateC
- con
-
org.apache.torque.TorqueException
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
productId
- encodedOptionValues
- catalogId
- deleteC
- con
-
org.apache.torque.TorqueException
protected boolean useExternalPrices(AdminProductMgrOptions mgrOptions)
mgrOptions
-
protected boolean useExternalQuantity(AdminProductMgrOptions mgrOptions)
mgrOptions
-
protected void setProductOptionCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
c
- protected void setProductOptionValueCriteriaWithStandardAttributes(com.konakart.bl.KKCriteria c)
c
- protected int getProductOptionCount(AdminProductOptionSearch search, int languageId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
search
- Search criterialanguageId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
protected int addProductOptionSearchCriteria(com.konakart.bl.KKCriteria c, AdminProductOptionSearch search, int langId)
c
- search
- langId
-
protected void addProductOptionOrderBy(com.konakart.bl.KKCriteria c, AdminProductOptionSearch search)
c
- search
- public void deleteCatalog(int catalogId) throws org.apache.torque.TorqueException, KKAdminException
deleteCatalog
in interface AdminProductMgrIf
catalogId
-
org.apache.torque.TorqueException
KKAdminException
public AdminCatalogSearchResult getCatalogs(AdminCatalogSearch search, int offset, int size) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getCatalogs
in interface AdminProductMgrIf
search
- offset
- size
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public int insertCatalog(AdminCatalog catalog) throws KKAdminException, org.apache.torque.TorqueException
insertCatalog
in interface AdminProductMgrIf
catalog
-
KKAdminException
org.apache.torque.TorqueException
public void updateCatalog(AdminCatalog catalog) throws java.lang.Exception
updateCatalog
in interface AdminProductMgrIf
catalog
-
java.lang.Exception
public AdminCatalog getCatalogById(int catalogId) throws java.lang.Exception
getCatalogById
in interface AdminProductMgrIf
catalogId
-
java.lang.Exception
protected int getCatalogCount(com.konakart.bl.KKCriteria c) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
c
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
public static boolean isCustomAttrAnOracleCLOB()
public int copyProductToStore(int productId, java.lang.String storeIdFrom, java.lang.String storeIdTo, AdminCopyProductOptions options) throws java.lang.Exception
copyProductToStore
in interface AdminProductMgrIf
productId
- The numeric id of the product to copystoreIdFrom
- The id of the source storestoreIdTo
- The id of the destination storeoptions
- Options to configure the copy operation
java.lang.Exception
protected int getProductIdFromUUIDAndStore(java.lang.String uuid, java.lang.String storeId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
uuid
- storeId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected int getMappedProductId(int idFrom, java.lang.String storeIdTo) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
idFrom
- storeIdTo
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected void copyProductPrices(AdminProduct prodFrom, AdminProduct prodTo) throws KKAdminException
prodFrom
- prodTo
-
KKAdminException
public AdminProducts getProductsToSynchronize(java.lang.String storeIdFrom, java.lang.String storeIdTo, AdminDataDescriptor dataDesc, int languageId, AdminSynchProductsOptions options, AdminProductMgrOptions mgrOptions) throws java.lang.Exception
getProductsToSynchronize
in interface AdminProductMgrIf
storeIdFrom
- The id of the source storestoreIdTo
- The id of the destination storedataDesc
- 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 languageoptions
- 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.
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |