Revision: 1407
http://geonetwork.svn.sourceforge.net/geonetwork/?rev=1407&view=revAuthor: rdewit
Date: 2008-07-17 07:53:58 +0000 (Thu, 17 Jul 2008)
Log Message:
-----------
Some cleanups.
Modified Paths:
--------------
sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms-common.xsl
sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms-header-footer.xsl
sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms.xsl
Modified: sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms-common.xsl
===================================================================
--- sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms-common.xsl 2008-07-17 07:38:46 UTC (rev 1406)
+++ sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms-common.xsl 2008-07-17 07:53:58 UTC (rev 1407)
@@ -40,7 +40,7 @@
<xsl:param name="counter" select="1"/>
<xsl:param name="xpath-todo" select="''"/>
<xsl:param name="xpath-done" select="''"/>
- <xsl:param name="custom"/>
+ <xsl:param name="config"/>
<xsl:variable name="doc" select="/"/>
<xsl:variable name="grandParentName">
@@ -118,69 +118,17 @@
.
-->
-<!--
-PARENT: <xsl:value-of select="name(..)"/><xh:br />
-ELEMENT: <xsl:value-of select="name()"/><xh:br />
-CHILD: <xsl:value-of select="$grandchildName"/><xh:br />
--->
-
<xsl:variable name="repeat-id" select="concat(saxon:path(),'-',$counter)"/>
+
<xsl:choose>
<!-- if there is more than one of the same node then only process one -->
<!-- done by: if the next sibling is the same as me, move on to the next -->
- <!--
- <xsl:when test="following-sibling::*[name() = $childName]"/>
- -->
- <xsl:when test="preceding-sibling::node()[name() = $childName]">
- <!--
- Preceding sibling: <xsl:value-of select="name()"/>
- Ignoring
- -->
- </xsl:when>
+ <xsl:when test="preceding-sibling::node()[name() = $childName]"/>
- <!--
- <xsl:when test="$xpath-todo and $xpath-todo != ''">
-
- <xsl:apply-templates select="saxon:evaluate($first-element)">
- <xsl:with-param name="xpath-done" select="concat($xpath-done,'/',$first-element)"/>
- <xsl:with-param name="xpath-todo" select="$xpath-todo"/>
- </xsl:apply-templates>
-
- </xsl:when>
- -->
-
- <!-- Test if this is an unmarked codelist -->
- <!--
- <xsl:when test="not(child::*/@codeList) and $codelists-doc/codelist/@name = $grandChildName">
- -->
- <!--
- <xsl:when test="geonet:element/geonet:text">
- TEASTASDF
- <xh:p>
- <xf:select1 ref="{$childName}">
- <xf:label ref="instance('labels')/element[@name='{$childName}']/label" class="input-label"/>
- <xf:hint ref="instance('labels')/element[@name='{$childName}']/description"/>
- <xf:help ref="instance('labels')/element[@name='{$childName}']/example"/>
- <xf:itemset nodeset="instance('codelists')/codelist[@name='{$childName}']/entry">
- <xf:label ref="label"/>
- <xf:value ref="code"/>
- </xf:itemset>
- </xf:select1>
- </xh:p>
- </xsl:when>
-
- -->
<!-- Test for complex node
-->
<xsl:when test="count(descendant::*[substring-before(name(),':') != 'geonet']) > 1">
-
- <!--
- <xf:output value="count({name()})" />
-PARENTNAME: <xsl:value-of select="$parentName"/>
-CHILDNAME: <xsl:value-of select="$childName"/>
- -->
-
<xsl:variable name="minVal">
<xsl:choose>
<xsl:when test="geonet:element/@min">
@@ -219,8 +167,8 @@
<xsl:variable name="label">
<xsl:choose>
- <xsl:when test="$custom and $custom/@name">
- <xsl:value-of select="$custom/@name"/> (<xsl:value-of select="name()"/>,
+ <xsl:when test="$config and $config/@name">
+ <xsl:value-of select="$config/@name"/> (<xsl:value-of select="name()"/>,
<xf:output ref="instance('labels')/element[@name='{name()}']/label"/>)
</xsl:when>
<xsl:otherwise><xf:output ref="instance('labels')/element[@name='{name()}']/label"/></xsl:otherwise>
@@ -242,7 +190,7 @@
<xsl:choose>
<xsl:when test="$xpath-todo != ''">
<!--
- Custom and xpath-todo:
+ config and xpath-todo:
todo: <xsl:value-of select="$xpath-todo"/>
done: <xsl:value-of select="$xpath-done"/>
saxon: <xsl:value-of select="concat($xpath-done,'/',$first-element)"/>
@@ -251,14 +199,14 @@
<xsl:with-param name="counter" select="concat($counter,'-',position())"/>
<xsl:with-param name="xpath-done" select="$xpath-new-done"/>
<xsl:with-param name="xpath-todo" select="$xpath-new-todo"/>
- <xsl:with-param name="custom" select="$custom"/>
+ <xsl:with-param name="config" select="$config"/>
</xsl:apply-templates>
</xsl:when>
- <xsl:when test="$custom">
- <xsl:variable name="xpath2" select="$custom/@xpath"/>
- <xsl:for-each select="$custom/*">
+ <xsl:when test="$config">
+ <xsl:variable name="xpath2" select="$config/@xpath"/>
+ <xsl:for-each select="$config/*">
<xsl:apply-templates select=".">
<xsl:with-param name="counter" select="concat($counter,'-',position())"/>
<xsl:with-param name="doc" select="$doc"/>
@@ -310,15 +258,15 @@
<xf:group ref="." class="gn-subgroup">
<xsl:choose>
- <xsl:when test="$custom and $xpath-todo != ''">
+ <xsl:when test="$config and $xpath-todo != ''">
<xsl:apply-templates select="saxon:evaluate($first-element)">
<xsl:with-param name="xpath-done" select="$xpath-new-done"/>
<xsl:with-param name="xpath-todo" select="$xpath-new-todo"/>
</xsl:apply-templates>
</xsl:when>
- <xsl:when test="$custom">
- <xsl:for-each select="$custom/*">
- <xsl:variable name="xpath-todo" select="$custom/@xpath"/>
+ <xsl:when test="$config">
+ <xsl:for-each select="$config/*">
+ <xsl:variable name="xpath-todo" select="$config/@xpath"/>
<xsl:apply-templates select=".">
<xsl:with-param name="counter" select="$counter"/>
<xsl:with-param name="doc" select="$doc"/>
@@ -408,7 +356,7 @@
<xf:group ref=".[count(geonet:choose) > 0]">
<xf:select1 ref="@namespace">
<xf:item>
- <xf:label/>
+ <xf:label>- please select -</xf:label>
<xf:value/>
</xf:item>
<xf:itemset nodeset="../geonet:choose">
@@ -419,7 +367,7 @@
</xf:group>
<xf:trigger>
- <xf:label>Add <xf:output value="instance('labels')/element[@name='{$nodeName}']/label"/> <!--(<xsl:value-of select="$nodeName"/>)--></xf:label>
+ <xf:label>Add <xf:output value="instance('labels')/element[@name='{$nodeName}']/label"/> (<xsl:value-of select="$nodeName"/>)</xf:label>
<xf:action ev:event="DOMActivate">
<!--
<xf:insert context="." nodeset="{$child}" at="last()" position="after" origin="instance('snippets')/snippet[@id = '{$snippet-id}']/*"/>
@@ -450,20 +398,20 @@
<xf:setvalue ref="instance('snippet-request')/parent" value="'{$child}'"/>
<!-- this one could be more efficient, since // is used now -->
- <xf:setvalue ref="instance('snippet-request')/child" value="instance('full')/..{$xpath}[index('{$repeat-id}')]/../geonet:child[@name='{substring-after($child,':')}']/@namespace"/>
+ <xf:setvalue ref="instance('snippet-request')/child" value="instance('metadata')/..{$xpath}[index('{$repeat-id}')]/../geonet:child[@name='{substring-after($child,':')}']/@namespace"/>
<!--<xf:setvalue ref="instance('snippet-request')/child" value="{$grandchild}"/> ../../../../name(), '|', ../../../../name(), '|', ../../../name(), '|', ../../name(), '|',
<xf:setvalue ref="instance('snippet-request')/child" value="concat(saxon:path(), '../geonet:child[@name='geographicElement']/@selected')"/>-->
<!--
- <xf:setvalue ref="instance('snippet-request')/child" value="instance('full'){$xpath}[index('{$repeat-id}')]/../geonet:child[@name='geographicElement']/@selected"/>
+ <xf:setvalue ref="instance('snippet-request')/child" value="instance('metadata'){$xpath}[index('{$repeat-id}')]/../geonet:child[@name='geographicElement']/@selected"/>
- TEST <xf:message value="instance('full')//gmd:geographicElement[index('{$repeat-id}')]/../geonet:child[@name='geographicElement']/@selected"/>
+ TEST <xf:message value="instance('metadata')//gmd:geographicElement[index('{$repeat-id}')]/../geonet:child[@name='geographicElement']/@selected"/>
<xf:setvalue ref="instance('snippet-request')/child" value="$grandchild"/>
TEST <xf:output value="{$context}/geonet:child[@name='{substring-after($child,':')}' and @prefix='{substring-before($child,':')}']/@selected"/>
- **<xf:message value="concat('',instance('full')//geonet:child[@name='geographicElement' and @selected !='']/@selected)"/>**
- <xf:setvalue ref="instance('snippet-request')/child" value="concat('',instance('full'){$grandchild}//geonet:child[@name='geographicElement']/@selected)"/>
- <xf:setvalue ref="instance('snippet-request')/child" value="concat('',instance('full')//geonet:child[@name='geographicElement' and @selected !='']/@selected)"/>
+ **<xf:message value="concat('',instance('metadata')//geonet:child[@name='geographicElement' and @selected !='']/@selected)"/>**
+ <xf:setvalue ref="instance('snippet-request')/child" value="concat('',instance('metadata'){$grandchild}//geonet:child[@name='geographicElement']/@selected)"/>
+ <xf:setvalue ref="instance('snippet-request')/child" value="concat('',instance('metadata')//geonet:child[@name='geographicElement' and @selected !='']/@selected)"/>
-->
<xf:send submission="get-snippet"/>
@@ -489,119 +437,7 @@
</xsl:template>
-
-<!--
-<xsl:template match="gmd:*|gco:*|gml:*">
- <xf:repeat nodeset="{name()}">
- <xsl:apply-templates/>
- </xf:repeat>
-</xsl:template>
--->
-
-<!-- geonet:child elements -->
-<xsl:template match="geonet:TODOFIXLATERchild[not(../*[name() = concat(@prefix, ':', @name)])]">
-<!--
-GEONET:CHILD
--->
- <!-- Get the User Friendly label from the labels file for the geonet:child attribute -->
- <xsl:variable name="attribName" select="concat(@prefix,':',@name)"/>
- <xsl:variable name="attribPath" select="$labels-doc/labels/element[@name=$attribName]"/>
- <xsl:variable name="attribLabel" select="$attribPath/label"/>
- <xsl:variable name="snippet-id" select="concat(name(parent::node()), '/', $attribName)"/>
-
- <xsl:variable name="grandParentName">
- <xsl:choose>
- <xsl:when test="name(../..)">
- <xsl:value-of select="name(../..)"/>
- </xsl:when>
- <xsl:otherwise>/</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="parentName">
- <xsl:choose>
- <xsl:when test="name(..)">
- <xsl:value-of select="name(..)"/>
- </xsl:when>
- <xsl:otherwise>/</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="childName" select="concat(@prefix,':',@name)"/>
-
- <!-- create xpath for current node -->
- <xsl:variable name="xpath">
- <xsl:for-each select="ancestor::*">
- <xsl:value-of select="concat('/',name())"/>
- </xsl:for-each>
- <!--
- <xsl:value-of select="concat('/',name())"/>
- -->
- </xsl:variable>
- <!--
- GEONET:CHILD
- -->
- <xsl:choose>
- <!-- If it does not have a child, create an input element with a label -->
- <xsl:when test="not(./*)">
- <!--
- NORMAL CHILD
- -->
- <xh:p>
- <xf:output ref="instance('labels')/element[@name='{concat(@prefix, ':', @name)}']/label" class="input-label"/>
-
- <xsl:call-template name="create_add_button">
- <xsl:with-param name="grandparent" select="$grandParentName"/>
- <xsl:with-param name="parent" select="$parentName"/>
- <xsl:with-param name="child" select="$childName"/>
- <xsl:with-param name="context" select="concat('..','')"/>
- </xsl:call-template>
- (geonet:child)
-
- <!--
- <xf:trigger>
- <xf:label>Add geonet:child</xf:label>
- <xf:action ev:event="DOMActivate">
- <xf:insert context="{$xpath}" nodeset="{$attribName}" at="last()" position="after" origin="instance('snippets')/snippet[@id = '{$snippet-id}']/*"/>
- </xf:action>
- </xf:trigger>
- -->
- </xh:p>
- </xsl:when>
-
- <xsl:otherwise>
- <xh:p>
- <!-- If it has children, create a select list -->
- <xf:select1 ref="{$xpath}">
- <xf:label><xsl:value-of select="$attribLabel" /></xf:label>
- <xf:item>
- <xf:label/>
- <xf:value/>
- </xf:item>
-
- <xsl:for-each select="node()">
- <!-- Get the User Friendly label from the labels file for the name attribute of the children of geonet:child -->
- <xsl:variable name="a" select="attribute::node()"/>
- <!-- Only create a select item if the attribute of this node is not empty -->
- <xsl:if test="attribute::node()">
- <xf:item>
- <xf:label><xsl:value-of select="$labels-doc/labels/element[@name=$a]/label"/></xf:label>
- <xf:value><xsl:value-of select="attribute::node()"/></xf:value>
- </xf:item>
- </xsl:if>
- </xsl:for-each>
- <xf:action ev:event="xforms-value-changed">
- <xf:insert
- context="{$xpath}"
- at="last()" position="after"
- origin="instance('snippets')/snippet[@id='{$snippet-id}']/*" />
- </xf:action>
- </xf:select1>
- </xh:p>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
+<!-- Special element that have a selection list -->
<xsl:template match="*[geonet:element/geonet:text]">
<xsl:variable name="childName" select="name()"/>
<xsl:variable name="parentName" select="name(..)"/>
@@ -751,17 +587,6 @@
</xf:action>
</xf:trigger>
- <!-- OLD
- <xf:trigger>
- <xf:label>Delete</xf:label>
- <xf:action ev:event="DOMActivate">
- <xf:insert context="../.." nodeset="{$parentName}" at="index('{name(../..)}/{$parentName}')" position="after" origin="instance('snippets')/snippet[@id = '{$grandparentName}']//geonet:child[@name='{$parentLocalName}' and @prefix='{$parentPrefix}']"/>
- <xf:insert context="../.." nodeset="{$parentName}" at="last()" position="after" origin="instance('snippets')/snippet//geonet:child[@name='{$parentLocalName}' and @prefix='{$parentPrefix}']"/>
- <xf:delete context=".."/>
- </xf:action>
- </xf:trigger>
- -->
-
</xf:group>
</xsl:template>
@@ -862,80 +687,6 @@
</xsl:template>
-<xsl:template name="geonet:childDDAKFSDAJF">
- <xsl:param name="child"/>
-
- <xsl:variable name="attribName" select="concat($child/@prefix,':',$child/@name)"/>
- <xsl:variable name="attribPath" select="$labels-doc/labels/element[@name=$attribName]"/>
- <xsl:variable name="attribLabel" select="$attribPath/label"/>
- <xsl:variable name="snippet-id" select="concat(name($child/parent::node()), '/', $attribName)"/>
-
- <xsl:variable name="xpath">
- <xsl:for-each select="$child/ancestor::*">
- <xsl:value-of select="concat('/',name())"/>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:choose>
- <!-- If it does not have a child, create an input element with a label -->
- <xsl:when test="not($child/*)">
- <xh:p>
- <xf:output ref="instance('labels')/element[@name='{$attribName}']/label" class="input-label"/>
- <xf:trigger>
- <xf:label>Add geonet:child2</xf:label>
- <xf:action ev:event="DOMActivate">
- <!--
- -->
- <xf:insert context="." nodeset="{$attribName}" at="last()" position="after" origin="instance('snippets')/snippet[@id = '{$snippet-id}']/*"/>
- </xf:action>
- </xf:trigger>
- </xh:p>
- </xsl:when>
- <xsl:otherwise>
- <xh:p>
- <!-- If it has children, create a select list -->
- <xf:select1 ref="{$xpath}">
- <xf:label><xsl:value-of select="$attribLabel" /></xf:label>
- <xsl:for-each select="$child/node()">
- <!-- Get the User Friendly label from the labels file for the name attribute of the children of geonet:child -->
- <xsl:variable name="a" select="$child/attribute::node()"/>
- <!-- Only create a select item if the attribute of this node is not empty -->
- <xsl:if test="$child/attribute::node()">
- <xf:item>
- <xf:label><xsl:value-of select="$labels-doc/labels/element[@name=$a]/label"/></xf:label>
- <xf:value><xsl:value-of select="$child/attribute::node()"/></xf:value>
- </xf:item>
- </xsl:if>
- </xsl:for-each>
- <xf:action ev:event="xforms-value-changed">
- <xf:insert
- context="{$xpath}"
- at="last()" position="after"
- origin="instance('snippets')/snippet[@id='{$snippet-id}']/*" />
- </xf:action>
- </xf:select1>
- </xh:p>
- </xsl:otherwise>
- </xsl:choose>
-
-</xsl:template>
-
- <!--
-<xsl:template match="gmd:identificationInfo|gmd:distributionInfo|gmd:spatialRepresentationInfo|gmd:referenceSystemInfo">
- <xsl:variable name="labelNode" select="$labels-doc/labels/element[@name=name()]"/>
- <xsl:variable name="label" select="$labelNode/label"/>
- <xsl:if test="name() = 'gmd:identificationInfo'">
- <xsl:text></xf:case></xsl:text>
- </xsl:if>
- <xf:case id="{name()}_case">
- <xh:h1><xsl:value-of select="$label"/></xh:h1>
- <xsl:apply-templates/>
- </xf:case>
- <xsl:apply-templates select="./@*"/>
- <xsl:apply-templates select="./*"/>
-</xsl:template>
- -->
-
<!-- remove all geonet:element nodes -->
<xsl:template match="geonet:element"/>
Modified: sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms-header-footer.xsl
===================================================================
--- sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms-header-footer.xsl 2008-07-17 07:38:46 UTC (rev 1406)
+++ sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms-header-footer.xsl 2008-07-17 07:53:58 UTC (rev 1407)
@@ -22,22 +22,32 @@
<xsl:param name="callback"/>
<xhtml:html
-xmlns="
http://www.w3.org/1999/xhtml"
-xmlns:xh="
http://www.w3.org/1999/xhtml"
-xmlns:xhtml="
http://www.w3.org/1999/xhtml"
-xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
-xmlns:xf="
http://www.w3.org/2002/xforms"
-xmlns:xforms="
http://www.w3.org/2002/xforms"
- xmlns:f="
http://orbeon.org/oxf/xml/formatting"
- xmlns:xxforms="
http://orbeon.org/oxf/xml/xforms"
- xmlns:widget="
http://orbeon.org/oxf/xml/widget"
- xmlns:ev="
http://www.w3.org/2001/xml-events"
- xmlns:xs="
http://www.w3.org/2001/XMLSchema"
-xmlns:gmd="
http://www.isotc211.org/2005/gmd" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="
http://www.isotc211.org/2005/gco" xmlns:gts="
http://www.isotc211.org/2005/gts" xmlns:gsr="
http://www.isotc211.org/2005/gsr" xmlns:gss="
http://www.isotc211.org/2005/gss" xmlns:gmx="
http://www.isotc211.org/2005/gmx" xmlns:gml="
http://www.opengis.net/gml" xmlns:xlink="
http://www.w3.org/1999/xlink" xsi:schemaLocation="
http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd http://www.opengis.net/gml http://www.opengis.net/gml/gml.xsd http://www.w3.org/1999/xlink http://www.w3.org/1999/xlink/xlinks.xsd"
-xmlns:geonet="
http://www.fao.org/geonetwork"
+ xmlns="
http://www.w3.org/1999/xhtml"
+ xmlns:xh="
http://www.w3.org/1999/xhtml"
+ xmlns:xhtml="
http://www.w3.org/1999/xhtml"
+ xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"
+ xmlns:xf="
http://www.w3.org/2002/xforms"
+ xmlns:xforms="
http://www.w3.org/2002/xforms"
+ xmlns:f="
http://orbeon.org/oxf/xml/formatting"
+ xmlns:xxforms="
http://orbeon.org/oxf/xml/xforms"
+ xmlns:widget="
http://orbeon.org/oxf/xml/widget"
+ xmlns:ev="
http://www.w3.org/2001/xml-events"
+ xmlns:xs="
http://www.w3.org/2001/XMLSchema"
+ xmlns:gmd="
http://www.isotc211.org/2005/gmd"
+ xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gco="
http://www.isotc211.org/2005/gco"
+ xmlns:gts="
http://www.isotc211.org/2005/gts"
+ xmlns:gsr="
http://www.isotc211.org/2005/gsr"
+ xmlns:gss="
http://www.isotc211.org/2005/gss"
+ xmlns:gmx="
http://www.isotc211.org/2005/gmx"
+ xmlns:gml="
http://www.opengis.net/gml"
+ xmlns:xlink="
http://www.w3.org/1999/xlink"
+
+ xsi:schemaLocation="
http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd http://www.opengis.net/gml http://www.opengis.net/gml/gml.xsd http://www.w3.org/1999/xlink http://www.w3.org/1999/xlink/xlinks.xsd"
+ xmlns:geonet="
http://www.fao.org/geonetwork"
>
<xh:head>
- <style type="text/css">
+ <xh:style type="text/css">
<![CDATA[
/* Hide Orbeon specifics */
@@ -76,235 +86,222 @@
height: 24px;
}
*/
- .xforms-invalid {
- background-color:#FFF0F0;
- }
+ .xforms-invalid {
+ background-color:#FFF0F0;
+ }
- /* takes away yellow background in repeat */
- .xforms-repeat-selected-item,
- .xforms-repeat-selected-item-1,
- .xforms-repeat-selected-item-2,
- .xforms-repeat-selected-item-3,
- .xforms-repeat-selected-item-4
- {
- background-color:transparent
- }
- .xforms-label {
- width: 180px;
- }
+ /* takes away yellow background in repeat */
+ .xforms-repeat-selected-item,
+ .xforms-repeat-selected-item-1,
+ .xforms-repeat-selected-item-2,
+ .xforms-repeat-selected-item-3,
+ .xforms-repeat-selected-item-4
+ {
+ background-color:transparent
+ }
+ .xforms-label {
+ width: 180px;
+ }
- .group-label {
- display: block;
- font-weight: bold;
- margin-top: 10px;
- width: 100%;
- min-width: 180px;
- }
+ .group-label {
+ display: block;
+ font-weight: bold;
+ margin-top: 10px;
+ width: 100%;
+ min-width: 180px;
+ }
- .input-label {
- float: left;
- display: block;
- width: 180px;
- min-width: 180px;
- }
+ .input-label {
+ float: left;
+ display: block;
+ width: 180px;
+ min-width: 180px;
+ }
- .input-control, .xforms-input, .xforms-select1 {
- float: left;
- /*margin-left: 180px;*/
- }
+ .input-control, .xforms-input, .xforms-select1 {
+ float: left;
+ /*margin-left: 180px;*/
+ }
- .xforms-repeat {
- }
- .xforms-textarea-appearance-xxforms-autosize { width: 20em; margin-bottom: 2px }
- .xforms-input input { width: 20em; margin-bottom: 2px }
- .xforms-select1 { margin-bottom: 2px }
- .xforms-select1 input { margin-bottom: 2px }
- .xforms-repeat-selected-item-1 .form-td { background: #ffc }
- /*.xforms-repeat-selected-item-1 .form-td .xforms-select1-appearance-minimal { background: white; }*/
-
- /* NOTE needed, else xforms that should be disabled
- (relevent="false()") might be shown if their CSS sets the display
- property */
- .xforms-disabled {
- display:none;
- }
+ .xforms-repeat {
+ }
+ .xforms-textarea-appearance-xxforms-autosize { width: 20em; margin-bottom: 2px }
+ .xforms-input input { width: 20em; margin-bottom: 2px }
+ .xforms-select1 { margin-bottom: 2px }
+ .xforms-select1 input { margin-bottom: 2px }
+ .xforms-repeat-selected-item-1 .form-td { background: #ffc }
+ /*.xforms-repeat-selected-item-1 .form-td .xforms-select1-appearance-minimal { background: white; }*/
+
+ /* NOTE needed, else xforms that should be disabled
+ (relevent="false()") might be shown if their CSS sets the display
+ property */
+ .xforms-disabled {
+ display:none;
+ }
]]>
- </style>
- <xh:title>GeoNetwork XForms Metadata Editor</xh:title>
- <xf:model xmlns:xforms="
http://www.w3.org/2002/xforms" id="bluenet">
- <!--
- <xf:instance id="full" src="
http://localhost/xforms/tmp.xml"/>
- <xf:instance id="full" src="
http://localhost/xforms/instance-minimal.xml"/>
- <xf:instance id="full" src="
http://localhost/xforms/instance-minimal.xml"/>
- -->
- <xf:instance id="full" src="{$geonetwork-location}/srv/{$language}/xml.metadocument.instance?uuid={$uuid}"/>
+ </xh:style>
+ <xh:title>GeoNetwork XForms Metadata Editor</xh:title>
+ <xf:model xmlns:xforms="
http://www.w3.org/2002/xforms" id="bluenet">
- <xf:instance id="template-characterstring">
- <gco:CharacterString>Test
- </gco:CharacterString>
- </xf:instance>
+ <!-- empty first instance to make instance inspector load faster -->
+ <xf:instance id="dummy">
+ <dummy xmlns=""/>
+ </xf:instance>
- <!-- Template for inserting attributes in an element -->
- <xf:instance id="template-attributes">
- <attributes xmlns=""
- gco:nilReason=""
- type=""
- uuidref=""
- uuid=""
- id=""
- xlink:href=""
- xlink:role=""
- xlink:arcrole=""
- xlink:title=""
- xlink:show=""
- xlink:actuate=""
- gml:id=""
- frame=""
- calendarEraName=""
- codeSpace=""
- indeterminatePosition=""
+ <xf:instance id="metadata" src="{$geonetwork-location}/srv/{$language}/xml.metadocument.instance?uuid={$uuid}"/>
- />
- </xf:instance>
+ <!-- Template for inserting attributes in an element -->
+ <xf:instance id="template-attributes">
+ <attributes xmlns=""
+ gco:nilReason=""
+ type=""
+ uuidref=""
+ uuid=""
+ id=""
+ xlink:href=""
+ xlink:role=""
+ xlink:arcrole=""
+ xlink:title=""
+ xlink:show=""
+ xlink:actuate=""
+ gml:id=""
+ frame=""
+ calendarEraName=""
+ codeSpace=""
+ indeterminatePosition=""
+ uom=""
- <xf:instance id="labels" src="{$labels}"/>
- <xf:instance id="codelists" src="{$codelists}"/>
+ />
+ </xf:instance>
- <!-- Metadata -->
- <xf:bind id="Metadata_fileIdentifier" nodeset="/gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString" required="true()" />
- <xf:bind id="Metadata_Organisation_Name" nodeset="/gmd:MD_Metadata/gmd:contact/gmd:CI_ResponsibleParty/gmd:organisationName/gco:CharacterString" required="true()"/>
- <xf:bind id="Metadata_Date" nodeset="/gmd:MD_Metadata/gmd:dateStamp/gco:Date" />
+ <xf:instance id="labels" src="{$labels}"/>
+ <xf:instance id="codelists" src="{$codelists}"/>
- <!-- Reference System -->
- <xf:bind id="RefSys_Date" nodeset="/gmd:MD_Metadata/gmd:dateStamp/gco:Date" />
+ <!-- Read-only fields -->
+ <xf:bind nodeset="/gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString" readonly="true()" />
- <!-- Read-only fields -->
- <!--
- <xf:bind nodeset="/gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString" readonly="true()" />
- -->
+ <!-- Make all dates a date selector -->
+ <xf:bind nodeset="instance('metadata')//gco:DateNEWNEW" type="xs:date" constraint="if (. castable as xs:date) then current-date() + xdt:dayTimeDuration('P1D') >= xs:date(.) else false()" readonly="false()" calculate="if (. = '') then adjust-date-to-timezone(current-date(), ()) else ."/>
- <!-- Make all dates a date selector -->
- <xf:bind nodeset="//gco:DateNEWNEW" type="xs:date" constraint="if (. castable as xs:date) then current-date() + xdt:dayTimeDuration('P1D') >= xs:date(.) else false()" readonly="false()" calculate="if (. = '') then adjust-date-to-timezone(current-date(), ()) else ."/>
+ <xf:bind nodeset="instance('metadata')//gco:Date" type="xforms:date"/>
+ <xf:bind nodeset="instance('metadata')//gco:DateTime" type="xforms:dateTime"/>
- <xf:bind nodeset="//gco:Date" type="xforms:date"/>
- <xf:bind nodeset="//gco:DateTime" type="xforms:dateTime"/>
+ <xforms:submission id="save-submission-file" action="file:/tmp/results.xml" method="put"/>
+ <xforms:submission id="save-submission-exist" ref="instance('metadata')" resource="/exist/rest/db/orbeon/sandbox/meta.xml" method="put" replace="none"/>
- <xforms:submission id="save-submission-file" action="file:/tmp/results.xml" method="put"/>
- <xforms:submission id="save-submission-exist" ref="instance('full')" resource="/exist/rest/db/orbeon/sandbox/meta.xml" method="put" replace="none"/>
+ <xf:submission id="switch-language-en" action="
http://localhost/xforms/labels.xml" replace="instance" instance="labels" method="get"/>
+ <xf:submission id="switch-language-fr" action="
http://localhost/xforms/labels-fr.xml" replace="instance" instance="labels" method="get"/>
- <xf:submission id="switch-language-en" action="
http://localhost/xforms/labels.xml" replace="instance" instance="labels" method="get"/>
- <xf:submission id="switch-language-fr" action="
http://localhost/xforms/labels-fr.xml" replace="instance" instance="labels" method="get"/>
+ <xf:instance id="snippet" xmlns="">
+ <snippet/>
+ </xf:instance>
+ <xf:instance id="snippet-request" xmlns="">
+ <parameters>
+ <schema><xsl:value-of select="$schema"/></schema>
+ <grandparent/>
+ <parent/>
+ <child/>
+ </parameters>
+ </xf:instance>
- <xf:instance id="snippet" xmlns="">
- <snippet/>
- </xf:instance>
- <xf:instance id="snippet-request" xmlns="">
- <parameters>
- <schema><xsl:value-of select="$schema"/></schema>
- <grandparent/>
- <parent/>
- <child/>
- </parameters>
- </xf:instance>
+ <xf:submission id="get-snippet"
+ method="get" action="{$geonetwork-location}/srv/en/xml.metadocument.snippet?"
+ separator="&"
+ replace="instance" instance="snippet" ref="instance('snippet-request')"
+ >
+ <xf:toggle case="case-busy" ev:event="xforms-submit" />
+ <xf:toggle case="case-submit-error" ev:event="xforms-submit-error" />
+ <xf:toggle case="case-done" ev:event="xforms-submit-done" />
+ </xf:submission>
- <xf:submission id="get-snippet"
- method="get" action="{$geonetwork-location}/srv/en/xml.metadocument.snippet?"
- separator="&"
- replace="instance" instance="snippet" ref="instance('snippet-request')"
- >
- <xf:toggle case="case-busy" ev:event="xforms-submit" />
- <xf:toggle case="case-submit-error" ev:event="xforms-submit-error" />
- <xf:toggle case="case-done" ev:event="xforms-submit-done" />
- </xf:submission>
+ <!--<![CDATA[
+ Geonetwork needs some additional info (id and new revision number
+ (version) of the document) for storing the meta data.]]>-->
+ <xf:instance id="geonetwork-request-update">
+ <request xmlns="">
+ <username>admin</username>
+ <password>admin</password>
+ <id><xsl:value-of select="/root/gmd:MD_Metadata/geonet:info/id"/></id>
+ <version><xsl:value-of select="number(/root/gmd:MD_Metadata/geonet:info/version)"/></version>
+ <data/>
+ <!--
+ <foo2><xsl:copy-of select="/root/gmd:MD_Metadata/geonet:info"/></foo2>
+ -->
+ </request>
+ </xf:instance>
- <!--<![CDATA[
- Geonetwork needs some additional info (id and new revision number
- (version) of the document) for storing the meta data.]]>-->
- <xf:instance id="geonetwork-request-update">
- <request xmlns="">
- <username>admin</username>
- <password>admin</password>
- <id><xsl:value-of select="/root/gmd:MD_Metadata/geonet:info/id"/></id>
- <version><xsl:value-of select="number(/root/gmd:MD_Metadata/geonet:info/version)"/></version>
- <data/>
- <!--
- <foo2><xsl:copy-of select="/root/gmd:MD_Metadata/geonet:info"/></foo2>
- -->
- </request>
- </xf:instance>
+ <!-- information messages. TODO l10n -->
+ <xf:instance id="geonetwork-info-messages">
+ <messages xmlns="">
+ <message id="saved">The metadata was saved successfully.</message>
+ </messages>
+ </xf:instance>
- <!-- information messages. TODO l10n -->
- <xf:instance id="geonetwork-info-messages">
- <messages xmlns="">
- <message id="saved">The metadata was saved successfully.</message>
- </messages>
- </xf:instance>
+ <xf:instance id="geonetwork-errors">
+ <errors xmlns=""/>
+ </xf:instance>
- <xf:instance id="geonetwork-errors">
- <errors xmlns=""/>
- </xf:instance>
+ <xf:instance id="geonetwork-infos">
+ <infos xmlns=""/>
+ </xf:instance>
- <xf:instance id="geonetwork-infos">
- <infos xmlns=""/>
- </xf:instance>
+ <xf:submission action="{$geonetwork-location}/srv/en/metadata.update"
+ method="post"
+ id="submit-full"
+ ref="instance('geonetwork-request-update')"
+ replace="none"
+ validate="false"
+ >
+ </xf:submission>
- <xf:submission action="{$geonetwork-location}/srv/en/metadata.update"
- method="post"
- id="submit-full"
- ref="instance('geonetwork-request-update')"
- replace="none"
- validate="false"
- >
- </xf:submission>
+ <xf:submission action="{$geonetwork-location}/srv/en/metadata.update.validate"
+ method="post"
+ id="submit-validate"
+ ref="instance('geonetwork-request-update')"
+ replace="none"
+ validate="false"
+ >
+ </xf:submission>
- <xf:submission action="{$geonetwork-location}/srv/en/metadata.update.validate"
- method="post"
- id="submit-validate"
- ref="instance('geonetwork-request-update')"
- replace="none"
- validate="false"
- >
- </xf:submission>
+ <xforms:action ev:event="xforms-submit" ev:observer="submit-full" >
+ <xf:delete nodeset="instance('geonetwork-errors')/*"/>
+ <xf:delete nodeset="instance('geonetwork-infos')/*"/>
+ </xforms:action>
+ <xf:action ev:event="xforms-submit-done" ev:observer="submit-full">
+ <xf:setvalue ref="instance('geonetwork-request-update')/version" value=". + 1"/>
+ <xf:insert context="instance('geonetwork-infos')" nodeset="//mesage[@id='saved']" origin="instance('geonetwork-info-messages')"/>
+ </xf:action>
+ <xf:action ev:event="xforms-submit-error" ev:observer="submit-full">
+ <xf:insert context="instance('geonetwork-errors')" nodeset="*" origin="event('response-body')"/>
+ </xf:action>
- <xforms:action ev:event="xforms-submit" ev:observer="submit-full" >
- <xf:delete nodeset="instance('geonetwork-errors')/*"/>
- <xf:delete nodeset="instance('geonetwork-infos')/*"/>
- </xforms:action>
- <xf:action ev:event="xforms-submit-done" ev:observer="submit-full">
- <xf:setvalue ref="instance('geonetwork-request-update')/version" value=". + 1"/>
- <xf:insert context="instance('geonetwork-infos')" nodeset="//mesage[@id='saved']" origin="instance('geonetwork-info-messages')"/>
- </xf:action>
- <xf:action ev:event="xforms-submit-error" ev:observer="submit-full">
- <xf:insert context="instance('geonetwork-errors')" nodeset="*" origin="event('response-body')"/>
- </xf:action>
+ <xforms:action ev:event="xforms-submit" ev:observer="submit-validate" >
+ <xf:delete nodeset="instance('geonetwork-errors')/*"/>
+ <xf:delete nodeset="instance('geonetwork-infos')/*"/>
+ <xf:setvalue ref="instance('geonetwork-request-update')/version" value=". + 1"/>
+ </xforms:action>
+ <xf:action ev:event="xforms-submit-done" ev:observer="submit-validate">
+ <xf:insert context="instance('geonetwork-infos')" nodeset="*">test</xf:insert>
+ <xf:setvalue ref="instance('geonetwork-request-update')/version" value=". - 1"/>
+ </xf:action>
+ <xf:action ev:event="xforms-submit-error" ev:observer="submit-validate">
+ <xf:insert context="instance('geonetwork-errors')" nodeset="*" origin="event('response-body')"/>
+ <xf:setvalue ref="instance('geonetwork-request-update')/version" value=". - 1"/>
+ </xf:action>
- <xforms:action ev:event="xforms-submit" ev:observer="submit-validate" >
- <xf:delete nodeset="instance('geonetwork-errors')/*"/>
- <xf:delete nodeset="instance('geonetwork-infos')/*"/>
- <xf:setvalue ref="instance('geonetwork-request-update')/version" value=". + 1"/>
- </xforms:action>
- <xf:action ev:event="xforms-submit-done" ev:observer="submit-validate">
- <xf:insert context="instance('geonetwork-infos')" nodeset="*">test</xf:insert>
- <xf:setvalue ref="instance('geonetwork-request-update')/version" value=". - 1"/>
- </xf:action>
- <xf:action ev:event="xforms-submit-error" ev:observer="submit-validate">
- <xf:insert context="instance('geonetwork-errors')" nodeset="*" origin="event('response-body')"/>
- <xf:setvalue ref="instance('geonetwork-request-update')/version" value=". - 1"/>
- </xf:action>
+ <!-- Show error pane only if there were any errors -->
+ <xf:bind nodeset="instance('geonetwork-errors')" relevant="count(instance('geonetwork-errors')/*) > 0" />
- <!-- Show error pane only if there were any errors -->
- <xf:bind nodeset="instance('geonetwork-errors')" relevant="count(instance('geonetwork-errors')/*) > 0" />
+ <!-- Show info pane only if there were any information messages -->
+ <xf:bind nodeset="instance('geonetwork-infos')" relevant="count(instance('geonetwork-infos')/*) > 0" />
- <!-- Show info pane only if there were any information messages -->
- <xf:bind nodeset="instance('geonetwork-infos')" relevant="count(instance('geonetwork-infos')/*) > 0" />
+ </xf:model>
+ </xh:head>
- </xf:model>
- </xh:head>
-
<xh:body>
<!-- pane for error messages -->
<xf:group ref="instance('geonetwork-errors')" id="geonetwork-error-pane" class="gn-group">
@@ -324,7 +321,7 @@
<xf:action ev:event="DOMActivate">
<!-- Replace data for new request -->
<xf:delete nodeset="instance('geonetwork-request-update')/data/*"/>
- <xf:insert context="instance('geonetwork-request-update')/data" nodeset="*" origin="instance('full')"/>
+ <xf:insert context="instance('geonetwork-request-update')/data" nodeset="*" origin="instance('metadata')"/>
</xf:action>
<!-- remove all geonet:child elements before submitting -->
@@ -338,7 +335,7 @@
<xf:action ev:event="DOMActivate">
<!-- Replace data for new request -->
<xf:delete nodeset="instance('geonetwork-request-update')/data/*"/>
- <xf:insert context="instance('geonetwork-request-update')/data" nodeset="*" origin="instance('full')"/>
+ <xf:insert context="instance('geonetwork-request-update')/data" nodeset="*" origin="instance('metadata')"/>
</xf:action>
<!-- remove all geonet:child elements before submitting -->
@@ -347,105 +344,63 @@
</xf:action>
</xf:submit>
+ <!--
<xh:p>
<xf:input ref="instance('geonetwork-request-update')/version">
<xf:label class="input-label">version</xf:label>
</xf:input>
</xh:p>
+ -->
- <xh:div class="gn-group">
- <xh:span class="group-label">Snippet Service</xh:span>
- <xh:p>
- <xf:input ref="instance('snippet-request')/grandparent">
- <xf:label class="input-label">Grandparent</xf:label>
- </xf:input>
- </xh:p>
- <xh:p>
- <xf:input ref="instance('snippet-request')/parent">
- <xf:label class="input-label">Parent</xf:label>
- </xf:input>
- </xh:p>
- <xh:p>
- <xf:input ref="instance('snippet-request')/child">
- <xf:label class="input-label">Child</xf:label>
- </xf:input>
- </xh:p>
- <xf:switch>
- <xf:case id="case-start"></xf:case>
- <xf:case id="case-busy">
- <p>Searching...</p>
- </xf:case>
- <xf:case id="case-submit-error">
- <p>Submission error!</p>
- </xf:case>
- <xf:case id="case-done">Done
- <xf:message level="modal">hmm</xf:message>
-
- </xf:case>
- </xf:switch>
- <xf:submit submission="get-snippet">
- <xf:label>Get Snippet</xf:label>
- </xf:submit>
- </xh:div>
- <!--
- -->
+ <!--
+ <xh:div class="gn-group">
+ <xh:span class="group-label">Snippet Service</xh:span>
+ <xh:p>
+ <xf:input ref="instance('snippet-request')/grandparent">
+ <xf:label class="input-label">Grandparent</xf:label>
+ </xf:input>
+ </xh:p>
+ <xh:p>
+ <xf:input ref="instance('snippet-request')/parent">
+ <xf:label class="input-label">Parent</xf:label>
+ </xf:input>
+ </xh:p>
+ <xh:p>
+ <xf:input ref="instance('snippet-request')/child">
+ <xf:label class="input-label">Child</xf:label>
+ </xf:input>
+ </xh:p>
+ <xf:switch>
+ <xf:case id="case-start"></xf:case>
+ <xf:case id="case-busy">
+ <p>Searching...</p>
+ </xf:case>
+ <xf:case id="case-submit-error">
+ <p>Submission error!</p>
+ </xf:case>
+ <xf:case id="case-done">Done
+ <xf:message level="modal">hmm</xf:message>
+
+ </xf:case>
+ </xf:switch>
+ <xf:submit submission="get-snippet">
+ <xf:label>Get Snippet</xf:label>
+ </xf:submit>
+ </xh:div>
+ -->
-<!--
-<xf:submit submission="switch-language-en"><xf:label>English</xf:label></xf:submit>
-<xf:submit submission="switch-language-fr"><xf:label>French</xf:label></xf:submit>
-
-<xh:p>
-
- <xf:trigger class="tab">
- <xf:label>Identification Info</xf:label>
- <xf:action xmlns:ev="
http://www.w3.org/2001/xml-events" ev:event="DOMActivate">
- <xf:toggle case="gmd:identificationInfo_case"/>
- </xf:action>
- </xf:trigger>
- <xf:trigger class="tab">
- <xf:label>Distribution Info</xf:label>
- <xf:action xmlns:ev="
http://www.w3.org/2001/xml-events" ev:event="DOMActivate">
- <xf:toggle case="gmd:distributionInfo_case"/>
- </xf:action>
- </xf:trigger>
- <xf:trigger class="tab">
- <xf:label>Spatial Info</xf:label>
- <xf:action xmlns:ev="
http://www.w3.org/2001/xml-events" ev:event="DOMActivate">
- <xf:toggle case="gmd:spatialRepresentationInfo_case"/>
- </xf:action>
- </xf:trigger>
- <xf:trigger class="tab">
- <xf:label>Reference System</xf:label>
- <xf:action xmlns:ev="
http://www.w3.org/2001/xml-events" ev:event="DOMActivate">
- <xf:toggle case="gmd:referenceSystemInfo_case"/>
- </xf:action>
- </xf:trigger>
- <xf:trigger class="tab">
- <xf:label>Metadata</xf:label>
- <xf:action xmlns:ev="
http://www.w3.org/2001/xml-events" ev:event="DOMActivate">
- <xf:toggle case="Metadata_case"/>
- </xf:action>
- </xf:trigger>
-</xh:p>
-
-<xf:switch>
--->
-
- <xf:group ref="/" class="group">
+ <xf:group ref="instance('metadata')/.." class="group">
<xf:label ref="instance('labels')/element[@name='{name()}']/label" class="group-label"/>
<xsl:call-template name="CallBack"/>
</xf:group>
-<!--
-</xf:switch>
--->
- <!--
- -->
- <widget:xforms-instance-inspector xmlns:widget="
http://orbeon.org/oxf/xml/widget"/>
+ <!--
+ <widget:xforms-instance-inspector xmlns:widget="
http://orbeon.org/oxf/xml/widget"/>
+ -->
- </xh:body>
+</xh:body>
</xhtml:html>
</xsl:template>
Modified: sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms.xsl
===================================================================
--- sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms.xsl 2008-07-17 07:38:46 UTC (rev 1406)
+++ sandbox/geonetworkui/BlueNetMEST/web/geonetwork/xsl/conversion/export/xml_xforms.xsl 2008-07-17 07:53:58 UTC (rev 1407)
@@ -185,7 +185,7 @@
<xsl:with-param name="counter" select="concat($counter,'-', $position)"/>
<xsl:with-param name="xpath-done" select="$xpath-new-done"/>
<xsl:with-param name="xpath-todo" select="$xpath-new-todo"/>
- <xsl:with-param name="custom" select="$config"/>
+ <xsl:with-param name="config" select="$config"/>
</xsl:apply-templates>
</xsl:when>
<!-- item -->
@@ -270,7 +270,7 @@
<xsl:with-param name="xpath-todo" select="$relative_xpath"/>
<!--
-->
- <xsl:with-param name="custom" select="$group"/>
+ <xsl:with-param name="group" select="$group"/>
<xsl:with-param name="label" select="@name"/>
</xsl:apply-templates>
</xsl:when>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
GeoNetwork-commit mailing list
GeoNetwork-commit@...
https://lists.sourceforge.net/lists/listinfo/geonetwork-commit