com.konakartadmin.bl
Class AdminPublishProductMgr

java.lang.Object
  extended by com.konakartadmin.bl.AdminBaseMgr
      extended by com.konakartadmin.bl.AdminPublishProductMgr
All Implemented Interfaces:
AdminPublishProductMgrIf

public class AdminPublishProductMgr
extends AdminBaseMgr
implements AdminPublishProductMgrIf

The AdminPublishProductMgr - for Managing Product Publishing for the Admin Application


Nested Class Summary
protected  class AdminPublishProductMgr.StaticData
          Used to store the static data of this manager
 
Field Summary
protected static java.lang.String baseKey
          The base key for the custom managers defined in the konakartadmin.properties file
protected static java.lang.String DEFAULT_GOOGLE_PUB_PRODS_CLASS
          The default class name for the Google Publish Products class
protected static java.lang.String DEFAULT_GOOGLE_PUB_PRODS_KEY
          The Google Publish Products class name key for the konakartadmin.properties file
static java.lang.String DEFAULT_LOG_FILE_NAME
          Default log file name for the Publishing log (for diagnostics only)
static java.lang.String DEFAULT_READ_PRODS_FILE_NAME
          Default log file name for the output of Read Published Products
protected static org.apache.commons.logging.Log log
          the log
protected static java.lang.String mutex
           
protected static java.util.Map<java.lang.String,AdminPublishProductMgr.StaticData> staticDataHM
          Hash Map that contains the static data
 
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir
 
Constructor Summary
AdminPublishProductMgr(KKAdminIf eng)
          Constructor
 
Method Summary
 void deleteAllProductFeedItems(int feedType)
          Delete all Product Feed Items for the specified feed
 void deleteProductFeedItem(AdminProductFeedItem feedItem)
          Delete a Product Feed Item
protected  java.lang.String getDefaultLogFileDirName()
           
protected  java.lang.String getDefaultLogFileName()
           
protected  java.lang.String getDefaultReadProdsFileName()
           
static java.lang.String getFeedTypeString(int feedType)
          For diagnostics purposes, this provides a String representation of the feed type which is specified as an integer
 PublishProductsIf getGooglePublisher()
          Returns the Google Publisher for this store
 AdminProductFeedItem[] getProductFeedItems(int productId, int languageId, int feedType)
          Returns an array of Product Feed Items that match the specified productId, languageId and feedType passed in as parameters.
protected  AdminPublishProductMgr.StaticData getStoreData(java.lang.String storeId)
           
 void insertProductFeedItem(AdminProductFeedItem feedItem)
          Insert a Product Feed Item
protected  void isCodePresent(int feedType)
          Throws an exception if the specified feed isn't enabled.
 void publishAllProducts(AdminPublishConfig adminPublishConfig)
          Publish all products in the database
 void publishProduct(AdminProduct product, AdminPublishConfig adminPublishConfig)
          Publish the product passed in as a parameter
 java.lang.String readProducts(AdminPublishConfig adminPublishConfig)
          Read Products from external published source
 void refreshConfigs()
          Refresh the configuration of the Admin Publish Products Manager
 void removeAllProducts(AdminPublishConfig adminPublishConfig)
          Remove all published products
 void removeProduct(int productId, AdminPublishConfig adminPublishConfig)
          Remove the published product passed in as a parameter.
 boolean shouldWePublishProduct(AdminProduct prod, int feedType)
          Determines whether or not this specified product should be published to the specified feed
 boolean useGoogleShopping()
          Returns true if Google Shopping can be used, otherwise it returns false
 void validateProductFeedItem(AdminProductFeedItem feedItem)
          Validate a Product Feed Item.
 
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


mutex

protected static java.lang.String mutex

staticDataHM

protected static java.util.Map<java.lang.String,AdminPublishProductMgr.StaticData> staticDataHM
Hash Map that contains the static data


DEFAULT_LOG_FILE_NAME

public static final java.lang.String DEFAULT_LOG_FILE_NAME
Default log file name for the Publishing log (for diagnostics only)

