Project

General

Profile

1
<?xml version="1.0" encoding="ISO-8859-1"?>
2

    
3
<!--
4
Description: parses an OGC context document to generate an array of DHTML layers.
5
Author:      adair
6
Licence:     LGPL as specified in http://www.gnu.org/copyleft/lesser.html .
7

    
8
$Id$
9
$Name$
10
-->
11

    
12
<xsl:stylesheet version="1.0" 
13
    xmlns:wps="http://www.opengis.net/wps"
14
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
15
		xmlns:ogc="http://www.opengis.net/ogc"
16
    xmlns:ows="http://www.opengis.net/ows"
17
		xmlns:gml="http://www.opengis.net/gml"
18
    xmlns:xlink="http://www.w3.org/1999/xlink">
19

    
20
  <xsl:output method="xml" omit-xml-declaration="no" encoding="utf-8" indent="yes"/>
21

    
22
  <!-- The coordinates of the DHTML Layer on the HTML page -->
23
  <xsl:param name="modelId"/>
24
  <xsl:param name="modelUrl"/>
25
  <xsl:param name="widgetId"/>
26
  <xsl:param name="toolId"/>
27
  
28
  <!-- template rule matching source root element -->
29
  <xsl:template match="/">
30
    <div>
31
    <p style="text-align:right;font:70%;margin:0"><a href="{$modelUrl}" target="modelXML">ExecuteProcess response</a></p>
32
    <xsl:apply-templates/>
33
    </div>
34
  </xsl:template>
35
    
36
  <xsl:template match="wps:ExecuteResponse">
37
    <xsl:param name="statusLocation"><xsl:value-of select="@statusLocation"/></xsl:param>
38
    Process results for <xsl:value-of select="wps:ProcessName"/>: 
39
    <xsl:apply-templates select="wps:Status">
40
      <xsl:with-param name="statusURL" select="$statusLocation"/>
41
    </xsl:apply-templates>
42
    
43
    <table cellspacing="0" border="1" width="100%">
44
      <tr>
45
        <th colspan="2" align="left">Outputs</th>
46
      </tr>
47
      <tr>
48
        <td>parameter</td>
49
        <td>value</td>
50
      </tr>
51
      <xsl:apply-templates select="wps:Output"/>
52
    </table>
53
    <table cellspacing="0" border="1" width="100%">
54
      <tr>
55
        <th colspan="2" align="left">Inputs</th>
56
      </tr>
57
      <tr>
58
        <td>parameter</td>
59
        <td>value</td>
60
      </tr>
61
      <xsl:apply-templates select="wps:Input"/>
62
    </table>
63
  </xsl:template>
64
  
65
  <xsl:template match="wps:Status[wps:ProcessSucceeded]">
66
    Succeeded.<br/>
67
  </xsl:template>
68

    
69
  <xsl:template match="wps:Status[wps:ProcessFailed]">
70
    Failed.<br/>
71
    Exception message:<xsl:value-of select="wps:ExceptionReport/ows:ExceptionText"/>
72
  </xsl:template>
73

    
74
  <xsl:template match="wps:Status[wps:ProcessAccepted]">
75
    <xsl:param name="statusURL"/>
76
    Accepted.<br/>
77
    <a href="javascript:loadExecuteResponse('{$statusURL}')">Check the status here</a> 
78
  </xsl:template>
79

    
80
  <xsl:template match="wps:Status[wps:ProcessStarted]">
81
    <xsl:param name="statusURL"/>
82
    Started.<br/>
83
    <a href="javascript:loadExecuteResponse('{$statusURL}')">Check the status here</a> 
84
  </xsl:template>
85

    
86
  <xsl:template match="wps:Input/wps:ParameterValue | wps:Output/wps:ParameterValue">
87
    <xsl:variable name="paramName"><xsl:value-of select="wps:Name"/></xsl:variable>
88
    <tr>
89
      <td>
90
        <dl class="params">
91
          <dt><xsl:value-of select="wps:Label"/></dt>
92
          <dd><xsl:value-of select="wps:Description"/></dd>
93
        </dl>
94
      </td>
95
      <td>
96
        <xsl:apply-templates select="wps:LiteralValue | wps:BoundingBox | wps:ComplexValue | wps:Reference">
97
          <xsl:with-param name="paramName" select="$paramName"/>
98
        </xsl:apply-templates>
99
      </td>
100
    </tr>
101
  </xsl:template>
102

    
103
  <xsl:template match="wps:LiteralValue">
104
    <xsl:param name="paramName"/>
105
    <span>type: <xsl:value-of select="@ows:type"/></span>
106
    <br/>
107
    <xsl:value-of select="$paramName"/>=<xsl:value-of select="."/>
108
  </xsl:template>
109
  
110
  <xsl:template match="wps:Reference">
111
    <xsl:param name="paramName"/>
112
    <xsl:variable name="outputUrl" select="@xlink:href"/>
113
    <a href="{$outputUrl}"><xsl:value-of select="$paramName"/></a>
114
    <br/>
115
    <span>format: <xsl:value-of select="ows:Format"/></span>
116
  </xsl:template>
117
  
118
  <xsl:template match="wps:BoundingBox">
119
    <xsl:param name="paramName"/>
120
    <xsl:value-of select="$paramName"/> set to:<br/>
121
    lower corner: <xsl:value-of select="ows:LowerCorner"/><br/>
122
    upper corner: <xsl:value-of select="ows:UpperCorner"/><br/>
123
    CRS: <xsl:value-of select="@crs"/>
124
  </xsl:template>
125

    
126
  <xsl:template match="wps:ComplexValue">
127
    <xsl:param name="paramName"/>
128
    No XSL template yet.
129
  </xsl:template>
130
  
131
  <xsl:template match="text()|@*"/>
132

    
133
</xsl:stylesheet>
(14-14/21)