<?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 CMIS Atompub copy issue in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/cmis-atompub-copy-issue/m-p/248809#M201939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Environment: Alfresco 4.0d, OpenCmis 0.8.0, Alfresco OpenCmis Extension 0.4&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an issue when trying to copy a document which has custom aspects with custom properties using the ATOMPUB binding (This works fine for the now deprecated WEBSERVICE binding which implements the createDocumentFromSource() method).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;public void doCopy(Document mySourceDocument, Folder myTargetFolder) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;mySourceDocument.copy(myTargetFolder);&lt;BR /&gt;}&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;If I simply do this then I get the following exception:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;java.lang.IllegalArgumentException: Property 'ex:myCustomProperty' is neither an object type property nor an aspect property!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertProperties(AlfrescoObjectFactoryImpl.java:186)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(SessionImpl.java:726)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.alfresco.cmis.client.impl.AlfrescoDocumentImpl.copyViaClient(AlfrescoDocumentImpl.java:96)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.apache.chemistry.opencmis.client.runtime.DocumentImpl.copy(DocumentImpl.java:143)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.apache.chemistry.opencmis.client.runtime.DocumentImpl.copy(DocumentImpl.java:160)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can update the code to use the other copy method and specify the Aspect which defines this property:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt; myPropertiesMap.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document,P:ex:myCustomAspect")&lt;BR /&gt; &lt;BR /&gt; mySourceDocument.copy(myTargetFolder, myPropertiesMap, …&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So now it copies, but the value hasn't been set for ex:myCustomAspect, so I go in and add the property and value to myPropertiesMap:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;myPropertiesMap.put("ex:myCustomProperty", "myCopiedValue");&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;So far, so good.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The issues I have is that setting the property value this way overrides any behaviours I have in Alfresco which may want to change the value of the property, or not copy the value at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone else come across this problem, or have a suggested solution?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am wanting to move away from using the Webservice binding as it has been deprecated and also because it throws an error trying to delete nodes which have rules directly applied to them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Nov 2012 16:08:13 GMT</pubDate>
    <dc:creator>mikemars</dc:creator>
    <dc:date>2012-11-09T16:08:13Z</dc:date>
    <item>
      <title>CMIS Atompub copy issue</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cmis-atompub-copy-issue/m-p/248809#M201939</link>
      <description>Hi,Environment: Alfresco 4.0d, OpenCmis 0.8.0, Alfresco OpenCmis Extension 0.4I have an issue when trying to copy a document which has custom aspects with custom properties using the ATOMPUB binding (This works fine for the now deprecated WEBSERVICE binding which implements the createDocumentFromSou</description>
      <pubDate>Fri, 09 Nov 2012 16:08:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cmis-atompub-copy-issue/m-p/248809#M201939</guid>
      <dc:creator>mikemars</dc:creator>
      <dc:date>2012-11-09T16:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: CMIS Atompub copy issue</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/cmis-atompub-copy-issue/m-p/248810#M201940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is an old post, so hopefully you worked it out but for everyone else, if you are running Alfresco 4.2.x, it supports CMIS 1.1. CMIS 1.1 supports aspects out-of-the-box. You don't need the OpenCMIS extension when using the CMIS 1.1 bindings. You can simply do the copy and all of your custom aspects and values will copy over just fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As a reminder, the CMIS 1.1 AtomPub URL is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/atom&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the CMIS 1.1 Browser Binding URL is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The copy is known to work with custom aspects for Alfresco 4.2.x, CMIS 1.1, and OpenCMIS 0.10.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Mar 2014 15:49:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/cmis-atompub-copy-issue/m-p/248810#M201940</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2014-03-04T15:49:50Z</dc:date>
    </item>
  </channel>
</rss>

