com.konakartadmin.bl
Class AdminMiscItemMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminMiscItemMgr
All Implemented Interfaces:
AdminMiscItemMgrIf

public class AdminMiscItemMgr
extends AdminBaseMgr
implements AdminMiscItemMgrIf

The AdminMiscItemMgr - for Managing Miscellaneous Item Objects for the Admin Application


Nested Class Summary
 
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr
AdminBaseMgr.StaticData
 
Field Summary
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
AdminMiscItemMgr(KKAdminIf eng)
          Constructor
 
Method Summary
protected  void addMiscItemOrderBy(com.konakart.bl.KKCriteria c, AdminSearch search)
           
protected  int addMiscItemSearchCriteria(com.konakart.bl.KKCriteria c, AdminSearch search)
           
protected  void addMiscItemTypeOrderBy(com.konakart.bl.KKCriteria c, AdminSearch search)
           
protected  int addMiscItemTypeSearchCriteria(com.konakart.bl.KKCriteria c, AdminSearch search, java.lang.String aliasPrefix)
           
 void deleteMiscItem(int miTypeId)
          Delete an AdminMiscItem.
 void deleteMiscItemType(int miTypeId, boolean deleteChildren)
          Delete an AdminMiscItemType.
protected  boolean doesMiscItemTypeExist(int id)
          Return true if the Miscellaneous Item Type exists.
protected  boolean doesMiscItemTypeExist(int id, int langId)
          Return true if the Miscellaneous Item Type exists.
 AdminMiscItemSearchResult getMiscItems(AdminSearch search, int offset, int size)
          Return the AdminMiscItem objects defined by the search criteria.
protected  int getMiscItemsCount(AdminSearch search)
           
 AdminMiscItem[] getMiscItemsPerProduct(int productId)
          A method for returning the misc items of a product.
 AdminMiscItemType[] getMiscItemTypes(AdminSearch search, int offset, int size)
          Return the AdminMiscItemType objects defined by the search criteria.
protected  int insertMiscItem(AdminMiscItem miItem)
          Insert a new MiscItem object.
 int insertMiscItems(AdminMiscItem[] mItems)
          Insert an array of AdminMiscItem objects
protected  int insertMiscItemType(AdminMiscItemType miItemType)
          Insert a new MiscItemType object.
 int insertMiscItemType(AdminMiscItemType[] miTypes)
          Insert an array of AdminMiscItemType objects
 void refreshConfigs()
          Refresh the configuration of the Manager
 void updateMiscItems(AdminMiscItem[] mItems)
          Update an array of AdminMiscItem objects.
 void updateMiscItemType(AdminMiscItemType[] miTypes)
          Update an array of AdminMiscItemType objects.
 
Methods inherited from class com.konakartadmin.bl.AdminBaseMgr
addInsertAttr, addInsertAttr, checkIntIsSet, checkRequired, getAdminAddressMgr, getAdminAuditMgr, getAdminBillingMgr, getAdminBookableProductMgr, getAdminCatMgr, getAdminConfigMgr, getAdminCurrMgr, getAdminCustMgr, getAdminCustTagMgr, getAdminEmailMgr, getAdminEng, getAdminHtmlMgr, getAdminLanguageMgr, getAdminManuMgr, getAdminMessageMgr, getAdminMiscItemMgr, getAdminModulesMgr, getAdminMultiStoreMgr, getAdminOrderMgr, getAdminPdfMgr, getAdminProdAttrMgr, getAdminProdMgr, getAdminPromMgr, getAdminPublishProdMgr, getAdminReviewMgr, getAdminSearchRuleMgr, getAdminSecMgr, getAdminSolrMgr, getAdminStoreMgr, getAdminTagMgr, getAdminTaxMgr, getAdminValidationMgr, getAdminVelocityContextMgr, getAdminWishListMgr, getBooleanFromString, getExportXMLData, getIntFromString, getKkConfig, getKkInstanceId, getMode, getModeString, getMqMgr, getNewCriteria, getNewCriteria, getPostSearchText, getPreSearchText, getPropertyValue, getRecordCount, getRewardPointMgr, getSingleIntResult, getStoreId, getTemplate, getTemplateBase, getXml_io, init, isConfigSet, isEnterprise, isMultiStoreLanguagesShared, isMultiStoreMode, isMultiStoreShareCategories, isMultiStoreShareCustomers, isMultiStoreShareProducts, isMultiStoreSingleDBCSMode, isMultiStoreSingleDBMode, isMultiStoreSingleDBNonCSMode, manageException, removeCData, setAdminEng, setupWildCardRules, setWildCardAfter, setWildCardBefore, shutdownGracefully, shutdownGracefully, timestampStr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log

Constructor Detail

AdminMiscItemMgr

public AdminMiscItemMgr(KKAdminIf eng)
                 throws java.lang.Exception
Constructor

Parameters:
eng -
Throws:
java.lang.Exception
Method Detail

insertMiscItemType

