jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: newbie question - JCRUtils
Date Mon, 26 Apr 2010 21:27:24 GMT
On Mon, Apr 26, 2010 at 21:38, danisevsky <danisevsky@gmail.com> wrote:
> Hello, is there better way to create some folders (path) ?
>
> My code:
>
>    public static final String TMP_PATH = "my:root/tmp/incoming";
>    public static final String GALLERY_PATH = "my:root/data/gallery/";
>
>
>    public static initWorkspace() {
>            ...
>            JcrNode root = getCurrentSession(workspaceId).getRootNode();
>            root.addNode("my:root").addNode("data").addNode("gallery");
>            root.addNode("my:root/tmp").addNode("incomming");
>            getCurrentSession(workspaceId).save();
>            ...
>    }
>
> Is there some Utils class which can do something like this:
>
> JCRUtils.createNodes(TMP_PATH);
> JCRUtils.createNodes(GALLERY_PATH);

None that is open source and that I know of. We have such a utility
class that creates node paths, automatically creates unique node
names, if desired, does session-based copying of nodes, etc. in our
proprietary code base (cq5). It's fairly easy, though.

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message