The history format of XAR is specific and not easy to generate from scratch: it's actually JRCS export format and you can look at https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwik... to see how it's used. But you don't need to go trough XAR and to deal with this format if you are writing a JSPWiki importer but I would need more detail on what you are doing exactly. If you write a filter module you can check how Confluence module deal with history in https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwik.... On Thu, Aug 20, 2015 at 10:27 AM, qvendeville <[email protected]> wrote:
Hello,
I try to import the content from a JSPWiki to XWiki with the history. I managed to import the content, but not the history.
The generated XAR from the export contains my page in XML format :
<?xml version='1.0' encoding='UTF-8'?> <xwikidoc version="1.1"> <web>Import JSPWiki</web> <name>6.1WikiPage</name> <language/> <defaultLanguage/> <translation>0</translation> <creator>Import JSPWiki</creator> <creationDate>1439990795525</creationDate> <author>DupontJean</author> <version>1</version> <title>6.1WikiPage</title> <syntaxId>xwiki/2.1</syntaxId> <hidden>true</hidden> <content>La page dédiée à la version 6.1.</content> <author>DupontJean</author> <version>2</version> <title>6.1WikiPage</title> <syntaxId>xwiki/2.1</syntaxId> <hidden>true</hidden> <content>La page dédiée à la version 6.1. Infos dispo à l'adresse suivante : http://infos.com</content> <author>DanielD</author> <version>3</version> <title>6.1WikiPage</title> <syntaxId>xwiki/2.1</syntaxId> <hidden>false</hidden> <content>La page dédiée à la version 6.1. Infos dispo à l'adresse suivante : http://new-infos.com</content> </xwikidoc>
When I import this XAR on XWiki, i only have the last version (version 3) of the history.
I looked how XWiki generate XAR file when you export a page with the history. It looks like that :
<?xml version='1.0' encoding='UTF-8'?> <xwikidoc version="1.1"> <web>Sandbox</web> <name>TestPage1</name> <language/> <defaultLanguage>en</defaultLanguage> <translation>0</translation> <creator>XWiki.Admin</creator> <creationDate>1252454400000</creationDate> <versions>head 2.1; access; symbols; locks; strict; comment @# @;
2.1 date 2015.08.18.17.23.18; author XWiki_2EAdmin; state full; branches; next 1.1;
1.1 date 2015.07.28.15.16.57; author XWiki_2EAdmin; state diff; branches; next ;
desc @@
2.1 log @@ text @<?xml version="1.0" encoding="UTF-8"?> <xwikidoc> <web>Sandbox</web> <name>TestPage1</name> <language></language> <defaultLanguage>en</defaultLanguage> <translation>0</translation> <parent>Sandbox.WebHome</parent> <creator>XWiki.Admin</creator> <author>XWiki.Admin</author> <customClass></customClass> <contentAuthor>XWiki.Admin</contentAuthor> <creationDate>1252454400000</creationDate> <date>1439911398000</date> <contentUpdateDate>1439911398000</contentUpdateDate> <version>2.1</version> <title>Sandbox Test Page 1</title> <defaultTemplate></defaultTemplate> <validationScript></validationScript> <comment></comment> <minorEdit>false</minorEdit> <syntaxId>xwiki/2.0</syntaxId> <hidden>false</hidden> <content>Click on **"Edit"** and modify the contents of this page, then click on **"Save & View"** to see how they look like on your page!
= Here's some dummy text to show you what the page looks like =
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est</content></xwikidoc> @
1.1 log @Install extension [org.xwiki.platform:xwiki-platform-sandbox-7.0] @ text @d14 3 a16 3 <date>1438089417000</date> <contentUpdateDate>1438089417000</contentUpdateDate> <version>1.1</version> d20 1 a20 1 <comment>Install extension [org.xwiki.platform:xwiki-platform-sandbox-7.0]</comment> d28 1 a28 1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</content></xwikidoc> @ </versions> <parent>Sandbox.WebHome</parent> <author>XWiki.Admin</author> <contentAuthor>XWiki.Admin</contentAuthor> <date>1439911398000</date> <contentUpdateDate>1439911398000</contentUpdateDate> <version>2.1</version> <title>Sandbox Test Page 1</title> <comment/> <minorEdit>false</minorEdit> <syntaxId>xwiki/2.0</syntaxId> <hidden>false</hidden> <content>Click on **"Edit"** and modify the contents of this page, then click on **"Save & View"** to see how they look like on your page!
= Here's some dummy text to show you what the page looks like =
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est</content> </xwikidoc>
Obviously it is not the same format and I don't understand this format, can someone explain me how it is generated, and how I can modify my file to import it on XWiki correctly.
-- Quentin
-- View this message in context: http://xwiki.475771.n2.nabble.com/Import-JSPWiki-history-tp7595692.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne