com.konakartadmin.blif
Interface AdminMessageMgrIf

All Known Implementing Classes:
AdminMessageMgr

public interface AdminMessageMgrIf

AdminMessageMgrIf


Method Summary
 void deleteMsg(java.lang.String key, int type, java.lang.String locale)
          Delete a Message
 boolean doesMsgExist(java.lang.String key, int type, java.lang.String locale)
          Does the message exist?
 java.lang.String exportMsgs(int type, java.lang.String locale)
          Export Messages
 java.lang.String getHelpMsg(java.lang.String msgKey, java.lang.String locale)
          Return the help message for the specified language and the specified key.
 java.lang.String getHelpMsgFromDatabase(java.lang.String msgKey, java.lang.String locale)
          Get the help screen message for the specified help message key from the database in the specified language.
 java.lang.String getMsg(java.lang.String msgKey)
          Gets a message with the specified key from the catalog of the default language.
 java.lang.String getMsg(java.lang.String msgKey, java.lang.String locale)
          Gets a message with the specified key from the catalog for the specified locale.
 AdminMessageSet getMsgs(java.lang.String locale)
          Return a set of admin application messages specified language.
 AdminMessageSet getMsgsFromDatabase(java.lang.String locale)
          Gets an AdminMessageSet for the specified locale from the database.
 java.lang.String getMsgValue(java.lang.String key, int type, java.lang.String locale)
          Get a Message Value
 void importMsgs(int type, java.lang.String locale, java.lang.String msgString, boolean replace)
          Import Messages
 void insertMsg(java.lang.String key, int type, java.lang.String locale, java.lang.String value)
          Insert a Message
 java.util.Properties loadMessageProperties(java.lang.String messageFilePath)
          Load the contents of the file whose name is specified into a Properties object.
 void refreshConfigs()
          Retrieve some commonly-used properties and set the velocity log file location
 AdminKkMsgSearchResult searchMsg(AdminKkMsgSearch search, int groupSize, int offset)
          Retrieve all the messages that match the specified search criteria
 void updateMsg(java.lang.String key, int type, java.lang.String locale, java.lang.String value)
          Update a Message
 

Method Detail

getMsgs

AdminMessageSet getMsgs(java.lang.String locale)
                        throws KKAdminException
Return a set of admin application messages specified language. This is used to facilitate internationalization of the KonaKart Admin application - but it could also be used to internationalize any application via the KonaKart Admin API.

For file-based messages (where the configuration parameter USE_DB_FOR_MESSAGES = false) the messages are retrieved from a message properties file on the classpath that best-matches the specified language parameter. The name of the file starts with 'AdminMessages' and may have a language code or locale specification appended to it, and '.properties' added to the end. An example of such a file would be AdminMessages_de.properties. It first tries to find a file that matches the language_code exactly (this could be a full locale description such as 'de_DE' or 'pt_BR') and if no such file is found it tries to find one that matches just the first two characters (in this case 'de' and 'pt' respectively). When the specified language code is 'en' a file without any language or locale specification is used instead.

For database-based messages the language code specified must be the locale specified in the database. By default these will be the full locale names (eg. en_GB, de_DE, pt_BR etc). file for the locale or language code.

Parameters:
locale - See above... Either specify the full language locale or the 2-character language code. If null, the language code of the default language will be used.
Returns:
an AdminMessaegSet object
Throws:
KKAdminException

getMsgsFromDatabase

AdminMessageSet getMsgsFromDatabase(java.lang.String locale)
                                    throws KKAdminException
Gets an AdminMessageSet for the specified locale from the database.

Parameters:
locale - the 5-letter locale code eg. en_GB, es_ES, de_DE etc
Returns:
an AdminMessaegSet object
Throws:
KKAdminException

getHelpMsg

java.lang.String getHelpMsg(java.lang.String msgKey,
                            java.lang.String locale)
                            throws KKAdminException
Return the help message for the specified language and the specified key.

