<?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 Update document version in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/update-document-version/m-p/296694#M249824</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to update a document through Java into Alfresco.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The scenario is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the document is in Alfresco (4.0.e), with the version number 1.1 for example. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My code is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;File file = &amp;lt;file passed from UI&amp;gt;&lt;BR /&gt;Document document= &amp;lt;get Document object from Alresco through id&amp;gt;&lt;BR /&gt;ContentStream contentStream = new ContentStreamImpl(documentgetName(), BigInteger.valueOf(file.asBytes()), file.getContentType(), file.asStream());&lt;BR /&gt;&lt;BR /&gt;Map&amp;lt;String, Object&amp;gt; properties = new HashMap&amp;lt;String, Object&amp;gt;();&lt;BR /&gt;properties.put("cm:description", "my personal description");&lt;BR /&gt;document.updateProperties(properties, false);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;document.setContentStream(contentStream, true, false);&lt;BR /&gt;&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;/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;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code updates document correctly (content and properties) but version from 1.1 goes to 1.3.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried differents combinations of latest parameter of updateProperties and of setContentStream but the behaviour doesn't change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Whenever I update the file the version number increases of 2 minor versions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Someone knows why?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a method to update the document (like the code above) and increment only 1 skip minor version?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jul 2013 13:03:06 GMT</pubDate>
    <dc:creator>agz</dc:creator>
    <dc:date>2013-07-08T13:03:06Z</dc:date>
    <item>
      <title>Update document version</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-document-version/m-p/296694#M249824</link>
      <description>Hi all,I need to update a document through Java into Alfresco.The scenario is:the document is in Alfresco (4.0.e), with the version number 1.1 for example. My code is:File file = &amp;lt;file passed from UI&amp;gt;Document document= &amp;lt;get Document object from Alresco through id&amp;gt;ContentStream contentStr</description>
      <pubDate>Mon, 08 Jul 2013 13:03:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-document-version/m-p/296694#M249824</guid>
      <dc:creator>agz</dc:creator>
      <dc:date>2013-07-08T13:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Update document version</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-document-version/m-p/296695#M249825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I resolved this using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;document.checkIn(false, properties, contentStream, "");&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2013 09:20:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-document-version/m-p/296695#M249825</guid>
      <dc:creator>agz</dc:creator>
      <dc:date>2013-07-09T09:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update document version</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/update-document-version/m-p/296696#M249826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;interesting, when I'm doing the same operation on a Document, it throws an exception saying: &lt;/SPAN&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;Object is not a PWC!&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2013 15:49:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/update-document-version/m-p/296696#M249826</guid>
      <dc:creator>horia</dc:creator>
      <dc:date>2013-07-10T15:49:55Z</dc:date>
    </item>
  </channel>
</rss>

