Hi Chetan,

Just how I thought. But I hoped there would be a way to get a JCR Session.
What I was trying to do is copy a node (NodeState) with all its properties
and children. Using the oak API, I had to roll my own and recursively call
copy. Not a biggie, but it's odd that doesn't exist on the NodeBuilder or
something.

Thanks!
Andrei

On Wed Feb 11 2015 at 12:38:10 PM Chetan Mehrotra <[email protected]>
wrote:

> oak-run console is only meant to initialize a Oak ContentSession
> (which differs from a JCR Session!) and does not initializes a full
> feldged JCR session. So you cannot perform operations via JCR API. The
> console is mostly meant to perform low level debugging and
> manipulation of data.
>
> What are you trying to achieve? If you can use the std JCR API then
> prefer that but then yes oak-run console cannot be used
>
>
> Chetan Mehrotra
>
>
> On Wed, Feb 11, 2015 at 3:25 PM, Andrei Dulvac <[email protected]>
> wrote:
> > Hi devs,
> >
> > I'm curious of the easiest way to copy a jcr node using the oak run
> groovy
> > console. I know that's easily achievable from the workspace by using the
> > path and using the jcr Session:   session.getWorkspace().copy("/
> path/src",
> > "/path/dst/");
> > But from the oak run groovy console, all I have to start with is a
> > org.apache.jackrabbit.oak.console.ConsoleSession. I can't seem to find a
> > way to get the jcr workspace. Noob question 2: Should ConsoleSession
> > implement Session?
> >
> > Thanks,
> > Andrei
>

Reply via email to