Debian Codegraph @

gavo/resources/web/xsl/useruws-job-to-html.xsl

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!-- A stylesheet to convert a UWS job-summary into HTML.
4
5 This stylesheet is made available under CC-0 by the GAVO project,
6 http://www.g-vo.org.
7 See http://creativecommons.org/publicdomain/zero/1.0/ for details.
8 -->
9
10 <xsl:stylesheet
11 xmlns:uws="http://www.ivoa.net/xml/UWS/v1.0"
12 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
13 xmlns:xlink="http://www.w3.org/1999/xlink"
14 xmlns="http://www.w3.org/1999/xhtml"
15 version="1.0">
16
17 <xsl:output method="xml"
18 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
19 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
20
21 <!-- Don't spill the content of unknown elements. -->
22 <xsl:template match="text()"/>
23
24 <xsl:template match="uws:parameter">
25 <xsl:choose>
26 <xsl:when test="@byReference">
27 <dt><xsl:value-of select="@id"/></dt>
28 <dd>
29 <a>
30 <xsl:attribute name="href">
31 <xsl:value-of select="."/>
32 </xsl:attribute>uploaded file</a>
33 </dd>
34 </xsl:when>
35 <xsl:otherwise>
36 <dt><xsl:value-of select="@id"/></dt>
37 <dd><input type="test">
38 <xsl:attribute name="name">
39 <xsl:value-of select="@id"/>
40 </xsl:attribute>
41 <xsl:attribute name="value">
42 <xsl:value-of select="text()"/>
43 </xsl:attribute>
44 </input></dd>
45 </xsl:otherwise>
46 </xsl:choose>
47 </xsl:template>
48
49 <xsl:template match="uws:parameters">
50 <dl>
51 <form method="POST">
52 <xsl:attribute name="action">
53 <xsl:value-of select="//uws:jobId"
54 />/parameters</xsl:attribute>
55 <xsl:apply-templates/>
56 <input type="submit" value="Update"/>
57 </form>
58 </dl>
59 </xsl:template>
60
61 <xsl:template match="/">
62 <html>
63 <head>
64 <title>UWS job <xsl:value-of select="/*/uws:jobId"/></title>
65 </head>
66 <body>
67 <h1>UWS job <xsl:value-of select="/*/uws:jobId"/></h1>
68 <xsl:apply-templates/>
69 </body>
70 </html>
71 </xsl:template>
72
73 <xsl:template match="uws:result">
74 <li>
75 <a>
76 <xsl:attribute name="href">
77 <xsl:value-of select="@xlink:href"/>
78 </xsl:attribute>
79 <xsl:value-of select="@id"/>
80 </a>
81 </li>
82 </xsl:template>
83
84 <xsl:template match="uws:results">
85 <dt><xsl:text>Current results:</xsl:text></dt>
86 <dd><ul>
87 <xsl:apply-templates/>
88 </ul></dd>
89 </xsl:template>
90
91 <xsl:template match="uws:job">
92 <xsl:variable name="jobId"><xsl:value-of select="uws:jobId"/></xsl:variable>
93 <xsl:variable name="phase"><xsl:value-of select="uws:phase"/></xsl:variable>
94 <dl>
95 <dt><xsl:text>Phase:</xsl:text></dt>
96 <dd><xsl:value-of select="uws:phase"/></dd>
97
98 <dt><xsl:text>Start time</xsl:text></dt>
99 <dd><xsl:value-of select="uws:startTime"/></dd>
100
101 <dt><xsl:text>End time:</xsl:text></dt>
102 <dd><xsl:value-of select="uws:endTime"/></dd>
103
104 <dt><xsl:text>Maximum duration:</xsl:text></dt>
105 <dd><xsl:value-of select="uws:executionDuration"/></dd>
106
107 <dt><xsl:text>Destruction time:</xsl:text></dt>
108 <dd><xsl:value-of select="uws:destruction"/></dd>
109
110 <dt>Parameters</dt>
111 <dd><xsl:apply-templates select="uws:parameters"/></dd>
112
113 <xsl:apply-templates select="uws:results"/>
114
115 <xsl:if test="$phase='ERROR'">
116 <dt><xsl:text>Error message:</xsl:text></dt>
117 <dd><xsl:value-of select="uws:errorSummary/uws:message"/></dd>
118 </xsl:if>
119
120 </dl>
121 <xsl:if test="$phase='PENDING'">
122 <form method="post">
123 <xsl:attribute name="action">
124 <xsl:value-of select="$jobId"/>/phase</xsl:attribute>
125 <input type="hidden" name="PHASE" value="RUN"/>
126 <input type="submit" value="Execute"/>
127 </form>
128 </xsl:if>
129 <xsl:if test="$phase='EXECUTING' or $phase='QUEUED'">
130 <p>Use your browser's reload to update the phase information.</p>
131 <form method="post">
132 <xsl:attribute name="action">
133 <xsl:value-of select="$jobId"/>/phase</xsl:attribute>
134 <input type="hidden" name="PHASE" value="ABORT"/>
135 <input type="submit" value="Abort execution"/>
136 </form></xsl:if>
137 <p>
138 <form method="post">
139 <xsl:attribute name="action">
140 <xsl:value-of select="$jobId"/></xsl:attribute>
141 <input type="hidden" name="ACTION" value="DELETE"/>
142 <input type="submit" value="Delete job"/></form></p>
143 <p>
144 <form method="post">
145 <xsl:attribute name="action">
146 <xsl:value-of select="$jobId"/>/destruction</xsl:attribute>
147 <input type="submit" value="Change destruction time to"/>
148 <input type="text" name="DESTRUCTION">
149 <xsl:attribute name="value"><xsl:value-of select="uws:destruction"/></xsl:attribute>
150 <xsl:attribute name="size">23</xsl:attribute>
151 </input> </form> </p>
152 <p>
153 <a href="../uws.xml">List of known jobs</a></p>
154 </xsl:template>
155 </xsl:stylesheet>
156 <!-- vi:et:sw=2:sta
157 -->