My GSOC adventure with XWiki and Dokuwiki

Last modified by Ecaterina Moraru (Valica) on 2020/01/28

Aug 13 2018

Mentors :

I want to thank Thomas Mortagne and Shubham Jain for giving me this opportunity and guiding me throughout this awesome journey patiently.

A little bit about me

I’m a final year B.Tech student, from Bharati Vidyapeeth's College of Engineering, India. I’m 22 years old and I feel pleased to be a part of XWiki community as a GSoC’18 student and learn more about both XWiki and Dokuwiki while playing with Java. 

Description

The project focused on improving the existing DokuWiki importer that imports instances of DokuWiki to XWiki by using some intermediate common events based on Filter Stream Framework. In the previous Dokuwiki importer module already supported basic functionalities. Improvements like support for handling unserializing of files with no metadata, lists, image-link, interwiki-link, macro support and other syntax-parser bug resolution.

You can get inspiration from

http://extensions.xwiki.org/xwiki/bin/view/Extension/Import+DokuWiki+into+XWiki+Application and

Documentation can be found at

 https://extensions.xwiki.org/xwiki/bin/view/Extension/DokuWiki

The issue tracker can be found

 http://jira.xwiki.org/projects/DOKUWIKI/issues/DOKUWIKI-11?filter=allopenissues

Developer Profile

Java

Status

Successfully terminated

Milestones

Milestone 1 [May 14 - June 15]:

Blocking bug fixing and folder support.

I fixed the warning and critical bugs, by making modifications in dokuwiki-text module. This also included setting up the project and getting used to the Component architecture of XWiki.

  • I started with refactoring my understanding of the Filter API and getting used to the Component architecture of XWiki. 
  • Another challenge was to find the ideal way to check for the input-source type and handle exceptions by reading them and the next task was to add support for DokuWiki data-directory as an input source.
  • Understanding issues with apache compress behavior difference with file input and streaming input. Finding the bug in FileUtils.CopyToFile (closing streams after copying the file) and resolve the FileNotFound Blocking Bug.
  • Fixing the crash of Dokuwiki importer after a few Seconds of start with class ArrayIndexOutOfBoundsException took some days in the debugging phase.
  • The existing code ended up in an infinite loop when importing a tgz input-source package, so the exception handling was added for it to try to find the type of the file before actually read it, before it tried to read it as a zip directly and expect the first read to fail if it's not one basically.
  • Tests were written, and post-testing, the extension was released on XWiki nexus repository. 
  • Finally, documentation was modified on the XWiki extension page. 

Milestone 2 [May 14 - June 15]:

 

Adding more syntax features.

The next step was to modify the DokuWiki-syntax parser module and add support for some more popular features and fixing bugs in image-syntax parsing. The idea was to refine the most of the basic syntax available in DokuWiki. 

  • The initial task for second span tasks was to get the thorough understanding of the DokuWiki syntax module. Critical differences between XWiki syntax and DokuWiki syntax and macros. 
  • Next task was to understand the XWiki rendering API and then, understanding occasional differences in behavior in the XML input and the output string from xwiki/2.1 syntax renderer. 
  • Added support for DokuWiki Interwiki links.
  • Added support for DokuWiki Image links.
  • Added support for DokuWiki indented lists.
  • Fixed the bug of no alignment of images. In the previous module, the image feature support checked for image alignment to be center, left or right but, doesn't return the alignment parameter in the output, so all the images were aligned right. 
  • Test cases were added for the new features. The changes in parser were released as an extension on XWiki nexus repository. 

Milestone 3 [July 20 - August 14]:

Adding macros framework.

The next step was to parse the DokuWiki syntax-plugins and call the relevant methods of the Rendering API so that the output is the XWiki syntax. The idea was to add a DokuWiki macro-framework.

  • I tried to hard-code the DokuWiki plugins in the DokuWiki-syntax parser module initially, but the issue we found was that it's pretty much impossible to support all DokuWiki plugin with all kinds of entry-points, so the challenge was to make it as easy as possible for anyone to add support for new DokuWiki plugins not supported by the standard importer so with the guidance of my mentors I designed a framework which makes it easy to add any DokuWiki-plugin component.

Finally, an updated version of the extension was released on the XWiki nexus repository. 

Deliverables

  • Add improvements to support for ordered, unordered and nested lists.
  • Add code for image-links supporting links to other internal or external pages. 
  • Add support for a folder as a source input. 
  • Handling un-serializing of files with no metadata.
  • Support for Interwiki-link to move to other wikis.  
  • Fix OOM when importing a tgz.
  • Working on FileNotFoundException error. 
  • Add popular macros support with and without arguments.
  • Optimise the way to support various archive type.
  • No alignment of the image detected. 

First Milestone release, latest version here

Second Milestone release, latest version here

Third Milestone release, latest version here

The extension can be downloaded from here

It was a fun and learning experience at the same time this summer with XWiki. The best part was achieving the milestones and doing the release by myself, thanks to my mentors for giving me committer access. emoticon_grin I now have a better idea how everything works in a community, the schedules and deadlines and how to write a code for production. I've learned best practices to be used to code like a modern developer (which was fun for me).
Thank you for reading. emoticon_smile 

Tags:
    

Get Connected