jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils Weinander <nils.weinan...@mogul.com>
Subject Re: Adding jcr:title and jcr:description properties
Date Wed, 03 Mar 2010 14:43:42 GMT

On 2010-03-03 14:51, Jukka Zitting [via Jackrabbit] wrote:
> Hi,
>
> On Wed, Mar 3, 2010 at 11:24 AM, Nils Weinander
> <[hidden email]
> <http://n4.nabble.com/user/SendEmail.jtp?type=node&node=1576552&i=0>>
> wrote:
>  >   Node containerNode = rootNode.addNode(id,
> jcrConstants.getNT_FOLDER());
>  >   containerNode.addMixin("mix:title");
>  >   containerNode.setProperty("jcr:title", title);
>  >   containerNode.setProperty("jcr:description", description);
>  >   session.save();
>
> Try replacing the last line with:
>
> rootNode.getSession().save();
>
> As discussed, you're probably saving the wrong session.

No, that doesn't make a difference and shouldn't really as
I have got rootNode from session:

Node rootNode = session.getRootNode();				
Node containerNode = rootNode.addNode(id, jcrConstants.getNT_FOLDER());
containerNode.addMixin("mix:title");
containerNode.setProperty("jcr:title", title);
containerNode.setProperty("jcr:description", description);
session.save();

I am trying to upgrade spring-modules-jcr to a newer version,
but have other problems with that so far.

>
> PS. See constants like NodeType.NT_FOLDER, NodeType.MIX_TITLE and
> Property.JCR_DESCRIPTION in JCR 2.0.

Nice!

-- 
mogul | nils weinander |
hudiksvallsgatan 4 113 30 stockholm sweden |
+46 8 4100 6456 | +46 709 78 28 37 |
nils.weinander@mogul.com | skype: nils.weinander |
www.mogul.com


-----
____________________________________________________________
Nils Weinander
-- 
View this message in context: http://n4.nabble.com/Adding-jcr-title-and-jcr-description-properties-tp1576347p1576634.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message