Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 5155 invoked from network); 25 Oct 2010 16:27:44 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Oct 2010 16:27:44 -0000 Received: (qmail 7753 invoked by uid 500); 25 Oct 2010 16:27:44 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 7724 invoked by uid 500); 25 Oct 2010 16:27:44 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 7717 invoked by uid 99); 25 Oct 2010 16:27:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Oct 2010 16:27:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Oct 2010 16:27:43 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9PGRN0D019587 for ; Mon, 25 Oct 2010 16:27:23 GMT Message-ID: <1400079.61101288024043362.JavaMail.jira@thor> Date: Mon, 25 Oct 2010 12:27:23 -0400 (EDT) From: "Stefan Guggisberg (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Resolved: (JCR-2772) replacing an extended mixin with it's supertype is problematic In-Reply-To: <15738047.45271286566410561.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/JCR-2772?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Guggisberg resolved JCR-2772. ------------------------------------ Resolution: Fixed Fix Version/s: 2.2.0 resolved as duplicate of JCR-2788 > replacing an extended mixin with it's supertype is problematic > -------------------------------------------------------------- > > Key: JCR-2772 > URL: https://issues.apache.org/jira/browse/JCR-2772 > Project: Jackrabbit Content Repository > Issue Type: Improvement > Components: jackrabbit-core > Affects Versions: 2.0.0 > Reporter: Tobias Bocanegra > Fix For: 2.2.0 > > > node.addMixin() / node.removeMixin() have some checks to avoid redundant mixin settings on a node and not only when the node is saved. > eg: have 2 mixins: mix:A and mix:AA where mix:AA > mix:A and a node (N with mix:AA) on it. > then, N.addMixin(mix:A) has no effect, since it's regarded as redundant. so you have to remove mix:AA first and then add mix:A. > there is the first problem when applying mixin types programmatically, just be sure to remove them first before adding new ones. > the 2nd problem occurs when mix:A has a mandatory property. then somehow when downgrading from mix:AA to mix:A, some information is lost, and a save call results in > Unable to save node 'N': javax.jcr.nodetype.ConstraintViolationException: /test/A: mandatory property {}prop does not exist. > you need to "touch" the property, otherwise it will not work. > so only this works: > N.removeMixin("mix:AA"); > N.addMixin("mix:A"); > N.setProperty("prop", N.getProperty("prop").getValue()); > session.save(); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.