See Also:
Constant Field Values

DEFAULT_READ_PRODS_FILE_NAME

public static final java.lang.String DEFAULT_READ_PRODS_FILE_NAME
Default log file name for the output of Read Published Products

See Also:
Constant Field Values

DEFAULT_GOOGLE_PUB_PRODS_CLASS

protected static final java.lang.String DEFAULT_GOOGLE_PUB_PRODS_CLASS
The default class name for the Google Publish Products class

See Also:
Constant Field Values

DEFAULT_GOOGLE_PUB_PRODS_KEY

protected static final java.lang.String DEFAULT_GOOGLE_PUB_PRODS_KEY
The Google Publish Products class name key for the konakartadmin.properties file

See Also:
Constant Field Values

baseKey

protected static final java.lang.String baseKey
The base key for the custom managers defined in the konakartadmin.properties file

See Also:
Constant Field Values
Constructor Detail

AdminPublishProductMgr

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

Parameters:
eng - the Admin Engine
Throws:
java.lang.Exception
Method Detail

publishAllProducts

public void publishAllProducts(AdminPublishConfig adminPublishConfig)
                        throws java.lang.Exception
Description copied from interface: AdminPublishProductMgrIf
Publish all products in the database

Specified by:
publishAllProducts in interface AdminPublishProductMgrIf
Parameters:
adminPublishConfig -
Throws:
java.lang.Exception

getDefaultLogFileDirName

protected java.lang.String getDefaultLogFileDirName()
                                             throws org.apache.torque.TorqueException,
                                                    KKAdminException,
                                                    com.workingdogs.village.DataSetException,
                                                    java.lang.Exception
Throws:
org.apache.torque.TorqueException
KKAdminException
com.workingdogs.village.DataSetException
java.lang.Exception

getDefaultLogFileName

protected java.lang.String getDefaultLogFileName()
                                          throws org.apache.torque.TorqueException,
                                                 KKAdminException,
                                                 com.workingdogs.village.DataSetException,
                                                 java.lang.Exception
Throws:
org.apache.torque.TorqueException
KKAdminException
com.workingdogs.village.DataSetException
java.lang.Exception

getDefaultReadProdsFileName

protected java.lang.String getDefaultReadProdsFileName()
                                                throws org.apache.torque.TorqueException,
                                                       KKAdminException,
                                                       com.workingdogs.village.DataSetException,
                                                       java.lang.Exception
Throws:
org.apache.torque.TorqueException
KKAdminException
com.workingdogs.village.DataSetException
java.lang.Exception

readProducts

public java.lang.String readProducts(AdminPublishConfig adminPublishConfig)
                              throws java.lang.Exception
Read Products from external published source

Specified by:
readProducts in interface AdminPublishProductMgrIf
Parameters:
adminPublishConfig -
Returns:
a String representing the Products read from the external source
Throws:
java.lang.Exception

publishProduct

public void publishProduct(AdminProduct product,
                           AdminPublishConfig adminPublishConfig)
                    throws java.lang.Exception
Description copied from interface: AdminPublishProductMgrIf
Publish the product passed in as a parameter

Specified by:
publishProduct in interface AdminPublishProductMgrIf
Parameters:
product -
adminPublishConfig -
Throws:
java.lang.Exception

removeAllProducts

public void removeAllProducts(AdminPublishConfig adminPublishConfig)
                       throws java.lang.Exception
Description copied from interface: AdminPublishProductMgrIf
Remove all published products

Specified by:
removeAllProducts in interface AdminPublishProductMgrIf
Parameters:
adminPublishConfig -
Throws:
java.lang.Exception

removeProduct

public void removeProduct(int productId,
                          AdminPublishConfig adminPublishConfig)
                   throws java.lang.Exception
Description copied from interface: AdminPublishProductMgrIf
Remove the published product passed in as a parameter.

Specified by:
removeProduct in interface AdminPublishProductMgrIf
Parameters:
productId -
adminPublishConfig -
Throws:
java.lang.Exception

getStoreData

protected AdminPublishProductMgr.StaticData getStoreData(java.lang.String storeId)
                                                  throws KKAdminException
Throws:
KKAdminException

shouldWePublishProduct

public boolean shouldWePublishProduct(AdminProduct prod,
                                      int feedType)
Determines whether or not this specified product should be published to the specified feed

Specified by:
shouldWePublishProduct in interface AdminPublishProductMgrIf
Parameters:
prod -
feedType - the feed type eg KKConstants.DATA_FEED_TYPE_GOOGLE
Returns:
true if the product should be published, otherwise false

insertProductFeedItem

public void insertProductFeedItem(AdminProductFeedItem feedItem)
                           throws KKAdminException,
                                  org.apache.torque.TorqueException,
                                  com.workingdogs.village.DataSetException
Insert a Product Feed Item

Specified by:
insertProductFeedItem in interface AdminPublishProductMgrIf
Parameters:
feedItem - an AdminProductFeedItem object to insert
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

deleteProductFeedItem

public void deleteProductFeedItem(AdminProductFeedItem feedItem)
                           throws org.apache.torque.TorqueException
Delete a Product Feed Item

Specified by:
deleteProductFeedItem in interface AdminPublishProductMgrIf
Parameters:
feedItem - an AdminProductFeedItem object to delete (only the keys need to be filled in)
Throws:
org.apache.torque.TorqueException

deleteAllProductFeedItems

public void deleteAllProductFeedItems(int feedType)
                               throws org.apache.torque.TorqueException
Delete all Product Feed Items for the specified feed

Specified by:
deleteAllProductFeedItems in interface AdminPublishProductMgrIf
Parameters:
feedType - the feed type of the records to delete
Throws:
org.apache.torque.TorqueException

getProductFeedItems

public AdminProductFeedItem[] getProductFeedItems(int productId,
                                                  int languageId,
                                                  int feedType)
                                           throws org.apache.torque.TorqueException,
                                                  com.workingdogs.village.DataSetException
Returns an array of Product Feed Items that match the specified productId, languageId and feedType passed in as parameters. Returns an emty array if no object exists.

Specified by:
getProductFeedItems in interface AdminPublishProductMgrIf
Parameters:
productId - productId or -1 for all products
languageId - languageId or -1 for all languages
feedType - feedType or -1 for all feed types
Returns:
Returns an array of AdminProductFeedItem objects
Throws:
org.apache.torque.TorqueException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

validateProductFeedItem

public void validateProductFeedItem(AdminProductFeedItem feedItem)
                             throws KKAdminException
Validate a Product Feed Item. Throws an exception if the validation fails.

Specified by:
validateProductFeedItem in interface AdminPublishProductMgrIf
Parameters:
feedItem - the Product Feed Item
Throws:
KKAdminException - thrown if the validation fails

getGooglePublisher

public PublishProductsIf getGooglePublisher()
                                     throws KKAdminException
Returns the Google Publisher for this store

Specified by:
getGooglePublisher in interface AdminPublishProductMgrIf
Returns:
Returns the Google Publisher for this store
Throws:
KKAdminException

getFeedTypeString

public static java.lang.String getFeedTypeString(int feedType)
For diagnostics purposes, this provides a String representation of the feed type which is specified as an integer

Parameters:
feedType - the data feed type
Returns:
a String representation of the Feed Type

refreshConfigs

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

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

useGoogleShopping

public boolean useGoogleShopping()
                          throws KKAdminException
Returns true if Google Shopping can be used, otherwise it returns false

Specified by:
useGoogleShopping in interface AdminPublishProductMgrIf
Returns:
Returns true if Google Shopping can be used, otherwise it returns false
Throws:
KKAdminException

isCodePresent

protected void isCodePresent(int feedType)
                      throws java.lang.Exception
Throws an exception if the specified feed isn't enabled.

Throws:
com.konakart.app.KKException
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.