aspose file tools*
The moose likes Java in General and the fly likes live editing of Properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "live editing of Properties" Watch "live editing of Properties" New topic
Author

live editing of Properties

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39530
    
  27
For an I18N web site of ours we currently have lots of properties files for the textual content of the various languages. We now want to move towards a more dynamic site, and want to make the properties editable in "live" mode so any changes take effect immediately. The dynamic part seems relatively easy (store them in the DB, and create a custom ResourceBundle class that knows how to load them).

I'm wondering about the editing part, though. We can't be the first ones wanting to do this - what do people use for this? We'd prefer a web app as the front end - is anything available commercially or as open source? A search came up empty. Or are folks using an entirely different approach? Any hints and insights would be appreciated.


Ping & DNS - updated with new look and Ping home screen widget
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9313
    
109

Ulf Dittmer wrote:

I'm wondering about the editing part, though. We can't be the first ones wanting to do this - what do people use for this? We'd prefer a web app as the front end - is anything available commercially or as open source? A search came up empty. Or are folks using an entirely different approach? Any hints and insights would be appreciated.


I use github.com as the host for some of the git projects I'm involved in. github.com allows live editing of (any) files. And apparently it's backed by Ace - a javascript code editor


[My Blog] [JavaRanch Journal]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39530
    
  27
Thanks for the suggestion. It's not files we want to edit, though - it's properties. So the editor would have to know about property keys and values at the least. Ideally there would also be a search for both, since there are a lot of properties. And an understanding of how the same property can occur in multiple languages would also be nice (so that I could see the value of a property in all languages).
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
If I understood correct, you are looking to update the properties file based on locale or language.
Many of my considerations are related with environment.

With internationalization you will have various properties files for each locale.
Example
•MessagesBundle.properties
•MessagesBundle_de_DE.properties
•MessagesBundle_en_US.properties
•MessagesBundle_fr_FR.properties

I suggest considering the following.
1. You can pass locale and file name(Eg: "MessageBundle") and read the right properties file. How can you write to the right properties file? So as you said you are writing your own ResourceBundle which loads from db. But what mechanism are you using to write to the properties file.

2. In a clustered environment, how does the write make same changes to all nodes? Will you have property listeners. If it is not clustered do you know whether your website's user community will not increase in future.

3. Many companies have security constraints on writing to property files which are deployed. You said the website is yours. But in future if your companies security constraints change will you be able to write to properties file.?

If you are reading from db, why couldn't you parameterize your properties based on locale in the database itself. In this case you don't need properties file at all. This solution will effectively address scalability and portability issues.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29219
    
134

Another option (aside from the database) is to use Commons Configuration which supports auto-reloading of property files.

Fro the front end, I don't know of anything other than write your own and write to the relevant property files.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39530
    
  27
Commons Configuration looks interesting, although at first glance it doesn't seem to go down the ResourceBundle route - which I think is a must if it is to tie into JSTL's/Stripes' property mechanism (I forgot to mention that this is for a web app).

Apart from that, I don't seem to have explained the issue well. I don't foresee using files at all, as I don't see any benefits in that. The ResourceBundle class will load them directly from a DB. The missing piece is an editor for those properties that reads and writes from/to the DB, and which is savvy about multi-lingual Java properties. There must be thousands of web sites out there that have run into this exact problem, so I was hoping someone had encountered it.

Or are folks not using properties beyond a certain size of the site, and opt for a proper CMS instead? What I'm looking is actually a CMS - just not a full-featured one like OpenCms or Alfresco, but one limited to Java properties.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: live editing of Properties
 
Similar Threads
Properties Manager
JSPs and Servlets in WAS, without a web application
dreamweaver site in a web container?
Content management in J2EE
How to deploy WAR to Tomcat (which is server into Eclipse)