Fork me on GitHub

Installation

The Melati distribution includes a webserver (Jetty), a database (HSQLDB) and two templating engines (Velocity and WebMacro) so that it works straight out of the distribution with no configuration.

A completely empty database, which instantiates org.melati.poem.PoemDatabase is configured in the distribution.
This can be used as your local desktop database.

Maven quick start

Install Maven from maven.apache.org.

Change directory to a suitable directory (/dist or C:) and download using maven:

mvn -DconnectionUrl=scm:cvs:pserver:anonymous@melati.org:/usr/cvsroot:melati -Dpassword=anon -DcheckoutDirectory=melati scm:checkout
This will create a directory called melati containing the whole project. To install and generate the site documentation:
cd melati
mvn install site
That's it!

Testing

To test your installation and illustrate a few capabilities run through the interactive tests and run the unit tests using the following command:

mvn test
Though the tests are automatically run during the install.

Extending the contacts example

If you want to use Melati to build a website you might start by downloading and tinkering with the Contacts example locally, you can, of course change the target database and default templating engine.

Maven archetype

To create a new Melati based project use the archetype.

Using ant still?

Ant is a language, Maven is a build system : stop using Ant, we have.

Further installation instructions are in the README file.

Database Setup

HSQLDB

Melati works well with HSQLDB, this is set by default to save the database as an SQL script upon either servlet container restart or jvm exit, enabling all state to be maintained and editted by hand if neccessary. HSQLDB file or memory urls are supported, so the data can be persisted or not as required.

There is no setup required for HSQLDB, other than specifying the database url.

Postgresql

Install Postgresql, enable tcp access by adding -i to the postmaster options.

As the postgres user create your databases:

createdb everything
createdb melatijunit

MySQL

Install MySQL with support for transactions, to use InnoDb this involves uncomenting the innodb section of my.cnf.

In Mysql create your databases:

CREATE DATABASE everything;
CREATE DATABASE melatijunit;

Authorise the user that Poem will connect as:

USE everything;
GRANT ALL ON *.* to melati@localhost identified by 'melati';
USE melatijunit;
GRANT ALL ON *.* to melati@localhost identified by 'melati';

SQLServer

Install SQLServer, enable login access rather than Windows authentication. Set a user and password

In SQLServer Administrator create your databases:

everything
melatijunit

MSAccess

Create two empty databases called everything and melatijunit.

In ODBC set them as ODBC system DSN datasources, called everything and melatijunit.

There is currently a problem such that you have to rerun the tests a couple of times to get the tables to be recognised, the test DynamicTableTest needs to be disabled.