cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot set properties using createDocument??

syberyan
Champ in-the-making
Champ in-the-making
I am currently trying to upgrade our cmis client application from Alfresco 3.2 community to 3.3g.

But no matter what I try, createDocument won't set my custom properties. (Which worked fine in 3.2)
(createFolder does set them …)

This is what I post to a children uri:

    <entry xmlns="http://www.w3.org/2005/Atom">
        <title type="text">image1.jpg</title>
        <summary type="text">my summary</summary>
        <object xmlns="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
            <properties xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/">
                <propertyString propertyDefinitionId="cmis:objectTypeId">
                    <value>D:mymodel:image</value>
                </propertyString>
                <propertyString propertyDefinitionId="mymodel:prop">
                    <value>a value</value>
                </propertyString>
            </properties>
        </object>
    </entry>

The entry that is returned has no value for 'mymodelSmiley Tonguerop' . Also the summary isn't set. This can also be reproduced with the default cmis:document type:

Posting

<entry xmlns=\"http://www.w3.org/2005/Atom\">
<summary>a summary</summary>"
<title>image6</title>"
<object xmlns="http://docs.oasis-open.org/ns/cmis/restatom/200908/">"
<properties xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/">"
  <propertyString propertyDefinitionId="cmis:objectTypeId">"
    <value>cmis:document</value>"
  </propertyString>"
</properties>"
</object>"
</entry>

returns

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:alf="http://www.alfresco.org">

<summary>image6</summary>
<title>image6</title>

</entry>

Am I doing something wrong here or is this really a bug?
(would be weird that nobody has filed this before)
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
An old post, but in case it helps, the element name of your property matters. In this case you are setting an "ID" type but using "propertyString" as the element when you should be using "propertyId".

So instead of this:
<propertyString propertyDefinitionId="cmis:objectTypeId">
    <value>D:mymodel:image</value>
</propertyString>
Use this:
<propertyId propertyDefinitionId="cmis:objectTypeId">
    <value>D:mymodel:image</value>
</propertyId>
Jeff