views:

109

answers:

4

I have a bunch of configuration files which are usually properties files which are opened from application and edited like notepad.Now the requirement is pick each property and find which HTML tag does it fit through and display the whole properties file as HTML page. For eg:

Security.Properties file

//This property checks if the user has already logged or not
//Possible values Y N

order.security.Login=Y

So the above property has two possible values Y N .The equivalent HTML format can be a radio button with Y N. Similarly if another property takes values 1,2, the HTML is Listbox with these two values.

I know this is little cumbersome but has to done. Development is JAVA JAVASCRIPT VELOCITY My idea is convert all properties files into XML then use XSLT to render as HTML. I would like to hear more ideas including performance issues.

A: 

Like you said, XSLT seems like the way to go.

Gab Royer
But the problem is there are about 1200 conf files which needs to be altered. Can this be scalable?
GustlyWind
With the right templates and if your XML have similarly made, this would require only 1 XSLT sheet. XSLT is usually more efficient then DOM manipulation.
Gab Royer
A: 

How about a small javadoc/c#doc:

//<desc>This property checks if the user has already logged or not
//Possible values Y N</desc>
//<type>YN</type>
order.security.Login=Y
kd304
What will be the next step after JavaDoc .The second part of the problem of determining HTML appropriate tag
GustlyWind
+1  A: 

I would define a XML file that lists every properties key, and for each, the way it will displayed in HTML.

<property key="order.security.Login">
    <display type="radio" values="Y,N" />
</property>

then if you want to display a Properties as an HTML file, just parse this XML file with XSLT, using the property key to match the right element and display well its content (with a XSL file that convert a <display type="radio"> into a list of <input type="radio">)

Dunno if it will fit to your app configuration, but that'll be my first idea to fit.

ipingu
But please, don't reinvent the XML schema. There are Java tools available to build editors dinamically from XSD.
kd304
A: 
Shawn