jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Using a properties file for values in repository.xml
Date Thu, 29 May 2008 20:25:51 GMT
System properties inside the repository.xml are possible since
Jackrabbit 1.4, see here:
http://issues.apache.org/jira/browse/JCR-1304

You have to write a wrapper code that loads the properties in the same
JVM before the Jackrabbit repository is started, though.

Regards,
Alex

On Thu, May 29, 2008 at 8:24 PM, Emmanuel Hugonnet <ehsavoie73@gmail.com> wrote:
>  Karianne Berg a écrit :
>
> Hi, and thank you for replying. I did perhaps not describe the issue
> clearly enough. The case is that we have a project with several
> developers that have different database usernames/passwords/urls. If I
> worked up against a database, I would use Spring to declare a data
> source and have properties for these values, like this:
>
> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
>        <property name="driverClassName" value="${jdbc.driverClassName}"/>
>        <property name="url" value="${jdbc.url}"/>
>        <property name="username" value="${jdbc.username}"/>
>        <property name="password" value="${jdbc.password}"/>
> </bean>
>
> When I declare my repository in Spring via spring-modules' JCR
> support, this is no longer possible, since this data is not in my
> spring configuration files, but in repository.xml. I would like to be
> able to do something similar in repository.xml - not hardcode the
> database information, but have a property file hold these values. I
> was thinking about solving this by having one repository.xml per
> developer - this is perhaps the way to go if it is not possible to
> load a properties file from repository.xml and use the properties
> without running String replacement myself.
>
> - Karianne
>
> -----Original Message-----
> From: tmueller@day.com [mailto:tmueller@day.com <tmueller@day.com>] On
> Behalf Of Thomas Müller
> Sent: Wednesday, May 14, 2008 9:08 PM
> To: users@jackrabbit.apache.org
> Subject: Re: Using a properties file for values in repository.xml
>
> Hi,
>
>    I was wondering if it is possible to have certain values used in
> repository.xml in a properties file, and somehow get repository xml to
> use those values?
>
>  One solution is to use find / replace (read the document as a String,
> use String.replaceAll, store the document).
>
>   I am specifically thinking about database login information, as
> different users will want to have different usernames and passwords.
>
>  I don't understand, will multiple users open the same repository at
> the same time? This doesn't work. Or do you mean sessions? Could you
> please describe why you like to use multiple user names?
>
> Regards,
> Thomas
>
>   I have a spring-modules RespositoryFactoryBean that does this. It is a
> mix between Spring and Jackrabbit code ;)
> I have entered an issue here :
> https://springmodules.dev.java.net/issues/show_bug.cgi?id=12
> and here
> http://www.ehsavoie.com
>



-- 
Alexander Klimetschek
alexander.klimetschek@day.com

>> Day JCR Cup 08 | Win a MacBook Pro: http://dev.day.com/ <<

----------------------------< alexander.klimetschek@day.com >----------
Alexander Klimetschek, Day Management AG, Barfuesserplatz 6,
CH - 4001 Basel, T +41 61 226 55 31, M +49 151 15 77 20 56
---------------------------------------< http://www.day.com >-----------------

Xing: http://www.xing.com/go/invite/3268380.32d2d4
LinkedIn: http://www.linkedin.com/in/klimetschek
Blog: http://weblogs.goshaky.com/weblogs/alexkli/

Mime
View raw message