Installing Petals Master

Pre-requisites

Before installing the Petals Master web application, be sure that you have installed the following elements:

  • A JDK 1.6.0 or later,
  • A servlet container like [Apache Tomcat 5.5.26 or later,|http://tomcat.apache.org/]
  • A Web navigator like :
  • Firefox 2.0 or later with Javascript activated,
  • Chrome with Javascript activated,
  • Internet Explorer 6 or later with Javascript activated,
  • Opera 9.6 or later with Javascript activated,
  • Safari 3.1.2 or later with Javascript activated.
  • Optional : A relationnal database like :
  • MySQL 5.0 or later,
  • H2 1.1 or later,
  • HSQL 1.8.0 or later (HSQL DB is fully supported only in server mode).


By default, Petals Master is configured to use a H2 database, which is embedded into Petals Master (the H2 is configured in memory mode).

Configure a database and a Lucene index

The default configuration of the Petals Master application uses an H2 database, in non-persistent mode (memory mode). That means that when the servlet container is stopped, all the data are deleted (because they were not persisted).
You may want to change this configuration : use H2 database but in file mode (to persist data), or change the H2 database for a MySQL database for example. We will see how to do that.
Petals Master uses a Lucene index to store information about stored entities to provide advanced search capabilities. The default configuration stores the index in memory. So, if the servlet container is stopped, the index is lost. This default setting must only be used with a non persistant storage (H2 in memory mode). This configuration must be modified if you use a persistant storage like H2 in file mode or MySQL. We will see below, how to configure a file system directory for index purpose.
Petals Master is packaged as a war. To change the database configuration, you have to unzip the war archive. Go into the
${petals-master-root}/WEB-INF/classes directory and open the dragon.properties file.
The default dragon.properties file is (NB : here, we have disable the MySQL configuration and enable the H2 configuration, Indexation is set in memory mode) :

############
### Datasource properties
############

## MySQL Datasource
# jdbc.driverClassName = com.mysql.jdbc.Driver
# jdbc.url = jdbc:mysql://localhost:3306/dragon
# jdbc.username = anonymous
# jdbc.password =
# jdbc.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
# jdbc.hibernate.hbm2ddl.auto = update
# jdbc.hibernate.show_sql = false

## In Memory H2 Datasource
jdbc.driverClassName = org.h2.Driver
jdbc.url = jdbc:h2:mem:dragon
jdbc.username = sa
jdbc.password = sa
jdbc.hibernate.dialect = org.hibernate.dialect.H2Dialect
jdbc.hibernate.hbm2ddl.auto = update
jdbc.hibernate.show_sql = false

## In Memory HSQL Datasource
#jdbc.driverClassName = org.hsqldb.jdbcDriver
#jdbc.url = jdbc:hsqldb:mem:dragon
#jdbc.username = sa
#jdbc.password =
#jdbc.hibernate.dialect = org.hibernate.dialect.HSQLDialect
#jdbc.hibernate.hbm2ddl.auto = update
#jdbc.hibernate.show_sql = false
#jdbc.url =jdbc:hsqldb:file:c:/hsqldb/dragon

###########
### Indexation properties (Compass/Lucene)
###########

## Index path
compass.index.url = ram://compass
#compass.index.url = file:///c:/compass
# compass.index.url = file:///home/compass

## Full default analyser
#compass.engine.analyzer.default.type = snowball
#compass.engine.analyzer.default.name = English
compass.engine.analyzer.default.type = standard
compass.engine.analyzer.default.name = English

##########
### Log
##########
#log.root.path = C:/Projets/SOA4All

##########
### Repository
##########
## A Database repository configuration. All binary files are stored as DB Blobs
repo.type = database
repo.root = null
## A Filesystem repository configuration. All binary files are stored in the filesystem
#repo.type = filesystem
#repo.root = ./test-repository


The H2 Datasource (in memory mode) is the one used by default. You also have a MySQL configuration which is disabled by default.
Let's have a look at the available parameters (these parameters values are to adapt according to the used database) :
jdbc.driverClassName : this is the JDBC driver which enables the connection between the Java application and the database. A list of available JDBC drivers is available at JDBC Data Access API.


jdbc.url : this is the URL of the database.
jdbc.username : this is the username of the account used to access to the database.
jdbc.password : this is the password of the account used to access to the database.
jdbc.dialect : this is the Hibernate dialect allowing the translation of SQL information to the targeted database.
Available Hibernate dialects are :
H2 : org.hibernate.dialect.H2Dialect
MySQL : org.hibernate.dialect.MySQLDialect
MySQL 5 with InnoDB : org.hibernate.dialect.MySQL5InnoDBDialect
MySQL with InnoDB : org.hibernate.dialect.MySQLInnoDBDialect
MySQL with MyISAM : org.hibernate.dialect.MySQLMyISAMDialect
HSQLDB : org.hibernate.dialect.HSQLDialect
jdbc.hbm2ddl.auto : this parameter defines if the application creates a new database from scratch (create) or only update an existing database (update). Update mode also create a database if it doesn't exist. Except for an H2 in memory mode, it is recommended to set the value at update.
Let's have a look at the available parameter for the indexation :
compass.index.url : the index URL, "ram://path" for an in memory index, "file://path" for a file system persisted index.
compass.engine.analyser.default.type : type of analyser used to tokenize indexed information. Petals master comes with core analyzers (Which are part of the lucene-core jar). They are: standard, simple, whitespace, snowball, and stop.
standard : tokenize information with the following rules. Splits words at punctuation characters, removing punctuation. However, a dot that's not followed by whitespace is considered part of a token, splits words at hyphens, unless there's a number in the token, in which case the whole token is interpreted as a product number and is not split, recognizes email addresses and internet hostnames as one token.Then lowercase tokens and remove english stop words (the, a, an ...). It is the recommended and most tested analyser.
simple : tokenize information by dividing text at non-letters. That's to say, it defines tokens as maximal strings of adjacent letters, as defined by java.lang.Character.isLetter() predicate. Note: this does a decent job for most European languages, but does a terrible job for some Asian languages, where words are not separated by spaces.Then lowercase tokens.
whitespaces : tokenize information by dividing text at whitespace.
snowball : same as standard analyser but stems words using a Snowball-generated stemmer.
stop : same as simple analyser but remove english stop words (the, a, an ...).
compass.engine.analyser.default.name : An additional setting that must be set when using the snowball analyzer.
The settings can have the following values: Danish, Dutch, English, Finnish, French, German, German2, Italian, Kp, Lovins, Norwegian, Porter, Portuguese, Russian, Spanish, and Swedish.
Other parameters (not visible in the previous screenshot) :
configuration.reload.delay : this property specify the delay between 2 consecutives reload of the Petals Master configuration. Must not be modified.
root.domain : used to generate UDDI keys. By default the root domain is "dragon.org". You could specify your own root domain. For exemple : "mycompany.com". See Chapter 9, Adding custom Category/Identifier systems for Organizations/Services/Endpoints

Installing the application


Petals Master is packaged as a WAR archive, you just have to deploy it in your servlet container.
If you have previously unwar the Petals Master archive to set your own database configuration, you have two ways :
• Copy/paste your Petals Master directory directly into your serlet container,
• Zip your Petals Master directory as a WAR archive, then copy/paste this new archive into your servlet container (into the WebApp directory if you use Tomcat).
For instance, Tomcat users just have to copy the war to the webapps directory and wait for Tomcat to deploy the application.

Accessing the application

Once deployed, Petals Master can be accessed in your web browser through the address http://host:port/petals-master-1.x/petals-master

If your server configuration has "localhost" as host, 8080 as port, the URL for Petals Master V1.0 is : http://localhost:8080/petals-master-1.x/petals-master.


You reach the Login page of the application. You can choose to remember your logging information for two weeks. Petals Master is setup with a default user :
An administrator allowed to access to all Petals Master features : Username "master" / Password "master".

Once you are successfully logged in, you can see the following screen :

Please note that in the following screenshots, when you see a field with a yellow foreground, it means that the field is required.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.