• Welcome to KonaKart Community Forum. Please login or sign up.
 

Switching message catalog to database

Started by ReneA, December 20, 2011, 08:53:54 pm

Previous topic - Next topic

ReneA

Dear all,

In chapter 8 of the online documentation there is a chapter on the topic "Switching to Database Messages". I like the idea to be able to maintain the messages by the KonakartAdmin front end.

The documentation describes very well how to convert the message fles into a message table within Konakart database. Also the documentation describes that a configuration value must be switched to true.

What I do not understand is:

in the jsp's a bean:message is being used to retrieve the desired message. Once the configuration value has been set to true, will this bean:message statement retrieve he message from the database table ?

the same kind of question applies to accessing the resource bundle, i.e.
ResourceBundle res =
   ResourceBundle.getBundle("MyResource");
String labelOK = res.getString("OK_TEXT"); 

is there an automatic switch to database table messages ?

and what about the Konakart api getCatMessage. Will this api make the right decision to access either the resource bundle or either the database message table ?

ReneA

I've taken the next steps:
- installed standard Konakart 5.5.0.2.
- reviewed the kkMessage utility and supporting scripts
- modified some of these scripts because I've several different versions of standard Konakart running in my development environment
- discovered that there is no Konakart Admin frontend functionality to change "USE_DB_FOR_MESSAGES"
- so I changed it by using phpMyAdmin
- discovered that the webshop frontend now shows the key values of all messages since I've not loaded the messages yet into table kk_msg (so far so good)
- discovered that the admin frontend doesn't like an empty kk_msg table and is therefore crashing
- discovered that loading the messages by means of the kkMessage utility only works whenever "USE_DB_FOR_MESSAGES" is set to false
- discovered that once the message had been loaded into kk_msg and "USE_DB_FOR_MESSAGES" had been set to true, the messages are perfectly picked up by the jsp's from kk_msg table instead of the message property files.

Thanks Konakart Team for enabling this in the application

kate

The section in the User Guide "under Configuration of Messages") explains where in the Admin App you can modify the "USE_DB_FOR_MESSAGES" configuration variable and the process for loading messages successfully.

The default state of the kk_msg table is for it to be empty and that doesn't cause the Admin App to crash so I'm not sure what has happened to cause that.

You need to load the messages into the db first, then set the "USE_DB_FOR_MESSAGES" configuration variable then all will be fine.

Maybe you were getting problems because you set the config variable before you loaded the messages and hence KonaKart couldn't find any messages to use...

Anyway...  I'm glad you worked it all out on your own in the end.

ReneA

Quote from: kate on December 27, 2011, 09:32:10 am
The section in the User Guide "under Configuration of Messages") explains where in the Admin App you can modify the "USE_DB_FOR_MESSAGES" configuration variable and the process for loading messages successfully.

The default state of the kk_msg table is for it to be empty and that doesn't cause the Admin App to crash so I'm not sure what has happened to cause that.

You need to load the messages into the db first, then set the "USE_DB_FOR_MESSAGES" configuration variable then all will be fine.

Maybe you were getting problems because you set the config variable before you loaded the messages and hence KonaKart couldn't find any messages to use...

Anyway...  I'm glad you worked it all out on your own in the end.


Thanks for your reply.

Yes, you are right. I overlooked in the documentation the clue where to find to modify the "USE_DB_FOR_MESSAGES" configuration variable.

Yes, I changed that variable BEFORE loading the messages into the table. Just testing and getting a proof in the front end gui that the table was choosen as source of the messages. And, of course, it did.