• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

live editing of Properties

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic