commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <Joerg.Schai...@Elsag-Solutions.com>
Subject RE: [Configuration] Wish list
Date Thu, 26 Jan 2006 09:13:32 GMT
Hi Borut,

Borut Bolcina wrote on Thursday, January 26, 2006 9:21 AM:

[snip]

> *[1] Getting Properties out of Configuration*
> When using already written software components, some methods take
> Properties as input parameter. If using CompositeConfiguration as a
> central point for accesing properties, it would be desirable to get
> Properties out of PropertiesConfiguration which is part of
> CompositeConfiguration. Example of wanted functionality:
> 
> Configuration propertiesConfiguration = config.getConfiguration(2);
> Properties properties = propertiesConfiguration.getProperties();
> 
> Asume 3rd entry in configuration.xml is <properties>.

It is here and it is not tied to a spcific Configuration implementation:
ConfigurationConverter.getProperties(Configuration)

Hint for docu:
http://jakarta.apache.org/commons/configuration/overview.html
Should mension, that it does convert vice versa :)

[snip]

> *[3] Getting configurations out of configuration.xml could be done by
> name and not by index.* So, instead of
> config.getConfiguration(2)
> one could write
> config.getConfiguration("entryThree");
> 
> A new attribute for each entry should be introduced, something like:
>   <configuration>
>	 <xml id="entryOne" fileName="prop1.xml"/>
> 	 <xml id="entryTwo" fileName="prop2.xml"/>
>	 <properties id="entryThree" fileName="prop3.properties"/>  
> 	 <database id="entryFour"
> connect="jdbc:mysql://delovc10.noviforum.si/feeds?user=foo&pas
> sword=bar"/>
>   </configuration> 

Since you make seem to access the distinct configuration files anyway, use subsets instead:

<configuration>
    <additional>
        <xml fileName="prop1.xml" at="prop1" at="entryOne" />
        <!-- ... -->
    </additional>
</configuration>

config.subset("entryOne");

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message