[GeoNetwork-devel] [GeoNetwork opensource Developer website] #1247: Indexing / iso19139 / add XSL mode to easily add new field in a profile

#1247: Indexing / iso19139 / add XSL mode to easily add new field in a profile
-------------------------+--------------------------------------------------
Reporter: fxp | Owner: geonetwork-devel@…
     Type: enhancement | Status: new
Priority: minor | Milestone: v2.9.0
Component: General | Version: v2.9.0
Keywords: PIGMA |
-------------------------+--------------------------------------------------
When making a profile, indexing could be quite easily delegated to
iso19139 using:

{{{
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform&quot;
version="2.0">
     <xsl:import href="../iso19139.fra/index-fields.xsl"/>
</xsl:stylesheet>
}}}
but there is no easy way to add one field (without duplicating the
mode="metadata" template).

This task adds an "index" mode template in order to easily add new field.

For example, index some keywords from a specific thesaurus in a new field
adding the following to the previous XSL:
{{{
         <xsl:template mode="index"
             match="gmd:MD_Keywords[gmd:thesaurusName/gmd:CI_Citation/
                         gmd:title/gco:CharacterString='My thesaurus']/
                         gmd:keyword[normalize-space(gco:CharacterString)
!= '']">
             <Field name="myThesaurusKeyword" string="{string(.)}"
store="true" index="true"/>
         </xsl:template>
}}}

If matching a upper level element, apply mode to its child to further
index deeper level if required:
{{{
         <xsl:template mode="index" match="gmd:EX_Extent">
             ... do something
             ... and continue indexing
             <xsl:apply-templates mode="index" select="*"/>
         </xsl:template>
}}}

No changes made to mode="metadata" for compatibility with existing
profiles.

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1247&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#1247: Indexing / iso19139 / add XSL mode to easily add new field in a profile
-------------------------+--------------------------------------------------
Reporter: fxp | Owner: geonetwork-devel@…
     Type: enhancement | Status: new
Priority: minor | Milestone: v2.9.0
Component: General | Version: v2.9.0
Keywords: PIGMA |
-------------------------+--------------------------------------------------
Description changed by fxp:

Old description:

When making a profile, indexing could be quite easily delegated to
iso19139 using:

{{{
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform&quot;
version="2.0">
    <xsl:import href="../iso19139.fra/index-fields.xsl"/>
</xsl:stylesheet>
}}}
but there is no easy way to add one field (without duplicating the
mode="metadata" template).

This task adds an "index" mode template in order to easily add new field.

For example, index some keywords from a specific thesaurus in a new field
adding the following to the previous XSL:
{{{
        <xsl:template mode="index"
            match="gmd:MD_Keywords[gmd:thesaurusName/gmd:CI_Citation/
                        gmd:title/gco:CharacterString='My thesaurus']/
                        gmd:keyword[normalize-space(gco:CharacterString)
!= '']">
            <Field name="myThesaurusKeyword" string="{string(.)}"
store="true" index="true"/>
        </xsl:template>
}}}

If matching a upper level element, apply mode to its child to further
index deeper level if required:
{{{
        <xsl:template mode="index" match="gmd:EX_Extent">
            ... do something
            ... and continue indexing
            <xsl:apply-templates mode="index" select="*"/>
        </xsl:template>
}}}

No changes made to mode="metadata" for compatibility with existing
profiles.

New description:

When making a profile, indexing could be quite easily delegated to
iso19139 in schema/index-fields.xsl using:

{{{
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform&quot;
version="2.0">
     <xsl:import href="../iso19139/index-fields.xsl"/>
</xsl:stylesheet>
}}}
but there is no easy way to add one field (without duplicating the
mode="metadata" template).

This task adds an "index" mode template in order to easily add new field.

For example, index some keywords from a specific thesaurus in a new field
adding the following to the previous XSL:
{{{
         <xsl:template mode="index"
             match="gmd:MD_Keywords[gmd:thesaurusName/gmd:CI_Citation/
                         gmd:title/gco:CharacterString='My thesaurus']/
                         gmd:keyword[normalize-space(gco:CharacterString)
!= '']">
             <Field name="myThesaurusKeyword" string="{string(.)}"
store="true" index="true"/>
         </xsl:template>
}}}

If matching a upper level element, apply mode to its child to further
index deeper level if required:
{{{
         <xsl:template mode="index" match="gmd:EX_Extent">
             ... do something
             ... and continue indexing
             <xsl:apply-templates mode="index" select="*"/>
         </xsl:template>
}}}

No changes made to mode="metadata" for compatibility with existing
profiles.

--

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1247#comment:1&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.

#1247: Indexing / iso19139 / add XSL mode to easily add new field in a profile
--------------------------+-------------------------------------------------
  Reporter: fxp | Owner: geonetwork-devel@…
      Type: enhancement | Status: closed
  Priority: minor | Milestone: v2.9.0
Component: General | Version: v2.9.0
Resolution: fixed | Keywords: PIGMA
--------------------------+-------------------------------------------------
Changes (by fxp):

  * status: new => closed
  * resolution: => fixed

Comment:

master commit 8028ebde1f310b1c4c05aa0091db1ff015bb9fb9

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/1247#comment:2&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.