chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Carlos Campanero (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CMIS-523) Inconsistency when updating properties
Date Wed, 12 Feb 2014 17:28:25 GMT

    [ https://issues.apache.org/jira/browse/CMIS-523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13899302#comment-13899302
] 

Jose Carlos Campanero commented on CMIS-523:
--------------------------------------------

First of all, I wanted to apologize for the long period of time in responding to the issue.

Michael, Ivan, Gavin, if you consider appropriate, given that the issue has served to generate
and solve new issues, and that much of the identified erroneous functionality has been resolved,
we can proceed to close it. Do you agree?

Thank you very much.

> 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ürig
>         Attachments: AttachmentDocumentTypeHandler.java, JcrServiceFactoryDecorator.java,
NodeSetNameInvocationHandler.java, jcr_properties.patch
>
>
> Is it possible that errors arise when updating the properties of documents or folders?
> For instance, DefaultDocumentTypeHandler makes use of the content node to set the property
values ​​from the type definition at node's creation:
> {code}
>     public JcrNode createDocument(JcrFolder parentFolder, String name, Properties properties,
ContentStream contentStream, VersioningState versioningState) {
>         try {
>             Node fileNode = parentFolder.getNode().addNode(name, NodeType.NT_FILE);
>             if (versioningState != VersioningState.NONE) {
>                 fileNode.addMixin(NodeType.MIX_SIMPLE_VERSIONABLE);
>             }
>             Node contentNode = fileNode.addNode(Node.JCR_CONTENT, NodeType.NT_RESOURCE);
>             contentNode.addMixin(NodeType.MIX_CREATED);
>             // compile the properties
>             JcrFolder.setProperties(contentNode, getTypeDefinition(), properties);
> {code}
> In contrast, when the document properties are updated by the method updateProperties
in JcrNode is updated 'node', not the context node:
> {code}
>             // Are there properties to update?
>             PropertyUpdater propertyUpdater = PropertyUpdater.create(typeManager, getTypeId(),
properties);
>             JcrVersionBase jcrVersion = isVersionable()
>                     ? asVersion()
>                     : null;
>             // Update properties. Checkout if required
>             boolean autoCheckout = false;
>             if (!propertyUpdater.isEmpty()) {
>                 autoCheckout = jcrVersion != null && !jcrVersion.isCheckedOut();
>                 if (autoCheckout) {
>                     jcrVersion.checkout();
>                 }
>                 // update the properties
>                 propertyUpdater.apply(node);
>             }
> {code}
> Thus, when defining types derived from the base types with specific properties this causes
errors since it indicates that the properties that must be 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)

Mime
View raw message