From: <sp...@us...> - 2011-07-18 10:49:05
|
Revision: 8021 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=8021&view=rev Author: sppigot Date: 2011-07-18 10:48:54 +0000 (Mon, 18 Jul 2011) Log Message: ----------- Placeholders for schemaPlugin view/edit interfaces in experimental widgets interface (more to come) Added Paths: ----------- schemaPlugins/trunk/anzmeta/present/metadata-anzmeta-edit.xsl schemaPlugins/trunk/eml-gbif/present/metadata-eml-gbif-edit.xsl schemaPlugins/trunk/iso19139.anzlic/present/metadata-iso19139.anzlic-edit.xsl schemaPlugins/trunk/iso19139.mcp/present/metadata-iso19139.mcp-edit.xsl schemaPlugins/trunk/iso19139.mcp-1.4/present/metadata-iso19139.mcp-1.4-edit.xsl Added: schemaPlugins/trunk/anzmeta/present/metadata-anzmeta-edit.xsl =================================================================== --- schemaPlugins/trunk/anzmeta/present/metadata-anzmeta-edit.xsl (rev 0) +++ schemaPlugins/trunk/anzmeta/present/metadata-anzmeta-edit.xsl 2011-07-18 10:48:54 UTC (rev 8021) @@ -0,0 +1,478 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:geonet="http://www.fao.org/geonetwork" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:exslt= "http://exslt.org/common"> + +<!-- Good old ANZLIC Metadata Format Version 1.3/2.0 as delivered from Z39.50 + servers in the ASDD + + Simon Pigot, September-January 2006 --> + + <!-- main template - the way into processing anzmeta --> + <xsl:template name="metadata-anzmetaview-simple"> + <xsl:message>ANZMETA SIMPLE VIEW</xsl:message> + </xsl:template> + + <xsl:template name="metadata-anzmeta"> + <xsl:param name="schema"/> + <xsl:param name="edit" select="false()"/> + <xsl:param name="embedded"/> + + <xsl:apply-templates mode="anzmeta" select="." > + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="embedded" select="$embedded" /> + </xsl:apply-templates> + </xsl:template> + + <!-- CompleteTab template - anzmeta just calls completeTab from + metadata-utils.xsl --> + <xsl:template name="anzmetaCompleteTab"> + <xsl:param name="tabLink"/> + + <xsl:call-template name="completeTab"> + <xsl:with-param name="tabLink" select="$tabLink"/> + </xsl:call-template> + </xsl:template> + +<!-- default: in simple mode just a flat list --> + + <xsl:template mode="anzmeta" match="*|@*"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="element" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="flat" select="$currTab='simple'"/> + </xsl:apply-templates> + </xsl:template> + +<!-- these elements should be boxed + citeinfo and spdom below --> + + <xsl:template mode="anzmeta" match="timeperd|status|distinfo|dataqual|cntinfo|metainfo|attrinf|qsiispage1"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="complexElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:template> + +<!-- these elements are ignored because their contents are processed +elsewhere --> + + <xsl:template mode="anzmeta" match="coordref"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + </xsl:template> + +<!-- these elements need internal processing to remove additional xml tags --> + +<!-- jurisdic --> + + <xsl:template mode="anzmeta" match="jurisdic"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text" select="keyword"/> + </xsl:apply-templates> + </xsl:template> + +<!-- abstract,lineage,posacc,logic,complete --> + + <xsl:template mode="anzmeta" match="abstract|lineage|posacc|attracc|logic|complete|accconst"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:variable name="text"> + <!-- <div style="text-align: left;"><xsl:copy-of select="."/></div> --> + <xsl:copy-of select="."/> + </xsl:variable> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text" select="$text"/> + </xsl:apply-templates> + </xsl:template> + +<!-- native, avlform --> + + <xsl:template mode="anzmeta" match="native|avlform"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:variable name="digform"> + <xsl:for-each select="digform|nondig"> + <xsl:if test="name(.)='digform'"> + <xsl:text>Digital: </xsl:text> + </xsl:if> + <xsl:value-of select="formname"/><br/> + </xsl:for-each> + </xsl:variable> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text" select="$digform"/> + </xsl:apply-templates> + </xsl:template> + +<!-- theme, progress, update, place, sprep-vector, sprep-raster --> + + <xsl:template mode="anzmeta" match="theme|progress|update|place|sprep-vector|sprep-raster"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:variable name="keyword"> + <xsl:for-each select="keyword"> + <xsl:choose> + <xsl:when test="contains(.,'()')"> + <xsl:value-of select="normalize-space(substring-before(.,'()'))"/><br/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="."/><br/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:variable> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text" select="$keyword"/> + </xsl:apply-templates> + </xsl:template> + +<!-- begdate, enddate --> + + <xsl:template mode="anzmeta" match="begdate|enddate"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text" select="date|keyword"/> + </xsl:apply-templates> + </xsl:template> + +<!-- metd --> + + <xsl:template mode="anzmeta" match="metd"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text" select="date"/> + </xsl:apply-templates> + </xsl:template> + +<!-- supplinf --> + + <xsl:template mode="anzmeta" match="supplinf"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:variable name="content"> + <div style="text-align: left;"><xsl:copy-of select="."/></div> + </xsl:variable> + <xsl:apply-templates mode="complexElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="content" select="$content"/> + </xsl:apply-templates> + </xsl:template> + +<!-- spdom - add preview image and rest of the geobox elements --> + + <xsl:template mode="anzmeta" match="spdom"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:variable name="content"> + <xsl:apply-templates mode="elementEP" select="place"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + + <xsl:call-template name="geoBox"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:call-template> + + </xsl:variable> + + <xsl:variable name="title"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="'spdom'"/> + <xsl:with-param name="schema" select="$schema"/> + </xsl:call-template> + </xsl:variable> + + <xsl:call-template name="complexElementGui"> + <xsl:with-param name="title" select="$title"/> + <xsl:with-param name="content" select="$content"/> + <xsl:with-param name="schema" select="$schema"/> + </xsl:call-template> + </xsl:template> + + <!-- geoBox --> + + <xsl:template name="geoBox"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:variable name="eltRef" select="generate-id(.)"/> + + <!-- Loop on all projections defined in config-gui.xml --> + <xsl:for-each select="/root/gui/config/map/proj/crs"> + <input id="{@code}_{$eltRef}" type="radio" class="proj" name="proj_{$eltRef}" value="{@code}"> + <xsl:if test="@default='1'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> + </input> + <!-- Set label from loc file --> + <label for="{@code}_{$eltRef}"> + <xsl:variable name="code" select="@code"/> + <xsl:choose> + <xsl:when test="/root/gui/strings/*[@code=$code]"><xsl:value-of select="/root/gui/strings/*[@code=$code]"/></xsl:when> + <xsl:otherwise><xsl:value-of select="@code"/></xsl:otherwise> + </xsl:choose> + </label> + <xsl:text> </xsl:text> + </xsl:for-each> + + <xsl:variable name="w" select="bounding/westbc"/> + <xsl:variable name="e" select="bounding/eastbc"/> + <xsl:variable name="n" select="bounding/northbc"/> + <xsl:variable name="s" select="bounding/southbc"/> + + <table> + <tr> + <td/> + <td class="padded" align="center"> + <xsl:apply-templates mode="coordinateElementGUI" select="$n"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="name" select="'northbc'" /> + <xsl:with-param name="eltRef" select="concat('n', $eltRef)"/> + </xsl:apply-templates> + </td> + <td/> + </tr> + <tr> + <td class="padded" align="center"> + <xsl:apply-templates mode="coordinateElementGUI" select="$w"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="name" select="'westbc'" /> + <xsl:with-param name="eltRef" select="concat('w', $eltRef)"/> + </xsl:apply-templates> + </td> + + <td width="100" height="100" align="center"> + <xsl:variable name="wID" select="concat('w',$eltRef)"/> + <xsl:variable name="eID" select="concat('e',$eltRef)"/> + <xsl:variable name="sID" select="concat('s',$eltRef)"/> + <xsl:variable name="nID" select="concat('n',$eltRef)"/> + <xsl:variable name="geom" > + <xsl:value-of select="concat('Polygon((', $w, ' ', $s,',',$e,' ',$s,',',$e,' ',$n,',',$w,' ',$n,',',$w,' ',$s, '))')"/> + </xsl:variable> + <xsl:call-template name="showMap"> + <xsl:with-param name="edit" select="$edit" /> + <xsl:with-param name="mode" select="'bbox'" /> + <xsl:with-param name="coords" select="$geom"/> + <xsl:with-param name="watchedBbox" select="concat($wID, ',', $sID, ',', $eID, ',', $nID)"/> + <xsl:with-param name="eltRef" select="$eltRef"/> + </xsl:call-template> + </td> + + <td class="padded" align="center"> + <xsl:apply-templates mode="coordinateElementGUI" select="$e"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="name" select="'eastbc'" /> + <xsl:with-param name="eltRef" select="concat('e', $eltRef)"/> + </xsl:apply-templates> + </td> + </tr> + <tr> + <td/> + <td class="padded" align="center"> + <xsl:apply-templates mode="coordinateElementGUI" select="$s"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="name" select="'southbc'" /> + <xsl:with-param name="eltRef" select="concat('s', $eltRef)"/> + </xsl:apply-templates> + </td> + <td/> + </tr> + </table> + </xsl:template> + + <xsl:template mode="anzmeta" match="descript"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:variable name="content"> + + <xsl:apply-templates mode="elementEP" select="abstract"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + + <xsl:apply-templates mode="elementEP" select="theme"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + + <xsl:apply-templates mode="elementEP" select="spatial-representation"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + + <xsl:apply-templates mode="elementEP" select="scale-tip"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + + <xsl:apply-templates mode="elementEP" select="../content/coordref/hdatum"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + + <xsl:apply-templates mode="elementEP" select="../content/coordref/proj"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + + <xsl:apply-templates mode="elementEP" select="../content/coordref/prjparam"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + + <xsl:apply-templates mode="elementEP" select="spdom"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:variable> + + <xsl:apply-templates mode="complexElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="content" select="$content"/> + </xsl:apply-templates> + </xsl:template> + + +<!-- citeinfo - add preview image and rest of the box elements --> + + <xsl:template mode="anzmeta" match="citeinfo"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:variable name="content"> + <xsl:apply-templates mode="elementEP" select="uniqueid|title|origin"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:variable> + + <xsl:apply-templates mode="complexElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="content" select="$content"/> + </xsl:apply-templates> + </xsl:template> + +<!-- mailto link --> + + <xsl:template mode="anzmeta" match="cntemail"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text"> + <a href="mailto:{.}"><xsl:value-of select="."/></a> + </xsl:with-param> + </xsl:apply-templates> + </xsl:template> + +<!-- download and preview links using the anzmeta tag under <uniqueid> --> + + <xsl:template mode="anzmeta" match="uniqueid"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:apply-templates> + </xsl:template> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + <!-- anzmeta brief formatting --> + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:template match="anzmetaBrief"> + <xsl:for-each select="/metadata/*[1]"> + <metadata> + <title><xsl:value-of select="normalize-space(citeinfo/title)"/></title> + <abstract><xsl:value-of select="descript/abstract"/></abstract> + +<!-- now process each of the keywords removing the () stuff if present --> + + <xsl:for-each select="descript/theme/keyword"> + <xsl:element name="keyword"> + <xsl:choose> + <xsl:when test="contains(.,'()')"> + <xsl:value-of select="normalize-space(substring-before(.,'()'))"/><br/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="."/><br/> + </xsl:otherwise> + </xsl:choose> + </xsl:element> + </xsl:for-each> + + <xsl:variable name="anzmetatag" select="citeinfo/uniqueid"/> + <convert>anzmeta</convert> + +<!-- now the thumbnail from the appropriate site --> + + <xsl:choose> + <!-- don't abuse this - we use CSIRO for the generator only for + CSIRO records --> + <xsl:when test="starts-with($anzmetatag,'ANZCW0306')"> + <image type="thumbnail"><xsl:value-of select="concat('http://www.marine.csiro.au/cgi-bin/marlin/thumb.pl?','&E=',descript/spdom/bounding/eastbc,'&W=',descript/spdom/bounding/westbc,'&N=',descript/spdom/bounding/northbc,'&S=',descript/spdom/bounding/southbc)"/></image> + </xsl:when> + <!-- you could also use a known path to thumbnails based on the ANZ tag + like this --> + <xsl:when test="starts-with($anzmetatag,'ANZTA')"> + <image type="thumbnail"><xsl:value-of select="concat('http://www.thelist.tas.gov.au/asdd/',$anzmetatag,'.gif')"/></image> + </xsl:when> + <xsl:otherwise> + <!-- no image --> + </xsl:otherwise> + </xsl:choose> + +<!-- and the geoBox --> + + <geoBox> + <westBL><xsl:value-of select="descript/spdom/bounding/westbc"/></westBL> + <eastBL><xsl:value-of select="descript/spdom/bounding/eastbc"/></eastBL> + <southBL><xsl:value-of select="descript/spdom/bounding/southbc"/></southBL> + <northBL><xsl:value-of select="descript/spdom/bounding/northbc"/></northBL> + </geoBox> + <xsl:copy-of select="geonet:info"/> + </metadata> + </xsl:for-each> + </xsl:template> + +</xsl:stylesheet> Added: schemaPlugins/trunk/eml-gbif/present/metadata-eml-gbif-edit.xsl =================================================================== --- schemaPlugins/trunk/eml-gbif/present/metadata-eml-gbif-edit.xsl (rev 0) +++ schemaPlugins/trunk/eml-gbif/present/metadata-eml-gbif-edit.xsl 2011-07-18 10:48:54 UTC (rev 8021) @@ -0,0 +1,428 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:geonet="http://www.fao.org/geonetwork" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:dc="http://purl.org/dc/terms/" + xmlns:eml="eml://ecoinformatics.org/eml-2.1.1" + xmlns:exslt= "http://exslt.org/common"> + +<!-- EML-GBIF Presentation xslt --> + + <!-- main template - the way into processing eml-gbif --> + <xsl:template name="metadata-eml-gbif-view-simple"> + <xsl:message>VIEW SIMPLE EML-GBIF</xsl:message> + </xsl:template> + + <xsl:template name="metadata-eml-gbif"> + <xsl:param name="schema"/> + <xsl:param name="edit" select="false()"/> + <xsl:param name="embedded"/> + + <xsl:apply-templates mode="eml-gbif" select="." > + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="embedded" select="$embedded" /> + </xsl:apply-templates> + </xsl:template> + + <!-- CompleteTab template - eml-gbif just calls completeTab from + metadata-utils.xsl --> + <xsl:template name="eml-gbifCompleteTab"> + <xsl:param name="tabLink"/> + + <xsl:call-template name="displayTab"> + <xsl:with-param name="tab" select="'dataset'"/> + <xsl:with-param name="text" select="'Dataset'"/> + <xsl:with-param name="indent" select="'   '"/> + <xsl:with-param name="tabLink" select="$tabLink"/> + </xsl:call-template> + + <xsl:call-template name="displayTab"> + <xsl:with-param name="tab" select="'additional'"/> + <xsl:with-param name="text" select="'Additional'"/> + <xsl:with-param name="indent" select="'   '"/> + <xsl:with-param name="tabLink" select="$tabLink"/> + </xsl:call-template> + </xsl:template> + + <!-- default template --> + + <xsl:template mode="eml-gbif" match="*"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:choose> + <xsl:when test="$edit=true()"> + <xsl:apply-templates mode="element" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="true()"/> + <xsl:with-param name="flat" select="/root/gui/config/metadata-tab/*[name(.)=$currTab]/@flat"/> + </xsl:apply-templates> + </xsl:when> + + <xsl:otherwise> + <xsl:apply-templates mode="element" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="false()"/> + <xsl:with-param name="flat" select="/root/gui/config/metadata-tab/*[name(.)=$currTab]/@flat"/> + </xsl:apply-templates> + + </xsl:otherwise> + </xsl:choose> + + </xsl:template> + + <!-- The main template that gets called on the root element eml:eml --> + + <xsl:template mode="eml-gbif" match="eml:eml"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:choose> + + <!-- dataset tab --> + <xsl:when test="$currTab='dataset'"> + <xsl:apply-templates mode="elementEP" select="dataset"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- additional tab --> + <xsl:when test="$currTab='additional'"> + <xsl:apply-templates mode="elementEP" select="additionalMetadata"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <xsl:otherwise> + <xsl:apply-templates mode="elementEP" select="dataset"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + + <xsl:apply-templates mode="elementEP" select="additionalMetadata"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:otherwise> + + </xsl:choose> + </xsl:template> + + <!-- these elements should be boxed --> + + <xsl:template mode="eml-gbif" match="dataset|additionalMetadata|creator|metadataProvider|associatedParty|keywordSet|contact|methods|project|physical|collection|coverage|geographicCoverage|temporalCoverage|taxonomicCoverage"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="complexElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:template> + + <!-- handle the url element - sometimes has an attribute 'function' --> + + <xsl:template mode="eml-gbif" match="url"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <!-- FIXME: decide what to do based on attribute function --> + <xsl:if test="@function='download'"> + </xsl:if> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:template> + + <!-- handle the title element - sometimes has an attribute xml:lang --> + + <xsl:template mode="eml-gbif" match="title"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:template> + + <!-- keywords are processed to add thesaurus name in brackets afterwards --> + + <xsl:template mode="eml-gbif" match="keywordSet"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:choose> + <xsl:when test="$edit=false()"> + <xsl:variable name="keyword"> + <xsl:for-each select="keyword"> + <xsl:if test="position() > 1">, </xsl:if> + <xsl:value-of select="."/> + </xsl:for-each> + <xsl:if test="keywordThesaurus"> + <xsl:text> (</xsl:text> + <xsl:value-of select="keywordThesaurus"/> + <xsl:text>)</xsl:text> + </xsl:if> + </xsl:variable> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text" select="$keyword"/> + </xsl:apply-templates> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="complexElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- beginDate, endDate --> + + <xsl:template mode="eml-gbif" match="beginDate|endDate"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text" select="calendarDate"/> + </xsl:apply-templates> + </xsl:template> + + <!-- All the fields selected by this template can have embedded <para> tags + that need to be changed to HTML <p> tags --> + + <xsl:template mode="eml-gbif" match="abstract|additionalInfo|intellectualRights|purpose|description|samplingDescription|funding"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:variable name="rows"> + <xsl:choose> + <xsl:when test="name(.)='abstract'">10</xsl:when> + <xsl:otherwise>3</xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text"> + <xsl:choose> + <xsl:when test="para"> + <xsl:for-each select="para"> + <p><xsl:value-of select="."/></p> + </xsl:for-each> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="."/> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + <xsl:with-param name="rows" select="$rows" /> + </xsl:apply-templates> + </xsl:template> + + <!-- boundingCoordinates --> + + <xsl:template mode="eml-gbif" match="boundingCoordinates"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:variable name="eltRef" select="generate-id(.)"/> + + <tr> + <td colspan="2"> + + <table> + <tr> + <td colspan="3"> + <!-- Loop on all projections defined in config-gui.xml --> + <xsl:for-each select="/root/gui/config/map/proj/crs"> + <input id="{@code}_{$eltRef}" type="radio" class="proj" name="proj_{$eltRef}" value="{@code}"> + <xsl:if test="@default='1'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> + </input> + <!-- Set label from loc file --> + <label for="{@code}_{$eltRef}"> + <xsl:variable name="code" select="@code"/> + <xsl:choose> + <xsl:when test="/root/gui/strings/*[@code=$code]"><xsl:value-of select="/root/gui/strings/*[@code=$code]"/></xsl:when> + <xsl:otherwise><xsl:value-of select="@code"/></xsl:otherwise> + </xsl:choose> + </label> + <xsl:text> </xsl:text> + </xsl:for-each> + </td> + </tr> + + <xsl:variable name="w" select="westBoundingCoordinate"/> + <xsl:variable name="e" select="eastBoundingCoordinate"/> + <xsl:variable name="n" select="northBoundingCoordinate"/> + <xsl:variable name="s" select="southBoundingCoordinate"/> + + <tr> + <td/> + <td class="padded" align="center"> + <xsl:apply-templates mode="eml-gbifVertElement" select="$n"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="eltRef" select="concat('n', $eltRef)"/> + </xsl:apply-templates> + </td> + <td/> + </tr> + <tr> + <td class="padded" align="center"> + <xsl:apply-templates mode="eml-gbifVertElement" select="$w"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="eltRef" select="concat('w', $eltRef)"/> + </xsl:apply-templates> + </td> + + <td width="100" height="100" align="center"> + <xsl:variable name="wID" select="concat('w',$eltRef)"/> + <xsl:variable name="eID" select="concat('e',$eltRef)"/> + <xsl:variable name="sID" select="concat('s',$eltRef)"/> + <xsl:variable name="nID" select="concat('n',$eltRef)"/> + <xsl:variable name="geom" > + <xsl:value-of select="concat('Polygon((', $w, ' ', $s,',',$e,' ',$s,',',$e,' ',$n,',',$w,' ',$n,',',$w,' ',$s, '))')"/> + </xsl:variable> + <xsl:call-template name="showMap"> + <xsl:with-param name="edit" select="$edit" /> + <xsl:with-param name="mode" select="'bbox'" /> + <xsl:with-param name="coords" select="$geom"/> + <xsl:with-param name="watchedBbox" select="concat($wID, ',', $sID, ',', $eID, ',', $nID)"/> + <xsl:with-param name="eltRef" select="$eltRef"/> + </xsl:call-template> + </td> + + <td class="padded" align="center"> + <xsl:apply-templates mode="eml-gbifVertElement" select="$e"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="eltRef" select="concat('e', $eltRef)"/> + </xsl:apply-templates> + </td> + </tr> + <tr> + <td/> + <td class="padded" align="center"> + <xsl:apply-templates mode="eml-gbifVertElement" select="$s"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="eltRef" select="concat('s', $eltRef)"/> + </xsl:apply-templates> + </td> + <td/> + </tr> + </table> + + </td> + </tr> + </xsl:template> + + <xsl:template mode="eml-gbifVertElement" match="*"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:param name="eltRef" /> + + <xsl:variable name="title"> + <xsl:call-template name="getTitle"> + <xsl:with-param name="name" select="name(.)"/> + <xsl:with-param name="schema" select="$schema"/> + </xsl:call-template> + </xsl:variable> + <xsl:variable name="helpLink"> + <xsl:call-template name="getHelpLink"> + <xsl:with-param name="name" select="name(.)"/> + <xsl:with-param name="schema" select="$schema"/> + </xsl:call-template> + </xsl:variable> + <b> + <xsl:choose> + <xsl:when test="$helpLink!=''"> + <span id="tip.{$helpLink}" style="cursor:help;"> + <xsl:value-of select="$title" /> + </span> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$title"/> + </xsl:otherwise> + </xsl:choose> + </b> + <br/> + <xsl:variable name="size" select="'8'"/> + + <xsl:choose> + <!-- Hidden text field is use to store WGS84 values which are stored in metadata records. --> + <xsl:when test="$edit=true()"> + <xsl:call-template name="getElementText"> + <xsl:with-param name="schema" select="$schema" /> + <xsl:with-param name="edit" select="$edit" /> + <xsl:with-param name="cols" select="$size" /> + <xsl:with-param name="validator" select="'validateNumber(this, false)'" /> + <xsl:with-param name="no_name" select="true()" /> + </xsl:call-template> + <xsl:call-template name="getElementText"> + <xsl:with-param name="schema" select="$schema" /> + <xsl:with-param name="edit" select="true()" /> + <xsl:with-param name="cols" select="$size" /> + <xsl:with-param name="input_type" select="'hidden'" /> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <input class="md" type="text" id="{$eltRef}" value="{text()}" readonly="readonly" size="{$size}"/> + <input class="md" type="hidden" id="_{$eltRef}" name="_{$eltRef}" value="{text()}" readonly="readonly"/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- mailto link --> + + <xsl:template mode="eml-gbif" match="electronicMailAddress"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text"> + <a href="mailto:{.}"><xsl:value-of select="."/></a> + </xsl:with-param> + </xsl:apply-templates> + </xsl:template> + + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + <!-- eml-gbif brief formatting --> + <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> + + <xsl:template match="eml-gbifBrief"> + <xsl:for-each select="/metadata/*[1]"> + <metadata> + <title><xsl:value-of select="normalize-space(dataset/title[1])"/></title> + <abstract><xsl:value-of select="dataset/abstract"/></abstract> + + <xsl:for-each select="dataset/keywordSet/keyword"> + <xsl:copy-of select="."/> + </xsl:for-each> + + <geoBox> + <westBL><xsl:value-of select="dataset/coverage/geographicCoverage/boundingCoordinates/westBoundingCoordinate"/></westBL> + <eastBL><xsl:value-of select="dataset/coverage/geographicCoverage/boundingCoordinates/eastBoundingCoordinate"/></eastBL> + <southBL><xsl:value-of select="dataset/coverage/geographicCoverage/boundingCoordinates/southBoundingCoordinate"/></southBL> + <northBL><xsl:value-of select="dataset/coverage/geographicCoverage/boundingCoordinates/northBoundingCoordinate"/></northBL> + </geoBox> + <xsl:copy-of select="geonet:info"/> + </metadata> + </xsl:for-each> + </xsl:template> + +</xsl:stylesheet> Added: schemaPlugins/trunk/iso19139.anzlic/present/metadata-iso19139.anzlic-edit.xsl =================================================================== --- schemaPlugins/trunk/iso19139.anzlic/present/metadata-iso19139.anzlic-edit.xsl (rev 0) +++ schemaPlugins/trunk/iso19139.anzlic/present/metadata-iso19139.anzlic-edit.xsl 2011-07-18 10:48:54 UTC (rev 8021) @@ -0,0 +1,1043 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" + xmlns:gmd="http://www.isotc211.org/2005/gmd" + xmlns:gts="http://www.isotc211.org/2005/gts" + xmlns:gco="http://www.isotc211.org/2005/gco" + xmlns:gmx="http://www.isotc211.org/2005/gmx" + xmlns:srv="http://www.isotc211.org/2005/srv" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:gml="http://www.opengis.net/gml" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:geonet="http://www.fao.org/geonetwork" + xmlns:exslt="http://exslt.org/common" + exclude-result-prefixes="gmx xsi gmd gco gml gts srv xlink exslt geonet"> + + <xsl:variable name="anzlicallgens" select="document('../schema/resources/Codelist/anzlic-allgens.xml')"/> + <xsl:variable name="anzlicthemes" select="document('../schema/resources/Codelist/anzlic-theme.xml')"/> + + <!-- main template - the way into processing iso19139.anzlic --> + <xsl:template name="metadata-iso19139.anzlicview-simple"> + <xsl:call-template name="metadata-iso19139view-simple"/> + </xsl:template> + + <xsl:template name="metadata-iso19139.anzlic"> + <xsl:param name="schema"/> + <xsl:param name="edit" select="false()"/> + <xsl:param name="embedded"/> + + <!-- process in profile mode first --> + <xsl:variable name="anzlicElements"> + <xsl:apply-templates mode="iso19139.anzlic" select="." > + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="embedded" select="$embedded" /> + </xsl:apply-templates> + </xsl:variable> + + <xsl:choose> + + <!-- if we got a match in profile mode then show it --> + <xsl:when test="count($anzlicElements/*)>0"> + <xsl:copy-of select="$anzlicElements"/> + </xsl:when> + + <!-- otherwise process in base iso19139 mode --> + <xsl:otherwise> + <xsl:apply-templates mode="iso19139" select="." > + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="embedded" select="$embedded" /> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <!-- ================================================================ --> + <!-- keyword; only called in edit mode (see descriptiveKeywords --> + <!-- template) and code keyword in gmd:geographicIdentifier --> + <!-- ================================================================ --> + + <xsl:template mode="iso19139.anzlic" match="gmd:keyword[following-sibling::gmd:type/gmd:MD_KeywordTypeCode/@codeListValue='place']|gmd:code[name(../..)='gmd:geographicIdentifier']"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:choose> + <xsl:when test="$edit=true()"> + + <xsl:variable name="text"> + <xsl:variable name="ref" select="gco:CharacterString/geonet:element/@ref"/> + <xsl:variable name="keyword" select="gco:CharacterString/text()"/> + + <input class="md" type="text" name="_{$ref}" value="{gco:CharacterString/text()}" size="50" /> + + <!-- anzlic-allgens combobox --> + + <select name="place" size="1" onChange="document.mainForm._{$ref}.value=this.options[this.selectedIndex].text"> + <option value=""/> + <xsl:for-each select="$anzlicallgens/gmx:CT_CodelistCatalogue/gmx:codelistItem/gmx:CodeListDictionary"> + <optgroup label="{gml:identifier}"> + <xsl:for-each select="gmx:codeEntry"> + <xsl:variable name="entry" select="substring-before(gmx:CodeDefinition/gml:description,'|')"/> + <option value="{$entry}"> + <xsl:if test="$entry=$keyword"> + <xsl:attribute name="selected"/> + </xsl:if> + <xsl:value-of select="$entry"/> + </option> + </xsl:for-each> + </optgroup> + </xsl:for-each> + </select> + </xsl:variable> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="true()"/> + <xsl:with-param name="text" select="$text"/> + </xsl:apply-templates> + </xsl:when> + + <xsl:otherwise> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text"> + <xsl:value-of select="gco:CharacterString"/> + </xsl:with-param> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- ================================================================ --> + <!-- anzlic theme keyword; only called in edit mode (see --> + <!-- descriptiveKeywords --> + <!-- ================================================================ --> + + <xsl:template mode="iso19139.anzlic" match="gmd:keyword[following-sibling::gmd:type/gmd:MD_KeywordTypeCode/@codeListValue!='place']"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:choose> + <xsl:when test="$edit=true()"> + + <xsl:variable name="text"> + <xsl:variable name="ref" select="gco:CharacterString/geonet:element/@ref"/> + <xsl:variable name="keyword" select="gco:CharacterString/text()"/> + + <input class="md" type="text" name="_{$ref}" value="{gco:CharacterString/text()}" size="50" /> + + <!-- anzlic-allgens combobox --> + + <select name="place" size="1" onChange="document.mainForm._{$ref}.value=this.options[this.selectedIndex].text"> + <option value=""/> + <xsl:for-each select="$anzlicthemes/gmx:CT_CodelistCatalogue/gmx:codelistItem/gmx:CodeListDictionary"> + <optgroup label="{gml:identifier}"> + <xsl:for-each select="gmx:codeEntry"> + <xsl:variable name="entry" select="gmx:CodeDefinition/gml:identifier"/> + <option value="{$entry}"> + <xsl:if test="$entry=$keyword"> + <xsl:attribute name="selected"/> + </xsl:if> + <xsl:value-of select="$entry"/> + </option> + </xsl:for-each> + </optgroup> + </xsl:for-each> + </select> + </xsl:variable> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="true()"/> + <xsl:with-param name="text" select="$text"/> + </xsl:apply-templates> + + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="text"> + <xsl:value-of select="gco:CharacterString"/> + </xsl:with-param> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + + </xsl:template> + + <!-- ================================================================== --> + <!-- EX_GeographicBoundingBox - use for all schemas except iso19139 --> + <!-- ================================================================== --> + + <xsl:template mode="iso19139.anzlic" match="gmd:EX_GeographicBoundingBox"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:variable name="geoBox"> + <xsl:apply-templates mode="iso19139GeoBox" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:variable> + + <xsl:variable name="eltRef"> + <xsl:choose> + <xsl:when test="$edit=true()"> + <xsl:value-of select="geonet:element/@ref"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="generate-id(.)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$edit=true()"> + <xsl:variable name="places"> + <xsl:variable name="ref" select="geonet:element/@ref"/> + <xsl:variable name="keyword" select="string(.)"/> + + <script type="text/javascript"> + + function setAnzlicRegion(westField, eastField, southField, northField, region, eltRef, descriptionRef) + { + var choice = region.value; + var w = ""; + var e = ""; + var s = ""; + var n = ""; + + if (choice != undefined && choice != "") { + coords = choice.split(","); + n = coords[0]; + s = coords[1]; + e = coords[2]; + w = coords[3]; + $("_" + westField).value = w; + $("_" + eastField).value = e; + $("_" + southField).value = s; + $("_" + northField).value = n; + + if ($("_" + descriptionRef) != null) + $("_" + descriptionRef).value = region.text; + } else { + $("_" + westField).value = ""; + $("_" + eastField).value = ""; + $("_" + southField).value = ""; + $("_" + northField).value = ""; + } + + var viewers = Ext.DomQuery.select('.extentViewer'); + for (var idx = 0; idx < viewers.length; ++idx) { + var viewer = viewers[idx]; + if (eltRef == viewer.getAttribute("elt_ref")) { + extentMap.updateBboxForRegion(extentMap.maps[eltRef], westField + "," + southField + "," + eastField + "," + northField, eltRef, true); // Region are in WGS84 + } + } + } + </script> + + <xsl:variable name="selection" select="concat(gmd:northBoundLatitude/gco:Decimal,',',gmd:southBoundLatitude/gco:Decimal,',',gmd:eastBoundLongitude/gco:Decimal,',',gmd:westBoundLongitude/gco:Decimal)"/> + + <!-- anzlic-allgens combobox --> + + <select name="place" size="1" onChange="javascript:setAnzlicRegion('{gmd:westBoundLongitude/gco:Decimal/geonet:element/@ref}', '{gmd:eastBoundLongitude/gco:Decimal/geonet:element/@ref}', '{gmd:southBoundLatitude/gco:Decimal/geonet:element/@ref}', '{gmd:northBoundLatitude/gco:Decimal/geonet:element/@ref}', this.options[this.selectedIndex], {$eltRef}, '{../../gmd:description/gco:CharacterString/geonet:element/@ref}')"> + <option value=""/> + <xsl:for-each select="$anzlicallgens/gmx:CT_CodelistCatalogue/gmx:codelistItem/gmx:CodeListDictionary"> + <optgroup label="{gml:identifier}"> + <xsl:for-each select="gmx:codeEntry"> + <xsl:variable name="value" select="translate(normalize-space(substring-after(gmx:CodeDefinition/gml:description,'|')),'|',',')"/> + <xsl:variable name="entry" select="substring-before(gmx:CodeDefinition/gml:description,'|')"/> + <option value="{$value}"> + <xsl:if test="contains($value,$selection)"> + <xsl:attribute name="selected"/> + </xsl:if> + <xsl:value-of select="$entry"/> + </option> + </xsl:for-each> + </optgroup> + </xsl:for-each> + </select> + </xsl:variable> + <xsl:apply-templates mode="complexElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="content"> + <tr> + <td align="center"> + <xsl:copy-of select="$places"/> + </td> + </tr> + <tr> + <td align="center"> + <xsl:copy-of select="$geoBox"/> + </td> + </tr> + </xsl:with-param> + </xsl:apply-templates> + </xsl:when> + <xsl:otherwise> + <!-- <xsl:if test="normalize-space($geoBox)!=''"> --> + <xsl:apply-templates mode="complexElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="content"> + <tr> + <td align="center"> + <xsl:copy-of select="$geoBox"/> + </td> + </tr> + </xsl:with-param> + </xsl:apply-templates> + <!-- </xsl:if> --> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template mode="iso19139GeoBox" match="*"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + + <xsl:variable name="eltRef"> + <xsl:choose> + <xsl:when test="$edit=true()"> + <xsl:value-of select="geonet:element/@ref"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="generate-id(.)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <!-- Loop on all projections defined in config-gui.xml --> + <xsl:for-each select="/root/gui/config/map/proj/crs"> + <input id="{@code}_{$eltRef}" type="radio" class="proj" name="proj_{$eltRef}" value="{@code}"> + <xsl:if test="@default='1'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> + </input> + <!-- Set label from loc file --> + <label for="{@code}_{$eltRef}"> + <xsl:variable name="code" select="@code"/> + <xsl:choose> + <xsl:when test="/root/gui/strings/*[@code=$code]"><xsl:value-of select="/root/gui/strings/*[@code=$code]"/></xsl:when> + <xsl:otherwise><xsl:value-of select="@code"/></xsl:otherwise> + </xsl:choose> + </label> + <xsl:text> </xsl:text> + </xsl:for-each> + + <table> + <tr> + <td class="padded" align="left" style="min-width:120px;"> + <table> + <tr> + <td> + <xsl:apply-templates mode="coordinateElementGUI" select="gmd:northBoundLatitude/gco:Decimal"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="name" select="'gmd:northBoundLatitude'"/> + <xsl:with-param name="eltRef" select="concat('n', $eltRef)"/> + </xsl:apply-templates> + </td> + </tr> + + <tr> + <td> + <xsl:apply-templates mode="coordinateElementGUI" select="gmd:westBoundLongitude/gco:Decimal"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="name" select="'gmd:westBoundLongitude'"/> + <xsl:with-param name="eltRef" select="concat('w', $eltRef)"/> + </xsl:apply-templates> + </td> + </tr> + + <tr> + <td> + <xsl:apply-templates mode="coordinateElementGUI" select="gmd:eastBoundLongitude/gco:Decimal"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="name" select="'gmd:eastBoundLongitude'"/> + <xsl:with-param name="eltRef" select="concat('e', $eltRef)"/> + </xsl:apply-templates> + </td> + </tr> + + <tr> + <td> + <xsl:apply-templates mode="coordinateElementGUI" select="gmd:southBoundLatitude/gco:Decimal"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="name" select="'gmd:southBoundLatitude'"/> + <xsl:with-param name="eltRef" select="concat('s', $eltRef)"/> + </xsl:apply-templates> + </td> + </tr> + </table> + </td> + <td align="center"> + <xsl:variable name="w" select="./gmd:westBoundLongitude/gco:Decimal"/> + <xsl:variable name="e" select="./gmd:eastBoundLongitude/gco:Decimal"/> + <xsl:variable name="n" select="./gmd:northBoundLatitude/gco:Decimal"/> + <xsl:variable name="s" select="./gmd:southBoundLatitude/gco:Decimal"/> + + <xsl:variable name="wID"> + <xsl:choose> + <xsl:when test="$edit=true()"><xsl:value-of select="./gmd:westBoundLongitude/gco:Decimal/geonet:element/@ref"/></xsl:when> + <xsl:otherwise>w<xsl:value-of select="$eltRef"/></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="eID"> + <xsl:choose> + <xsl:when test="$edit=true()"><xsl:value-of select="./gmd:eastBoundLongitude/gco:Decimal/geonet:element/@ref"/></xsl:when> + <xsl:otherwise>e<xsl:value-of select="$eltRef"/></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="nID"> + <xsl:choose> + <xsl:when test="$edit=true()"><xsl:value-of select="./gmd:northBoundLatitude/gco:Decimal/geonet:element/@ref"/></xsl:when> + <xsl:otherwise>n<xsl:value-of select="$eltRef"/></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:variable name="sID"> + <xsl:choose> + <xsl:when test="$edit=true()"><xsl:value-of select="./gmd:southBoundLatitude/gco:Decimal/geonet:element/@ref"/></xsl:when> + <xsl:otherwise>s<xsl:value-of select="$eltRef"/></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + + <xsl:variable name="geom" > + <xsl:value-of select="concat('Polygon((', $w, ' ', $s,',',$e,' ',$s,',',$e,' ',$n,',',$w,' ',$n,',',$w,' ',$s, '))')"/> + </xsl:variable> + <xsl:call-template name="showMap"> + <xsl:with-param name="edit" select="$edit" /> + <xsl:with-param name="mode" select="'bbox'" /> + <xsl:with-param name="coords" select="$geom"/> + <xsl:with-param name="watchedBbox" select="concat($wID, ',', $sID, ',', $eID, ',', $nID)"/> + <xsl:with-param name="eltRef" select="$eltRef"/> + </xsl:call-template> + </td> + </tr> + </table> + </xsl:template> + + <!-- ============================================================================= --> + <!-- supplementalInformation | purpose --> + <!-- ============================================================================= --> + + <xsl:template mode="iso19139.anzlic" match="gmd:supplementalInformation|gmd:purpose|gmd:statement" priority="2"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:call-template name="iso19139String"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="rows" select="5"/> + </xsl:call-template> + </xsl:template> + + <!-- ==================================================================== --> + <!-- Metadata --> + <!-- ==================================================================== --> + + <xsl:template mode="iso19139.anzlic" match="gmd:MD_Metadata"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:param name="embedded" select="false()"/> + + <xsl:variable name="dataset" select="gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='dataset' or gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue='dataObject' or normalize-space(gmd:hierarchyLevel/gmd:MD_ScopeCode/@codeListValue)=''"/> + + <xsl:choose> + + <!-- metadata tab --> + <xsl:when test="$currTab='metadata'"> + <xsl:call-template name="iso19139Metadata"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:call-template> + </xsl:when> + + <!-- identification tab --> + <xsl:when test="$currTab='identification'"> + <xsl:apply-templates mode="elementEP" select="gmd:identificationInfo|geonet:child[string(@name)='identificationInfo']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- maintenance tab --> + <xsl:when test="$currTab='maintenance'"> + <xsl:apply-templates mode="elementEP" select="gmd:metadataMaintenance|geonet:child[string(@name)='metadataMaintenance']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- constraints tab --> + <xsl:when test="$currTab='constraints'"> + <xsl:apply-templates mode="elementEP" select="gmd:metadataConstraints|geonet:child[string(@name)='metadataConstraints']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- spatial tab --> + <xsl:when test="$currTab='spatial'"> + <xsl:apply-templates mode="elementEP" select="gmd:spatialRepresentationInfo|geonet:child[string(@name)='spatialRepresentationInfo']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- refSys tab --> + <xsl:when test="$currTab='refSys'"> + <xsl:apply-templates mode="elementEP" select="gmd:referenceSystemInfo|geonet:child[string(@name)='referenceSystemInfo']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- distribution tab --> + <xsl:when test="$currTab='distribution'"> + <xsl:apply-templates mode="elementEP" select="gmd:distributionInfo|geonet:child[string(@name)='distributionInfo']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- embedded distribution tab --> + <xsl:when test="$currTab='distribution2'"> + <xsl:apply-templates mode="elementEP" select="gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- dataQuality tab --> + <xsl:when test="$currTab='dataQuality'"> + <xsl:apply-templates mode="elementEP" select="gmd:dataQualityInfo|geonet:child[string(@name)='dataQualityInfo']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- temporalExtent tab --> + <xsl:when test="$currTab='temporalExtent'"> + <xsl:apply-templates mode="elementEP" select="gmd:identificationInfo/*/gmd:extent/*/gmd:temporalElement|gmd:identificationInfo/*/gmd:extent/*/geonet:child[string(@name)='temporalElement']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- spatialExtent tab --> + <xsl:when test="$currTab='spatialExtent'"> + <xsl:apply-templates mode="elementEP" select="gmd:identificationInfo/*/gmd:extent/*/gmd:geographicElement|gmd:identificationInfo/*/gmd:extent/*/geonet:child[string(@name)='geographicElement']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- appSchInfo tab --> + <xsl:when test="$currTab='appSchInfo'"> + <xsl:apply-templates mode="elementEP" select="gmd:applicationSchemaInfo|geonet:child[string(@name)='applicationSchemaInfo']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- porCatInfo tab --> + <xsl:when test="$currTab='porCatInfo'"> + <xsl:apply-templates mode="elementEP" select="gmd:portrayalCatalogueInfo|geonet:child[string(@name)='portrayalCatalogueInfo']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- contentInfo tab --> + <xsl:when test="$currTab='contentInfo'"> + <xsl:apply-templates mode="elementEP" select="gmd:contentInfo|geonet:child[string(@name)='contentInfo']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- extensionInfo tab --> + <xsl:when test="$currTab='extensionInfo'"> + <xsl:apply-templates mode="elementEP" select="gmd:metadataExtensionInfo|geonet:child[string(@name)='metadataExtensionInfo']"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + </xsl:apply-templates> + </xsl:when> + + <!-- anzlicMinimum tab --> + <xsl:when test="$currTab='anzlicMinimum'"> + <xsl:call-template name="anzlic"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="dataset" select="$dataset"/> + <xsl:with-param name="core" select="false()"/> + </xsl:call-template> + </xsl:when> + + <!-- anzlicCore tab --> + <xsl:when test="$currTab='anzlicCore'"> + <xsl:call-template name="anzlic"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="dataset" select="$dataset"/> + <xsl:with-param name="core" select="true()"/> + </xsl:call-template> + </xsl:when> + + <!-- default - display everything - usually just tab="complete" --> + <xsl:otherwise> + <xsl:call-template name="iso19139Complete"> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="$edit"/> + <xsl:with-param name="dataset" select="$dataset"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- ============================================================================= --> + + <xsl:template name="anzlic"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + <xsl:param name="dataset"/> + <xsl:param... [truncated message content] |