You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Charles Johnson <cj...@proteanit.net> on 2008/05/12 12:39:38 UTC

JCR Controller copy node

Not quite sure how to get this to work, in terms of how to specify the 
source and destination nodes. Drag and drop is not enabled in my version 
( 0.72 ). Can anyone help?

CJ

Re: Using a properties file for values in repository.xml

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Wed, May 14, 2008 at 10:07 PM, Thomas Müller <th...@day.com> wrote:
>>  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).

Since Jackrabbit 1.4 it has been possible to system properties as
${...} variables in repository.xml. See JCR-1304 [1] for more details.

[1] https://issues.apache.org/jira/browse/JCR-1304

BR,

Jukka Zitting

Re: Using a properties file for values in repository.xml

Posted by Alexander Klimetschek <ak...@day.com>.
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 <eh...@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 <tm...@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/

Re: Using a properties file for values in repository.xml

Posted by Emmanuel Hugonnet <eh...@gmail.com>.
 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 <tm...@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

Re: Using a properties file for values in repository.xml

Posted by Emmanuel Hugonnet <eh...@gmail.com>.
Hi,
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

Emmanuel



RE: Using a properties file for values in repository.xml

Posted by Karianne Berg <ke...@start.no>.
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] 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


Re: Using a properties file for values in repository.xml

Posted by Thomas Müller <th...@day.com>.
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

Using a properties file for values in repository.xml

Posted by Karianne Berg <ke...@start.no>.
Hello list,

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? I am specifically thinking about database login information, as different users will want to have different usernames and passwords.

Best regards,
Karianne Berg


Re: JCR Controller copy node

Posted by Jacco van Weert <11...@gmail.com>.
Yes,

The copy of the object is placed on the same level as the original object


Jacco



On Tue, May 13, 2008 at 3:58 PM, Charles Johnson <cj...@proteanit.net> wrote:

> Thanks Jacco. Do you mean it's not possible to decide where to place the
> copy?
>
> CJ
>
>
> Jacco van Weert wrote:
>
> > Hello CJ,
> >
> > You can copy a node (select it and press the "Copy" button)... the
> > controller will create a copy of the node (and children) with a new
> > name.
> > Currently it isn't possible to move a node.
> >
> >
> > Greetings,
> >
> >   Jacco
> >
> >
> >
> >
> > On Mon, May 12, 2008 at 12:39 PM, Charles Johnson <cj...@proteanit.net>
> > wrote:
> >
> > Not quite sure how to get this to work, in terms of how to specify the
> > > source and destination nodes. Drag and drop is not enabled in my
> > > version (
> > > 0.72 ). Can anyone help?
> > >
> > > CJ
> > >
> > >
> >
> >
> >


-- 
-------------------------------------
Jacco van Weert -- 1111software@gmail.com
JCR Controller -- http://www.xs4all.nl/~weertj/jcr
JeCARS -- http://jecars.sourceforge.net

Re: JCR Controller copy node

Posted by Charles Johnson <cj...@proteanit.net>.
Thanks Jacco. Do you mean it's not possible to decide where to place the 
copy?

CJ

Jacco van Weert wrote:
> Hello CJ,
> 
> You can copy a node (select it and press the "Copy" button)... the
> controller will create a copy of the node (and children) with a new name.
> Currently it isn't possible to move a node.
> 
> 
> Greetings,
> 
>    Jacco
> 
> 
> 
> 
> On Mon, May 12, 2008 at 12:39 PM, Charles Johnson <cj...@proteanit.net> wrote:
> 
>> Not quite sure how to get this to work, in terms of how to specify the
>> source and destination nodes. Drag and drop is not enabled in my version (
>> 0.72 ). Can anyone help?
>>
>> CJ
>>
> 
> 
> 

Re: JCR Controller copy node

Posted by Jacco van Weert <11...@gmail.com>.
Hello CJ,

You can copy a node (select it and press the "Copy" button)... the
controller will create a copy of the node (and children) with a new name.
Currently it isn't possible to move a node.


Greetings,

   Jacco




On Mon, May 12, 2008 at 12:39 PM, Charles Johnson <cj...@proteanit.net> wrote:

> Not quite sure how to get this to work, in terms of how to specify the
> source and destination nodes. Drag and drop is not enabled in my version (
> 0.72 ). Can anyone help?
>
> CJ
>



-- 
-------------------------------------
Jacco van Weert -- 1111software@gmail.com
JCR Controller -- http://www.xs4all.nl/~weertj/jcr
JeCARS -- http://jecars.sourceforge.net