<?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 Upload new version with CMIS in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/upload-new-version-with-cmis/m-p/95297#M28057</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm uploading a new version of a node using CMIS, by following &lt;A title="CMIS API (OASIS ReST Standard)" href="https://docs.alfresco.com/community/concepts/dev-api-by-language-cmis.html" target="_blank" rel="noopener nofollow noreferrer"&gt;this&lt;/A&gt; instructions. I'm using Alfresco 6.2 ootb installation with docker.&lt;/P&gt;&lt;P&gt;I'm able to retrieve nodes' content, and to upload a new version, but I wonder if I can provide a version description, as can be done through the Alfresco ReST API and Alfresco Version2Service.&lt;/P&gt;&lt;P&gt;I've tried adding form data to the http call, but I see no results:&lt;/P&gt;&lt;PRE&gt;// Post new content to Alfresco as a new version using CMIS API
HttpPut put = new HttpPut(alfrescoBaseUrl + CMIS_URL + "content?id=" + ocrNodeId);
// Create request entity
requestEntityBuilder = MultipartEntityBuilder.create();
requestEntityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
requestEntityBuilder.addBinaryBody("file", inputStream);
requestEntityBuilder.addPart("versionComment", new StringBody("new version test", ContentType.MULTIPART_FORM_DATA));
// Tried with description, versionComment, versionDescription
requestEntity = requestEntityBuilder.build();
put.setEntity(requestEntity);&lt;/PRE&gt;&lt;P&gt;It's the first time I'm using CMIS, and I've seen that Alfresco documented in a different way CMIS operations for the new 201911 GA version, so I'd like to know:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is it possible what I'm trying to do, or should I call other endpoint/s to set version description?&lt;/LI&gt;&lt;LI&gt;Should I use "old" CMIS approach (using chemistry for example)? Would it give me the ability to update content and set version description in one call?&lt;/LI&gt;&lt;LI&gt;Should I use Alfresco v1 ReST API instead of CMIS? What are the differences, if any / if you know it, about the two approaches, regarding liability/speed/consistency/server load?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I've already looked at the &lt;A href="https://localhost:8080/alfresco/api/cmis/versions/1.1/atom/" target="_blank" rel="noopener nofollow noreferrer"&gt;service document&lt;/A&gt; as stated &lt;A href="https://docs.alfresco.com/community/pra/1/concepts/cmis-get-service-document.html" target="_blank" rel="noopener nofollow noreferrer"&gt;here&lt;/A&gt;, but I don't get a s***, nor I haven't found any "getting started guide" for OASIS standard but the &lt;A href="http://docs.oasis-open.org/cmis/CMIS/v1.1/os/CMIS-v1.1-os.html" target="_blank" rel="noopener nofollow noreferrer"&gt;oasis standard specification&lt;/A&gt;, which is too much for me at the moment.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Sat, 28 Dec 2019 13:45:08 GMT</pubDate>
    <dc:creator>narkuss</dc:creator>
    <dc:date>2019-12-28T13:45:08Z</dc:date>
    <item>
      <title>Upload new version with CMIS</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upload-new-version-with-cmis/m-p/95297#M28057</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm uploading a new version of a node using CMIS, by following &lt;A title="CMIS API (OASIS ReST Standard)" href="https://docs.alfresco.com/community/concepts/dev-api-by-language-cmis.html" target="_blank" rel="noopener nofollow noreferrer"&gt;this&lt;/A&gt; instructions. I'm using Alfresco 6.2 ootb installation with docker.&lt;/P&gt;&lt;P&gt;I'm able to retrieve nodes' content, and to upload a new version, but I wonder if I can provide a version description, as can be done through the Alfresco ReST API and Alfresco Version2Service.&lt;/P&gt;&lt;P&gt;I've tried adding form data to the http call, but I see no results:&lt;/P&gt;&lt;PRE&gt;// Post new content to Alfresco as a new version using CMIS API
HttpPut put = new HttpPut(alfrescoBaseUrl + CMIS_URL + "content?id=" + ocrNodeId);
// Create request entity
requestEntityBuilder = MultipartEntityBuilder.create();
requestEntityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
requestEntityBuilder.addBinaryBody("file", inputStream);
requestEntityBuilder.addPart("versionComment", new StringBody("new version test", ContentType.MULTIPART_FORM_DATA));
// Tried with description, versionComment, versionDescription
requestEntity = requestEntityBuilder.build();
put.setEntity(requestEntity);&lt;/PRE&gt;&lt;P&gt;It's the first time I'm using CMIS, and I've seen that Alfresco documented in a different way CMIS operations for the new 201911 GA version, so I'd like to know:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Is it possible what I'm trying to do, or should I call other endpoint/s to set version description?&lt;/LI&gt;&lt;LI&gt;Should I use "old" CMIS approach (using chemistry for example)? Would it give me the ability to update content and set version description in one call?&lt;/LI&gt;&lt;LI&gt;Should I use Alfresco v1 ReST API instead of CMIS? What are the differences, if any / if you know it, about the two approaches, regarding liability/speed/consistency/server load?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I've already looked at the &lt;A href="https://localhost:8080/alfresco/api/cmis/versions/1.1/atom/" target="_blank" rel="noopener nofollow noreferrer"&gt;service document&lt;/A&gt; as stated &lt;A href="https://docs.alfresco.com/community/pra/1/concepts/cmis-get-service-document.html" target="_blank" rel="noopener nofollow noreferrer"&gt;here&lt;/A&gt;, but I don't get a s***, nor I haven't found any "getting started guide" for OASIS standard but the &lt;A href="http://docs.oasis-open.org/cmis/CMIS/v1.1/os/CMIS-v1.1-os.html" target="_blank" rel="noopener nofollow noreferrer"&gt;oasis standard specification&lt;/A&gt;, which is too much for me at the moment.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 28 Dec 2019 13:45:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upload-new-version-with-cmis/m-p/95297#M28057</guid>
      <dc:creator>narkuss</dc:creator>
      <dc:date>2019-12-28T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Upload new version with CMIS</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/upload-new-version-with-cmis/m-p/95298#M28058</link>
      <description>&lt;P&gt;You should be using a CMIS client (like one from Apache Chemistry). It will save you a lot of trouble.&lt;/P&gt;
&lt;P&gt;What you are trying to do is set a checkin comment. With something like OpenCMIS, it is as easy as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="java hljs"&gt;ObjectId newVersionId = pwc.checkIn(&lt;SPAN class="hljs-keyword"&gt;true&lt;/SPAN&gt;, &lt;SPAN class="hljs-keyword"&gt;null&lt;/SPAN&gt;, &lt;SPAN class="hljs-keyword"&gt;null&lt;/SPAN&gt;, &lt;SPAN class="hljs-string"&gt;"new version comment"&lt;/SPAN&gt;);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can see additional OpenCMIS sample code here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://chemistry.apache.org/docs/cmis-samples/samples/versions/index.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://chemistry.apache.org/docs/cmis-samples/samples/versions/index.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You might also take a look at the CMIS related examples in my custom content types tutorial, although I do not cover checkout/checkin.&lt;/P&gt;
&lt;P&gt;As to whether you should use the REST API or CMIS, it is up to you and how closely each API meets your requirements.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 04:46:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/upload-new-version-with-cmis/m-p/95298#M28058</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2020-01-08T04:46:49Z</dc:date>
    </item>
  </channel>
</rss>

