<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311540#M264670</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I said, merging existing and aspects to add is the responsiblity of the client library before sending the CMIS request. Alfresco is not allowed to override the request data from the client because that would effectively result in users not being able to remove aspects again...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 08 Oct 2016 08:50:44 GMT</pubDate>
    <dc:creator>afaust</dc:creator>
    <dc:date>2016-10-08T08:50:44Z</dc:date>
    <item>
      <title>Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311535#M264665</link>
      <description>The following groovy demonstrates the problem I'm having:import org.apache.chemistry.opencmis.commons.*import org.apache.chemistry.opencmis.commons.data.*import org.apache.chemistry.opencmis.commons.enums.*import org.apache.chemistry.opencmis.client.api.*def cmis = new scripts.CMIS(session)Folder fo</description>
      <pubDate>Fri, 07 Oct 2016 16:00:27 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311535#M264665</guid>
      <dc:creator>ianw</dc:creator>
      <dc:date>2016-10-07T16:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311536#M264666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is indeed the established behaviour that Alfresco has had the entire time I have been working with it (~6 years). Alfresco may automatically remove aspects when they define associations and/or properties of which none is currently being used on the node or the last of which has just been removed (e.g. if you delete the value of a property defined by an aspect and it was the last property of that aspect, it may be removed). Alfresco will not remove aspects that do not define any properties / associations at all (which can be used for semantic marking).&lt;/P&gt;&lt;P&gt;There are some variations on this behaviour depending on which API is used - I would assume the CMIS integration is built in a way that triggers this automatic removal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Oct 2016 18:06:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311536#M264666</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-10-07T18:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311537#M264667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems alfresco will remove aspects that are already in item'existing aspects list but not in aspectsToAdd list in cmis implementation.&lt;/P&gt;&lt;P&gt;To avoid this problem ,you can get all existing aspects first and append them to the aspectsToAdd list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2016 03:44:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311537#M264667</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-10-08T03:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311538#M264668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In fact the "aspectsToAdd" is a &lt;A href="https://chemistry.apache.org/java/javadoc/org/apache/chemistry/opencmis/client/api/CmisObject.html#updateProperties-java.util.Map-java.util.List-java.util.List-" rel="nofollow noopener noreferrer"&gt;detail of the CMIS client library&lt;/A&gt; and is not transmitted to Alfresco that way. The CMIS specification only provides an &lt;A href="http://docs.oasis-open.org/cmis/CMIS/v1.1/errata01/os/CMIS-v1.1-errata01-os-complete.html#x1-27300013" rel="nofollow noopener noreferrer"&gt;updateProperties&lt;/A&gt; operation where ALL secondaryTypes / aspects need to be included that should still be applied after the operation (current + new). In case the client library does not correctly merge the existing and aspects to add, Alfresco may remove those aspects that are not in the cmis:secondaryObjectTypeIds list. This is implemented in the &lt;A href="https://github.com/Alfresco/community-edition/blob/master/projects/repository/source/java/org/alfresco/opencmis/CMISConnector.java#L3138" rel="nofollow noopener noreferrer"&gt;CMISConnector.processSecondaryTypes operation&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I would check the HTTP request the client library sends to Alfresco if it contains all the aspects that were applied before PLUS the aspects you want to add.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2016 08:05:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311538#M264668</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-10-08T08:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311539#M264669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I means is that alfresco server cmis implementation&amp;nbsp; &lt;SPAN style="color: #727174; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-size: 14px;"&gt;does not correctly merge the existing and aspects to add&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It removes the aspects that are in existing aspects list but not&amp;nbsp; contained in secondaryTypes in the parameter.&lt;/P&gt;&lt;P&gt;So to avoid the e&lt;SPAN lang="en"&gt;rror deleting,in the client we can get all existing aspects first and append it to secondaryTypes List we are going to add.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2016 08:47:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311539#M264669</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-10-08T08:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311540#M264670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I said, merging existing and aspects to add is the responsiblity of the client library before sending the CMIS request. Alfresco is not allowed to override the request data from the client because that would effectively result in users not being able to remove aspects again...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2016 08:50:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311540#M264670</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-10-08T08:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311541#M264671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got your point alfresco server should design that way .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Oct 2016 09:09:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311541#M264671</guid>
      <dc:creator>kaynezhang</dc:creator>
      <dc:date>2016-10-08T09:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311542#M264672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've checked the HTTP request and the existing aspects are indeed missing. I therefore conclude that there is a bug in the opencims client 1.0.0 for the function&lt;/P&gt;&lt;P&gt;CmisObject updateProperties(Map&amp;lt;String,?&amp;gt; properties,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; List&amp;lt;String&amp;gt; addSecondaryTypeIds,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; List&amp;lt;String&amp;gt; removeSecondaryTypeIds)&lt;/P&gt;&lt;P&gt;It seem sensible to use CmisObject updateProperties(Map&amp;lt;String,?&amp;gt; properties), however, when the aspect list is retrieved using getPropertyValue("cmis:secondaryObjectTypeIds") association type aspects are prefixed with "R:". If this is passed to updateProperties the opencmis library throws the error "Secondary types property contains a type that is not a secondary type: R:ncsrel:related". Changing the R: prefix to P: fixes the error, but feels wrong. Is this another problem with the opencmis client?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 13:12:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311542#M264672</guid>
      <dc:creator>ianw</dc:creator>
      <dc:date>2016-10-10T13:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311543#M264673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I fear the second part about the R: prefix might be a mapping bug inside of Alfresco. You have named the aspect and the association identically. I assume internally Alfresco is mapping Alfresco QNames to CMIS type IDs. The association &lt;SPAN class="attribute-value"&gt;ncsrel:related is mapped to the CMIS type ID R:&lt;SPAN class="attribute-value"&gt;ncsrel:related, overriding any prior mapping for the aspect. When Alfresco needs to map the aspect QName back to the CMIS secondary object type ID it picks up the relationship type ID instead.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 13:18:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311543#M264673</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2016-10-10T13:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using cmis, adding a new secondary type (aspect) removes association aspects, is this a bug?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311544#M264674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Spot on, I've rename the association and all is working. &lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Oct 2016 14:30:58 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/using-cmis-adding-a-new-secondary-type-aspect-removes/m-p/311544#M264674</guid>
      <dc:creator>ianw</dc:creator>
      <dc:date>2016-10-10T14:30:58Z</dc:date>
    </item>
  </channel>
</rss>

