jakarta-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Lopez <dan...@rawbyte.com>
Subject Re: Jakarta/Apache XML/RDF configuration file format(s)
Date Wed, 14 Jul 1999 00:42:36 GMT

Hi Stefano, Eric, everybody

I have been on travel and just now been able to catch up with all my email.
(also, Eric, can you update my address on the mailing list from
ridruejo@esi.us.es to daniel@rawbyte.com? Thanks!)
I have been working on a new version of Comanche for the past months.
I have implemented some ideas that you may find interesting

> > are not bothered by unnecessary information in their XML configuration
> I assume you are referring to the separation of the application
> dependent data from the data that the GUI configuration program uses.

I have implmented it in the following way: One XML file to describe the
syntax, type, etc of the data file and the data file. If you edit by hand
you only have to modify the data file. The GUI loads the data file ad when
it has to represent one of the entries, it looks up it in the definition.




Definition file:
<string name="serverName" label="Server Name" width="20">
<number name="port" label="Port" width="5">

> I believe Daniel Lopez Ridruejo has a lot of experience on this
> topic. Daniel - have you figured out the ultimate configuration schema
> to describe the universe?

Kind of :-) Here is my take on that. I wanted a generic enough configuration
mechanism so I can define arbitrary syntaxis. Brent Welch (from Tcl fame) gave
me the idea that I should go for describing the content, not what it looks
like (i.e use string instead of entry, because this way you can separate 
syntax from representation)

I have the following basic building blocks:

- String 
<string name="serverName" label="Name of the server"> 

What will appear in the configuration file:

- Number 
<string name="port" label="Port"> 
Conf file:

- List (Collection of elements of the same type. The list element definiton 
  (the part inside <syntax> can be itself be described in terms of other
basic building blocks) This is the simple case of a list of strings

<list name="userNames" label="Name of the users"> 
<syntax><string name="user" /></syntax>

Conf file:

- Structure: The structure is composed of one or more elements. For example, 
a web server address structure would be composed of a IP address / Port pair: 

<structure name="webAddress" label="Web address"> 
<string name="ip" label="Ip Address" /> 
<string name="port" label="Port" /> 

Conf file:

- Choice: The user can select among several options. 
<choice name="fruits" label="Fruits of the loom"> 
<option name="pear" value="green pear" /> 
<option name="grape" value="Red grape" /> 

Conf file:

- Boolean: The value can be one or zero (for true/false) 

<boolean name="hostNameLookUps" label="Look up host names?" > 

Conf file:

- Alternate: select one of several syntaxis

<alternate name="bindAddress" label="Address to bind the server">
<label name="allAddresses" label="All available addresses" />
<string name="specific" label="Specific address/domain-name" >


The cool thing about this is that you can arbitrarily define 
complex directives based on simple building blocks
Here is what comanche uses for allow/deny, etc directives
(do not worry, I think this is as complex as it can get:

<list name="access" label="IP based Access Control">
   <structure name="rule" label="Access Rule" >
	      <choice name="action" label="Action">
		        <option name="allow" value="Allow Access" />
			<option name="deny" value="Deny Access" />
   <alternate name="subject" label="Based on" style="normal" align="horizontal">
	      <alternate name="host" label="Hostname or IP address" style="normal">
		  <label name="all" label="All hosts" />
		  <string name="ipDom" label="Certain host(s) " />
	      <string name="env" label="Existence of environment variable" />
Which translates into:


To ease the transition, what I have also now is a set of rules for
converting from httpd.conf format to this one and the other way around.
So you can still edit your config files by hand.

I will release a beta as soon as I finnish the clean
up and some stuff I still have to do, so you can actually play with it.

What do you think of this stuff?



View raw message