public int insertMiscItemType(AdminMiscItemType[] miTypes)
                       throws KKAdminException,
                              java.lang.Exception
Description copied from interface: AdminMiscItemMgrIf
Insert an array of AdminMiscItemType objects

Specified by:
insertMiscItemType in interface AdminMiscItemMgrIf
Parameters:
miTypes - An array of AdminMiscItemType objects to insert. Typically you would insert one AdminMiscItemType record for each language to maintain data integrity.
Returns:
the id created for the newly-inserted AdminMiscItemType objects
Throws:
KKAdminException
java.lang.Exception

updateMiscItemType

public void updateMiscItemType(AdminMiscItemType[] miTypes)
                        throws KKAdminException,
                               org.apache.torque.TorqueException
Description copied from interface: AdminMiscItemMgrIf
Update an array of AdminMiscItemType objects. Only the name and the description can be updated.

Specified by:
updateMiscItemType in interface AdminMiscItemMgrIf
Parameters:
miTypes - An array of AdminMiscItemType objects to update.
Throws:
KKAdminException
org.apache.torque.TorqueException

deleteMiscItemType

public void deleteMiscItemType(int miTypeId,
                               boolean deleteChildren)
                        throws KKAdminException,
                               org.apache.torque.TorqueException,
                               java.lang.Exception
Description copied from interface: AdminMiscItemMgrIf
Delete an AdminMiscItemType. All records with the specified miscellaneous item type id will be deleted - that is the miscellaneous item type for every language defined.

Specified by:
deleteMiscItemType in interface AdminMiscItemMgrIf
Parameters:
miTypeId - the id of the miscellaneous item type object to delete
deleteChildren - if true all children (miscellaneous items with this miscellaneous item type) will also be deleted.
Throws:
KKAdminException
org.apache.torque.TorqueException
java.lang.Exception

getMiscItemTypes

public AdminMiscItemType[] getMiscItemTypes(AdminSearch search,
                                            int offset,
                                            int size)
                                     throws KKAdminException,
                                            java.lang.Exception
Description copied from interface: AdminMiscItemMgrIf
Return the AdminMiscItemType objects defined by the search criteria.

Specified by:
getMiscItemTypes in interface AdminMiscItemMgrIf
Parameters:
search - the generic Admin search object that defines the objects to search for. If null we use the default AdminSearch object. If you specify the LanguageId in the search object, only the MiscItemType for that specified language will be returned. If you specify AdminLanguage.ALL_LANGUAGES for the languageId the search will be made on the default language, and if MiscItemTypes are found, MiscItemTypes with these MiscItemTypeIds for all of the languages are returned.
offset - starting offset in database - so that you can page through results
size - size of the group that will be returned - the maximum number of records returned
Returns:
an array of AdminMiscItemType objects or null if no records match the search criteria.
Throws:
KKAdminException
java.lang.Exception

insertMiscItemType

protected int insertMiscItemType(AdminMiscItemType miItemType)
                          throws KKAdminException,
                                 java.lang.Exception
Insert a new MiscItemType object.

Parameters:
miItemType - the new AdminMiscItemType object to insert - do not fill out the Id as this will be created.
Returns:
the id of the AdminMiscItemType object created
Throws:
KKAdminException
java.lang.Exception

addMiscItemTypeSearchCriteria

protected int addMiscItemTypeSearchCriteria(com.konakart.bl.KKCriteria c,
                                            AdminSearch search,
                                            java.lang.String aliasPrefix)

addMiscItemTypeOrderBy

protected void addMiscItemTypeOrderBy(com.konakart.bl.KKCriteria c,
                                      AdminSearch search)

doesMiscItemTypeExist

protected boolean doesMiscItemTypeExist(int id)
                                 throws org.apache.torque.TorqueException,
                                        KKAdminException
Return true if the Miscellaneous Item Type exists.

Parameters:
id - Miscellaneous Item Type id
Returns:
True if the Miscellaneous Item Type exists otherwise false
Throws:
org.apache.torque.TorqueException
KKAdminException

doesMiscItemTypeExist

protected boolean doesMiscItemTypeExist(int id,
                                        int langId)
                                 throws org.apache.torque.TorqueException,
                                        KKAdminException
Return true if the Miscellaneous Item Type exists.

Parameters:
id - Miscellaneous Item Type id
langId - language id
Returns:
True if the Miscellaneous Item Type exists otherwise false
Throws:
org.apache.torque.TorqueException
KKAdminException

insertMiscItems

public int insertMiscItems(AdminMiscItem[] mItems)
                    throws KKAdminException,
                           java.lang.Exception
Description copied from interface: AdminMiscItemMgrIf
Insert an array of AdminMiscItem objects

Specified by:
insertMiscItems in interface AdminMiscItemMgrIf
Parameters:
mItems - An array of AdminMiscItem objects to insert.
Returns:
the id created for the last newly-inserted AdminMiscItem objects
Throws:
KKAdminException
java.lang.Exception

updateMiscItems

public void updateMiscItems(AdminMiscItem[] mItems)
                     throws KKAdminException,
                            org.apache.torque.TorqueException
Description copied from interface: AdminMiscItemMgrIf
Update an array of AdminMiscItem objects.

Specified by:
updateMiscItems in interface AdminMiscItemMgrIf
Parameters:
mItems - An array of AdminMiscItem objects to update.
Throws:
KKAdminException
org.apache.torque.TorqueException

deleteMiscItem

public void deleteMiscItem(int miTypeId)
                    throws KKAdminException,
                           org.apache.torque.TorqueException
Description copied from interface: AdminMiscItemMgrIf
Delete an AdminMiscItem. All records with the specified miscellaneous item type id will be deleted - that is the miscellaneous item type for every language defined.

Specified by:
deleteMiscItem in interface AdminMiscItemMgrIf
Parameters:
miTypeId - the id of the miscellaneous item object to delete
Throws:
KKAdminException
org.apache.torque.TorqueException

getMiscItems

public AdminMiscItemSearchResult getMiscItems(AdminSearch search,
                                              int offset,
                                              int size)
                                       throws KKAdminException,
                                              org.apache.torque.TorqueException,
                                              com.workingdogs.village.DataSetException
Description copied from interface: AdminMiscItemMgrIf
Return the AdminMiscItem objects defined by the search criteria.

Specified by:
getMiscItems in interface AdminMiscItemMgrIf
Parameters:
search - the generic Admin search object that defines the objects to search for. If null we use the default AdminSearch object.

AdminSearch criteria usage:

  • ids = Can contain an array of kkObjIds
  • id = kkMiscItemId
  • id2 = kkMiscItemTypeId
  • id3 = kkObjId
  • id4 = kkObjTypeId
  • name = item Value

AdminSearch order by options:

  • AdminSearch.ORDER_BY_ID_DESCENDING order by Misc Item Id descending
  • AdminSearch.ORDER_BY_ID_ASCENDING order by Misc Item Id ascending
  • AdminSearch.ORDER_BY_ID2_DESCENDING order by Misc Item Type Id descending
  • AdminSearch.ORDER_BY_ID2_ASCENDING order by Misc Item Type Id ascending
  • AdminSearch.ORDER_BY_ID3_DESCENDING order by Object Id descending
  • AdminSearch.ORDER_BY_ID3_ASCENDING order by Object Id ascending
  • AdminSearch.ORDER_BY_ID4_DESCENDING order by Object Type Id descending
  • AdminSearch.ORDER_BY_ID4_ASCENDING order by Object Type Id ascending
  • AdminSearch.ORDER_BY_NAME_DESCENDING order by Item Value descending
  • AdminSearch.ORDER_BY_NAME_ASCENDING order by Item Value ascending
  • AdminSearch.ORDER_BY_DATE_DESCENDING order by Date Added descending
  • AdminSearch.ORDER_BY_DATE_ASCENDING order by Date Added ascending
offset - starting offset in database - so that you can page through results
size - size of the group that will be returned - the maximum number of records returned
Returns:
an AdminMiscItemSearchResult object that contains an array of AdminMiscItem objects if records are found that match the search criteria.
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getMiscItemsCount

protected int getMiscItemsCount(AdminSearch search)
                         throws KKAdminException,
                                org.apache.torque.TorqueException,
                                com.workingdogs.village.DataSetException
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

insertMiscItem

protected int insertMiscItem(AdminMiscItem miItem)
                      throws KKAdminException,
                             java.lang.Exception
Insert a new MiscItem object.

Parameters:
miItem - the new AdminMiscItem object to insert - do not fill out the Id as this will be created.
Returns:
the id of the AdminMiscItem object created
Throws:
KKAdminException
java.lang.Exception

addMiscItemSearchCriteria

protected int addMiscItemSearchCriteria(com.konakart.bl.KKCriteria c,
                                        AdminSearch search)
                                 throws KKAdminException
Throws:
KKAdminException

addMiscItemOrderBy

protected void addMiscItemOrderBy(com.konakart.bl.KKCriteria c,
                                  AdminSearch search)

refreshConfigs

public void refreshConfigs()
                    throws java.lang.Exception
Refresh the configuration of the Manager

Specified by:
refreshConfigs in interface AdminMiscItemMgrIf
Overrides:
refreshConfigs in class AdminBaseMgr
Throws:
java.lang.Exception

getMiscItemsPerProduct

public AdminMiscItem[] getMiscItemsPerProduct(int productId)
                                       throws KKAdminException,
                                              org.apache.torque.TorqueException,
                                              com.workingdogs.village.DataSetException
A method for returning the misc items of a product. It doesn't check that the product belongs to the current store of the engine.

Specified by:
getMiscItemsPerProduct in interface AdminMiscItemMgrIf
Parameters:
productId -
Returns:
Returns an array of misc items associated with a product
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException


Copyright © 2011 DS Data Systems UK Ltd.