XWiki – Customize presentation with wiki macros

October 11th, 2009 Asiri Rathnayake No comments

About a week ago I decided to move my web content from myxwiki.org to rathnayake.org. The decision was mainly because I wanted have a personal server which I can use for all sorts of wacky experiments. As an added benefit, now I can host my content under a personal domain. With this move I began working on some of the articles that I always wanted to publish. But there I was bit worried; the default presentational macros of XWiki did not match my taste. For an example, xwiki has three macros for presenting informative messages:

messages.png

Clearly this wasn’t enough for me, I wanted more aesthetically pleasing, customizable and reusable presentational elements for my work. At this point it came to my mind that coupling XWiki skin extension support with XWiki wiki macros would provide a solution for my problem; I spent several hours with both the technologies and finally came up with the mbox macro:

mbox.png

NOTE: You can download & view source code for mbox macro at MBox macro page.

So how customizable is this new mbox macro? There are two possibilities here. On one hand we can mix-and-match various parameters of the mbox macro to create different presentational elements. For an example, we can quickly put together a warning mbox element like below:

warningmbox.png

Output of above warning mbox would be:

warningmboxoutput.png

NOTE: Tango icon library provides a wealth of icons that can be used with mbox macro.

The other approach towards customizing mbox macro is to edit the MBox style sheet extension or the MBox wiki macro Definition itself (both residing inside MBox macro page). Still, this approach might not qualify as a method of customizing, rather it is like a central control box where you can alter the presentation of your content by editing just one wiki page. All your wiki pages will be updated instantly to reflect your new instructions.

Finally what about re-usability? This is where it gets really interesting: xwiki macros can be nested, which means you can derive new macros encapsulating existing ones. I’ll leave the details out for now, just have a look at my mnote macro which is derived from the mbox macro:

mnote.png

NOTE: You can refer MNote macro page for source code and installation instructions.

As we saw above, wiki macros allow authorised users to define new presentational elements which are customizable, reusable and extensible. I should conclude my post stating that this is only one cool feature of XWiki, there are host of other XWiki features which when used wisely makes XWiki a great application / publishing platform. I will be posting more about these cool XWiki features in coming months :)

Categories: Technology, XWiki Tags: , , ,

New XWiki OfficeImporter

August 4th, 2009 Asiri Rathnayake No comments

We’ve been introducing several enhancements to XWiki OfficeImporter application for past few months. Along with XE 2.0 final release we’ll be launching our latest feature packed OfficeImporter!

officeimporter.png

Many thanks to laurent lunati for coming up with a cool UI :)

Categories: Technology, XWiki Tags: ,

Integration testing with maven and jetty

July 28th, 2008 Asiri Rathnayake No comments

While working on my gsoc project i came across a situation where i had to test a servlet while it is deployed within a servlet container. The requirement is simple; make some requests to the servlet and check whether the servlet responds correctly. After some googling i finally figured out how to put the pieces together in just two easy steps:

Configure jetty to start execution just before the “integration-test” phase and stop when all integration tests are run:


  org.mortbay.jetty
  jetty-maven-plugin
  7.0.0pre1
  
    /xwiki-webdav
    0
    stop
    9999
  
  
    
      start-jetty
pre-integration-test
      
        run
      
      
        0
        true
      
    
    
      stop-jetty
post-integration-test
      
        stop
      
    
  

Configure surefire tests so that integration tests are separated from usual unit tests:


  org.apache.maven.plugins
  maven-surefire-plugin
  
    
      **/*TTest.java
    
  
  
    
      surefire-it
integration-test
      
        test
      
      
      
        **/*ITest.java
      
      
    
  

That’s it, now simply execute `mvn integration-test` :)

GSoC 2008 – XWiki WebDAV Project

April 22nd, 2008 Asiri Rathnayake No comments

My dreams about Google Summer of Code have come true and I’m really happy about being selected to work with XWiki. I’m not in the mood to party or do anything like that but I feel satisfied and relaxed. For the coming three months I’ll be working with XWiki community towards developing a WebDAV interface that would allow any WebDAV client (like DAVExplorer) to brows / view / edit an XWiki repository using familiar DAV commands. I think this is enough for now; I’ll have more to blog about when the project takes off.

Categories: Personal Tags: , ,

Popular Neural Network Toolboxes & Libraries

March 13th, 2008 Asiri Rathnayake No comments

Today i thought i should write about various toolboxes / libraries available for interested researchers / developers working in the area of Artificial Neural Networks.

The first toolbox i became familiar with is the MATLAB Neural Network Toolbox which is handy for various simulation / testing purposes. I did not work with this tool much, but I think it is not used as an implementation platform for ANNs (but it’s really good for testing out various ideas). One important aspect of MATLAB NN Toolbox is that it supports various types of networks and training algorithms. I think by far this is the most complete “ToolBox” out there for a researcher on ANNs.

Then there is FANN (Fast Artificial Neural Networks) which is equally suited for testing as well as implementations of ANNs. Although the types of ANNs currently supported by FANN is limited to standard multilayer back-propagation networks (fully connected as well as sparse connected) , there are / have been several attempts to include various other types of networks into FANN (GSoC projects, SOMS and various other types).

Lush (Lisp Universal Shell) is not an NN library but a programming language (a derivative of Lisp) which includes support for many research subjects (including ANNs). Lush also supports Convolutional Neural Networks (CNNs) and has bindings for OpenCV.

Apart from those three, I found conv-net to be a very specific ANN library which supports Convolutional Neural Networks. But it only supports simulation of CNNs which makes it pretty dumb because we cannot actually train any network using this library.

The final project i want to mention is hosted here. This is not a library nor is a toolbox. This is a very specific application which performs handwritten digit recognition using convolutional neural networks. Based on this project i was able to put up a stand-alone convolutional neural network library which can train, simulate and save trained networks. I had to do a lot of reverse engineering because this is a windows MFC application (was quite hard to adopt it into Linux – which is my OS). I wish to publish this library somewhere on the web (may be in this blog itself) but first, i need to get proper permissions from the original developer.