Sunday, November 15, 2009

Progress with the rewrite

So it's decided. Digital variants, the Harpur Archive and perhaps part of Hrit (can't say any more) will be done in Joomla! with a C++ version of nmerge with several improvements:

  1. Merging using the list format, not the explicit graph. So no more wasteful conversion to/from the graph.
  2. Support for 'plug-in' alignment modules for corpus linguistics texts, multi-lingual texts, xml-aware alignment. Also a user-accessible API for building their own alignment modules in C++.
  3. Use of a full suffix-tree for the general alignment algorithm. In this way the performance will be linear.

The GUI will become a Joomla! module, extension or whatever that will take over all the current functionality of the wiki and add a manuscript view and a tree-view, which will show the genealogical tree of the work. Maybe each of these views could be designed as modules also, so the site designer can add his/her own. I want this to be as flexible as possible.

Of course, the advantage of using Joomla! is that we leverage all its existing GUI for site management and page editing etc. So we get out of the box something that humanists can already use to build their own website.

But the keyword is: components, components, components! Like Steve Ballmer with his 'Developers! developers! developers!' Let the designer be free to customise the system.

Rahmel's book on Joomla! is fairly comprehensive, but a bit difficult to read. I have nearly finished working my way through Chapter 3. My intention is to go through it all as fast as possible and type in and test all the examples. At the end I hope that I will come out as a Joomla! guru, able to create three websites at the stroke of a key. If the goal of changing the face of digital humanities is ambitious I think it is also achievable given the tools available today.

Sunday, November 1, 2009

Radical Redesign

I have decided after arguing this through with the DV people is that they want a Joomla! or php-based website so they get a nice GUI and can edit it themselves. And no Java. So I have to rewrite nmerge in C++ and develop a Joomla! plugin out of the Alpha wiki web application. This way other humanitites users can get a simple, easy to deploy, web-application without paying for expensive web-hosting.

Monday, August 24, 2009

Some Big changes are Afoot

OK, I've been quiet about this for a bit. But I had other things to do, like attending the Balisage Conference. In the meantime I've had a rethink. I have realised how poorly written Jetspeed is. To create your own Jetspeed website you have to modify an existing website. Yuck. It should just be a product that you ADD things to, like webapps or portlets. Drop them in and away you go. Instead there is all this tinkering with the internals of a complex progam.

So I am returning to Pluto. It's very simple a cleaner. OK, there's no so many features but I can add those. Also, I have decied to use JSPs to define the portlets. I can rewrite the servlet code I have for Alpha and fit it very nicely into Pluto. And the best thing is Pluto is tiny - just 20MB. That sure beats over 200MB for Jetspeed, and that was small.

Thursday, June 18, 2009

Changing the database location

This would seem to be a simple task. After all, a web application which is dependent on a database being located somewhere on the disk can't store that information in the database itself. It needs some independent storage location. The obvious place to put this information is in the customised application somewhere. But after searching for it for hours I couldn't find it. No, it is in Tomcat in the /conf/Catalina/localhost directory. The file is called dv.xml (or jetspeed.xml for an uncustomised application).

The reason I wanted to know was that I wished to distribute the website and have it run on Windows. Obviously /tmp/jetspeed wouldn't be available. It would make more sense to store the database in the same folder as the website, and then have a single .bat file to start it all up. But I needed to alter the database location. Now I can.

Actually, I use a relative url. Instead of /tmp/jetspeed/derby/productiondb I used: ../../jetspeed/derby/productiondb, and it worked. My jetspeed directory was in the same directory as apache-tomcat-6.0.20, and contains derby/productiondb.

Changing the Navigation Menu

The navigation menu, which in the 'thesolution' layout is seen on the left, is a reflection of the links defined in /dv/WEB-INF/pages. I just deleted all the boring apache ones and replaced them with more reasonable DV ones.

Wednesday, June 17, 2009

Localising Included HTML files

Of course, in a website you want lots of HTML files, and in a multi-language website you want to provide translations for them. But how do you arrange it so that if you choose French as your locale, then the correct French HTML files are loaded?

The trick is to create a portlet definition for each HTML file you want to include. A bit tedious, I know, but how else can you do it? The portlet definitions reside in portlet.xml in the j2-portal web application, inside the WEB-INF folder. In there you will find a suitable portlet to revise and take over, such as 'Welcome to Jetspeed 2'. Just copy and duplicate this as many times as you want. It uses the Apache Portal Applications FilePortlet. Now this contains a trick suggested here, although the real mechanism is a little bit different.

You first define an init-param for the portlet thus:

<init-param>
  <name>useLanguage</name>
  <value>true</value>
</init-param>
This turns on the 'fallback' mechanism for files you specify but Jetspeed doesn't find at first. It works like this: if you specify a file /WEB-INF/view/info/about.html in your portlet-preference (see the portlet.xml file) but it's not there, and you enabled the fr locale by saying <supported-locale>fr</supported-locale>, and the current locale is French, then it will generate a fallback consisting of /WEB-INF/view/info/fr/about.html, and if that is present it will load that. The same trick works for any locale, including en.

The title and description strings have to be defined in resource bundles, but I will tackle that tomorrow.

Tuesday, June 16, 2009

Localising the Website Title

Although my colleagues will probably want 'Digital Variants' in all languages, I wanted localised versions in French, Spanish and Italian as the website title. Here's how you do it. In default-page.psml add some meta-data for each desired version:

<metadata name="short-title" xml:lang="fr">Variantes Numériques</metadata>
etc.
Then, define a Velocity macro in decorator-macros.vm:
#macro (ShortPageTitle)$jetspeed.page.getShortTitle( $preferedLocale)#end
This calls the getShortTitle method of org.apache.jetspeed.page.document.Node.java, which retrieves the declared 'shortTitle' of the page. I now have 'Varianti Digitali' as the website title in Italian.