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 C0C01DD4C for ; Thu, 23 Aug 2012 13:42:42 +0000 (UTC) Received: (qmail 28768 invoked by uid 500); 23 Aug 2012 13:42:42 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 28651 invoked by uid 500); 23 Aug 2012 13:42:42 -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 28641 invoked by uid 99); 23 Aug 2012 13:42:42 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Aug 2012 13:42:42 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 5391F2C0A4B for ; Thu, 23 Aug 2012 13:42:42 +0000 (UTC) Date: Fri, 24 Aug 2012 00:42:42 +1100 (NCT) From: "Ivan Vasiliev (JIRA)" To: dev@chemistry.apache.org Message-ID: <693011748.5394.1345729362342.JavaMail.jiratomcat@arcas> In-Reply-To: <773693269.33273.1334676979126.JavaMail.tomcat@hel.zones.apache.org> 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=3D134402= 86#comment-13440286 ]=20 Ivan Vasiliev commented on CMIS-523: ------------------------------------ {quote} If you could propose a patch optimally also supply a patch {quote} Issues added: CMIS-563, CMIS-562 =20 > 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 > > > 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 is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs: https://issues.apache.org/jira/secure/ContactAdministrators!default.jsp= a For more information on JIRA, see: http://www.atlassian.com/software/jira