You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Fabián Mandelbaum <fm...@gmail.com> on 2010/02/10 16:51:46 UTC

JCR query command line client

Hello there,

I was wondering if there exist, preferably open source, command line
JCR query clients, similar to 'mysql' for the MySQL database server
for example, allowing one to execute queries against a JCR repository.

For example, I'd like to do things like:

DELETE /system/myNode

and have the JCR /system/myNode removed.

Thanks in advance for your help/ideas

-- 
Fabián Mandelbaum
IS Engineer

Re: JCR query command line client

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

2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
> OTOH, you mention JR 2.x jars, my repo is JR 1.4.x, will the 2.x jars
> work fine with it? (I can test before I ask, but better be safe than
> sorry, even if I can backup the whole folder before attempting
> anything ;-))

Yes, Jackrabbit 2.x should be able to open and use 1.x repositories.
However, Jackrabbit 2.x will automatically upgrade certain aspects of
the repository data structures, so you won't be able to go back to
1.x.

If you can't upgrade to 2.x yet, you can still use the WebDAV remoting
layer to connect to the repository from 2.x clients.

BR,

Jukka Zitting

Re: JCR query command line client

Posted by Fabián Mandelbaum <fm...@gmail.com>.
Hello Jukka,

Yes, you are right that file:///path/to/repository is exactly what I wanted.

OTOH, you mention JR 2.x jars, my repo is JR 1.4.x, will the 2.x jars
work fine with it? (I can test before I ask, but better be safe than
sorry, even if I can backup the whole folder before attempting
anything ;-))

On Wed, Feb 10, 2010 at 1:51 PM, Jukka Zitting <ju...@gmail.com> wrote:
> Hi,
>
> On Wed, Feb 10, 2010 at 5:43 PM, Ard Schrijvers
> <a....@onehippo.com> wrote:
>> 2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
>>> indeed it is! Though I'd like to use it with a local (transient) repo
>>> instead of an RMI one... is this possible with the tool 'as is'?
>>
>> Hmm, you need to connect to a repository, isn't? So, that would be
>> either rmi or webdav or..? Not sure how you could use a shell
>> embedded, if you mean that.
>
> I think he's referring to the client process starting an embedded
> repository instance for accessing the raw repository data on disk.
>
> As an alternative to jcr-shell, you may also want to take a look at
> the --cli mode of the jackrabbit-standalone jar in the latest trunk.
> To open an embedded repository with it, use:
>
>    java -jar jackrabbit-standalone-2.1-SNAPSHOT.jar --cli
> file:///path/to/repository
>
> The tool also supports the RMI and WebDAV remoting layers.
>
> BR,
>
> Jukka Zitting
>



-- 
Fabián Mandelbaum
IS Engineer

Re: JCR query command line client

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

On Wed, Feb 10, 2010 at 5:43 PM, Ard Schrijvers
<a....@onehippo.com> wrote:
> 2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
>> indeed it is! Though I'd like to use it with a local (transient) repo
>> instead of an RMI one... is this possible with the tool 'as is'?
>
> Hmm, you need to connect to a repository, isn't? So, that would be
> either rmi or webdav or..? Not sure how you could use a shell
> embedded, if you mean that.

I think he's referring to the client process starting an embedded
repository instance for accessing the raw repository data on disk.

As an alternative to jcr-shell, you may also want to take a look at
the --cli mode of the jackrabbit-standalone jar in the latest trunk.
To open an embedded repository with it, use:

    java -jar jackrabbit-standalone-2.1-SNAPSHOT.jar --cli
file:///path/to/repository

The tool also supports the RMI and WebDAV remoting layers.

BR,

Jukka Zitting

Re: JCR query command line client

Posted by Fabián Mandelbaum <fm...@gmail.com>.
Below follows an excerpt of a jcr-shell session I've tried, just FYI:

jcr-shell:>repository jcr
  completed: 0 msecs
jcr-shell:>server
Current server: rmi://localhost:1099/hipporepository
  completed: 0 msecs
jcr-shell:>server file:///home/fabman/repos/MyRepo
  completed: 0 msecs
jcr-shell:>server
Current server: file:///home/fabman/repos/MyRepo
  completed: 0 msecs
jcr-shell:>login

Connecting to JCR Repository at 'file:///home/fabman/repos/MyRepo' :
failed: Malformed URL: file:///home/fabman/repos/MyRepo; nested
exception is:
	java.net.MalformedURLException: invalid URL scheme:
file:///home/fabman/repos/MyRepo
  completed: 13 msecs
jcr-shell:>

Thanks again

