Wicket

At Code-Troopers, we like to work with the frameworks we love. One of them is Apache Wicket, and it happens to some of us doing some Play! Framework or Ruby on Rails (either for a client project, a side project or giving back OSS love).

One thing really great is this two frameworks is the central route system, one file allows to group all the routes handled by your application. Wicket does not provide such way of grouping routes, you can manually mount routes into your application or annotate your page classes.

Wicket routes mount library

This small library project available on Github allows to group mounts into a central file. To use it, simply add its dependency to your pom.xml (artifact is available on Maven central):

<dependency>
    <groupId>com.code-troopers</groupId>
    <artifactId>wicket-route-mount</artifactId>
    <version>0.1</version>
</dependency>
This dependency will transitively gets wicket-auth-roles (if there is a special need for a version without this dependency, it could be done easily).

Usage

To use it, simply create a routes.conf file at the root of the sources in your project (typically src/main/resources/) respecting the following format :

# mountPoint        class                           roles
/home               codetroopers.HomePage           
/secured            codetroopers.SecuredPage        USER
/user/${mode}/#{id} codetroopers.UserPage           ADMIN,USER

The files content is the following :

  • Mount path : using standard Wicket syntax (${requiredParam} and #{optionalParam} are available)
  • Page class : fully qualified name of the page class to mount
  • Roles (optional) : comma separated list of roles required to access the page
IntelliJ IDEA can do completion for class names in this file (you just need to hit the ctrl+space shortcut twice)

Logo DuckDuckGoMozilla added a function to search on the web in the latest versions of Thunderbird.That's nice, but the default search engine is bing. As a DuckDuckGo user, I wanted to add my favourite search engine and use it by default. So here's how to do it.
  1. Find your profile folder.
  2. In it, create a folder named "searchplugins" (without the quotes) if it doesn't exists.
  3. Save this xml file in it.
  4. (Re)start Thunderbird.
  5. Select some text in any mail, right clic and search with bing (sorry).
  6. Click the DuckDuckGo icon on the left.
  7. Click the heart icon on the bottom left.
  8. That's all!
To add google, add this file in the same folder.

alfred-icon

I recently bought the Alfred.app Powerpack. It is byfar the best application launcher / automation engine I've ever used. One of the new features of the second version of this application is user customizable workflows.

In my daily activities, I start, stop, restart and kill my Glassfish server several times a day. In order to save me a few keystrokes and a few alt-tabbing, I created this small workflow allowing me to manage my local Glassfish instance.

You can find the Alfred worfklow at the following url http://bit.ly/alfred-glassfish. You will probably need to adapt the GF_PATH variable in the script to point to the root of your Glassfish installation.

Once this small step is done, you'll end up with the following prompt in your Alfred :

Alfred with Glassfish workflow enabled