Wednesday Feb 13, 2008
Wednesday Feb 13, 2008
Wikis are fast becoming a core tool in a lot of companies. People are using Wikis for just about everything... from a collaborative text editing tool, to the whole website for a project. Basically.. who isn't using a Wiki these days?
OpenOffice.org is one project that is getting into the Wiki world in a big way. For example, the OpenOffice.org documentation is being ported over to the OOoWiki. To get there, we used the MediaWiki export functionality in OpenOffice.org. This worked great. The export is almost perfect - only a few small tweaks are needed if the source document is in good shape.
Now that the documentation is actually in the Wiki, we want to get it back out. I don't mean as HTML in a single Wiki page.... I mean we want to be able to queue a stack of Wiki pages and export them all as a single ODT file. The question is... how do you do this?
A few people have looked into this problem in the past, but no one yet (to my knowledge) has actually come up with a fully working MediaWiki to ODT export tool (with no "gotcha's" ). The closest I have seen is found here http://svn.wikimedia.org/svnroot/mediawiki/trunk/wiki2xml/php/ This is the source for an extension to MediaWiki. Once it is installed and configured you get a new menu item in the "Special pages" section of your MediaWiki. This page looks like this:
The output is reasonable (once you work around the various quirks and bugs in the extension), but it really needs a lot of post conversion work to turn the result into a presentable document. One noticeable problem is that all the images are lost. Well, not lost, but they are not included in the export. They have to be added back into the exported document. This is OK if you have 1 or 2 images to deal with, but in the case of a large document with a hundred or more images, it becomes quite cumbersome. There are other issues as well that I have not yet resolved... such as.. .for some reason, the exported ODT file has 4 extra bytes at the beginning of the zip file. OpenOffice.org cannot open this broken ODT. The solution.. manually unzip the ODT, and zip it back up again. I don't know if this problem is due to a bug in the PHP or if it is a problem with the Linux environment that the exporter and Wiki are running on.

This MediaWiki extension comes closest (from what I've seen) to providing the tools needed to do the round trip from OpenOffice.org to MediaWiki and back to OpenOffice.org.... but it's not quite there. It needs a better user interface for one thing... it needs to be integrated into the Wiki itself, not tacked on as a "Special page". It should be easy for readers to select multiple pages or entire Wiki books to be exported. The export should also include the images that are used in each Wiki page.
Someone with a little XML knowledge.. someone who knows their way around PHP could probably fix this extension up, add a little to it, and produce a really useful extension to MediaWiki. Any volunteers? 
Hello
this seems not to work for me, when I paste a regular wikitext and try to convert I get an error of the form:
XML Parsing Error: xml declaration not at start of external entity
Location: http://localhost/wiki/index.php/Special:Wiki2XML
Line Number 3, Column 1:<?xml version='1.0' encoding='UTF-8' ?>
^
any idea?
Uwe Brauer
Posted by Uwe Brauer on April 02, 2008 at 05:32 PM CEST #
Off the top of my head.. no :-) What Wiki are you trying this on? A locally installed version? Do you have curl and docbook installed? Have you picked the right options from the radio buttons?
Posted by cdc on April 02, 2008 at 05:53 PM CEST #
Thank you very much for this article. It took me some hours to find it: I just wanted to find the place where I can download the MediaWiki Extension for OpenOffice.org ( http://wiki.services.openoffice.org/wiki/MediaWiki_Extension ). So I googled for "MediaWiki Extension" and got this one :))
If you want more information about the extension check out http://www.mediawiki.org/wiki/Extension:Wiki2xml and its talk page.
Posted by Flominator on April 15, 2008 at 02:12 PM CEST #