On Wed, Feb 10, 2010 at 1:43 PM, Ard Schrijvers
<a....@onehippo.com> wrote:
> 2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
>> Hello Ard,
>>
>> indeed it is! Though I'd like to use it with a local (transient) repo
>> instead of an RMI one... is this possible with the tool 'as is'?
>
> Hmm, you need to connect to a repository, isn't? So, that would be
> either rmi or webdav or..? Not sure how you could use a shell
> embedded, if you mean that. OTOH, I do not know much about the tool at
> all. I know I did use it like a year ago, remove nodes, set
> properties, do queries, etc etc. The developer who made it is
> currently on holiday, so he can't help you either at this moment
>
> Regards Ard
>
>>
>> On Wed, Feb 10, 2010 at 1:01 PM, Ard Schrijvers
>> <a....@onehippo.com> wrote:
>>> Hello,
>>>
>>> one of my colleagues, Bart van der Schans, has developed a quite
>>> feature complete jcr shell some time ago. You can download it here
>>>
>>> http://forge.onehippo.org/frs/?group_id=10
>>>
>>> the sources:
>>>
>>> http://forge.hippo-ecm.org/svn/jcr-shell
>>>
>>> and small feature list:
>>>
>>> http://forge.onehippo.org/forum/forum.php?forum_id=21
>>>
>>> It has been a long time ago I used it, but seems exactly what you need.
>>>
>>> Regards Ard
>>>
>>> 2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
>>>> Hello there,
>>>>
>>>> I was wondering if there exist, preferably open source, command line
>>>> JCR query clients, similar to 'mysql' for the MySQL database server
>>>> for example, allowing one to execute queries against a JCR repository.
>>>>
>>>> For example, I'd like to do things like:
>>>>
>>>> DELETE /system/myNode
>>>>
>>>> and have the JCR /system/myNode removed.
>>>>
>>>> Thanks in advance for your help/ideas
>>>>
>>>> --
>>>> Fabián Mandelbaum
>>>> IS Engineer
>>>>
>>>
>>
>>
>>
>> --
>> Fabián Mandelbaum
>> IS Engineer
>>
>



-- 
Fabián Mandelbaum
IS Engineer

Re: JCR query command line client

Posted by Fabián Mandelbaum <fm...@gmail.com>.
Hello again,

yes, I need to connect to a JCR repository, but it's not remote, it's
local, I was thinking on being able to provide the path to the repo
folder for example, and have the shell login onto it with its login
command.

What I'm trying to do is to write a repo migration tool (old repo
structure to new repo structure for a given application, where I know
exactly what changed from one repo to the other) and I was wondering a
tool like jcr-shell would be of much help. I could write the JCR code
to add/remove/change nodes 'by hand', but having a 'generic' tool
(like jcr-shell) would make things much simpler: I was thinking on
having a script like migrate.sql and input that script to the JCR
'interpreter', jcr-shell in this case, and have the repo migrated in a
very simple way.

Anyway, thanks a lot for your help! I'll keep investigating.

On Wed, Feb 10, 2010 at 1:43 PM, Ard Schrijvers
<a....@onehippo.com> wrote:
> 2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
>> Hello Ard,
>>
>> indeed it is! Though I'd like to use it with a local (transient) repo
>> instead of an RMI one... is this possible with the tool 'as is'?
>
> Hmm, you need to connect to a repository, isn't? So, that would be
> either rmi or webdav or..? Not sure how you could use a shell
> embedded, if you mean that. OTOH, I do not know much about the tool at
> all. I know I did use it like a year ago, remove nodes, set
> properties, do queries, etc etc. The developer who made it is
> currently on holiday, so he can't help you either at this moment
>
> Regards Ard
>
>>
>> On Wed, Feb 10, 2010 at 1:01 PM, Ard Schrijvers
>> <a....@onehippo.com> wrote:
>>> Hello,
>>>
>>> one of my colleagues, Bart van der Schans, has developed a quite
>>> feature complete jcr shell some time ago. You can download it here
>>>
>>> http://forge.onehippo.org/frs/?group_id=10
>>>
>>> the sources:
>>>
>>> http://forge.hippo-ecm.org/svn/jcr-shell
>>>
>>> and small feature list:
>>>
>>> http://forge.onehippo.org/forum/forum.php?forum_id=21
>>>
>>> It has been a long time ago I used it, but seems exactly what you need.
>>>
>>> Regards Ard
>>>
>>> 2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
>>>> Hello there,
>>>>
>>>> I was wondering if there exist, preferably open source, command line
>>>> JCR query clients, similar to 'mysql' for the MySQL database server
>>>> for example, allowing one to execute queries against a JCR repository.
>>>>
>>>> For example, I'd like to do things like:
>>>>
>>>> DELETE /system/myNode
>>>>
>>>> and have the JCR /system/myNode removed.
>>>>
>>>> Thanks in advance for your help/ideas
>>>>
>>>> --
>>>> Fabián Mandelbaum
>>>> IS Engineer
>>>>
>>>
>>
>>
>>
>> --
>> Fabián Mandelbaum
>> IS Engineer
>>
>



