public class AdminProductAttrMgr extends AdminBaseMgr implements AdminProdAttrMgrIf
AdminBaseMgr.StaticData
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
the log
|
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, debugStackTraceExclusions, kkAdminPropsFilePath, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
Constructor and Description |
---|
AdminProductAttrMgr(KKAdminIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
addProdAttrDescOrderBy(com.konakart.db.KKCriteria c,
AdminProdAttrDescSearch search)
Add order by constraints for AdminProdAttrDescs
|
protected int |
addProdAttrDescSearchCriteria(com.konakart.db.KKCriteria c,
AdminProdAttrDescSearch search)
Add search criteria for ProdAttrDescs
|
void |
addProdAttrDescsToTemplate(AdminProdAttrDesc[] attrDescs,
int templateId)
Add the array of ProdAttrDesc objects to the template.
|
protected void |
addProdAttrTemplateOrderBy(com.konakart.db.KKCriteria c,
AdminProdAttrTemplateSearch search)
Add order by constraints for AdminProdAttrTemplates
|
protected int |
addProdAttrTemplateSearchCriteria(com.konakart.db.KKCriteria c,
AdminProdAttrTemplateSearch search)
Add search criteria for ProdAttrTemplates
|
int |
deleteProdAttrDesc(int id)
Delete an AdminProdAttrDesc
|
int |
deleteProdAttrDescWithOptions(int id,
AdminProdAttrDescOptions options)
Delete an AdminProdAttrDesc
|
int |
deleteProdAttrTemplate(int id)
Delete an AdminProdAttrTemplate
|
AdminProdAttrDesc[] |
getCustomAttrsFromXML(java.lang.String xml)
Create an array of custom attributes from the XML
|
AdminProdAttrDesc |
getProdAttrDesc(int id)
Returns the AdminProdAttrDesc object for the
id parameter, or Null if the
AdminProdAttrDesc doesn't exist in the DB. |
protected int |
getProdAttrDescCount(AdminProdAttrDescSearch search)
Returns a count of the number of ProdAttrDescs
|
AdminProdAttrDescSearchResult |
getProdAttrDescs(AdminProdAttrDescSearch search,
int offset,
int size)
This returns an AdminProdAttrDescSearchResult object.
|
AdminProdAttrDesc[] |
getProdAttrDescsForTemplate(int templateId)
This method fetches all of the AdminProdAttrDesc objects for the template referenced by the
templateId parameter. |
AdminProdAttrDesc[] |
getProdAttrDescsForTemplates(AdminProdAttrTemplate[] templates)
This method fetches all of the AdminProdAttrDesc objects for the array of templates
referenced by the
templates parameter. |
AdminProdAttrTemplate |
getProdAttrTemplate(int id)
Returns the AdminProdAttrTemplate object for the
id parameter, or Null if the
AdminProdAttrTemplate doesn't exist in the DB. |
protected int |
getProdAttrTemplateCount(AdminProdAttrTemplateSearch search)
Returns a count of the number of ProdAttrTemplates
|
AdminProdAttrTemplateSearchResult |
getProdAttrTemplates(AdminProdAttrTemplateSearch search,
int offset,
int size)
This returns an AdminProdAttrTemplateSearchResult object.
|
AdminProdAttrTemplate[] |
getProdAttrTemplatesPerProduct(int productId)
Returns an array of custom attribute templates associated with the product
|
AdminProdAttrTemplate[] |
getProdAttrTemplatesPerProduct(int productId,
java.sql.Connection con)
Returns an array of custom attribute templates associated with the product
|
int |
getProductCountPerProdAttrDesc(int attrDescId)
Returns the number of products using the product attribute descriptor
|
int |
getProductCountPerTemplate(int templateId)
Returns the number of products using the custom product attribute template
|
int |
getTemplateCountPerProdAttrDesc(int attrDescId)
Returns the number of templates using the product attribute descriptor
|
java.lang.String |
getXMLFromCustomAttrs(AdminProdAttrDesc[] attrDescArray)
Create an XML structure for the custom attributes
|
int |
insertProdAttrDesc(AdminProdAttrDesc attrDesc)
An AdminProdAttrDesc object is inserted into the database.
|
int |
insertProdAttrTemplate(AdminProdAttrTemplate template)
An AdminProdAttrTemplate object is inserted into the database.
|
void |
removeProdAttrDescsFromTemplate(AdminProdAttrDesc[] attrDescs,
int templateId)
Remove an array of ProdAttrDesc objects from the template
|
protected void |
setProdAttrDescCriteriaWithStandardAttributes(com.konakart.db.KKCriteria c)
Common code to avoid duplication
|
protected void |
setProdAttrTemplateCriteriaWithStandardAttributes(com.konakart.db.KKCriteria c)
Common code to avoid duplication
|
int |
updateProdAttrDesc(AdminProdAttrDesc attrDesc)
Update an AdminProdAttrDesc object.
|
int |
updateProdAttrTemplate(AdminProdAttrTemplate template)
Update an AdminProdAttrTemplate object.
|
protected int |
updateProductsForDeletedProdAttrDesc(int attrDescId)
For each template, loop through the products and update the custom fields.
|
int |
updateProductsUsingProdAttrDesc(int attrDescId)
Loop through all templates containing the custom attribute.
|
int |
updateProductsUsingTemplates(int[] templateIds)
For each template, loop through the products and update the custom fields.
|
addInsertAttr, addInsertAttr, addStringRuleConstraint, addStringRuleConstraint, checkAPICallEnabled, checkIntInRange, checkIntIsSet, checkRequired, executeQuery, executeQuery, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminContentMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustPwdHistMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminEngineCacheMgr, getAdminEventMgr, getAdminExecuteMgr, getAdminFileMgr, getAdminFilterMgr, getAdminHtmlMgr, getAdminImportMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminMiscPriceMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminServletMgr, getAdminShipmentMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminSuggestionMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getDebugStackTraceExclusions, getEmailThreadGracefulShutdownTimeout, getExportMgr, getExportMgr, getExportXMLData, getIntFromString, getKkAdminPropsFilePath, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getNewCriteria, getNewCriteria, getOtherModuleByName, getPostSearchText, getPreSearchText, getProductsToCategoresCriteria, getPropertyValue, getPropertyValue, getPropertyValueAsBool, getPropertyValueAsInt, getPropertyValueAsLong, getRecordCount, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, insertKKEvent, insertKKEvent, isBusiness, isBusinessOrEnterprise, isCommunity, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareCustomersOrProducts, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, isUnix, isWindows, manageException, manageThrowable, refreshConfigs, removeCData, sendMQMessages, setAdminEng, setDebugStackTraceExclusions, setKkAdminPropsFilePath, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr, updateStaticVariablesNow
public AdminProductAttrMgr(KKAdminIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic int insertProdAttrDesc(AdminProdAttrDesc attrDesc) throws KKAdminException, org.apache.torque.TorqueException
insertProdAttrDesc
in interface AdminProdAttrMgrIf
attrDesc
- the attrDescKKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public int updateProdAttrDesc(AdminProdAttrDesc attrDesc) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
updateProdAttrDesc
in interface AdminProdAttrMgrIf
attrDesc
- An AdminProdAttrDesc objectKKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public int deleteProdAttrDesc(int id) throws KKAdminException, org.apache.torque.TorqueException
deleteProdAttrDesc
in interface AdminProdAttrMgrIf
id
- The id of the deleted AdminProdAttrDesc objectKKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public int deleteProdAttrDescWithOptions(int id, AdminProdAttrDescOptions options) throws KKAdminException, org.apache.torque.TorqueException
deleteProdAttrDescWithOptions
in interface AdminProdAttrMgrIf
id
- The id of the deleted AdminProdAttrDesc objectoptions
- Can be used to configure the operation to update all products to remove the
deleted attribute from the products using it.KKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public AdminProdAttrDesc getProdAttrDesc(int id) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
id
parameter, or Null if the
AdminProdAttrDesc doesn't exist in the DB.getProdAttrDesc
in interface AdminProdAttrMgrIf
id
- the idKKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public AdminProdAttrDesc[] getProdAttrDescsForTemplate(int templateId) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException
templateId
parameter.
An empty array is returned if no AdminProdAttrDesc objects exist.
getProdAttrDescsForTemplate
in interface AdminProdAttrMgrIf
templateId
- the templateIdorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public AdminProdAttrDesc[] getProdAttrDescsForTemplates(AdminProdAttrTemplate[] templates) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException
templates
parameter.
An empty array is returned if no AdminProdAttrDesc objects exist.
getProdAttrDescsForTemplates
in interface AdminProdAttrMgrIf
templates
- the templatesorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public AdminProdAttrDescSearchResult getProdAttrDescs(AdminProdAttrDescSearch search, int offset, int size) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getProdAttrDescs
in interface AdminProdAttrMgrIf
search
- the searchoffset
- the offset in the dbsize
- the number of records from the specified offsetcom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void addProdAttrDescOrderBy(com.konakart.db.KKCriteria c, AdminProdAttrDescSearch search)
c
- the csearch
- the searchprotected int getProdAttrDescCount(AdminProdAttrDescSearch search) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
search
- Search criteriaorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Engineprotected int addProdAttrDescSearchCriteria(com.konakart.db.KKCriteria c, AdminProdAttrDescSearch search)
c
- the csearch
- the searchprotected void setProdAttrDescCriteriaWithStandardAttributes(com.konakart.db.KKCriteria c)
c
- the cpublic int insertProdAttrTemplate(AdminProdAttrTemplate template) throws KKAdminException, org.apache.torque.TorqueException
insertProdAttrTemplate
in interface AdminProdAttrMgrIf
template
- the templateKKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public int updateProdAttrTemplate(AdminProdAttrTemplate template) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
updateProdAttrTemplate
in interface AdminProdAttrMgrIf
template
- An AdminProdAttrTemplate objectKKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public int deleteProdAttrTemplate(int id) throws KKAdminException, org.apache.torque.TorqueException
deleteProdAttrTemplate
in interface AdminProdAttrMgrIf
id
- The id of the deleted AdminProdAttrTemplate objectKKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public AdminProdAttrTemplate getProdAttrTemplate(int id) throws KKAdminException, org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
id
parameter, or Null if the
AdminProdAttrTemplate doesn't exist in the DB. If the Template contains an array of
ProdAttrDesc objects, these are also fetched from the DB.getProdAttrTemplate
in interface AdminProdAttrMgrIf
id
- the idKKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public AdminProdAttrTemplateSearchResult getProdAttrTemplates(AdminProdAttrTemplateSearch search, int offset, int size) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
getProdAttrTemplates
in interface AdminProdAttrMgrIf
search
- the searchoffset
- the offset in the dbsize
- the number of records from the specified offsetcom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Enginepublic AdminProdAttrTemplate[] getProdAttrTemplatesPerProduct(int productId) throws KKAdminException, com.workingdogs.village.DataSetException, org.apache.torque.TorqueException
getProdAttrTemplatesPerProduct
in interface AdminProdAttrMgrIf
productId
- the productIdKKAdminException
- unexpected exception in the KonaKart Admin Enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public AdminProdAttrTemplate[] getProdAttrTemplatesPerProduct(int productId, java.sql.Connection con) throws KKAdminException, com.workingdogs.village.DataSetException, org.apache.torque.TorqueException
getProdAttrTemplatesPerProduct
in interface AdminProdAttrMgrIf
productId
- the productIdcon
- Connection for transactionKKAdminException
- unexpected exception in the KonaKart Admin Enginecom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)org.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)protected void addProdAttrTemplateOrderBy(com.konakart.db.KKCriteria c, AdminProdAttrTemplateSearch search)
c
- the csearch
- the searchprotected int getProdAttrTemplateCount(AdminProdAttrTemplateSearch search) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
search
- Search criteriaorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)com.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Engineprotected int addProdAttrTemplateSearchCriteria(com.konakart.db.KKCriteria c, AdminProdAttrTemplateSearch search)
c
- the csearch
- the searchprotected void setProdAttrTemplateCriteriaWithStandardAttributes(com.konakart.db.KKCriteria c)
c
- the cpublic void addProdAttrDescsToTemplate(AdminProdAttrDesc[] attrDescs, int templateId) throws org.apache.torque.TorqueException, KKAdminException
addProdAttrDescsToTemplate
in interface AdminProdAttrMgrIf
attrDescs
- the attrDescstemplateId
- the templateIdorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Enginepublic void removeProdAttrDescsFromTemplate(AdminProdAttrDesc[] attrDescs, int templateId) throws org.apache.torque.TorqueException, KKAdminException
removeProdAttrDescsFromTemplate
in interface AdminProdAttrMgrIf
attrDescs
- the attrDescstemplateId
- the templateIdorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Enginepublic int getTemplateCountPerProdAttrDesc(int attrDescId) throws com.workingdogs.village.DataSetException, KKAdminException, org.apache.torque.TorqueException
getTemplateCountPerProdAttrDesc
in interface AdminProdAttrMgrIf
attrDescId
- the attrDescIdcom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public int getProductCountPerProdAttrDesc(int attrDescId) throws com.workingdogs.village.DataSetException, KKAdminException, org.apache.torque.TorqueException
getProductCountPerProdAttrDesc
in interface AdminProdAttrMgrIf
attrDescId
- the attrDescIdcom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public int updateProductsUsingProdAttrDesc(int attrDescId) throws java.lang.Exception
updateProductsUsingProdAttrDesc
in interface AdminProdAttrMgrIf
attrDescId
- the attrDescIdjava.lang.Exception
- an unexpected exceptionpublic int updateProductsUsingTemplates(int[] templateIds) throws java.lang.Exception
updateProductsUsingTemplates
in interface AdminProdAttrMgrIf
templateIds
- the templateIdsjava.lang.Exception
- an unexpected exceptionprotected int updateProductsForDeletedProdAttrDesc(int attrDescId) throws java.lang.Exception
attrDescId
- the attrDescIdjava.lang.Exception
- an unexpected exceptionpublic int getProductCountPerTemplate(int templateId) throws com.workingdogs.village.DataSetException, KKAdminException, org.apache.torque.TorqueException
getProductCountPerTemplate
in interface AdminProdAttrMgrIf
templateId
- the templateIdcom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public java.lang.String getXMLFromCustomAttrs(AdminProdAttrDesc[] attrDescArray)
getXMLFromCustomAttrs
in interface AdminProdAttrMgrIf
attrDescArray
- Array of custom attributespublic AdminProdAttrDesc[] getCustomAttrsFromXML(java.lang.String xml)
getCustomAttrsFromXML
in interface AdminProdAttrMgrIf
xml
- The custom attribute data in xml formatCopyright © 2018 DS Data Systems UK Ltd.