|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.konakart.al.KKAppEng
public class KKAppEng
This is the entry point for all method calls to the KonaKart client engine. The idea behind the
client engine is that each application user instantiates a copy and continues to use the same
copy which keeps state for the user. The Struts Actions call methods to retrieve data from the
server engine or perform transactions, whereas the JSPs normally call methods to display data
which has been cached by the client engine.
This object can be used to get an instance of one of the manager objects such as the
CustomerMgr() and the CategoryMgr(). It can also be used to get an instance of the server engine
using the getEng() method. Examples of how to use these calls can be obtained from the Struts
Action Classes which are shipped in source code format.
| Field Summary | |
|---|---|
static java.lang.String |
KONAKART_KEY
Key used to store the KonaKart object within the session. |
protected org.apache.commons.logging.Log |
log
|
CurrentNavigation |
nav
Used to keep track of where we are. |
| Constructor Summary | |
|---|---|
KKAppEng()
Constructor for engine created when a user creates a new session. |
|
KKAppEng(java.lang.String propertiesPath)
Constructor called by struts when the servlet container is started. |
|
| Method Summary | |
|---|---|
boolean |
displayPriceWithTax()
Called by the UI to determine whether to display prices with tax. |
java.lang.String |
formatPrice(java.math.BigDecimal number)
Used to create a string in order to visualize a price. |
java.lang.String |
formatPrice(java.math.BigDecimal number,
java.lang.String currencyCode)
Used to create a string in order to visualize a price. |
BasketMgr |
getBasketMgr()
Used to get an instance of the BasketMgr. |
ConfigCacheUpdater |
getCacheUpdateThread()
|
CategoryMgr |
getCategoryMgr()
Used to get an instance of the CategoryMgr. |
java.lang.String |
getConfig(java.lang.String key)
Returns the configuration value for the key passed in as a parameter. |
java.lang.String |
getCustom1()
Can be used for any custom logic |
java.lang.String |
getCustom2()
Can be used for any custom logic |
java.lang.String |
getCustom3()
Can be used for any custom logic |
java.lang.String |
getCustom4()
Can be used for any custom logic |
java.lang.String |
getCustom5()
Can be used for any custom logic |
CustomerMgr |
getCustomerMgr()
Used to get an instance of the CustomerMgr. |
java.lang.String |
getDateAsString(java.util.Calendar date)
The date template defined in com.konakart.al.Constants.dateTemplate is used to format the date. |
static java.lang.String |
getDdbasePath()
|
com.konakart.appif.KKEngIf |
getEng()
Returns an instance of the KonaKart server engine so that methods may be called directly on it. |
java.lang.String |
getForwardAfterLogin()
The forwardAfterLogin is stored for the cases where the user wants to perform some action such as writing a review, which requires him to be logged in. |
int |
getHeadingImageHeight()
The headingImageHeight is set by a configuration parameter. |
int |
getHeadingImageWidth()
The headingImageWidth is set by a configuration parameter. |
int |
getLangId()
Get the current language Id. |
java.lang.String |
getLocale()
Get the current locale. |
java.lang.String |
getMetaDescription()
Used by the JSPs to set the content of the meta description tag. |
java.lang.String |
getMetaKeywords()
Used by the JSPs to set the content of the meta keywords tag. |
java.lang.String[] |
getNav()
Get an array of strings that define the current navigation. |
java.lang.String |
getNowAsString()
The date template defined in com.konakart.al.Constants.dateTemplate is used to get the current date and time. |
OrderMgr |
getOrderMgr()
Used to get an instance of the OrderMgr. |
java.lang.String |
getPageTitle()
Used by the JSPs to set the content of the title tag. |
ProductMgr |
getProductMgr()
Used to get an instance of the ProductMgr. |
ReviewMgr |
getReviewMgr()
Used to get an instance of the ReviewMgr. |
java.lang.String |
getSEARCH_ALL()
This is a constant used for searching all products. |
java.lang.String |
getSessionId()
Returns the session id of the currently logged in customer. |
int |
getSmallImageHeight()
The smallImageHeight is set by a configuration parameter. |
int |
getSmallImageWidth()
The smallImageWidth is set by a configuration parameter. |
static java.lang.String |
getSslBaseUrl()
The default condition is that the sslBaseUrl isn't used unless the SSL_BASE_URL configuration variable is set. |
static java.lang.String |
getSslPort()
The standard port "443" is used unless it is overidden by the SSL_PORT_NUMBER configuration variable. |
static java.lang.String |
getStandardPort()
The standard port "80" is used unless it is overidden by the STANDARD_PORT_NUMBER configuration. |
int |
getSubcatImageHeight()
The subcatImageHeight is set by a configuration parameter. |
int |
getSubcatImageWidth()
The subcatImageWidth is set by a configuration parameter. |
java.lang.String |
getXMLOverHTTPResp()
XMLOverHTTPResp is used to temporary store an XML response. |
static boolean |
isDdAsAttachment()
The value is read from the DD_DOWNLOAD_AS_ATTACHMENT configuration variable. |
static boolean |
isEnableSSL()
Whether SSL is enabled or not is determined by the ENABLE_SSL configuration variable. |
void |
logout()
Log-off and reset some variables. |
void |
refreshAllClientConfigs()
Refresh the configuration variables. |
protected void |
refreshAllManagers()
Refresh all manager caches |
java.lang.String |
removeCData(java.lang.String stringIn)
Returns the string passed in as stringIn without the CData information. |
void |
reset()
Puts the Konakart object back into it's original state with no categories or products selected. |
void |
setCustom1(java.lang.String custom1)
Can be used for any custom logic |
void |
setCustom2(java.lang.String custom2)
Can be used for any custom logic |
void |
setCustom3(java.lang.String custom3)
Can be used for any custom logic |
void |
setCustom4(java.lang.String custom4)
Can be used for any custom logic |
void |
setCustom5(java.lang.String custom5)
Can be used for any custom logic |
static void |
setDdAsAttachment(boolean ddAsAttachment)
The value is read from the DD_DOWNLOAD_AS_ATTACHMENT configuration variable. |
static void |
setDdbasePath(java.lang.String ddbasePath)
The value of the Digital Download base path is read from the DD_BASE_PATH configuration variable. |
static void |
setEnableSSL(boolean enableSSL)
Whether SSL is enabled or not is determined by the ENABLE_SSL configuration variable. |
void |
setForwardAfterLogin(java.lang.String forwardAfterLogin)
The forwardAfterLogin is stored for the cases where the user wants to perform some action such as writing a review, which requires him to be logged in. |
void |
setLangId(int langId)
Set the languageId with the id passed in as a parameter. |
void |
setLocale(java.lang.String lowerCaseCode,
java.lang.String upperCaseCode)
Used to change the locale of the application from the default locale. |
void |
setMetaDescription(java.lang.String metaDescription)
Used by the JSPs to set the content of the meta description tag. |
void |
setMetaKeywords(java.lang.String metaKeywords)
Used by the JSPs to set the content of the meta keywords tag. |
void |
setPageTitle(java.lang.String pageTitle)
Used by the JSPs to set the content of the title tag. |
void |
setSessionId(java.lang.String sessionId)
Set the sessionId with the string passed in as a parameter. |
static void |
setSslPort(java.lang.String sslPort)
The standard port "443" is used unless it is overidden by the SSL_PORT_NUMBER configuration variable. |
static void |
setStandardPort(java.lang.String standardPort)
The standard port "80" is used unless it is overidden by the STANDARD_PORT_NUMBER configuration. |
void |
setXMLOverHTTPResp(java.lang.String overHTTPResp)
XMLOverHTTPResp is used to temporary store an XML response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected org.apache.commons.logging.Log log
public static final java.lang.String KONAKART_KEY
public CurrentNavigation nav
| Constructor Detail |
|---|
public KKAppEng(java.lang.String propertiesPath)
throws com.konakart.app.KKException,
KKAppException
propertiesPath - The name of the properties file (e.g. konakart.properties) which should be in the
class path.
com.konakart.app.KKException
KKAppException
public KKAppEng()
throws KKAppException,
com.konakart.app.KKException
KKAppException
com.konakart.app.KKException| Method Detail |
|---|
public void refreshAllClientConfigs()
throws com.konakart.app.KKException,
KKAppException
KKAppException
com.konakart.app.KKException
protected void refreshAllManagers()
throws com.konakart.app.KKException,
KKAppException
com.konakart.app.KKException
KKAppException
public void reset()
throws com.konakart.app.KKException
com.konakart.app.KKException
public void setLocale(java.lang.String lowerCaseCode,
java.lang.String upperCaseCode)
throws com.konakart.app.KKException,
KKAppException
lowerCaseCode - This is the two letter country code in lower case characters (i.e. it, en etc.)upperCaseCode - This is the two letter country code in upper case characters (i.e. IT, GB etc.)
com.konakart.app.KKException
KKAppExceptionpublic java.lang.String getLocale()
public java.lang.String getConfig(java.lang.String key)
key -
public java.lang.String formatPrice(java.math.BigDecimal number)
throws com.konakart.app.KKException,
KKAppException
number - to be formatted
com.konakart.app.KKException
KKAppException
public java.lang.String formatPrice(java.math.BigDecimal number,
java.lang.String currencyCode)
throws com.konakart.app.KKException,
KKAppException
number - to be formattedcurrencyCode - Three letter currency code (USD, GBP, EUR etc.)
com.konakart.app.KKException
KKAppExceptionpublic CategoryMgr getCategoryMgr()
public ProductMgr getProductMgr()
public int getLangId()
public void setLangId(int langId)
langId - The langId to set.public ReviewMgr getReviewMgr()
public java.lang.String[] getNav()
public java.lang.String getSEARCH_ALL()
public java.lang.String getSessionId()
public java.lang.String getForwardAfterLogin()
public void setForwardAfterLogin(java.lang.String forwardAfterLogin)
forwardAfterLogin - The forwardAfterLogin to set.public com.konakart.appif.KKEngIf getEng()
public java.lang.String getDateAsString(java.util.Calendar date)
date -
public java.lang.String getNowAsString()
public java.lang.String removeCData(java.lang.String stringIn)
stringIn -
public void logout()
throws com.konakart.app.KKException
com.konakart.app.KKExceptionpublic OrderMgr getOrderMgr()
public int getHeadingImageHeight()
public int getHeadingImageWidth()
public int getSmallImageHeight()
public int getSmallImageWidth()
public int getSubcatImageHeight()
public int getSubcatImageWidth()
public boolean displayPriceWithTax()
public BasketMgr getBasketMgr()
public CustomerMgr getCustomerMgr()
public void setSessionId(java.lang.String sessionId)
sessionId - The sessionId to set.public java.lang.String getXMLOverHTTPResp()
public void setXMLOverHTTPResp(java.lang.String overHTTPResp)
overHTTPResp - The xMLOverHTTPResp to set.public static boolean isEnableSSL()
public static void setEnableSSL(boolean enableSSL)
enableSSL - The enableSSL to set.public static java.lang.String getSslPort()
public static void setSslPort(java.lang.String sslPort)
sslPort - The sslPort to set.public static java.lang.String getStandardPort()
public static void setStandardPort(java.lang.String standardPort)
standardPort - The standardPort to set.public ConfigCacheUpdater getCacheUpdateThread()
public java.lang.String getPageTitle()
public void setPageTitle(java.lang.String pageTitle)
pageTitle - The pageTitle to set.public java.lang.String getMetaDescription()
public void setMetaDescription(java.lang.String metaDescription)
metaDescription - The metaDescription to set.public java.lang.String getMetaKeywords()
public void setMetaKeywords(java.lang.String metaKeywords)
metaKeywords - The metaKeywords to set.public static java.lang.String getSslBaseUrl()
public static java.lang.String getDdbasePath()
public static void setDdbasePath(java.lang.String ddbasePath)
ddbasePath - The ddbasePath to set.public static boolean isDdAsAttachment()
public static void setDdAsAttachment(boolean ddAsAttachment)
ddAsAttachment - The ddAsAttachment to set.public java.lang.String getCustom1()
public void setCustom1(java.lang.String custom1)
custom1 - The custom1 to set.public java.lang.String getCustom2()
public void setCustom2(java.lang.String custom2)
custom2 - The custom2 to set.public java.lang.String getCustom3()
public void setCustom3(java.lang.String custom3)
custom3 - The custom3 to set.public java.lang.String getCustom4()
public void setCustom4(java.lang.String custom4)
custom4 - The custom4 to set.public java.lang.String getCustom5()
public void setCustom5(java.lang.String custom5)
custom5 - The custom5 to set.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||