<?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: Multiple version creations while creating/updating in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197344#M150474</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;SPAN&gt;I found the solution and posting here. This moght be helpful if anyone is searching for this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Here is the way . &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Search for "contentModel.xml" file . This will be under tomcat/webapps/alfresco/WEB-INF/classes/alfresco/model/contentModel.xml&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Look for "&amp;lt;aspect name="cm:versionable"&amp;gt;" inside that and make "&amp;lt;property name="cm:initialVersion"&amp;gt;" &amp;amp; "&amp;lt;property name="cm:autoVersion"&amp;gt;"&amp;nbsp; as false.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By updating this, it wont add a version by default. Now you will get more control on when to add a version and you can do that by &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VersionResult res = authoringService.createVersion(predicateVersion, ….versioncomments,&amp;nbsp; false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We can get the versionLabel &amp;amp; other version properties from this returned object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Satish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Mar 2009 21:09:21 GMT</pubDate>
    <dc:creator>satishvarmadand</dc:creator>
    <dc:date>2009-03-05T21:09:21Z</dc:date>
    <item>
      <title>Multiple version creations while creating/updating</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197343#M150473</link>
      <description>Hi,How it is going o solve the problem for Update.&amp;nbsp;&amp;nbsp; When i try to update a file, i am using Content contentRef = contentService.write(node, Constants.PROP_CONTENT, dataToUpdate, contentFormat);But by calling this, it is creating a version. I want to disable version creation when i update a document</description>
      <pubDate>Thu, 05 Mar 2009 19:45:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197343#M150473</guid>
      <dc:creator>satishvarmadand</dc:creator>
      <dc:date>2009-03-05T19:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple version creations while creating/updating</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197344#M150474</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;SPAN&gt;I found the solution and posting here. This moght be helpful if anyone is searching for this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Here is the way . &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Search for "contentModel.xml" file . This will be under tomcat/webapps/alfresco/WEB-INF/classes/alfresco/model/contentModel.xml&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Look for "&amp;lt;aspect name="cm:versionable"&amp;gt;" inside that and make "&amp;lt;property name="cm:initialVersion"&amp;gt;" &amp;amp; "&amp;lt;property name="cm:autoVersion"&amp;gt;"&amp;nbsp; as false.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;By updating this, it wont add a version by default. Now you will get more control on when to add a version and you can do that by &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VersionResult res = authoringService.createVersion(predicateVersion, ….versioncomments,&amp;nbsp; false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We can get the versionLabel &amp;amp; other version properties from this returned object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Satish&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Mar 2009 21:09:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197344#M150474</guid>
      <dc:creator>satishvarmadand</dc:creator>
      <dc:date>2009-03-05T21:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple version creations while creating/updating</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197345#M150475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for this information. Anyway, I have one relating problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I set &amp;lt;property name="cm:initialVersion"&amp;gt;" &amp;amp; "&amp;lt;property name="cm:autoVersion"&amp;gt;" as false, I've got an error on the first "check-in" I make.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Didin't you get this problem ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2009 16:09:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197345#M150475</guid>
      <dc:creator>cviaud</dc:creator>
      <dc:date>2009-04-21T16:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple version creations while creating/updating</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197346#M150476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;I found the solution and posting here. This moght be helpful if anyone is searching for this&lt;BR /&gt;&lt;BR /&gt; Here is the way . &lt;BR /&gt;1) Search for "contentModel.xml" file . This will be under tomcat/webapps/alfresco/WEB-INF/classes/alfresco/model/contentModel.xml&lt;BR /&gt;2) Look for "&amp;lt;aspect name="cm:versionable"&amp;gt;" inside that and make "&amp;lt;property name="cm:initialVersion"&amp;gt;" &amp;amp; "&amp;lt;property name="cm:autoVersion"&amp;gt;"&amp;nbsp; as false.&lt;BR /&gt;&lt;BR /&gt;By updating this, it wont add a version by default. Now you will get more control on when to add a version and you can do that by &lt;BR /&gt;VersionResult res = authoringService.createVersion(predicateVersion, ….versioncomments,&amp;nbsp; false);&lt;BR /&gt;&lt;BR /&gt;We can get the versionLabel &amp;amp; other version properties from this returned object.&lt;BR /&gt;&lt;BR /&gt;-Satish&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;But I think there's a risk that it can change alfresco's default behavior for example type cm:mlContainer is versionable. And you have to remember to change the war during upgrade - that sort of customization should be done not in the war&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm setting properties initialVersion and autoVersion directly in my code just before update&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Apr 2009 13:07:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197346#M150476</guid>
      <dc:creator>ra74</dc:creator>
      <dc:date>2009-04-27T13:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple version creations while creating/updating</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197347#M150477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In case anyone finds this helpfull, this is what I did..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Assuming you have created a file already, use the authoring service to checkout the file. Then use the content service to update that working copy, and check it back in forcing a major version. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You''ll need to get a reference to the file you want to work with…In this example Im dealing with the bytes of a file Im reading in. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&lt;BR /&gt;// Add the versionable aspect to the document.&amp;nbsp; This will allows the content to be versioned&lt;BR /&gt;makeVersionable(repositoryService, contentReference);&lt;BR /&gt;&lt;BR /&gt;// Use authoring service to checkout file, update content, then check back in with major revision&lt;BR /&gt;AuthoringServiceSoapBindingStub authoringService = WebServiceFactory.getAuthoringService();&lt;BR /&gt;&lt;BR /&gt;// Checkout the document to update, placing the working document in the same folder&lt;BR /&gt;Predicate itemsToCheckOut = new Predicate(new Reference[]{contentReference}, null, null);&lt;BR /&gt;CheckoutResult checkOutResult = authoringService.checkout(itemsToCheckOut, null);&lt;BR /&gt;&lt;BR /&gt;// Get a reference to the working copy&lt;BR /&gt;Reference workingCopyReference = checkOutResult.getWorkingCopies()[0];&lt;BR /&gt;&lt;BR /&gt;// Update the content of the working copy&lt;BR /&gt;ContentFormat contentFormat = new ContentFormat(MIME_TYPE, "UTF-8");&lt;BR /&gt;contentService.write(workingCopyReference, Constants.PROP_CONTENT, bytearray, contentFormat);&lt;BR /&gt;&lt;BR /&gt;// Now check the working copy in with a description of the change made that will be recorded in the version history&lt;BR /&gt;Predicate predicate = new Predicate(new Reference[]{workingCopyReference}, null, null);&lt;BR /&gt;&lt;BR /&gt;NamedValue[] revisionType = new NamedValue[]{Utils.createNamedValue("versionType", "MAJOR")};&lt;BR /&gt;authoringService.checkin(predicate, revisionType, false);&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;/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;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2009 19:38:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/multiple-version-creations-while-creating-updating/m-p/197347#M150477</guid>
      <dc:creator>jneeve</dc:creator>
      <dc:date>2009-09-29T19:38:05Z</dc:date>
    </item>
  </channel>
</rss>