For file-based messages (where the configuration parameter USE_DB_FOR_MESSAGES = false) the message is retrieved from a message properties file on the classpath that best-matches the specified language parameter. The name of the file starts with 'AdminHelpMessages' and may have a language code or locale specification appended to it, and '.properties' added to the end. An example of such a file would be AdminHelpMessages_de.properties. It first tries to find a file that matches the language_code exactly (this could be a full locale description such as 'de_DE' or 'pt_BR') and if no such file is found it tries to find one that matches just the first two characters (in this case 'de' and 'pt' respectively). When the specified language code is 'en' a file without any language or locale specification is used instead.

For database-based messages the language code specified must be the locale specified in the database. By default these will be the full locale names (eg. en_GB, de_DE, pt_BR etc). file for the locale or language code.

Parameters:
msgKey - the key of the help message in the properties file. If null, a null help message is returned.
locale - the language code (if null it uses the current default language)
Returns:
the help message as a String
Throws:
KKAdminException

getHelpMsgFromDatabase

java.lang.String getHelpMsgFromDatabase(java.lang.String msgKey,
                                        java.lang.String locale)
                                        throws KKAdminException
Get the help screen message for the specified help message key from the database in the specified language. No caching is done - it always re-reads the record from the database.

Parameters:
msgKey - the message key
locale - the 5-letter locale code eg. en_GB, es_ES, de_DE etc
Returns:
the help message as a String
Throws:
KKAdminException

loadMessageProperties

java.util.Properties loadMessageProperties(java.lang.String messageFilePath)
                                           throws KKAdminException
Load the contents of the file whose name is specified into a Properties object.

Parameters:
messageFilePath - the message filename
Returns:
the Properties object created
Throws:
KKAdminException

getMsg

java.lang.String getMsg(java.lang.String msgKey)
                        throws KKAdminException
Gets a message with the specified key from the catalog of the default language. This uses caching - it only reads the catalog once - the first time it's called.

This is for Admin Application messages only (type is KKConstants.MSG_TYP_ADMIN_APP)

Parameters:
msgKey - the message key into the message catalog file
Returns:
the message associated with the key as a String
Throws:
KKAdminException

getMsg

java.lang.String getMsg(java.lang.String msgKey,
                        java.lang.String locale)
                        throws KKAdminException
Gets a message with the specified key from the catalog for the specified locale. This uses caching - it only reads the catalog once - the first time it's called.

This is for Admin Application messages only (type is KKConstants.MSG_TYP_ADMIN_APP)

Parameters:
msgKey - the message key into the message catalog file
locale - the 5-letter locale code eg. en_GB, es_ES, de_DE etc
Returns:
the message associated with the key as a String
Throws:
KKAdminException

doesMsgExist

boolean doesMsgExist(java.lang.String key,
                     int type,
                     java.lang.String locale)
                     throws KKAdminException
Does the message exist?

Parameters:
key -
type -
locale -
Returns:
true if the message exists, otherwise false
Throws:
KKAdminException

searchMsg

AdminKkMsgSearchResult searchMsg(AdminKkMsgSearch search,
                                 int groupSize,
                                 int offset)
                                 throws KKAdminException,
                                        org.apache.torque.TorqueException,
                                        com.workingdogs.village.DataSetException
Retrieve all the messages that match the specified search criteria

Parameters:
search - the AdminKkMsgSearch object that defines the search criteria
groupSize - a maximum of this many messages will be returned by each call (the group size)
offset - the offset in the record set that match the criteria from which records are returned
Returns:
An AdminKkMsgSearchResult object containing the messages that match the specified search criteria.
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

getMsgValue

java.lang.String getMsgValue(java.lang.String key,
                             int type,
                             java.lang.String locale)
                             throws java.lang.Exception,
                                    KKAdminException,
                                    org.apache.torque.TorqueException,
                                    com.workingdogs.village.DataSetException
Get a Message Value

