<?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 How to import a document and put it in Nuxeo in version 12 as initial version? in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328403#M15404</link>
    <description>&lt;P&gt;As part of the migration of existing documents in Nuxeo, we have to manage documents that already have an existing version.&lt;/P&gt;
&lt;P&gt;How to import a document and put it in Nuxeo in version 12?
Is it possible without having to click 12 times on "Increment major version"?&lt;/P&gt;
&lt;P&gt;Do you have some hints to help us to developing this feature?&lt;/P&gt;
&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
    <pubDate>Mon, 14 May 2012 21:03:34 GMT</pubDate>
    <dc:creator>maxr_</dc:creator>
    <dc:date>2012-05-14T21:03:34Z</dc:date>
    <item>
      <title>How to import a document and put it in Nuxeo in version 12 as initial version?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328403#M15404</link>
      <description>&lt;P&gt;As part of the migration of existing documents in Nuxeo, we have to manage documents that already have an existing version.&lt;/P&gt;
&lt;P&gt;How to import a document and put it in Nuxeo in version 12?
Is it possible without having to click 12 times on "Increment major version"?&lt;/P&gt;
&lt;P&gt;Do you have some hints to help us to developing this feature?&lt;/P&gt;
&lt;P&gt;Thanks a lot&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2012 21:03:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328403#M15404</guid>
      <dc:creator>maxr_</dc:creator>
      <dc:date>2012-05-14T21:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a document and put it in Nuxeo in version 12 as initial version?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328404#M15405</link>
      <description>&lt;P&gt;You can use Nuxeo's extension system to do that just that. For instance you could create a file called&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;versioning-override-config.xml
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the following location:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;NUXEO_HOME&amp;gt;/nxserver/config
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then fill it with the following contents:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;?xml version="1.0"?&amp;gt;
   &amp;lt;component name="org.nuxeo.ecm.platform.versionoverride" version="1.0"&amp;gt;
     &amp;lt;extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="versioningRules"&amp;gt;
       &amp;lt;defaultVersioningRule&amp;gt;
         &amp;lt;initialState major="12" minor="0" /&amp;gt;
        &amp;lt;/defaultVersioningRule&amp;gt;
      &amp;lt;/extension&amp;gt;
   &amp;lt;/component&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and restart your server.&lt;/P&gt;
&lt;P&gt;You can find more documentation and other possible applications of the versioning service:
&lt;A href="http://explorer.nuxeo.org/nuxeo/site/distribution/current/viewComponent/org.nuxeo.ecm.core.versioning.VersioningService"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2012 08:07:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328404#M15405</guid>
      <dc:creator>Wojciech_Sulejm</dc:creator>
      <dc:date>2012-05-15T08:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a document and put it in Nuxeo in version 12 as initial version?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328405#M15406</link>
      <description>&lt;P&gt;This solution will put each new documents in version 12. We need to be able to choose the initial version when we import the documents. Do you have other ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2012 14:33:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328405#M15406</guid>
      <dc:creator>maxr_</dc:creator>
      <dc:date>2012-05-15T14:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a document and put it in Nuxeo in version 12 as initial version?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328406#M15407</link>
      <description>&lt;P&gt;So you have two possible solution here.&lt;/P&gt;
&lt;P&gt;You can filter the versioning rule per document if that's enough for you. Every document of this type will start with version defined in the versioning rule.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;versioningRule typeName="File" enabled="true"&amp;gt;
     &amp;lt;initialState major="12" minor="0" /&amp;gt;
    &amp;lt;/versioningRule&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This way every File document start with version 12.0 . You can always remove this contribution after the import.&lt;/P&gt;
&lt;P&gt;Another solution would be to define your own versioningService. This way you can override the doPostCreate called every time a document is created by the method CoreSession#createDocument(DocumentModel) . The option Map it takes as parameter is the one from DocumentModel#getContextData . You can define your own versioningService with a contribution like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="versioningService"&amp;gt;
    &amp;lt;service class="yourVersioningservice" /&amp;gt;
&amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope it helps.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2012 16:22:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328406#M15407</guid>
      <dc:creator>Laurent_Doguin</dc:creator>
      <dc:date>2012-05-16T16:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a document and put it in Nuxeo in version 12 as initial version?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328407#M15408</link>
      <description>&lt;P&gt;I overwrite doPostCreate method from VersioningService class. I am able to change the version of the document with a hard coded value. I want to retrieve a value from a field in create_document view. Options parameters doesn't contains anything about context data. Thanks a lot. I am new to nuxeo development.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2012 22:04:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328407#M15408</guid>
      <dc:creator>maxr_</dc:creator>
      <dc:date>2012-05-16T22:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a document and put it in Nuxeo in version 12 as initial version?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328408#M15409</link>
      <description>&lt;P&gt;Just to be clear, each document that I import doesn't have the same version number. I need to have a way to chose the version number when I import it. I don't want to click X times on "Increment major version" to go to version X. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 17:31:31 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328408#M15409</guid>
      <dc:creator>maxr_</dc:creator>
      <dc:date>2012-05-17T17:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a document and put it in Nuxeo in version 12 as initial version?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328409#M15410</link>
      <description>&lt;P&gt;The &lt;CODE&gt;Document&lt;/CODE&gt; object that &lt;CODE&gt;doPostCreate&lt;/CODE&gt; receives has APIs like &lt;CODE&gt;getPropertyValue&lt;/CODE&gt; that you can use to get values from the document.&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2012 14:18:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328409#M15410</guid>
      <dc:creator>Florent_Guillau</dc:creator>
      <dc:date>2012-05-21T14:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a document and put it in Nuxeo in version 12 as initial version?</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328410#M15411</link>
      <description>&lt;P&gt;After i tried this solution on Nuxeo-dm5.6 i get a HTTP internal 500 error...&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2012 21:43:35 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/how-to-import-a-document-and-put-it-in-nuxeo-in-version-12-as/m-p/328410#M15411</guid>
      <dc:creator>peter013_</dc:creator>
      <dc:date>2012-10-08T21:43:35Z</dc:date>
    </item>
  </channel>
</rss>

