Moulder in action

In a previous blog post, I’ve talked about templating in general and showed a quick example of how Moulder does templating.

Moulder is an Open source templating library that exists in 2 versions: Scala and Java. Both versions are hosted on Github and are available under the MIT Licence.

Unlike many other templating libraries, Moulder keeps the template data and the templating rules in separate files. The template data can (only) be any XML-like format, including HTML.
The templating rules are written in Scala or in Java (depending on the version you choose) and mimics jQuery’s usage patterns, i.e. a rule is expressed as a CSS selector and a list of operations to perform on the elements returned by that selector.

Read more of this post

Introducing Immanix: a Java library to process XML using parser combinators

Processing XML files is a PITA. There. I said it. Processing XML files using the Java standard XML API, i.e. JAXP is even worse. There are some nicer APIs out there that alleviate this pain, like XPATH, XStream, JAXB, Castor, etc.

But still, they all fail in some point or another, ranging from being verbose and tedious to write to not being able to handle large XML streams.
The latter is a killer for many of the higher level approaches out there. Try using XPATH or any mapping library on a file weighing more than a couple of megabytes.

To handle such cases, we are usually left with StAX. Don’t get me wrong: StAX is not that bad an API, and I’d take it any day instead of JAXP even for small files. It still is a very low level API and parsing the simplest of files requires an impressive amount of code. Also, handling state with StAX is a painful exercice. You usually end up building a full-fledged state machine to do it.

It’s in dealing with such cases that I thought that there must be a better way to do this. And that’s how immanix was born.
Read more of this post

Création d’une application de type CRUD avec Wicket

Extrait du synopsis :

Cet article va présenter le framework Apache Wicket et ce en s’appuyant sur la création d’une application de suivi de bugs (Bug tracker) qu’on nommera “Min.Bug.Tra”. Une telle application est un cas particulier de ce qu’on appèle CRUD (Create, Read, Update et Delete) mais qui a l’avantage de traiter une problématique réelle.

L’article complet est par ici : Création d’une application de type CRUD avec Wicket

On templating, and a shameless plug of Moulder

Moulder is a server-side templating system. It uses jQuery’s approach, i.e. select and transform, and works only on XML-like data. I’ve written it two times over: One time in Java and another in Scala. Both versions are available as Open source software on GitHub and released under the MIT License.

1. What is templating

Templating is generally used in (but not limited to) web applications to generate dynamic web pages. Every time you perform a search on Google or open your Facebook page, templating was used behind the scene to generate these pages.
Read more of this post

How to reference the latest versions of Woodstox with Maven

I spent some time digging around before figuring out how to reference the latest version of Woodstox Stax processor with Maven: Central only contains older versions, and the project changed its group and artefact ids, so I figured I’d blog about it in case it turns to be useful to others.

First, add the codehaus maven repository to your pom:


And then add


to your dependencies:


Mettre en place un Lazy Tree avec GWT

Le but de ce billet est de présenter une technique simple pour mettre en place un arbre paresseux (lazy tree) avec GWT.

GWT offre des primitives basiques pour la création d’un arbre, qui sont :

  • Le composant TreeItem : représente un noeud dans l’arbre et peut contenir de sous noeuds du même type.
  • Le composant Tree : représente la racine de l’arbre et peut contenir des TreeItems

Construire un arbre revient donc à créer autant d’instances de TreeItem que nécessaire et des les assembler pour obtenir l’hiérarchie souhaitée.
Cependant, cette méthode n’est pas applicable dans le cas où :

  • On dispose d’un grand nombre des noeuds (des centaines voire des milliers)
  • La récupération des noeuds est coûteuse : accès à la base de données et/ou au réseau

Dans des cas pareils, mieux vaut être paresseux et ne charger des noeuds que quand nécessaire (ne charger les fils d’un noeud que quand l’utilisateur l’ouvre).
Dans le cadre de ce billet, et comme source de données pour l’arbre, on suppose disposer d’un service exposé en RPC dont voici l’interface :

Read more of this post

Manually installing a recent version of Jetty as a service in Linux

While Jetty is available in most of the distributions packages managers, the included versions are rather old (6.1 in Karmic) :

djo@j-pc:~ aptitude show jetty
Package: jetty
State: not installed
Version: 6.1.20-2

So in order to use a recent version of Jetty, you’re on your own.

Here’s a quick post about how to install Jetty as a service on Linux (Ubuntu Karmic in my case), plus how to make it run as a different user account than the root and finally how to enable the automatic deployment of wars placed in Jetty’s webapps directory.

Start by grabbing a more recent version of Jetty from this rather confusing download page. I picked the tar-gz’ed Hightide 7.0.1 version from here.

Read more of this post


Get every new post delivered to your Inbox.