Return-Path: X-Original-To: apmail-jackrabbit-users-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F09C6202E for ; Wed, 27 Apr 2011 13:14:33 +0000 (UTC) Received: (qmail 65367 invoked by uid 500); 27 Apr 2011 13:14:33 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 65314 invoked by uid 500); 27 Apr 2011 13:14:32 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 65306 invoked by uid 99); 27 Apr 2011 13:14:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Apr 2011 13:14:32 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=MSGID_MULTIPLE_AT,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [217.11.236.49] (HELO xitee.com) (217.11.236.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 Apr 2011 13:14:23 +0000 Received: (qmail 5655 invoked from network); 27 Apr 2011 15:14:03 +0200 Received: from svr-mail.ee-consultants.de (HELO karnak) (213.61.130.122) by xitee.com with (RC4-MD5 encrypted) SMTP; 27 Apr 2011 15:14:02 +0200 From: "Kamil Nezval" To: References: <001e01cbfb60$59f98cb0$0deca610$@nezval@xitee.com> In-Reply-To: <001e01cbfb60$59f98cb0$0deca610$@nezval@xitee.com> Subject: RE: Create readonly property Date: Wed, 27 Apr 2011 15:13:35 +0200 Organization: xITee Message-ID: <02e501cc04dc$eb8770e0$c29652a0$@nezval@xitee.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acv7YFjRGMwNuYefSHq51ageN5PyxQJfAalA Content-Language: cs X-Virus-Checked: Checked by ClamAV on apache.org Hi, Really nobody knows a solution? I suppose there is an API in a jackrabbit library that allows it, but I haven't found any so far. Could anybody please help me? Thanks a lot. Kamil -----Original Message----- Hi, 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." So is there a way how to create a node, set its properties and then insert it into a repository? Or how should I reach my goal? Thanks a lot for any help. Regards Kamil