Geonetwork configuration

By default, Geonetwork stores metadata in an H2 database. It is recommanded to change the database configuration to a more 'accessible' database like postgres. This configuration is described here

Geonetwork version must be <= 2.6.3 to be compliant with easySDI !

Configuring search on EasySDI metadata and harvested metadata

EasySDI's metadatas and harvested metadatas can coexist in the same Geonetwork catalog.
To allow EasySDI solution to handle these two kinds of data, the EasySDI's 'harvested' attribute needs to be set in the Geonetwork configuration as an index field.

- edit the file /var/lib/tomcat6/webapps/geonetwork/xml/schemas/iso19139/index-fields.xsl

- in namespaces declaration, add the sdi namespace:

<xsl:stylesheet version="1.0" xmlns:gmd="http://www.isotc211.org/2005/gmd" 
            xmlns:sdi="http://www.easysdi.org/2011/sdi" 
            xmlns:gco="http://www.isotc211.org/2005/gco" 
            xmlns:gml="http://www.opengis.net/gml" 

- in the node:

<xsl:template match="*" mode="metadata">

- add the new node:

        <xsl:for-each select="sdi:platform">
            <xsl:for-each select="@guid">
                <Field name="platform" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="@harvested">
                <Field name="harvested" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/@type">
                <Field name="resourcetype" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/@name">
                <Field name="resourcename" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/@organism">
                <Field name="resourceorganism" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/@scope">
                <Field name="scope" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:users/sdi:user/@guid">
                <Field name="sdiuser" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:organisms/sdi:organism/@guid">
                <Field name="sdiorganism" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:categories/sdi:category/@guid">
                <Field name="sdicategory" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each> 

            <xsl:for-each select="sdi:resource/sdi:metadata/@state">
                <Field name="metadatastate" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:metadata/@lastVersion">
                <Field name="lastversion" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:metadata/@published">
                <Field name="published" string="{string(.)}" store="true" index="true" token="false"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:metadata/@endpublished">
           <Field name="endpublished" string="{string(.)}" store="true" index="true" token="false"/>
        </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:metadata/@created">
                <Field name="created" string="{string(.)}" store="true" index="true" token="false"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:metadata/sdi:diffusion/@isFree">
                <Field name="isfree" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:metadata/sdi:diffusion/@isDownloadable">
                <Field name="isdownloadable" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:metadata/sdi:diffusion/@isOrderable">
                <Field name="isorderable" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>

            <xsl:for-each select="sdi:resource/sdi:metadata/sdi:visualization/@isViewable">
                <Field name="isviewable" string="{string(.)}" store="true" index="true" token="true"/>
            </xsl:for-each>
        </xsl:for-each>

- after :

 <xsl:for-each select="*/gmd:EX_Extent">
     <xsl:apply-templates select="gmd:geographicElement/gmd:EX_GeographicBoundingBox" mode="latLon"/>

- add the new node:

 <xsl:for-each select="gmd:geographicElement/gmd:EX_GeographicDescription/gmd:geographicIdentifier/gmd:MD_Identifier/gmd:code/gco:CharacterString">
      <Field name="definedBoundary" string="{string(.)}" store="true" index="true" token="false"/>
 </xsl:for-each>

Configuring Geonetwork to allow EasySDI metadatas to be harvested

Harvesting can be done on a EasySDI catalog (via EasySDI Proxy), by adding in the default configuration of the 'ElementSet' named 'summary', the element 'sdi:platform' :

- edit the file ..\geonetwork\xml\csw\schemas\iso19139\iso-summary.xsl

- add copy instruction of the 'sdi:platform' element in the following template :

