|
|||||||||
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.AdminStoreMgr
public class AdminStoreMgr
The AdminStoreMgr - for Store-related functions of the Admin Application
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
AdminBaseMgr.StaticData |
Field Summary | |
---|---|
protected static int |
DEFAULT_ADMIN_ROLE_ID
|
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
|
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 |
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir |
Constructor Summary | |
---|---|
AdminStoreMgr(KKAdminIf eng)
Constructor |
Method Summary | |
---|---|
protected void |
addStandardSelectColumns(com.konakart.bl.KKCriteria c)
|
protected void |
addStatusSelectColumns(com.konakart.bl.KKCriteria c)
|
protected void |
addStoreOrderBy(com.konakart.bl.KKCriteria c,
AdminStoreSearch search)
|
protected int |
addStoreSearchCriteria(com.konakart.bl.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.bl.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.bl.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.configuration.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)
|
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 |
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
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
Constructor Detail |
---|
public AdminStoreMgr(KKAdminIf eng) throws KKAdminException
eng
- KKAdminIf Admin Engine
KKAdminException
Method Detail |
---|
protected void doInit(KKAdminIf eng) throws KKAdminException
KKAdminException
public AdminStore[] getStores(java.lang.String configFile) throws KKAdminException
getStores
in interface AdminStoreMgrIf
configFile
- the name of the properties file
KKAdminException
public AdminStore[] getStores(org.apache.commons.configuration.Configuration kkConfig) throws KKAdminException
getStores
in interface AdminStoreMgrIf
kkConfig
- A configuration that has already been read
KKAdminException
protected 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
protected int getStoreCount(AdminStoreSearch search) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
search
- Search criteria
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
protected int getCount(com.konakart.bl.KKCriteria c) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException
c
- the Criteria which contains a count()
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
public AdminStore getStoreStatusById(java.lang.String storeId) throws KKAdminException
getStoreStatusById
in interface AdminStoreMgrIf
storeId
- the storeId of the AdminStore object to retrieve.
KKAdminException
public AdminStore getStoreDBById(java.lang.String storeId) throws KKAdminException
getStoreDBById
in interface AdminStoreMgrIf
storeId
- the storeId of the AdminStore object to retrieve.
KKAdminException
protected void setLocal(AdminStore store) throws KKAdminException
store
-
KKAdminException
protected void addStandardSelectColumns(com.konakart.bl.KKCriteria c)
c
- protected void addStatusSelectColumns(com.konakart.bl.KKCriteria c)
protected int addStoreSearchCriteria(com.konakart.bl.KKCriteria c, AdminStoreSearch search)
c
- search
-
protected void addStoreOrderBy(com.konakart.bl.KKCriteria c, AdminStoreSearch search)
public void deleteStoreDB(java.lang.String storeId) throws KKAdminException
deleteStoreDB
in interface AdminStoreMgrIf
storeId
- A Store id
KKAdminException
public boolean doesStoreExistDB(java.lang.String storeId) throws KKAdminException, org.apache.torque.TorqueException
doesStoreExistDB
in interface AdminStoreMgrIf
storeId
- store id
org.apache.torque.TorqueException
KKAdminException
protected void checkEngineMode(java.lang.String attempting) throws KKAdminException
attempting
-
KKAdminException
public 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 store
java.lang.Exception
KKAdminException
org.apache.torque.TorqueException
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 store
java.lang.Exception
KKAdminException
protected void checkValidStoreId(java.lang.String storeId) throws KKAdminException
storeId
-
KKAdminException
protected java.lang.String insertStoreDB(AdminStore insertObj) throws KKAdminException
insertObj
- An AdminStore object
KKAdminException
public void updateStoreDB(AdminStore updateObj) throws KKAdminException
updateStoreDB
in interface AdminStoreMgrIf
updateObj
- An AdminStore object
KKAdminException
public com.konakart.bl.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
-
java.lang.Exception
org.apache.torque.TorqueException
KKAdminException
protected void loadStoreData(AdminStore store, AdminNewStoreOptions options, java.lang.String sourceStoreId, int userId) throws java.lang.Exception
options
- Some options for defining how to execute the clone
java.lang.Exception
org.apache.torque.TorqueException
protected void cloneStoreData(KKAdminIf targetEng, java.lang.String sessionId, java.lang.String sourceStoreId, java.lang.String targetStoreId)
protected 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
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
protected 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
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
java.lang.Exception
protected void modifyConfigValueForNewStore(KKAdminIf adEng, java.lang.String sessionId, java.lang.String key, java.lang.String targetStoreId, java.lang.String sourceStoreId) throws KKAdminException
KKAdminException
private 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
-
KKAdminException
protected void insertRoleForUser(KKAdminIf eng, java.lang.String sessionId, int roleId, int userId) throws java.lang.Exception
eng
- sessionId
- roleId
- userId
-
java.lang.Exception
protected java.lang.String loginToAdminEngine(KKAdminIf eng, java.lang.String userName, java.lang.String password) throws com.konakart.app.KKException, KKAdminException
eng
- userName
- password
-
com.konakart.app.KKException
KKAdminException
protected XmlIoDataConfig getDataConfigForCloning(int direction) throws KKAdminException
direction
- either KonakartAdminConstants.XML_IMPORT or KonakartAdminConstants.XML_EXPORT
KKAdminException
protected void loadUserNewStoreFile(AdminStore store, java.lang.String sourceStoreId) throws KKAdminException
KKAdminException
org.apache.torque.TorqueException
protected void loadKonaKartNewStoreFile(AdminStore store, java.lang.String sourceStoreId) throws KKAdminException
store
- the the target storesourceStoreId
- the source store's storeId
KKAdminException
protected java.lang.String getConfigValue(java.lang.String key) throws KKAdminException
key
-
KKAdminException
protected int getConfigValueAsInt(java.lang.String key, int def) throws KKAdminException
key
- def
-
KKAdminException
protected void loadNewStoreFile(java.lang.String filename, AdminStore store, java.lang.String sourceStoreId) throws KKAdminException
filename
- store
- sourceStoreId
-
KKAdminException
protected boolean sqlLine(java.lang.String line)
line
-
protected void executeStatement(java.lang.String sqlStatement) throws org.apache.torque.TorqueException
sqlStatement
-
org.apache.torque.TorqueException
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
- targetDir
-
java.io.IOException
protected void createDir(java.lang.String dir)
dir
- protected void copyFile(java.io.File source, java.io.File target)
source
- target
- protected 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
-
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.reflect.InvocationTargetException
java.lang.IllegalArgumentException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |