Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4807110A73 for ; Wed, 12 Feb 2014 17:36:28 +0000 (UTC) Received: (qmail 666 invoked by uid 500); 12 Feb 2014 17:36:21 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 601 invoked by uid 500); 12 Feb 2014 17:36:21 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 582 invoked by uid 99); 12 Feb 2014 17:36:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Feb 2014 17:36:20 +0000 Date: Wed, 12 Feb 2014 17:36:20 +0000 (UTC) From: =?utf-8?Q?Michael_D=C3=BCrig_=28JIRA=29?= To: dev@chemistry.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CMIS-523) Inconsistency when updating properties MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CMIS-523?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D138993= 11#comment-13899311 ]=20 Michael D=C3=BCrig commented on CMIS-523: ------------------------------------ works for me > Inconsistency when updating properties > -------------------------------------- > > Key: CMIS-523 > URL: https://issues.apache.org/jira/browse/CMIS-523 > Project: Chemistry > Issue Type: Bug > Components: opencmis-server-jcr > Affects Versions: OpenCMIS 0.6.0 > Reporter: Jose Carlos Campanero > Assignee: Michael D=C3=BCrig > Attachments: AttachmentDocumentTypeHandler.java, JcrServiceFactor= yDecorator.java, NodeSetNameInvocationHandler.java, jcr_properties.patch > > > Is it possible that errors arise when updating the properties of document= s or folders? > For instance, DefaultDocumentTypeHandler makes use of the content node to= set the property values =E2=80=8B=E2=80=8Bfrom the type definition at node= 's creation: > {code} > public JcrNode createDocument(JcrFolder parentFolder, String name, Pr= operties properties, ContentStream contentStream, VersioningState versionin= gState) { > try { > Node fileNode =3D parentFolder.getNode().addNode(name, NodeTy= pe.NT_FILE); > if (versioningState !=3D VersioningState.NONE) { > fileNode.addMixin(NodeType.MIX_SIMPLE_VERSIONABLE); > } > Node contentNode =3D fileNode.addNode(Node.JCR_CONTENT, NodeT= ype.NT_RESOURCE); > contentNode.addMixin(NodeType.MIX_CREATED); > // compile the properties > JcrFolder.setProperties(contentNode, getTypeDefinition(), pro= perties); > {code} > In contrast, when the document properties are updated by the method updat= eProperties in JcrNode is updated 'node', not the context node: > {code} > // Are there properties to update? > PropertyUpdater propertyUpdater =3D PropertyUpdater.create(ty= peManager, getTypeId(), properties); > JcrVersionBase jcrVersion =3D isVersionable() > ? asVersion() > : null; > // Update properties. Checkout if required > boolean autoCheckout =3D false; > if (!propertyUpdater.isEmpty()) { > autoCheckout =3D jcrVersion !=3D null && !jcrVersion.isCh= eckedOut(); > if (autoCheckout) { > jcrVersion.checkout(); > } > // update the properties > propertyUpdater.apply(node); > } > {code} > Thus, when defining types derived from the base types with specific prope= rties this causes errors since it indicates that the properties that must b= e updated are not defined in the node. > Maybe it is necessary to override this functionality in the derived types= ? -- This message was sent by Atlassian JIRA (v6.1.5#6160)