From: <jes...@us...> - 2009-02-25 08:06:21
|
Revision: 2360 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=2360&view=rev Author: jesseeichar Date: 2009-02-25 08:06:15 +0000 (Wed, 25 Feb 2009) Log Message: ----------- looks like editor is up and running Modified Paths: -------------- sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-edit.xsl sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-iso19139.xsl sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata.xsl Modified: sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-edit.xsl =================================================================== --- sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-edit.xsl 2009-02-25 08:05:19 UTC (rev 2359) +++ sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-edit.xsl 2009-02-25 08:06:15 UTC (rev 2360) @@ -189,26 +189,27 @@ <script type="text/javascript" src="{/root/gui/url}/scripts/editor/tooltip-manager.js"></script> <script language="JavaScript1.2" type="text/javascript"> + function enableLocalInput(node) { - var ref = node.value - var parent = node.parentNode.parentNode - var nodes = parent.getElementsByTagName("input") - var textarea = parent.getElementsByTagName("textarea") + var ref = node.value; + var parent = node.parentNode.parentNode; + var nodes = parent.getElementsByTagName("input"); + var textarea = parent.getElementsByTagName("textarea"); - for ( index in nodes ) { - var input = nodes[index] - if( input.name == ref ) - input.style.display = "block"; - else - input.style.display = "none"; + show(nodes,ref) + show(textarea,ref) + + }; + + function show(nodes,ref){ + for ( index in nodes ) { + var input = nodes[index] + if( input.style!=null && input.style.display != "none" ) input.style.display = "none"; + } + for ( index in nodes ) { + var input = nodes[index]; + if( input.name == ref ) input.style.display = "block"; } - for ( index in textarea ) { - var input = textarea[index] - if( input.name == ref ) - input.style.display = "block"; - else - input.style.display = "none"; - } } </script> Modified: sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-iso19139.xsl =================================================================== --- sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-iso19139.xsl 2009-02-25 08:05:19 UTC (rev 2359) +++ sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata-iso19139.xsl 2009-02-25 08:06:15 UTC (rev 2360) @@ -212,6 +212,7 @@ </xsl:call-template> </xsl:template> + <xsl:template mode="iso19139" match="gmd:*[gco:CharacterString]| srv:*[gco:CharacterString]| @@ -219,59 +220,74 @@ <xsl:param name="schema" /> <xsl:param name="edit" /> - <xsl:variable name="langId"> - <xsl:call-template name="getLangId"> - <xsl:with-param name="langGui" select="/root/gui/language" /> - <xsl:with-param name="md" - select="ancestor-or-self::*[name(.)='gmd:MD_Metadata' or @gco:isoType='gmd:MD_Metadata']" /> - </xsl:call-template> - </xsl:variable> + <xsl:call-template name="localizedCharStringField"> + <xsl:with-param name="schema" select="$schema" /> + <xsl:with-param name="edit" select="$edit" /> + </xsl:call-template> + </xsl:template> - <xsl:variable name="widget"> - <xsl:if test="$edit='true' and count(ancestor-or-self::*[@xlink:href])=0"> - <xsl:variable name="tmpFreeText"> - <xsl:call-template name="PT_FreeText_Tree" /> - </xsl:variable> - <xsl:variable name="ptFreeTextTree" select="xalan:nodeset($tmpFreeText)" /> + <xsl:template name="localizedCharStringField" > + <xsl:param name="schema" /> + <xsl:param name="edit" /> + <xsl:param name="rows" select="1" /> + + <xsl:variable name="langId"> + <xsl:call-template name="getLangId"> + <xsl:with-param name="langGui" select="/root/gui/language" /> + <xsl:with-param name="md" + select="ancestor-or-self::*[name(.)='gmd:MD_Metadata' or @gco:isoType='gmd:MD_Metadata']" /> + </xsl:call-template> + </xsl:variable> - <xsl:variable name="mainLang" - select="string(/root/*/gmd:language/gco:CharacterString)" /> + <xsl:variable name="widget"> + <xsl:if test="$edit='true' and count(ancestor-or-self::*[@xlink:href])=0"> + <xsl:variable name="tmpFreeText"> + <xsl:call-template name="PT_FreeText_Tree" /> + </xsl:variable> + <xsl:variable name="ptFreeTextTree" select="xalan:nodeset($tmpFreeText)" /> + <xsl:variable name="mainLang" + select="string(/root/*/gmd:language/gco:CharacterString)" /> + <table><tr><td> <xsl:for-each select="gco:*"> - <xsl:call-template name="getElementText"> - <xsl:with-param name="schema" select="$schema" /> - <xsl:with-param name="edit" select="$edit" /> - </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="rows" select="$rows" /> + </xsl:call-template> </xsl:for-each> - <xsl:for-each select="$ptFreeTextTree//gmd:LocalisedCharacterString"> - <xsl:call-template name="getElementText"> - <xsl:with-param name="schema" select="$schema" /> - <xsl:with-param name="edit" select="$edit" /> - <xsl:with-param name="visible" select="none" /> - </xsl:call-template> - </xsl:for-each> - <select name="localization" onchange="enableLocalInput(this)"> - <option value="_{gco:*/geonet:element/@ref}"> - <xsl:value-of - select="/root/gui/isoLang/record[code=$mainLang]/label/*[name(.)=/root/gui/language]" /> - </option> - <xsl:for-each select="$ptFreeTextTree//gmd:LocalisedCharacterString"> - <option value="_{geonet:element/@ref}"> - <xsl:value-of select="@language" /> - </option> - <xsl:value-of select="name(.)" /> - </xsl:for-each> - </select> - </xsl:if> - </xsl:variable> - <xsl:call-template name="iso19139String"> - <xsl:with-param name="schema" select="$schema" /> - <xsl:with-param name="edit" select="$edit" /> - <xsl:with-param name="langId" select="$langId" /> - <xsl:with-param name="widget" select="$widget" /> - </xsl:call-template> - </xsl:template> - - + <xsl:for-each select="$ptFreeTextTree//gmd:LocalisedCharacterString"> + <xsl:call-template name="getElementText"> + <xsl:with-param name="schema" select="$schema" /> + <xsl:with-param name="edit" select="'true'" /> + <xsl:with-param name="visible" select="'false'" /> + <xsl:with-param name="rows" select="$rows" /> + </xsl:call-template> + </xsl:for-each> + </td> + <td align="left">  + <select class="md" name="localization" onchange="enableLocalInput(this)" SELECTED="true"> + <option value="_{gco:*/geonet:element/@ref}"> + <xsl:value-of + select="/root/gui/isoLang/record[code=$mainLang]/label/*[name(.)=/root/gui/language]" /> + </option> + <xsl:for-each select="$ptFreeTextTree//gmd:LocalisedCharacterString"> + <option value="_{geonet:element/@ref}"> + <xsl:value-of select="@language" /> + </option> + <xsl:value-of select="name(.)" /> + </xsl:for-each> + </select> + </td></tr></table> + </xsl:if> + </xsl:variable> + <xsl:call-template name="iso19139String"> + <xsl:with-param name="schema" select="$schema" /> + <xsl:with-param name="edit" select="$edit" /> + <xsl:with-param name="langId" select="$langId" /> + <xsl:with-param name="widget" select="$widget" /> + <xsl:with-param name="rows" select="$rows" /> + </xsl:call-template> + </xsl:template> <xsl:template name="PT_FreeText_Tree"> <xsl:variable name="mainLang" select="string(/root/*/gmd:language/gco:CharacterString)" /> @@ -1081,38 +1097,11 @@ <xsl:param name="schema" /> <xsl:param name="edit" /> - <xsl:variable name="langId"> - <xsl:call-template name="getLangId"> - <xsl:with-param name="langGui" select="/root/gui/language" /> - <xsl:with-param name="md" - select="ancestor-or-self::*[name(.)='gmd:MD_Metadata' or @gco:isoType='gmd:MD_Metadata']" /> - </xsl:call-template> - </xsl:variable> - - <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="10" /> - <xsl:with-param name="langId" select="$langId" /> - </xsl:call-template> - - - <xsl:if test="$edit='true'"> - <xsl:variable name="ptFreeTextTree"> - <xsl:call-template name="PT_FreeText_Tree" /> - </xsl:variable> - - <xsl:for-each - select="xalan:nodeset($ptFreeTextTree)//gmd:LocalisedCharacterString"> - <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:with-param name="langId" select="$langId" /> - </xsl:call-template> - </xsl:for-each> - </xsl:if> - + <xsl:call-template name="localizedCharStringField"> + <xsl:with-param name="schema" select="$schema" /> + <xsl:with-param name="edit" select="$edit" /> + <xsl:with-param name="rows" select="10" /> + </xsl:call-template> </xsl:template> <!-- Modified: sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata.xsl =================================================================== --- sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata.xsl 2009-02-25 08:05:19 UTC (rev 2359) +++ sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata.xsl 2009-02-25 08:06:15 UTC (rev 2360) @@ -701,7 +701,7 @@ <xsl:with-param name="id" select="$id"/> </xsl:call-template> </th> - <td class="padded" valign="top"><xsl:copy-of select="$text"/></td> + <td class="padded" valign="top"><xsl:copy-of select="$text"/></td> </tr> </xsl:template> <!-- @@ -911,7 +911,7 @@ <xsl:param name="edit" select="false()"/> <xsl:param name="rows" select="1"/> <xsl:param name="cols" select="50"/> - <xsl:param name="visible" select="block"/> + <xsl:param name="visible" select="true"/> <xsl:param name="langId"/> <xsl:variable name="name" select="name(.)"/> @@ -922,7 +922,10 @@ <xsl:choose> <!-- list of values --> <xsl:when test="geonet:element/geonet:text"> - <select class="md" name="_{geonet:element/@ref}" size="1" style="display:{$visible};"> + <select class="md" name="_{geonet:element/@ref}" size="1" > + <xsl:if test="$visible = 'false'"> + <xsl:attribute name="style">display:none;</xsl:attribute> + </xsl:if> <xsl:if test="$xlinkedAncestor != 0"> <xsl:attribute name="disabled">disabled</xsl:attribute> </xsl:if> @@ -952,10 +955,13 @@ ($schema='iso19115' and $name='keyword') or (starts-with($schema,'iso19139') and (name(..)='gmd:keyword' or ../@gco:isoType='gmd:keyword'))"> - <input class="md" type="text" id="_{geonet:element/@ref}" name="_{geonet:element/@ref}" value="{text()}" size="{$cols}" style="display:{$visible};"> - <xsl:if test="$xlinkedAncestor != 0"> + <input class="md" type="text" id="_{geonet:element/@ref}" name="_{geonet:element/@ref}" value="{text()}" size="{$cols}"> + <xsl:if test="$xlinkedAncestor != 0"> <xsl:attribute name="disabled">disabled</xsl:attribute> </xsl:if> + <xsl:if test="$visible = 'false'"> + <xsl:attribute name="style">display:none;</xsl:attribute> + </xsl:if> </input> <div id='keywordList' class="keywordList" ></div> @@ -978,10 +984,13 @@ </xsl:call-template> </xsl:when> <xsl:otherwise> - <input class="md" type="text" id="_{geonet:element/@ref}" name="_{geonet:element/@ref}" value="{text()}" size="{$cols}" style="display:{$visible};"> + <input class="md" type="text" id="_{geonet:element/@ref}" name="_{geonet:element/@ref}" value="{text()}" size="{$cols}" > <xsl:if test="$xlinkedAncestor != 0"> <xsl:attribute name="disabled">disabled</xsl:attribute> </xsl:if> + <xsl:if test="$visible = 'false'"> + <xsl:attribute name="style">display:none;</xsl:attribute> + </xsl:if> </input> <xsl:call-template name="helper"> @@ -992,10 +1001,13 @@ </xsl:choose> </xsl:when> <xsl:when test="$edit=true()"> - <textarea class="md" name="_{geonet:element/@ref}" rows="{$rows}" cols="{$cols}" style="display:{$visible};"> + <textarea class="md" name="_{geonet:element/@ref}" rows="{$rows}" cols="{$cols}"> <xsl:if test="$xlinkedAncestor != 0"> <xsl:attribute name="disabled">disabled</xsl:attribute> </xsl:if> + <xsl:if test="$visible = 'false'"> + <xsl:attribute name="style">display:none;</xsl:attribute> + </xsl:if> <xsl:value-of select="text()"/> </textarea> </xsl:when> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |