Commit a3a5f901 authored by ByronCinNZ's avatar ByronCinNZ

Added files and changes needed to support GeoNetwork 3.4 and later

parents
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>schemas</artifactId>
<groupId>org.geonetwork-opensource</groupId>
<version>2.11.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>schema-iso19139.mcp-1.4</artifactId>
<name>GeoNetwork schema plugin for iso19139.mcp-1.4 standard</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>schema-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>test-jar</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>run-static-analysis</id>
<activation>
<property>
<name>!skipTests</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Mapping between netcdfDatasetInfo and ISO19139 keywords -->
<xsl:stylesheet version="2.0"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gts="http://www.isotc211.org/2005/gts"
xmlns:gml="http://www.opengis.net/gml"
xmlns:srv="http://www.isotc211.org/2005/srv"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="java:java.util.UUID"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="util">
<!-- ==================================================================== -->
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<!-- ==================================================================== -->
<xsl:template match="*">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<gmd:descriptiveKeywords>
<gmd:MD_Keywords>
<xsl:for-each select="variable">
<gmd:keyword>
<gco:CharacterString><xsl:value-of select="concat(@name,' ',@long_name,' ',@decl)"/></gco:CharacterString>
</gmd:keyword>
</xsl:for-each>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<gmd:type>
<gmd:MD_KeywordTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode" codeListValue="theme"/>
</gmd:type>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<gmd:thesaurusName>
<gmd:CI_Citation>
<gmd:title>
<gco:CharacterString><xsl:value-of select="concat(convention/@name,' (see http://www.unidata.ucar.edu/software/netcdf/conventions.html for more info on some conventions and adding conventions to the Unidata netcdf-4.0 Java library)')"/></gco:CharacterString>
</gmd:title>
<gmd:alternateTitle>
<gco:CharacterString>Data Parameters/Variables following the <xsl:value-of select="convention/@name"/> conventions</gco:CharacterString>
</gmd:alternateTitle>
</gmd:CI_Citation>
</gmd:thesaurusName>
</gmd:MD_Keywords>
</gmd:descriptiveKeywords>
</xsl:template>
<!-- ============================================================================= -->
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<!-- Mapping between netcdfDatasetInfo and MCP dataParameters -->
<xsl:stylesheet version="2.0"
xmlns:mcp="http://bluenet3.antcrc.utas.edu.au/mcp"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gts="http://www.isotc211.org/2005/gts"
xmlns:gml="http://www.opengis.net/gml"
xmlns:srv="http://www.isotc211.org/2005/srv"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="java:java.util.UUID"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink"
exclude-result-prefixes="util">
<!-- ==================================================================== -->
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<!-- ==================================================================== -->
<xsl:template match="*">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<mcp:dataParameters>
<mcp:DP_DataParameters>
<xsl:for-each select="variable">
<mcp:dataParameter>
<mcp:DP_DataParameter>
<!-- short name -->
<mcp:parameterName>
<mcp:DP_ParameterName>
<mcp:name>
<gco:CharacterString><xsl:value-of select="@name"/></gco:CharacterString>
</mcp:name>
<mcp:type>
<mcp:DP_TypeCode codeList="http://bluenet3.antcrc.utas.edu.au/mcp/resources/Codelist/gmxCodelists.xml#DP_TypeCode" codeListValue="shortName"/>
</mcp:type>
<mcp:usedInDataset>
<gco:Boolean>true</gco:Boolean>
</mcp:usedInDataset>
<mcp:localDefinition>
<gco:CharacterString><xsl:value-of select="@decl"/></gco:CharacterString>
</mcp:localDefinition>
</mcp:DP_ParameterName>
</mcp:parameterName>
<!-- long name -->
<xsl:if test="@long_name">
<mcp:parameterName>
<mcp:DP_ParameterName>
<mcp:name>
<gco:CharacterString><xsl:value-of select="@long_name"/></gco:CharacterString>
</mcp:name>
<mcp:type>
<mcp:DP_TypeCode codeList="http://bluenet3.antcrc.utas.edu.au/mcp/resources/Codelist/gmxCodelists.xml#DP_TypeCode" codeListValue="longName"/>
</mcp:type>
<mcp:usedInDataset>
<gco:Boolean>false</gco:Boolean>
</mcp:usedInDataset>
<mcp:localDefinition>
<gco:CharacterString><xsl:value-of select="@decl"/></gco:CharacterString>
</mcp:localDefinition>
</mcp:DP_ParameterName>
</mcp:parameterName>
</xsl:if>
<!-- units -->
<xsl:if test="@units">
<mcp:parameterUnits>
<mcp:DP_UnitsName>
<mcp:name>
<gco:CharacterString><xsl:value-of select="@units"/></gco:CharacterString>
</mcp:name>
<mcp:type>
<mcp:DP_TypeCode codeList="http://bluenet3.antcrc.utas.edu.au/mcp/resources/Codelist/gmxCodelists.xml#DP_TypeCode" codeListValue="shortName"/>
</mcp:type>
<mcp:usedInDataset>
<gco:Boolean>true</gco:Boolean>
</mcp:usedInDataset>
<mcp:localDefinition>
<gco:CharacterString>
<xsl:if test="@udunits">
<xsl:value-of select="@udunits"/>
</xsl:if>
<!-- otherwise missing -->
</gco:CharacterString>
</mcp:localDefinition>
</mcp:DP_UnitsName>
</mcp:parameterUnits>
</xsl:if>
<!-- description (we'll use the long name here) -->
<xsl:if test="@long_name">
<mcp:parameterDescription>
<gco:CharacterString><xsl:value-of select="@long_name"/></gco:CharacterString>
</mcp:parameterDescription>
</xsl:if>
</mcp:DP_DataParameter>
</mcp:dataParameter>
</xsl:for-each>
</mcp:DP_DataParameters>
</mcp:dataParameters>
</xsl:template>
<!-- ============================================================================= -->
</xsl:stylesheet>
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tds-range="java:ucar.nc2.units.DateRange"
xmlns:tds-date="java:ucar.nc2.units.DateType"
xmlns:tds-duration="java:ucar.nc2.units.TimeDuration"
xmlns:tds-dateunit="java:ucar.nc2.units.DateUnit"
xmlns:tds-dateformatter="java:ucar.nc2.units.DateFormatter"
xmlns:sdf="java:java.text.SimpleDateFormat"
exclude-result-prefixes="xs tds-range tds-date tds-duration tds-dateunit tds-dateformatter sdf">
<!-- === Convert NetCDF date to ISO Date - refer ucar.nc2.units.DateType constructor === -->
<!-- === can't use here due to issues passing nulls to extension functions === -->
<xsl:template name="getThreddsDateAsUTC">
<xsl:param name="sourceDate"/>
<xsl:choose>
<xsl:when test="normalize-space($sourceDate)=''"/>
<xsl:when test="lower-case($sourceDate) = 'present'">
<xsl:call-template name="getUtcDateTime"><xsl:with-param name="dateTime" select="current-dateTime()"/></xsl:call-template>
</xsl:when>
<xsl:when test="$sourceDate/@format">
<xsl:call-template name="getUtcDateTime"><xsl:with-param name="dateTime" select="sdf:parse(sdf:new($sourceDate/@format),$sourceDate)"/></xsl:call-template>
</xsl:when>
<xsl:when test="contains(lower-case($sourceDate),'since')">
<xsl:call-template name="getUtcDateTime"><xsl:with-param name="dateTime" select="tds-dateunit:getStandardDate($sourceDate)"/></xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="getUtcDateTime"><xsl:with-param name="dateTime" select="tds-dateformatter:getISODate(tds-dateformatter:new(),$sourceDate)"/></xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Convert NetCDF date range into a simple start/end date range -->
<xsl:template name="resolveThreddsDateRange">
<xsl:param name="start"/>
<xsl:param name="end"/>
<xsl:param name="duration"/>
<!-- get start date as DateType -->
<xsl:variable name="startDate">
<xsl:call-template name="getThreddsDateAsUTC">
<xsl:with-param name="sourceDate" select="$start"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="sdfStartDate">
<xsl:if test="normalize-space($startDate)!=''"><xsl:value-of select="format-dateTime($startDate,'[Y0001]-[M01]-[D01] [H01]:[m01]:[s01] [z]')"/></xsl:if>
</xsl:variable>
<xsl:variable name="tdsStartDate" select="tds-date:new($sdfStartDate, 'yyyy-MM-dd HH:mm:ss z', '')"/>
<!-- get end date as DateType -->
<xsl:variable name="endDate">
<xsl:call-template name="getThreddsDateAsUTC">
<xsl:with-param name="sourceDate" select="$end"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="sdfEndDate">
<xsl:if test="normalize-space($endDate)!=''"><xsl:value-of select="format-dateTime($endDate,'[Y0001]-[M01]-[D01] [H01]:[m01]:[s01] [z]')"/></xsl:if>
</xsl:variable>
<xsl:variable name="tdsEndDate" select="tds-date:new($sdfEndDate, 'yyyy-MM-dd HH:mm:ss z', '')"/>
<!-- get DateRange -->
<xsl:variable name="tdsDuration" select="tds-duration:new(string($duration))"/>
<xsl:variable name="tdsResolution" select="tds-duration:new('')"/>
<xsl:variable name="dateRange" select="tds-range:new($tdsStartDate,$tdsEndDate,$tdsDuration,$tdsResolution)"/>
<!-- return as fragment -->
<startDate><xsl:value-of select="tds-date:toDateTimeStringISO(tds-range:getStart($dateRange))"/></startDate>
<endDate><xsl:value-of select="tds-date:toDateTimeStringISO(tds-range:getEnd($dateRange))" /></endDate>
</xsl:template>
<!-- === Function to return dateTime in UTC time zone === -->
<xsl:template name="getUtcDateTime">
<xsl:param name="dateTime"/>
<xsl:value-of select="adjust-dateTime-to-timezone($dateTime,xs:dayTimeDuration('-PT0H'))"/>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:app="http://www.deegree.org/app"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gml="http://www.opengis.net/gml"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<!--
This xslt should transform output from the WFS philosophers database
that you should install with deegree into fragments that can be linked
into the template 'deegree fragments test template' by the WFS fragment
harvester in GeoNetwork.
-->
<xsl:template match="wfs:FeatureCollection">
<records>
<xsl:if test="boolean( ./@timeStamp )">
<xsl:attribute name="timeStamp">
<xsl:value-of select="./@timeStamp"></xsl:value-of>
</xsl:attribute>
</xsl:if>
<xsl:if test="boolean( ./@lockId )">
<xsl:attribute name="lockId">
<xsl:value-of select="./@lockId"></xsl:value-of>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="gml:featureMember"/>
</records>
</xsl:template>
<xsl:template match="*[@xlink:href]" priority="20">
<xsl:variable name="linkid" select="substring-after(@xlink:href,'#')"/>
<xsl:apply-templates select="//*[@gml:id=$linkid]"/>
</xsl:template>
<xsl:template match="gml:featureMember">
<xsl:apply-templates select="app:Philosopher"/>
</xsl:template>
<xsl:template match="app:Philosopher">
<record>
<!-- boundingBox -->
<fragment id="boundingbox" uuid="{@gml:id}_boundingbox" title="{concat(app:name,':',app:id)}">
<gmd:EX_Extent>
<gmd:geographicElement>
<gmd:EX_GeographicBoundingBox>
<gmd:westBoundLongitude>
<gco:Decimal><xsl:value-of select="substring-before(gml:boundedBy/gml:Envelope/gml:pos[1],' ')"/></gco:Decimal>
</gmd:westBoundLongitude>
<gmd:eastBoundLongitude>
<gco:Decimal><xsl:value-of select="substring-after(gml:boundedBy/gml:Envelope/gml:pos[1],' ')"/></gco:Decimal>
</gmd:eastBoundLongitude>
<gmd:southBoundLatitude>
<gco:Decimal><xsl:value-of select="substring-before(gml:boundedBy/gml:Envelope/gml:pos[2],' ')"/></gco:Decimal>
</gmd:southBoundLatitude>
<gmd:northBoundLatitude>
<gco:Decimal><xsl:value-of select="substring-after(gml:boundedBy/gml:Envelope/gml:pos[2],' ')"/></gco:Decimal>
</gmd:northBoundLatitude>
</gmd:EX_GeographicBoundingBox>
</gmd:geographicElement>
</gmd:EX_Extent>
</fragment>
<!-- pointOfContact -->
<fragment id="contactinfo" uuid="{@gml:id}_contactinfo" title="{concat(app:name,':',app:id,':contactinfo')}">
<gmd:CI_ResponsibleParty>
<gmd:individualName>
<gco:CharacterString>Dr Charlie Brown</gco:CharacterString>
</gmd:individualName>
<gmd:organisationName>
<gco:CharacterString>Silicon Graphics R4400 64bit Systems and Philosophy Management Section</gco:CharacterString>
</gmd:organisationName>
<gmd:positionName>
<gco:CharacterString>Part-time Chief Philosopher</gco:CharacterString>
</gmd:positionName>
<gmd:role>
<gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact"/>
</gmd:role>
</gmd:CI_ResponsibleParty>
</fragment>
<!-- keywords -->
<fragment id="keywords" uuid="{@gml:id}_keywords" title="{concat(app:name,':',app:id,':keywords')}">
<gmd:descriptiveKeywords>
<gmd:MD_Keywords>
<xsl:for-each select="app:subject">
<gmd:keyword>
<gco:CharacterString><xsl:value-of select="."/></gco:CharacterString>
</gmd:keyword>
</xsl:for-each>
<gmd:keyword>
<gco:CharacterString>Philosophy</gco:CharacterString>
</gmd:keyword>
<gmd:type>
<gmd:MD_KeywordTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode" codeListValue="theme"/>
</gmd:type>
</gmd:MD_Keywords>
</gmd:descriptiveKeywords>
</fragment>
<!-- citation -->
<fragment id="citation" uuid="{@gml:id}_citation" title="{concat(app:name,':',app:id,':citation')}">
<gmd:CI_Citation>
<gmd:title>
<gco:CharacterString>Information about the Philosopher <xsl:value-of select="app:name"/></gco:CharacterString>
</gmd:title>
<gmd:date>
<gmd:CI_Date>
<gmd:date>
<gco:Date>
<xsl:choose>
<xsl:when test="boolean(//wfs:FeatureCollection/@timeStamp)">
<xsl:value-of select="//wfs:FeatureCollection/@timeStamp"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>2009-05-24</xsl:text>
</xsl:otherwise>
</xsl:choose>
</gco:Date>
</gmd:date>
<gmd:dateType>
<gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" codeListValue="publication"/>
</gmd:dateType>
</gmd:CI_Date>
</gmd:date>
<!-- xlink to contactinfo fragment defined above -->
<gmd:citedResponsibleParty xlink:href="#{@gml:id}_contactinfo"/>
</gmd:CI_Citation>
</fragment>
<!-- abstract -->
<fragment id="abstract" uuid="{@gml:id}_abstract" title="{concat(app:name,':',app:id,':abstract')}">
<gmd:abstract>
<gco:CharacterString>
Metadata about the Philosopher <xsl:value-of select="app:name"/>
&#160;
Sex: <xsl:value-of select="app:sex"/>
&#160;
<xsl:for-each select="app:isAuthorOf">
Is the author of: <xsl:value-of select="app:Book/app:title"/>
&#160;
</xsl:for-each>
</gco:CharacterString>
</gmd:abstract>
</fragment>
<!-- temporal extent = lifespan -->
<fragment id="tempextent" uuid="{@gml:id}_tempextent" title="{concat(app:name,':',app:id,':tempextent')}">
<gmd:temporalElement>
<gmd:EX_TemporalExtent>
<gmd:extent>
<gml:TimePeriod gml:id="">
<gml:beginPosition><xsl:value-of select="app:dateOfBirth"/></gml:beginPosition>
<gml:endPosition><xsl:value-of select="app:dateOfDeath"/></gml:endPosition>
</gml:TimePeriod>
</gmd:extent>
</gmd:EX_TemporalExtent>
</gmd:temporalElement>
</fragment>
</record>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:gn="http://geonetwork-opensource.org"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:gml="http://www.opengis.net/gml"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<!--
This xslt should transform output from the gboundaries WFS service
available in the geoserver instance installed with geonetwork into fragments
that can be inserted into the template 'gboundaries fragments test template'
by the WFS fragment harvester in GeoNetwork to create metadata records
for each country.
Note: The WFS server in geoserver must be enabled before this service can be
accessed.
-->
<xsl:template match="/">
<records>
<xsl:if test="boolean( ./@timeStamp )">
<xsl:attribute name="timeStamp">
<xsl:value-of select="./@timeStamp"></xsl:value-of>
</xsl:attribute>
</xsl:if>
<xsl:if test="boolean( ./@lockId )">
<xsl:attribute name="lockId">
<xsl:value-of select="./@lockId"></xsl:value-of>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="*"/>
</records>
</xsl:template>
<xsl:template match="gml:featureMembers">
<xsl:apply-templates select="gn:gboundaries"/>
</xsl:template>
<xsl:template match="gn:gboundaries">
<record>
<!-- boundingPolygon -->
<fragment id="geoservertest.boundingpolygon" uuid="{@gml:id}_boundingpolygon" title="{concat(gn:ADM0NAME,':',gn:ADM0_CODE,':boundingpoly')}">
<gmd:geographicElement>
<gmd:EX_BoundingPolygon>
<gmd:polygon>
<xsl:copy-of select="gn:the_geom/*"/>
</gmd:polygon>
</gmd:EX_BoundingPolygon>
</gmd:geographicElement>
</fragment>
<!-- pointOfContact -->
<fragment id="geoservertest.contactinfo" uuid="{@gml:id}_contactinfo" title="{concat(gn:ADM0NAME,':',gn:ADM0_CODE,':contactinfo')}">
<gmd:CI_ResponsibleParty>
<gmd:individualName>
<gco:CharacterString>Dr Charlie Brown</gco:CharacterString>
</gmd:individualName>
<gmd:organisationName>
<gco:CharacterString>Silicon Graphics R4400 64bit Systems and Mapping Section</gco:CharacterString>
</gmd:organisationName>
<gmd:positionName>
<gco:CharacterString>Part-time Chief Cartographer</gco:CharacterString>
</gmd:positionName>
<gmd:role>
<gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" codeListValue="pointOfContact"/>
</gmd:role>
</gmd:CI_ResponsibleParty>
</fragment>
<!-- keywords -->
<fragment id="geoservertest.keywords" uuid="{@gml:id}_keywords" title="{concat(gn:ADM0NAME,':',gn:ADM0_CODE,':keywords')}">
<gmd:descriptiveKeywords>
<gmd:MD_Keywords>
<gmd:keyword>
<gco:CharacterString><xsl:value-of select="gn:CONTINENT_"/></gco:CharacterString>
</gmd:keyword>
<gmd:keyword>
<gco:CharacterString><xsl:value-of select="gn:REGION_"/></gco:CharacterString>
</gmd:keyword>
<gmd:keyword>
<gco:CharacterString>Country</gco:CharacterString>
</gmd:keyword>
<gmd:type>
<gmd:MD_KeywordTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode" codeListValue="theme"/>
</gmd:type>
</gmd:MD_Keywords>
</gmd:descriptiveKeywords>
</fragment>
<!-- citation -->