commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borut Bolčina <...@najdi.si>
Subject Re: [Configuration] Wish list
Date Thu, 26 Jan 2006 10:06:09 GMT
Hello Jörg

see below

On 26.1.2006 10:13, Jörg Schaible wrote:
> 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)
>   
That is good news - thanks!
> Hint for docu:
> http://jakarta.apache.org/commons/configuration/overview.html
> Should mension, that it does convert vice versa :)
>   
This feature is easily missed as it is under "Configuration Sources"  
section. IMHO it should stand out on its own. More careful API 
inspection on my side should discover ConfigurationConverter class though.
> [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");
>   
Where is <additional> tag documented? Is there a DTD or XML Schema? 
There are two attributes with the same name (at).

Thanks for your quick reply Jörg!

- Borut


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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message