The Melati distribution includes a webserver (Jetty), a database (HSQLDB) and three templating engines (Velocity, Freemarker, 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.
Install Maven from maven.apache.org.
Change directory to a suitable directory clone using git:
git clone git@github.com:Melati/Melati.git
This will create a directory called Melati containing the whole project.
cd Melati mvn install cd melati mvn jetty:run
Point your browser at http://localhost:8080/
To install and generate the site documentation:
mvn install site
That's it!
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
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.
To create a new Melati based project use the archetype.
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.
Install Postgresql, enable tcp access by adding -i
to the postmaster options.
As the postgres user create your databases:
createdb everything createdb melatijunit
Install MySQL with support for transactions, to use InnoDb this involves uncommenting 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';
Install SQLServer, enable login access rather than Windows authentication. Set a user and password
In SQLServer Administrator create your databases:
everything melatijunit
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.