Forum OpenACS Q&A: xowiki - data export

Posted by Robert Taylor on
what is currently the quickest, most painless way to export data from xowiki to a file format such as a plain ascii text file, pdf, .odt/.ods, other file formats?
2: Re: xowiki - data export (response to 1)
Posted by Gustaf Neumann on
The answer of the question depends, what you want to do with the data.

The easiest way to export all data from an xowiki instance is to point you browser to xowiki/admin and press export. The result is a plain text file containing all data as xotcl objects. These objects can be loaded into plain Tcl to do with it whatever you want. This is the most flexible approach and allows to import the contents of an xowiki instance into other systems and as well to import data from other systems into xowiki.

If you need a more text oriented approach, you will probably need pages in a certain order. One can use the prototype page "book" and produce a single HTML file from all pages of the xowiki instance, including a table of contents. This requires to specify the page order (section) to define the order and which pages should be exported.

For example, the static HTML file was generated this way with minor editing on the result.

One can load the generated HTML file into OpenOffice and save it as ODT. If you want to go towards pdf, there are several options to go from HTML to pdf as well.

3: Re: xowiki - data export (response to 2)
Posted by Ryan Gallimore on
Hi Gustaf,

I read through the xowiki docs regarding exporting using the book prototype, but wasn't able to render all pages in the instance into this format.

Can you provide instructions on how to generate a page similar to from all pages in an instance?


4: Re: xowiki - data export (response to 3)
Posted by Gustaf Neumann on
The book-export is not a general exporter for all pages, but exports only pages with a page_order attribute (in the edit-form the field called "section"), which have as well the publish_status "ready" (in the admin/list, publish has green symbol). These pages can be transformed into one html-page using the prototype page book-print (if you instance is called /wiki, type /wiki/book-print).

Save the page generated page and edit as desired (e.g. adding style-files, adding more info, etc.). You can also make your own variant of the book-print page, which can be found in packages/xowiki/ The single html-file can be converted to pdf using the usual html-conversion tools, or can be printed into pdf.

For exporting all pages (e.g. exchange between instances), use the export functionality in admin).

-gustaf neumann