Parameters:
key - the message key
type - the message type (Use KKConstants.MSG_TYP_APPLICATION for application messages, KKConstants.MSG_TYP_ADMIN_APP for Admin App messages, KKConstants.MSG_TYP_Admin_HELP for Admin App Help messages)
locale - the message locale (eg. "en_GB"). If this is null the default locale for the store is used.
Returns:
The message for the key, type and locale. If the message isn't found the String "[key:type:locale]" is returned.
Throws:
java.lang.Exception
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

deleteMsg

void deleteMsg(java.lang.String key,
               int type,
               java.lang.String locale)
               throws KKAdminException,
                      org.apache.torque.TorqueException,
                      com.workingdogs.village.DataSetException
Delete a Message

Parameters:
key - the message key
type - the message type (Use KKConstants.MSG_TYP_APPLICATION for application messages, KKConstants.MSG_TYP_ADMIN_APP for Admin App messages, KKConstants.MSG_TYP_Admin_HELP for Admin App Help messages)
locale - the message locale (eg. "en_GB"). If this is null the default locale for the store is used.
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

insertMsg

void insertMsg(java.lang.String key,
               int type,
               java.lang.String locale,
               java.lang.String value)
               throws KKAdminException,
                      org.apache.torque.TorqueException,
                      com.workingdogs.village.DataSetException
Insert a Message

Parameters:
key - the message key
type - the message type (Use KKConstants.MSG_TYP_APPLICATION for application messages, KKConstants.MSG_TYP_ADMIN_APP for Admin App messages, KKConstants.MSG_TYP_Admin_HELP for Admin App Help messages)
locale - the message locale (eg. "en_GB"). If this is null the default locale for the store is used.
value - the value of the message to be inserted
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

updateMsg

void updateMsg(java.lang.String key,
               int type,
               java.lang.String locale,
               java.lang.String value)
               throws KKAdminException,
                      org.apache.torque.TorqueException,
                      com.workingdogs.village.DataSetException
Update a Message

Parameters:
key - the message key
type - the message type (Use KKConstants.MSG_TYP_APPLICATION for application messages, KKConstants.MSG_TYP_ADMIN_APP for Admin App messages, KKConstants.MSG_TYP_Admin_HELP for Admin App Help messages)
locale - the message locale (eg. "en_GB"). If this is null the default locale for the store is used.
value - the new value for the message
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

importMsgs

void importMsgs(int type,
                java.lang.String locale,
                java.lang.String msgString,
                boolean replace)
                throws KKAdminException,
                       org.apache.torque.TorqueException,
                       com.workingdogs.village.DataSetException
Import Messages

Parameters:
type - the message type (Use KKConstants.MSG_TYP_APPLICATION for application messages, KKConstants.MSG_TYP_ADMIN_APP for Admin App messages, KKConstants.MSG_TYP_Admin_HELP for Admin App Help messages)
locale - the message locale (eg. "en_GB"). If this is null the default locale for the store is used.
msgString - A String containing the messages to import in the format of a java properties file
replace - if true all the current messages for the specified type and locale are removed before importing the new messages. If false the new messages are appended and if a message key already exists it is replaced by the new message value being imported.
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

exportMsgs

java.lang.String exportMsgs(int type,
                            java.lang.String locale)
                            throws KKAdminException,
                                   org.apache.torque.TorqueException,
                                   com.workingdogs.village.DataSetException
Export Messages

Parameters:
type - the message type (Use KKConstants.MSG_TYP_APPLICATION for application messages, KKConstants.MSG_TYP_ADMIN_APP for Admin App messages, KKConstants.MSG_TYP_Admin_HELP for Admin App Help messages)
locale - the message locale (eg. "en_GB"). If this is null the default locale for the store is used.
Returns:
msgString A String containing the messages in the format of a java properties file
Throws:
KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException

refreshConfigs

void refreshConfigs()
                    throws KKAdminException
Retrieve some commonly-used properties and set the velocity log file location

Throws:
KKAdminException


Copyright © 2011 DS Data Systems UK Ltd.