-- 
Fabián Mandelbaum
IS Engineer

Re: JCR query command line client

Posted by Ard Schrijvers <a....@onehippo.com>.
2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
> Hello Ard,
>
> indeed it is! Though I'd like to use it with a local (transient) repo
> instead of an RMI one... is this possible with the tool 'as is'?

Hmm, you need to connect to a repository, isn't? So, that would be
either rmi or webdav or..? Not sure how you could use a shell
embedded, if you mean that. OTOH, I do not know much about the tool at
all. I know I did use it like a year ago, remove nodes, set
properties, do queries, etc etc. The developer who made it is
currently on holiday, so he can't help you either at this moment

Regards Ard

>
> On Wed, Feb 10, 2010 at 1:01 PM, Ard Schrijvers
> <a....@onehippo.com> wrote:
>> Hello,
>>
>> one of my colleagues, Bart van der Schans, has developed a quite
>> feature complete jcr shell some time ago. You can download it here
>>
>> http://forge.onehippo.org/frs/?group_id=10
>>
>> the sources:
>>
>> http://forge.hippo-ecm.org/svn/jcr-shell
>>
>> and small feature list:
>>
>> http://forge.onehippo.org/forum/forum.php?forum_id=21
>>
>> It has been a long time ago I used it, but seems exactly what you need.
>>
>> Regards Ard
>>
>> 2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
>>> Hello there,
>>>
>>> I was wondering if there exist, preferably open source, command line
>>> JCR query clients, similar to 'mysql' for the MySQL database server
>>> for example, allowing one to execute queries against a JCR repository.
>>>
>>> For example, I'd like to do things like:
>>>
>>> DELETE /system/myNode
>>>
>>> and have the JCR /system/myNode removed.
>>>
>>> Thanks in advance for your help/ideas
>>>
>>> --
>>> Fabián Mandelbaum
>>> IS Engineer
>>>
>>
>
>
>
> --
> Fabián Mandelbaum
> IS Engineer
>

Re: JCR query command line client

Posted by Fabián Mandelbaum <fm...@gmail.com>.
Hello Ard,

indeed it is! Though I'd like to use it with a local (transient) repo
instead of an RMI one... is this possible with the tool 'as is'?

On Wed, Feb 10, 2010 at 1:01 PM, Ard Schrijvers
<a....@onehippo.com> wrote:
> Hello,
>
> one of my colleagues, Bart van der Schans, has developed a quite
> feature complete jcr shell some time ago. You can download it here
>
> http://forge.onehippo.org/frs/?group_id=10
>
> the sources:
>
> http://forge.hippo-ecm.org/svn/jcr-shell
>
> and small feature list:
>
> http://forge.onehippo.org/forum/forum.php?forum_id=21
>
> It has been a long time ago I used it, but seems exactly what you need.
>
> Regards Ard
>
> 2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
>> Hello there,
>>
>> I was wondering if there exist, preferably open source, command line
>> JCR query clients, similar to 'mysql' for the MySQL database server
>> for example, allowing one to execute queries against a JCR repository.
>>
>> For example, I'd like to do things like:
>>
>> DELETE /system/myNode
>>
>> and have the JCR /system/myNode removed.
>>
>> Thanks in advance for your help/ideas
>>
>> --
>> Fabián Mandelbaum
>> IS Engineer
>>
>



-- 
Fabián Mandelbaum
IS Engineer

Re: JCR query command line client

Posted by Ard Schrijvers <a....@onehippo.com>.
Hello,

one of my colleagues, Bart van der Schans, has developed a quite
feature complete jcr shell some time ago. You can download it here

http://forge.onehippo.org/frs/?group_id=10

the sources:

http://forge.hippo-ecm.org/svn/jcr-shell

and small feature list:

http://forge.onehippo.org/forum/forum.php?forum_id=21

It has been a long time ago I used it, but seems exactly what you need.

Regards Ard

2010/2/10 Fabián Mandelbaum <fm...@gmail.com>:
> Hello there,
>
> I was wondering if there exist, preferably open source, command line
> JCR query clients, similar to 'mysql' for the MySQL database server
> for example, allowing one to execute queries against a JCR repository.
>
> For example, I'd like to do things like:
>
> DELETE /system/myNode
>
> and have the JCR /system/myNode removed.
>
> Thanks in advance for your help/ideas
>
> --
> Fabián Mandelbaum
> IS Engineer
>