public class AdminStoreMgr extends AdminBaseMgr implements AdminStoreMgrIf
AdminBaseMgr.StaticData
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_ADMIN_ROLE_ID
Default role Id is for the "Store Administrator" role
|
protected static java.lang.String |
DEFAULT_ADMIN_USERNAME
Default credentials for accessing the KonaKart Admin App
|
protected static java.lang.String |
DEFAULT_PASSWORD
Default credentials for accessing the KonaKart Admin App
|
protected static int |
DEFAULT_SUPER_USER_ROLE_ID
Default Super User Role Id
|
protected static java.lang.String |
DEFAULT_SUPER_USERNAME
Default credentials for accessing the KonaKart Admin App
|
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 |
---|
AdminStoreMgr(KKAdminIf eng)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
addStandardSelectColumns(com.konakart.db.KKCriteria c) |
protected void |
addStatusSelectColumns(com.konakart.db.KKCriteria c) |
protected void |
addStoreOrderBy(com.konakart.db.KKCriteria c,
AdminStoreSearch search) |
protected int |
addStoreSearchCriteria(com.konakart.db.KKCriteria c,
AdminStoreSearch search) |
protected void |
checkEngineMode(java.lang.String attempting) |
protected void |
checkValidStoreId(java.lang.String storeId) |
protected void |
cloneOrderStatuses(KKAdminIf targetEng,
java.lang.String sessionId,
java.lang.String sourceStoreId,
java.lang.String targetStoreId) |
void |
cloneStore(AdminNewStoreOptions options,
java.lang.String storeToCloneId,
AdminStore newStore,
int userId)
Insert a new store into the mall by cloning a specified store.
|
protected void |
cloneStoreData(KKAdminIf targetEng,
java.lang.String sessionId,
java.lang.String sourceStoreId,
java.lang.String targetStoreId) |
protected void |
cloneStoreFiles(AdminStore newStore,
AdminStore oldStore)
Copy the reports and the template files from the original Store's mall file area to the new
Store's mall file area
|
protected void |
copyDirTree(java.lang.String sourceDir,
java.lang.String targetDir)
create the directory if it doesn't already exist
|
protected void |
copyFile(java.io.File source,
java.io.File target)
File copying utility function
|
protected KKAdminIf |
createAdminEngine(java.lang.String targetStoreId) |
protected void |
createDir(java.lang.String dir) |
protected java.lang.String |
createNewStore(AdminNewStoreOptions options,
java.lang.String storeToCloneId,
AdminStore newStore,
int userId)
Insert an AdminStore object
|
void |
deleteStoreDB(java.lang.String storeId)
Delete a Store from the Database.
|
boolean |
doesStoreExistDB(java.lang.String storeId)
Return true if the store exists.
|
protected void |
doInit(KKAdminIf eng) |
protected void |
executeStatement(java.lang.String sqlStatement)
Execute statement that works for multi database testing
|
protected AdminStoreIntegrationMgrInterface |
getAdminStoreIntegMgrInstanceByName(java.lang.String className)
Called to instantiate an AdminStoreIntegrationMgr.
|
protected AdminStoreIntegrationMgrInterface |
getAdminStoreIntegrationMgr()
Used to get an instance of the AdminStoreIntegrationMgr
|
protected java.lang.String |
getConfigValue(java.lang.String key) |
protected int |
getConfigValueAsInt(java.lang.String key,
int def) |
protected int |
getCount(com.konakart.db.KKCriteria c)
Get the count of the number of rows returned by the KKCriteria (usually used for paging).
|
protected XmlIoDataConfig |
getDataConfigForCloning(int direction)
Creates a DataConfig object for cloning
|
com.konakart.db.KKCriteria |
getNewCriteria()
Gets a new KKCriteria object from the super class then takes off the storeId as we never want
to add a where storeId= constraint when looking up these stores.
|
protected int |
getStoreCount(AdminStoreSearch search)
Returns a count of the number of Zones with the specified search criteria
|
AdminStore |
getStoreDBById(java.lang.String storeId)
Return the AdminStore object from the database with the specified storeId
|
AdminStore[] |
getStores(org.apache.commons.configuration2.Configuration kkConfig)
Get the stores supported by the server.
|
AdminStore[] |
getStores(java.lang.String configFile)
Get the stores supported by the server.
|
AdminStoreSearchResult |
getStoresDB(AdminStoreSearch search,
int offset,
int size)
Return the AdminStore objects defined by the search criteria.
|
protected AdminStore[] |
getStoresPrivate()
Just returns the default single store list.
|
AdminStore |
getStoreStatusById(java.lang.String storeId)
Return the status elements of the AdminStore object from the database with the specified
storeId
|
protected void |
insertRoleForUser(KKAdminIf eng,
java.lang.String sessionId,
int roleId,
int userId) |
java.lang.String |
insertStore(AdminStore newStore,
int userId)
Insert an AdminStore object
|
protected java.lang.String |
insertStoreDB(AdminStore insertObj)
Insert an AdminStore object into the database
|
protected void |
loadKonaKartNewStoreFile(AdminStore store,
java.lang.String sourceStoreId)
Copy the reference data from the source store to the target store.
|
protected void |
loadNewStoreFile(java.lang.String filename,
AdminStore store,
java.lang.String sourceStoreId)
Copy the reference data from the source store to the target store.
|
protected void |
loadStoreData(AdminStore store,
AdminNewStoreOptions options,
java.lang.String sourceStoreId,
int userId)
Load the database for this new store
|
protected void |
loadUserNewStoreFile(AdminStore store,
java.lang.String sourceStoreId)
Copy the reference data from the source store to the target store.
|
protected java.lang.String |
loginToAdminEngine(KKAdminIf eng,
java.lang.String userName,
java.lang.String password) |
protected void |
modifyConfigValueForNewStore(KKAdminIf adEng,
java.lang.String sessionId,
java.lang.String key,
java.lang.String targetStoreId,
java.lang.String sourceStoreId) |
void |
removeStoreDB(java.lang.String storeId)
Delete a Store from the Database - this doesn't just mark the store as deleted (that's what
deleteStoreDB does) but it removes all the records for this store from the database.
|
protected void |
removeStoreRecords(java.lang.String table,
java.lang.String storeId) |
protected void |
setConfigsForNewStore(AdminStore store,
KKAdminIf adminEng,
java.lang.String sessionId,
java.lang.String targetStoreId,
java.lang.String sourceStoreId) |
private void |
setConfigValue(KKAdminIf adminEng,
java.lang.String sessionId,
java.lang.String key,
java.lang.String value) |
protected void |
setLocal(AdminStore store)
Set the local attribute on the store record to true or false as appropriate.
|
protected boolean |
sqlLine(java.lang.String line) |
void |
updateStoreDB(AdminStore updateObj)
Update an AdminStore object
|
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, 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
protected static org.apache.commons.logging.Log log
protected static final int DEFAULT_ADMIN_ROLE_ID
protected static final int DEFAULT_SUPER_USER_ROLE_ID
protected static java.lang.String DEFAULT_ADMIN_USERNAME
protected static java.lang.String DEFAULT_SUPER_USERNAME
protected static java.lang.String DEFAULT_PASSWORD
public AdminStoreMgr(KKAdminIf eng) throws KKAdminException
eng
- KKAdminIf Admin EngineKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void doInit(KKAdminIf eng) throws KKAdminException
eng
- the engKKAdminException
- unexpected exception in the KonaKart Admin Enginepublic AdminStore[] getStores(java.lang.String configFile) throws KKAdminException
getStores
in interface AdminStoreMgrIf
configFile
- the name of the properties fileKKAdminException
- unexpected exception in the KonaKart Admin Enginepublic AdminStore[] getStores(org.apache.commons.configuration2.Configuration kkConfig) throws KKAdminException
getStores
in interface AdminStoreMgrIf
kkConfig
- A configuration that has already been readKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected AdminStore[] getStoresPrivate()
public AdminStoreSearchResult getStoresDB(AdminStoreSearch search, int offset, int size) throws KKAdminException
getStoresDB
in interface AdminStoreMgrIf
search
- the Admin Store search object that defines the AdminStore objects to search for.
If null we use the default AdminStoreSearch object.offset
- starting offset in database - so that you can page through resultssize
- size of the group that will be returned - the maximum number of records returned.
If this is set to -1 (KonakartAdminConstants.NOT_SET) no limit is imposed.KKAdminException
- unexpected exception in the KonaKart Admin Engineprotected int getStoreCount(AdminStoreSearch search) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
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)protected int getCount(com.konakart.db.KKCriteria c) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
c
- the Criteria which contains a count()org.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 AdminStore getStoreStatusById(java.lang.String storeId) throws KKAdminException
getStoreStatusById
in interface AdminStoreMgrIf
storeId
- the storeId of the AdminStore object to retrieve.KKAdminException
- unexpected exception in the KonaKart Admin Enginepublic AdminStore getStoreDBById(java.lang.String storeId) throws KKAdminException
getStoreDBById
in interface AdminStoreMgrIf
storeId
- the storeId of the AdminStore object to retrieve.KKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void setLocal(AdminStore store) throws KKAdminException
store
- the storeKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void addStandardSelectColumns(com.konakart.db.KKCriteria c)
c
- the cprotected void addStatusSelectColumns(com.konakart.db.KKCriteria c)
c
- the cprotected int addStoreSearchCriteria(com.konakart.db.KKCriteria c, AdminStoreSearch search)
c
- the csearch
- the searchprotected void addStoreOrderBy(com.konakart.db.KKCriteria c, AdminStoreSearch search)
c
- the csearch
- the searchpublic void deleteStoreDB(java.lang.String storeId) throws KKAdminException
deleteStoreDB
in interface AdminStoreMgrIf
storeId
- A Store idKKAdminException
- unexpected exception in the KonaKart Admin Enginepublic void removeStoreDB(java.lang.String storeId) throws KKAdminException
removeStoreDB
in interface AdminStoreMgrIf
storeId
- A Store idKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void removeStoreRecords(java.lang.String table, java.lang.String storeId) throws org.apache.torque.TorqueException
org.apache.torque.TorqueException
public boolean doesStoreExistDB(java.lang.String storeId) throws KKAdminException, org.apache.torque.TorqueException
doesStoreExistDB
in interface AdminStoreMgrIf
storeId
- store idorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)KKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void checkEngineMode(java.lang.String attempting) throws KKAdminException
attempting
- the attemptingKKAdminException
- unexpected exception in the KonaKart Admin Enginepublic java.lang.String insertStore(AdminStore newStore, int userId) throws org.apache.torque.TorqueException, KKAdminException, java.lang.Exception
insertStore
in interface AdminStoreMgrIf
newStore
- An AdminStore object to insertuserId
- the user inserting the storejava.lang.Exception
- an unexpected exceptionKKAdminException
- unexpected exception in the KonaKart Admin Engineorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)protected java.lang.String createNewStore(AdminNewStoreOptions options, java.lang.String storeToCloneId, AdminStore newStore, int userId) throws java.lang.Exception, KKAdminException
options
- Some options for defining how to execute the clonestoreToCloneId
- the store the will be cloned to make the new storenewStore
- the new store - all attributes should be filled in, including storeIduserId
- the user inserting the storejava.lang.Exception
- an unexpected exceptionKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void checkValidStoreId(java.lang.String storeId) throws KKAdminException
storeId
- the storeIdKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected java.lang.String insertStoreDB(AdminStore insertObj) throws KKAdminException
insertObj
- An AdminStore objectKKAdminException
- unexpected exception in the KonaKart Admin Enginepublic void updateStoreDB(AdminStore updateObj) throws KKAdminException
updateStoreDB
in interface AdminStoreMgrIf
updateObj
- An AdminStore objectKKAdminException
- unexpected exception in the KonaKart Admin Enginepublic com.konakart.db.KKCriteria getNewCriteria()
getNewCriteria
in interface AdminStoreMgrIf
getNewCriteria
in class AdminBaseMgr
public void cloneStore(AdminNewStoreOptions options, java.lang.String storeToCloneId, AdminStore newStore, int userId) throws java.lang.Exception
cloneStore
in interface AdminStoreMgrIf
options
- Some options for defining how to execute the clonestoreToCloneId
- the store the will be cloned to make the new storenewStore
- the new store - all attributes should be filled in, including storeIduserId
- the userIdjava.lang.Exception
- an unexpected exceptionprotected void loadStoreData(AdminStore store, AdminNewStoreOptions options, java.lang.String sourceStoreId, int userId) throws java.lang.Exception
store
- the storeoptions
- Some options for defining how to execute the clonesourceStoreId
- the sourceStoreIduserId
- the userIdjava.lang.Exception
- an unexpected exceptionorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)protected void cloneStoreData(KKAdminIf targetEng, java.lang.String sessionId, java.lang.String sourceStoreId, java.lang.String targetStoreId)
targetEng
- the targetEngsessionId
- the sessionIdsourceStoreId
- the sourceStoreIdtargetStoreId
- the targetStoreIdprotected void cloneOrderStatuses(KKAdminIf targetEng, java.lang.String sessionId, java.lang.String sourceStoreId, java.lang.String targetStoreId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
targetEng
- the targetEngsessionId
- the sessionIdsourceStoreId
- the sourceStoreIdtargetStoreId
- the targetStoreIdorg.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 void setConfigsForNewStore(AdminStore store, KKAdminIf adminEng, java.lang.String sessionId, java.lang.String targetStoreId, java.lang.String sourceStoreId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, java.lang.Exception
store
- the storeadminEng
- the adminEngsessionId
- the sessionIdtargetStoreId
- the targetStoreIdsourceStoreId
- the sourceStoreIdorg.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)java.lang.Exception
- an unexpected exceptionprotected void modifyConfigValueForNewStore(KKAdminIf adEng, java.lang.String sessionId, java.lang.String key, java.lang.String targetStoreId, java.lang.String sourceStoreId) throws KKAdminException
adEng
- the adEngsessionId
- the sessionIdkey
- the keytargetStoreId
- the targetStoreIdsourceStoreId
- the sourceStoreIdKKAdminException
- unexpected exception in the KonaKart Admin Engineprivate void setConfigValue(KKAdminIf adminEng, java.lang.String sessionId, java.lang.String key, java.lang.String value) throws KKAdminException
KKAdminException
protected KKAdminIf createAdminEngine(java.lang.String targetStoreId) throws KKAdminException
targetStoreId
- the targetStoreIdKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void insertRoleForUser(KKAdminIf eng, java.lang.String sessionId, int roleId, int userId) throws java.lang.Exception
eng
- the engsessionId
- the sessionIdroleId
- the roleIduserId
- the userIdjava.lang.Exception
- an unexpected exceptionprotected java.lang.String loginToAdminEngine(KKAdminIf eng, java.lang.String userName, java.lang.String password) throws com.konakart.app.KKException, KKAdminException
eng
- the enguserName
- the userNamepassword
- the passwordcom.konakart.app.KKException
- an unexpected KKException exceptionKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected XmlIoDataConfig getDataConfigForCloning(int direction) throws KKAdminException
direction
- either KonakartAdminConstants.XML_IMPORT or KonakartAdminConstants.XML_EXPORTKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void loadUserNewStoreFile(AdminStore store, java.lang.String sourceStoreId) throws KKAdminException
store
- the storesourceStoreId
- the sourceStoreIdKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void loadKonaKartNewStoreFile(AdminStore store, java.lang.String sourceStoreId) throws KKAdminException
store
- the the target storesourceStoreId
- the source store's storeIdKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected java.lang.String getConfigValue(java.lang.String key) throws KKAdminException
key
- the keyKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected int getConfigValueAsInt(java.lang.String key, int def) throws KKAdminException
key
- the keydef
- the defKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected void loadNewStoreFile(java.lang.String filename, AdminStore store, java.lang.String sourceStoreId) throws KKAdminException
filename
- the filenamestore
- the storesourceStoreId
- the sourceStoreIdKKAdminException
- unexpected exception in the KonaKart Admin Engineprotected boolean sqlLine(java.lang.String line)
line
- the lineprotected void executeStatement(java.lang.String sqlStatement) throws org.apache.torque.TorqueException
sqlStatement
- the sqlStatementorg.apache.torque.TorqueException
- an unexpected exception in Torque (the database layer)protected void cloneStoreFiles(AdminStore newStore, AdminStore oldStore)
newStore
- the newly created storeoldStore
- the source storeprotected void copyDirTree(java.lang.String sourceDir, java.lang.String targetDir) throws java.io.IOException
sourceDir
- the sourceDirtargetDir
- the targetDirjava.io.IOException
- an unexpected IOException exceptionprotected void createDir(java.lang.String dir)
dir
- the dirprotected void copyFile(java.io.File source, java.io.File target)
source
- the sourcetarget
- the targetprotected AdminStoreIntegrationMgrInterface getAdminStoreIntegrationMgr()
protected AdminStoreIntegrationMgrInterface getAdminStoreIntegMgrInstanceByName(java.lang.String className) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.ClassNotFoundException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException
className
- the classNamejava.lang.IllegalAccessException
- an unexpected IllegalAccessException exceptionjava.lang.InstantiationException
- an unexpected InstantiationException exceptionjava.lang.ClassNotFoundException
- an unexpected ClassNotFoundException exceptionjava.lang.reflect.InvocationTargetException
- an unexpected InvocationTargetException exceptionjava.lang.IllegalArgumentException
- an unexpected IllegalArgumentException exceptionCopyright © 2018 DS Data Systems UK Ltd.