You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Requirements

  • Postgres database with Postgis extension
  • Tomcat 6
  • Java 1.7 (Tested with Java version "1.7.0_45")

Configuring the Geonetwork 3 sources

To make Geonetwork 3 use the Postgres with postgis a new configuration is added. the following has to be changed in the "web/src/main/webapp/" directory:

  • WEB-INF\config-node\srv.xml -->  Change to: <import resource="../config-db/postgres-postgis.xml"/>
  • WEB-INF\config-db\postgres-postgis.xml will be added. (content displayed hereafter).
  • WEB-INF\config-db\jdbc.properties --> Fill in the database host, username and password (used for local development)
  • Put the jdbc.properties in the tomcat conf directory to override the default jdbc.properties.

Configure the postgres-postgis.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<beans default-lazy-init="true"
       xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
   ">
    <!--  Postgresql database with postgis extenstion to allow storing spatial index in postgres. -->

    <!-- allow loading properties from the tomcat conf directory. If not found the default jdbc.properties will be used. -->
    <context:property-placeholder location="file:${catalina.home}/conf/jdbc.properties" ignore-resource-not-found="true" file-encoding="UTF-8" ignore-unresolvable="true" order="0"/>

    <import resource="defaultJdbcDataSource.xml"/>
    <import resource="postgis-alternate-datasource.xml"/>

    <bean id="jpaVendorAdapterDatabaseParam" class="java.lang.String">
        <constructor-arg value="POSTGRESQL"/>
    </bean>

    <bean id="jdbcDriverClassName" class="java.lang.String">
        <constructor-arg value="org.postgis.DriverWrapper"/>
    </bean>

    <bean id="jdbcURL" class="java.lang.String">
    <constructor-arg value="jdbc:postgresql_postGIS://${jdbc.host}:${jdbc.port}/${jdbc.database}"/>
    </bean>
</beans>

 

Geonetwork uses stopwords to create indexes and to filter them from queries. This leads to unexpected results if a user uses the english user interface and types a dutch query. For example the query "het water" wil be interpreted as an english query. The stopword "het" won't be removed from the query. During indexing dutch documents the stop words will be removed, so only "water" is stored in the index. So searching for "het water" will not find any results.

To work around this issue, the english and dutch stop words have been merged:

webapp/resources/stopwords

  • eng.txt
  • dut.txt

Tomcat 6 Configuration

To store indexes and other Geonetwork specific data, pass a java environment data directory to tomcat.

"-Dgeonetwork.dir=/var/lib/geonetwork_data"

To make sure tomcat has enough memory available, use the following java parameters:

"-Dfile.encoding=UTF-8 -Xms128m -Xmx712m -XX:PermSize=128m -XX:MaxPermSize=128m"

 

On CentOS these settings can be set in the /usr/share/tomcat6/conf/tomcat6.conf file.

  • JAVA_OPTS="-Dgeonetwork.dir=/var/lib/geonetwork_data -Dfile.encoding=UTF-8 -Xms128m -Xmx712m -XX:PermSize=128m -XX:MaxPermSize=128m"

On windows the JAVA_OPTS can be added to the sentenv.bat file in the tomcat bin directory.

 

 

 

 

 

 

 

  • No labels