public class AdminProductBatchMgr extends AdminBatchBaseMgr
Modifier and Type | Class and Description |
---|---|
private class |
AdminProductBatchMgr.SolrProductSender
Purpose of object is to send a product to Solr.
|
AdminBatchBaseMgr.CustTagCounter
AdminBaseMgr.StaticData
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CHANGEFREQ |
private static java.lang.String |
CHANGEFREQ_END |
private static java.lang.String |
HEADER |
private static java.lang.String |
IMAGE |
private static java.lang.String |
IMAGE_END |
private static java.lang.String |
IMAGE_LOC |
private static java.lang.String |
IMAGE_LOC_END |
private static java.lang.String |
IMAGE_TITLE |
private static java.lang.String |
IMAGE_TITLE_END |
private static java.lang.String |
LASTMOD |
private static java.lang.String |
LASTMOD_END |
private static java.lang.String |
LOC |
private static java.lang.String |
LOC_END |
private static java.lang.String |
PRIORITY |
private static java.lang.String |
PRIORITY_END |
private static java.lang.String |
SITEMAP |
private static java.lang.String |
SITEMAP_END |
private static java.lang.String |
SITEMAPINDEX |
private static java.lang.String |
SITEMAPINDEX_END |
private static java.lang.String |
URL |
private static java.lang.String |
URL_END |
private static java.lang.String |
URLSET |
private static java.lang.String |
URLSET_END |
private static java.lang.String |
URLSET_PROD |
log
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, debugStackTraceExclusions, kkAdminPropsFilePath, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
Constructor and Description |
---|
AdminProductBatchMgr(KKAdminIf eng) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addAllProductsToSearchEngineBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String numThreadsStr,
java.lang.String recordFetchSizeStr,
java.lang.String debugStr,
java.lang.String sessId)
This batch adds all products to the Solr search engine using multiple threads.
|
void |
createSitemapBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
This method creates 4 or more files as described below:
sitemap.xml - the sitemap index file that includes the other sitemap files
sitemap-products_n.xml - includes links to all of the product detail pages.
|
java.lang.String |
removeExpiredStockReservationsBatch(java.lang.String logName,
java.lang.String appendLogStr)
This batch removes all expired stock reservation records.
|
void |
setProductAverageRatingsBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
Whenever a product review is submitted, a rating is given to the product.
|
void |
setSpecialPriceStateBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr)
Whenever a product special price is set and active, it is used in sort / filter by price
queries regardless of whether it has expired or has yet to start.
|
private void |
setSpecialState(com.konakart.db.KKCriteria updateC,
com.konakart.db.KKCriteria selectC,
int id,
boolean enable)
Private method to enable or disable the special
|
void |
synchronizeStoresBatch(java.lang.String logName,
java.lang.String appendLogStr,
java.lang.String recordFetchSizeStr,
java.lang.String storeIdFrom,
java.lang.String storeIdTo)
This batch synchronizes the products in storeIdFrom with the ones in storeIdTo.
|
private void |
writeSitemapPageEntry(java.io.BufferedWriter sm,
java.lang.String url,
java.lang.String changeFreq,
java.lang.String priority)
Utility method to write a sitemap entry for a page
|
ensureCustomerTagIsPresent, getAdEngConf, getAdminJsonEngine, getBatchLogName, getBoolean, getCustomerTagsHash, getInt, getIntArray, getIntArray, getLiteCustomerCriteria, getLiteCustomers, getLogName, getOrders, getSkuForProduct, insertOrUpdateCustomerTag, trimMultiTag, validateTemplate
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
private static final java.lang.String HEADER
private static final java.lang.String SITEMAPINDEX
private static final java.lang.String SITEMAPINDEX_END
private static final java.lang.String SITEMAP
private static final java.lang.String SITEMAP_END
private static final java.lang.String LOC
private static final java.lang.String LOC_END
private static final java.lang.String URLSET_PROD
private static final java.lang.String URLSET
private static final java.lang.String URLSET_END
private static final java.lang.String URL
private static final java.lang.String URL_END
private static final java.lang.String LASTMOD
private static final java.lang.String LASTMOD_END
private static final java.lang.String CHANGEFREQ
private static final java.lang.String CHANGEFREQ_END
private static final java.lang.String PRIORITY
private static final java.lang.String PRIORITY_END
private static final java.lang.String IMAGE
private static final java.lang.String IMAGE_END
private static final java.lang.String IMAGE_LOC
private static final java.lang.String IMAGE_LOC_END
private static final java.lang.String IMAGE_TITLE
private static final java.lang.String IMAGE_TITLE_END
public AdminProductBatchMgr(KKAdminIf eng) throws java.lang.Exception
eng
- the engjava.lang.Exception
- an unexpected exceptionpublic void setProductAverageRatingsBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr) throws java.lang.Exception
The product rating may be used by the application to filter and order products.
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.java.lang.Exception
- an unexpected exceptionpublic void setSpecialPriceStateBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr) throws java.lang.Exception
If your policy is to set special prices on a daily basis, then this batch should be run on a daily basis. It looks at the start and expiry dates of the special and disables it if the current date doesn't lie in between these two dates. Otherwise the special is enabled if there is a start date and the special price should have started.
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.java.lang.Exception
- an unexpected exceptionprivate void setSpecialState(com.konakart.db.KKCriteria updateC, com.konakart.db.KKCriteria selectC, int id, boolean enable) throws org.apache.torque.TorqueException
updateC
- the updateCselectC
- the selectCid
- the idenable
- the enableorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)public void synchronizeStoresBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr, java.lang.String storeIdFrom, java.lang.String storeIdTo) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.storeIdFrom
- The id of the source storestoreIdTo
- The id of the destination storejava.lang.Exception
- an unexpected exceptionpublic void createSitemapBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String recordFetchSizeStr) throws java.lang.Exception
The directory into which the files are written is defined by a configuration variable and can be set in the Admin App under "Configuration >> Sitemap Configuration".
More information on sitemaps can be found at http://www.sitemaps.org/.
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.recordFetchSizeStr
- It the batch involves reading many records in a loop, this determines the maximum
number read in any one loop. It defaults to 100.java.lang.Exception
- an unexpected exceptionprivate void writeSitemapPageEntry(java.io.BufferedWriter sm, java.lang.String url, java.lang.String changeFreq, java.lang.String priority) throws java.io.IOException
sm
- the smurl
- the urlchangeFreq
- the changeFreqpriority
- the priorityjava.io.IOException
- an unexpected IOException exceptionpublic java.lang.String removeExpiredStockReservationsBatch(java.lang.String logName, java.lang.String appendLogStr) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.java.lang.Exception
- an unexpected exceptionpublic java.lang.String addAllProductsToSearchEngineBatch(java.lang.String logName, java.lang.String appendLogStr, java.lang.String numThreadsStr, java.lang.String recordFetchSizeStr, java.lang.String debugStr, java.lang.String sessId) throws java.lang.Exception
logName
- The name of the log which shouldn't include the path or extension. i.e. It should
be myLog rather than /logs/myLog.txt.appendLogStr
- If set to false, a new log will be created every time the batch job is run.
Otherwise new data will be appended to the existing log. It defaults to false.numThreadsStr
- Defines the number of worker threads to use for sending the product data to SolrrecordFetchSizeStr
- Defines number of products to read from the DB in a single query. They are then
sent to Solr by the worker threads and committed.debugStr
- When set to true, more detailed information is written to the logsessId
- The sessionId. The sessionId is a special parameter defined in the
konakart_jobs.xml file. If a parameter is defined with value "SESSION_ID",
KonaKart will replace this value with the sessionId of the logged in session.java.lang.Exception
- an unexpected exceptionCopyright © 2018 DS Data Systems UK Ltd.