On May 22, 2012, at 2:57 PM, Fabio Mancinelli wrote:

> Interesting :)
> 
> FYI I think I already did almost the same thing for a prototype.
> 
> In particular the module
> https://github.com/xwiki-contrib/xwiki-platform-cloud/tree/master/xwiki-platform-cloud-configuration/xwiki-platform-cloud-configuration-hibernate-environment

Interesting indeed :)

BTW did you know that we already support overriding in DBCPConnectionProvider? 
:)

Here's the code:

            String jdbcUrl = System.getProperty(Environment.URL);
            if (jdbcUrl == null) {
                jdbcUrl = props.getProperty(Environment.URL);
            }
            dbcpProperties.put("url", jdbcUrl);


So if you put "hibernate.connection.url" as a System property it'll be used 
instead of the one from the hibernate.cfg.xml file.

Thanks
-Vincent

> and the old core patch
> https://github.com/xwiki-contrib/xwiki-platform-cloud/blob/master/xwiki-platform-cloud-legacy-oldcore/src/main/patches/XWikiHibernateBaseStore.patch
> 
> -Fabio
> 
> On Tue, May 22, 2012 at 2:49 PM, Vincent Massol <[email protected]> wrote:
>> Hi devs,
>> 
>> I need to be able to configuration the location of the HSQLDB database/ 
>> directory in our installer when executing on windows7 (because on windows7 
>> you cannot write to the ProgramFiles directory).
>> 
>> I'm proposing to add variable substitution so that we can configure 
>> connectio.url for HSQLDB to point to the environment.permanentDirectory 
>> location.
>> 
>> We would have:
>> <property 
>> name="connection.url">jdbc:hsqldb:file:${environment.permanentDirectory)/database/xwiki_db;shutdown=true</property>
>> 
>> Technical details:
>> * I'll modify DBCPConnectionProvider. More specifically this part:
>> 
>>            String jdbcUrl = System.getProperty(Environment.URL);
>>            if (jdbcUrl == null) {
>>                jdbcUrl = props.getProperty(Environment.URL);
>>            }
>>            dbcpProperties.put("url", jdbcUrl);
>> 
>> * And look for ${…} , extract the variable name and use the 
>> XWikiPropertiesConfigurationSource to get the value for that variable name, 
>> as a String.
>> 
>> WDYT?
>> 
>> Thanks
>> -Vincent
>> 
>> 
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to