<xsl:template match="gmd:MD_Metadata|*[@gco:isoType='gmd:MD_Metadata']">
        <xsl:variable name="info" select="geonet:info"/>
        <xsl:copy>
            <xsl:apply-templates select="gmd:fileIdentifier"/>
            <xsl:apply-templates select="gmd:language"/>
            <xsl:apply-templates select="gmd:characterSet"/>
            <xsl:apply-templates select="gmd:parentIdentifier"/>
            <xsl:apply-templates select="gmd:hierarchyLevel"/>
            <xsl:apply-templates select="gmd:hierarchyLevelName"/>
            <xsl:apply-templates select="gmd:dateStamp"/>
            <xsl:apply-templates select="gmd:metadataStandardName"/>
            <xsl:apply-templates select="gmd:metadataStandardVersion"/>
            <xsl:apply-templates select="gmd:referenceSystemInfo"/>
            <xsl:apply-templates select="gmd:identificationInfo"/>
            <xsl:apply-templates select="gmd:distributionInfo"/>
            <xsl:apply-templates select="gmd:dataQualityInfo"/>
            <xsl:apply-templates select="sdi:platform"/>
            <!-- GeoNetwork elements added when resultType is equal to results_with_summary -->
            <xsl:if test="$displayInfo = 'true'">
                <xsl:copy-of select="$info"/>
            </xsl:if>

        </xsl:copy>
    </xsl:template>

- and the corresponding namespace in the declaration :

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
         xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" 
         xmlns:gmd="http://www.isotc211.org/2005/gmd" 
         xmlns:gco="http://www.isotc211.org/2005/gco" 
         xmlns:srv="http://www.isotc211.org/2005/srv" 
         xmlns:ows="http://www.opengis.net/ows" 
         xmlns:geonet="http://www.fao.org/geonetwork" 
         xmlns:sdi="http://www.easysdi.org/2011/sdi">

Configuring Geonetwork to handle empty/null/non existing attribute

Usefull when you update your EasySDI CATALOG from a version that not handle harvesting to a version which do

In the file ..\geonetwork\xml\csw\filter-to-lucene.xsl, find the template PropertyIsNull.
It should be like this :

<xsl:template match="ogc:PropertyIsNull">
   <error type="Operator not implemented">
    <xsl:copy-of select="."/>
  </error>
</xsl:template>

Replace it by :

<xsl:template match="ogc:PropertyIsNull">
    <BooleanQuery>
      <BooleanClause required="true" prohibited="false">
        <MatchAllDocsQuery required="true" prohibited="false"/>
      </BooleanClause>

      <BooleanClause required="false" prohibited="true">
        <WildcardQuery fld="{ogc:PropertyName}" txt="*"/>
      </BooleanClause>
    </BooleanQuery>
</xsl:template>

Configuring index fields

- Index fields to add in WEB-INF/config-lucene.xml

<config>
    <tokenized>
        <Field name="any"/>
        <Field name="abstract"/>
        <Field name="abstractFR"/>
        <Field name="abstract_FR"/>
        <Field name="title"/>
        <Field name="titleFR"/>
        <Field name="title_FR"/>
        <Field name="altTitle"/>
    <!-- SDI system fields --> 
    <Field name="platform"/>
    <Field name="harvested"/>
    <Field name="resourcetype"/>
    <Field name="resourcename"/>
    <Field name="resourceorganism"/>
    <Field name="scope"/>
    <Field name="sdiuser"/>
    <Field name="sdiorganism"/>
    <Field name="metadatastate"/>
    <Field name="lastversion"/>
    <Field name="published"/>
    <Field name="created"/>
    <Field name="isfree"/>
    <Field name="isdownloadable"/>
    <Field name="isorderable"/>
    <Field name="isviewable"/>
         <!--Field name="inspiretheme"/-->
        <Field name="keywordType"/>
        <Field name="keyword"/>
        <Field name="keyword_FR"/>
        <Field name="subject"/>
        <Field name="orgName"/>
        <Field name="specificationTitle"/>
        <Field name="levelName"/>
        <Field name="responsiblePartyRole"/>
        <!-- from SearchManager/static -->
        <Field name="_uuid"/>
        <Field name="parentUuid"/>
        <Field name="operatesOn"/>
        <Field name="mainsearch"/>
        <Field name="mainsearch_FR"/>
    </tokenized>

    <numeric>
        <Field name="denominator" type="integer" />
    </numeric>
</config>

In the admin panel of geonetwork, launch the "Rebuild Lucene index". You're now ready to use geonetwork with EasySDI.