Chapter 3. Installation

Version 1 by Sandra TRINO
on Feb 15, 2010 10:09.

compared with
Version 2 by Sandra TRINO
on Feb 15, 2010 10:14.

Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (49)

View Page History
h1. {color:#003f80}{*}3.1.*{color} {color:#003f80}{*}Configure{*}{color} {color:#003f80}{*}a{*}{color} {color:#003f80}{*}database{*}{color} {color:#003f80}{*}and{*}{color} {color:#003f80}{*}a{*}{color} {color:#003f80}{*}Lucene{*}{color} {color:#003f80}{*}index{*}{color}

\\
h1.{color:#003f80}*3.1.*{color} {color:#003f80}*Configure*{color} {color:#003f80}*a*{color} {color:#003f80}*database*{color} {color:#003f80}*and*{color} {color:#003f80}*a*{color} {color:#003f80}*Lucene*{color} {color:#003f80}*index*{color}

\\
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).
\\
\\
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 _$\{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) :
{code:lang=xml}############
### Dragon properties file
############

############
### Registry properties
############
configuration.reload.delay = 3000
root.domain = dragon.org

############
### 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{code}
!worddavfa1a093611d90f1c128cf742dfdbc7aa.png|height=431,width=291!\\
\\
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 [{color:#003f80}{+}JDBC Data Access API{+}{color}.|http://developers.sun.com/product/jdbc/drivers]\\
\\
\\
*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{*}. *update*.
\\
Let's have a look at the available parameter for the indexation :
\\
*compass.index.url* : the index URL, "ram://{_}path{_}" "ram://_path_" for an in memory index, "file://{_}path{_}" "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 [{color:#003f80}{+}stemmer{+}{color}.|http://en.wikipedia.org/wiki/Stemming]\\
• *stop* : same as simple analyser but remove english stop words (the, a, an ...).
\\
• *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{*}. 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 {color:#003f80}Chapter 9, _Adding 9,{color} {color:#003f80}{_}Adding custom Category/Identifier systems for Organizations/Services/Endpoints{_}{color}\\
\\
\\
h1.{color:#003f80}*3.2.*{color} {color:#003f80}*Installing*{color} {color:#003f80}*the*{color} {color:#003f80}*application*{color}
h1. {color:#003f80}{*}3.2.*{color} {color:#003f80}{*}Installing{*}{color} {color:#003f80}{*}the{*}{color} {color:#003f80}{*}application{*}{color}

\\
For instance, Tomcat users just have to copy the war to the _webapps_ directory and wait for Tomcat to deploy the application.
\\
h1.{color:#003f80}*3.3.*{color} {color:#003f80}*Accessing*{color} {color:#003f80}*the*{color} {color:#003f80}*application*{color}

h1. {color:#003f80}{*}3.3.*{color} {color:#003f80}{*}Accessing{*}{color} {color:#003f80}{*}the{*}{color} {color:#003f80}{*}application{*}{color}

\\
Once deployed, Petals Master can be accessed in your web browser through the address [{color:#003f80}{+}http://{_}host{_}:{_}port{_}/petals-master-+{color}|http://localhost:8080/dragon-ui-${version-number}/Dragon] \[{color:#003f80}{+}http://+{color}{color:#003f80}{_}{+}host{+}{_}{color}{color:#003f80}+:+{color}{color:#003f80}{_}{+}port{+}{_}{color}{color:#003f80}+/petals-master\-+{color}\|http://localhost:8080/dragon-ui-${version-number}/Dragon\]
[{color:#003f80}{+}$\{version-number\}/petals-master{+}{color}.|http://localhost:8080/dragon-ui-${version-number}/Dragon] \[{color:#003f80}+$\{version-number\}/petals-master{+}{color}.\|http://localhost:8080/dragon-ui-${version-number}/Dragon\] If your server configuration has "localhost" as host, 8080 as port, the URL for Petals
Master V1.0 is : [{color:#003f80}{+}http://{_}localhost{_}:{_}8080{_}/petals-master-1.0/petals-master{+}{color}.|http://localhost:8080/dragon-ui-${version-number}/Dragon] \[{color:#003f80}{+}http://+{color}{color:#003f80}{_}{+}localhost{+}{_}{color}{color:#003f80}+:+{color}{color:#003f80}{_}{+}8080{+}{_}{color}{color:#003f80}+/petals-master-1.0/petals-master{+}{color}.\|http://localhost:8080/dragon-ui-${version-number}/Dragon\]
!worddav1470979c40c05ae03ae385074aab0004.png|height=343,width=450!\\
\\
You reach the Login page of the application. You can choose to remember your logging information for two weeks. Petals Master is setup with two default users :
• An *administrator* allowed to access to all Petals Master features : Username "{*}master{*}" "*master*" / Password "{*}master{*}" "*master*"
\\
• A *simple user* having limited access rights : Username "{*}user{*}" "*user*" / Password "{*}user{*}" "*user*"
\\
You can add/remove users by editing the applicationContext-security.xml file that sits in the same directory as the dragon.properties file ($\{petals-master-root\}/WEB-INF/). You must edit this part of the file :
\\
<authentication-provider>
- -<password-encoder -hash="{*}md5{*}" -/>
- \-<password-encoder \-hash="*md5*" \-/>
- \-<user-service>
- - - -<user -name="{*}master{*}" -password="{*}eb0a191797624dd3a48fa681d3061212{*}"
- - - - -authorities="{*}ROLE_USER{*}, -{*}ROLE_ADMIN{*}" -/>
- - - -<user -name="{*}user{*}" -password="{*}ee11cbb19052e40b07aac0ca060c23ee{*}"
- - - - -authorities="{*}ROLE_USER{*}" -/>\\
- \- - \-<user \-name="*master*" \-password="*eb0a191797624dd3a48fa681d3061212*"
- \- - - \-authorities="*ROLE_USER*, -*ROLE_ADMIN*" \-/>
- \- - \-<user \-name="*user*" \-password="*ee11cbb19052e40b07aac0ca060c23ee*"
- \- - - \-authorities="*ROLE_USER*" \-/>
\\
\\
- -</user-service>
</authentication-provider>
Two roles are available : *ROLE_ADMIN* and *ROLE_USER{*}. All users must have at least the *ROLE_USER* role. Passwords must be encoded in md5. An online encoder is available at [{color:#003f80}{+}http://7thspace.com/webmaster_tools/+{color}|http://7thspace.com/webmaster_tools/online_md5_encoder.html]
[{color:#003f80}{+}online_md5_encoder.html{+}{color}.|http://7thspace.com/webmaster_tools/online_md5_encoder.html]
\\
- \-</user-service>
</authentication-provider>
Two roles are available : *ROLE_ADMIN* and *ROLE_USER*. All users must have at least the *ROLE_USER* role. Passwords must be encoded in md5. An online encoder is available at [{color:#003f80}{+}{color}|http://7thspace.com/webmaster_tools/online_md5_encoder.html]{color:#003f80}[http://7thspace.com/webmaster_tools/\+|http://7thspace.com/webmaster_tools/+]{color}
[{color:#003f80}{+}online_md5_encoder.html{+}{color}.|http://7thspace.com/webmaster_tools/online_md5_encoder.html]\\
Once you are sucessfully logged in, you can see the following screen :
!worddav57ecf34e76a9ee989288afb4f3f3d0a5.png|height=345,width=448!\\
Please note that in the following screenshots, when you see *a* *field* *with* *a* *yellow* *foreground*, it means that *the* *field is required*.
\\
Please note that in the following screenshots, when you see *a* *field* *with* *a* *yellow* *foreground{*}, it means that *the* *field is required{*}.\\
\\
\\