Loading...
 
Skip to main content

History: XML Wiki Import-Export

Source of version: 10

Copy to clipboard
            ! XML Import-Export

Introduced in ((Tiki3))

It is possible to import/or export a list of pages or a structure in an xml format
Each page can be exported with:
* its history
* its comments
* its attached files
* its images
The export produces a zip file containing
* a wiki.xml page
* a directory for each page. And each of this directory
** page.txt: that contains the data of a page
** a directory attachments that contains all the attached files of the page
** a directory images that contains all the images contained in the page (via the wiki plugin {img})
** a directory history that contains all the data of each history

Example of a wiki.xml page
{CODE()}
<pages>
  <page zip="noel/page.txt">
    <name>noel</name>
    <user>me</user>
    <comments>
      <comment>Joyeux Noel</comment>
    </comments>
    <images>
      <image zip="test1/images/fgal/2" where="fgal">
         <wiki>/test/tikiwikitrunk/tiki-download_file.php?fileId=2&amp;display</wiki>
      </image>
    </images>
     <attachments>
	<attachment filename="noel.jpg" attId="1" zip="test1/attachments/1">
		<filesize>89597</filesize>
		<filetype>image/jpeg</filetype>
	</attachment>
     </attachments>

     <history>
	<version version="1" zip="test1/history/1.txt">
		  <user><![CDATA[admin]]></user>
        </version>
      </history>
  </page>
</pages>
{CODE}
This example is very simplified. More fields are provided

For a structure we will have something like
{CODE()}
<structure>
  <page><name>noel</name></page>
  <structure>
    <page>1 noel</page>
    <structure>
       <page>1.1 noel</page>
    </structure>
  <structure>
  <structure>
     <page>2 noel</page>
  </structure>
</structure>
{CODE}

The export can be done in wiki->List pages or in Structures-> List structures
The import can be done by calling tiki-import_xml_zip.php
You need to have tiki_p_admin to do the import and the export

^::{img src="img/wiki_up/tiki3_listpages_xml_export.png" }::^

! Requirements
[http://php.net/manual/en/class.ziparchive.php|The ZipArchive class for php] must be installed
(Example: for gentoo, emerge pecl-zip and restart the server)

! Alias
* (alias(XML Wiki Import-Export))
* (alias(XML Import/Export))

        

History

Information Version
Marc Laporte 14
Volker Wysk 13
Volker Wysk 12
Marc Laporte 11
Marc Laporte previous name of page 10
Marc Laporte 9
Marc Laporte 8
Marc Laporte 6
Marc Laporte 5
Xavier de Pedro 4
sylvie 3
sylvie 2
sylvie 1