On 15.04.11 04:29, "Kamil Nezval" <[email protected]> wrote: >I'm trying to register my own node that contains a read-only property (set >only when the node is created). So my CND definition looks like this: > >[test:nodeDef] > mix:versionable >- test:protectedproperty (STRING) protected mandatory > >But then I do not know how to create the node and insert it into my >repository. Because when I try this: > >Node rootnode = session.getRootNode(); >Node testNode = rootnode.addNode("testNode", "test:nodeDef"); >testnode.setProperty("test:protectedproperty", "my text"); >session.save(); > >I get an error "javax.servlet.ServletException: >javax.jcr.nodetype.ConstraintViolationException: Unable to perform >operation. Node is protected."
Protected properties/nodes are only available to the implementation, you can't define custom ones (as protected means that you can't change them through the JCR API). This was asked multiple times already: http://markmail.org/message/x6meweddg4bys6tr Regards, Alex -- Alexander Klimetschek Developer // Adobe (Day) // Berlin - Basel
