I made a change in the blogger configuration to ease the later work when blogging. It is possible that older entries are not correctly formatted.

Wednesday, 21 April 2010

Installing qwt (Qooxdoo Windowing Toolkit)

After trying qooxdoo, I natually tried QWT, which is a simple implementation of the windowing toolkit with java. The default project generated for qwt is basicall the same as the one provided by qooxdoo. However, the main idea is to use java as programming language. The javascript components are then generated I suppose.

Getting QWT to run with maven without the installed Maven

The QWT install package contains a maven instance. However, I already have two instances of maven installed on my computer, therefore I prefered using my own maven instance. This worked quite well after I installed the qooxdoo files as well as some eclipse base package in my local repository. Moreover I need the following setting:

<settings>
  <pluginGroups>
   <pluginGroup>org.qooxdoo.toolkit</pluginGroup>
  </pluginGroups>
</settings>

Then I could use the qwt project generator: $qwt-workplace> mvn-jul qx:new -Dpackage=de.deprofundis.exampleqwt -Dorg.apache.maven.global-settings=`pwd`/../qwt-0.2.0/bin/settings.xml
and then I could change in the directory "exampleqwt", where there is a src directory as well as a pom.xml.

Installing the project in my repository was easy:
$exampleqwt> mvn package -Dorg.apache.maven.global-settings=`pwd`/../qwt-0.2.0/bin/settings.xml
Then using qx:run task from the qwt maven plugin:
$exampleqwt> mvn qx:run -Dorg.apache.maven.global-settings=`pwd`/../qwt-0.2.0/bin/settings.xml

This started an instance of tomcat on port 8080. Therefore I could then test the application.

First Comments

The generated code is an index.html (or index.html.gz for browser/servers supporting gz I suppose. This is a huge html file containing the core content of the javascript for running qwt. I wonder why the programmers have not put this generated code in a javascript file and loaded this file.

The directory layout of a qwt project is described in a wiki page: directory_layout. Note that, there is a logging mechanism. Though I have not yet looked at what it really does. There is also a list of the modules to be loaded and the index.html which has been created.

From all this, it is not yet clear to me how to have a more modular approach, so that the qooxdoo code does not need to be loaded every time I need a qooxdoo component. I suppose this might be solved in a later version of the code.

Caveats

According to the following page of the documentation, QWT only works in a Tomcat 6 Servlet instance:

In order to distribute your QWT application, simply run mvn clean package to generate a target/yourapp-version.war file. Your application should run in any Tomcat 6 servlet container. QWT applications follow Sun’s servlet specification 2.5. Unfortunately, the servlet specification has currently no support for “reverse Ajax” (sometimes called “Comet”). QWT uses Tomcat 6 features to work-around this limitation. As a consequence, you cannot deploy in other servlet containers.