The entry point is the following method:
https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-rest/xwiki-platform-rest-server/src/main/java/org/xwiki/rest/internal/resources/wikis/WikiResourceImpl.java#L85

On Wed, Sep 30, 2015 at 1:35 AM, Ghosh, Amrita <amr...@amazon.com> wrote:
> Thanks very much for your response.
>
> Can you please point me to the GitHub link of the code where this logic is 
> defined? I am trying to understand if / how we can customize it by ourselves.
>
> -----Original Message-----
> From: devs [mailto:devs-boun...@xwiki.org] On Behalf Of Thomas Mortagne
> Sent: Friday, September 25, 2015 1:25 AM
> To: XWiki Developers <devs@xwiki.org>
> Subject: Re: [xwiki-devs] XML file format to import multiple revisions of an 
> existing page via XAR upload
>
> As far as I can see in the code of this REST service, when the document 
> already exist either you overwrite it entirely with what comes from the XAR 
> (including the history) or you add a new version but appending the history 
> from the XAR to the history from the database does not seems to be supported.
>
> You might want to create an improvement issue related to that on 
> http://jira.xwiki.org.
>
> On Fri, Sep 25, 2015 at 2:53 AM, Ghosh, Amrita <amr...@amazon.com> wrote:
>> Hi,
>>
>> I am trying to update an existing page (ad new revisions) by uploading XAR 
>> using REST API:
>>
>> curl -k -u Admin:admin -v -X POST -T "Main.testpage.xar" -H
>> "Content-Type: application/stream"
>> https://SERVER/xwiki/rest/wikis/xwiki?history=ADD
>>
>> I could successfully upload a single new revision to an existing page and 
>> that new revision is correctly showing up on the page history. But I wanted 
>> to upload multiple revisions at a time.  For that in the document xml I 
>> specified the new revisions inside <versions> </versions> tag (similar to 
>> what we see in the XML of exported page with history), but that does not 
>> work.
>>
>> Is it possible to add multiple revisions to an existing page with a single 
>> XAR upload?
>>
>> Following are my document xml and package.xml inside the XAR file that I was 
>> using:
>>
>> Main/testpage.xml:
>>
>> <?xml version='1.0' encoding='UTF-8'?> <xwikidoc version="1.1">
>>   <web>Main</web>
>>   <name>testpage</name>
>>   <language/>
>>   <defaultLanguage>en</defaultLanguage>
>>   <translation>0</translation>
>>   <creator>XWiki.amritg</creator>
>>   <creationDate>1443041962000</creationDate>
>> <versions>head               6.1;
>> access;
>> symbols;
>> locks; strict;
>>
>> 6.1
>> date       2015.09.23.21.11.51;       author XWiki.amritg;      state full;
>> branches;
>> next       5.1;
>>
>> 5.1
>> date       2015.09.23.21.01.49;       author XWiki.amritg;      state full;
>> branches;
>> next       ;
>>
>>
>> desc
>> @@
>>
>> 6.1
>> log
>> @@
>> text
>> @&lt;?xml version="1.0" encoding="UTF-8"?> &lt;xwikidoc>
>> &lt;web>Main&lt;/web> &lt;name>testpage&lt;/name>
>> &lt;language>&lt;/language>
>> &lt;defaultLanguage>en&lt;/defaultLanguage>
>> &lt;translation>0&lt;/translation>
>> &lt;parent>&lt;/parent>
>> &lt;creator>XWiki.amritg&lt;/creator>
>> &lt;author>XWiki.amritg&lt;/author>
>> &lt;customClass>&lt;/customClass>
>> &lt;contentAuthor>XWiki.amritg&lt;/contentAuthor>
>> &lt;creationDate>1443041962000&lt;/creationDate>
>> &lt;date>1443042713000&lt;/date>
>> &lt;contentUpdateDate>1443042713000&lt;/contentUpdateDate>
>> &lt;version>6.1&lt;/version>
>> &lt;title>Test Page&lt;/title>
>> &lt;defaultTemplate>&lt;/defaultTemplate>
>> &lt;validationScript>&lt;/validationScript>
>> &lt;comment>&lt;/comment>
>> &lt;minorEdit>false&lt;/minorEdit>
>> &lt;syntaxId>xwiki/2.1&lt;/syntaxId>
>> &lt;hidden>false&lt;/hidden>
>> &lt;content>Update content for 6th revision&lt;/content>&lt;/xwikidoc>
>> @
>>
>> 5.1
>> log
>> @@
>> text
>> @&lt;?xml version="1.0" encoding="UTF-8"?> &lt;xwikidoc>
>> &lt;web>Main&lt;/web> &lt;name>testpage&lt;/name>
>> &lt;language>&lt;/language>
>> &lt;defaultLanguage>en&lt;/defaultLanguage>
>> &lt;translation>0&lt;/translation>
>> &lt;parent>&lt;/parent>
>> &lt;creator>XWiki.amritg&lt;/creator>
>> &lt;author>XWiki.amritg&lt;/author>
>> &lt;customClass>&lt;/customClass>
>> &lt;contentAuthor>XWiki.amritg&lt;/contentAuthor>
>> &lt;creationDate>1443041962000&lt;/creationDate>
>> &lt;date>1443042713000&lt;/date>
>> &lt;contentUpdateDate>1443042713000&lt;/contentUpdateDate>
>> &lt;version>5.1&lt;/version>
>> &lt;title>Test Page&lt;/title>
>> &lt;defaultTemplate>&lt;/defaultTemplate>
>> &lt;validationScript>&lt;/validationScript>
>> &lt;comment>&lt;/comment>
>> &lt;minorEdit>false&lt;/minorEdit>
>> &lt;syntaxId>xwiki/2.1&lt;/syntaxId>
>> &lt;hidden>false&lt;/hidden>
>> &lt;content>Update content for 5th revision&lt;/content>&lt;/xwikidoc>
>> @
>>
>> </versions>
>>   <author>XWiki.amritg</author>
>>   <contentAuthor>XWiki.amritg</contentAuthor>
>>   <date>1443042712000</date>
>>   <contentUpdateDate>1443042712000</contentUpdateDate>
>>   <version>6.1</version>
>>   <title>Test Page</title>
>>   <comment/>
>>   <minorEdit>false</minorEdit>
>>   <syntaxId>xwiki/2.1</syntaxId>
>>   <hidden>false</hidden>
>>   <content>Update content for 6th revision</content> </xwikidoc>
>>
>>
>>
>> Package.xml:
>>
>> <?xml version='1.0' encoding='UTF-8'?>
>> <package>
>>   <infos>
>>     <name>Main.testpage</name>
>>     <description/>
>>     <licence/>
>>     <author/>
>>     <version/>
>>     <backupPack>false</backupPack>
>>     <preserveVersion>true</preserveVersion>
>>     <extensionId/>
>>   </infos>
>>   <files>
>>     <file defaultAction="0" language="">Main.testpage</file>
>>   </files>
>> </package>
>>
>> Thanks,
>> Amrita
>>
>>
>>
>> _______________________________________________
>> devs mailing list
>> devs@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/devs
>
>
>
> --
> Thomas Mortagne
> _______________________________________________
> devs mailing list
> devs@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/devs
> _______________________________________________
> devs mailing list
> devs@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/devs



-- 
Thomas Mortagne
_______________________________________________
devs mailing list
devs@xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to