Debian Codegraph @

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

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- A stylesheet turning datalink UWS job documents into something usable
3 in a web browser.
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="http://www.w3.org/1999/xhtml"
14 version="1.0">
15
16 <!-- A stylesheet to convert a UWS job-summary into HTML. -->
17
18 <xsl:output method="xml"
19 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
20 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
21
22 <!-- Don't spill the content of unknown elements. -->
23 <xsl:template match="text()"/>
24
25 <xsl:template match="uws:parameter">
26 <dt><xsl:value-of select="@id"/></dt>
27 <dd><xsl:value-of select="text()"/></dd>
28 </xsl:template>
29
30 <xsl:template match="uws:parameters">
31 <dl><xsl:apply-templates/></dl>
32 </xsl:template>
33
34 <xsl:template match="/">
35 <html>
36 <head>
37 <title>UWS job <xsl:value-of select="/*/uws:jobId"/></title>
38 </head>
39 <body>
40 <h1>UWS job <xsl:value-of select="/*/uws:jobId"/></h1>
41 <xsl:apply-templates/>
42 </body>
43 </html>
44 </xsl:template>
45
46 <xsl:template match="uws:job">
47 <xsl:variable name="jobId"><xsl:value-of select="uws:jobId"/></xsl:variable>
48 <xsl:variable name="phase"><xsl:value-of select="uws:phase"/></xsl:variable>
49 <dl>
50 <dt><xsl:text>Phase:</xsl:text></dt>
51 <dd><xsl:value-of select="uws:phase"/></dd>
52
53 <dt><xsl:text>Start time</xsl:text></dt>
54 <dd><xsl:value-of select="uws:startTime"/></dd>
55
56 <dt><xsl:text>End time:</xsl:text></dt>
57 <dd><xsl:value-of select="uws:endTime"/></dd>
58
59 <dt><xsl:text>Maximum duration:</xsl:text></dt>
60 <dd><xsl:value-of select="uws:executionDuration"/></dd>
61
62 <dt><xsl:text>Destruction time:</xsl:text></dt>
63 <dd><xsl:value-of select="uws:destruction"/></dd>
64
65 <dt>Parameters</dt>
66 <dd><xsl:apply-templates/></dd>
67
68 <xsl:if test="$phase='COMPLETED'">
69 <dt><xsl:text>Query results:</xsl:text></dt>
70 <dd><a>
71 <xsl:attribute name="href">
72 <xsl:value-of select="$jobId"/>/results/result</xsl:attribute>
73 Result</a></dd>
74 </xsl:if>
75
76 <xsl:if test="$phase='ERROR'">
77 <dt><xsl:text>Error message:</xsl:text></dt>
78 <dd><xsl:value-of select="uws:errorSummary/uws:message"/></dd>
79 </xsl:if>
80
81 </dl>
82 <xsl:if test="$phase='PENDING'">
83 <form method="post">
84 <xsl:attribute name="action">
85 <xsl:value-of select="$jobId"/>/phase</xsl:attribute>
86 <input type="hidden" name="PHASE" value="RUN"/>
87 <input type="submit" value="Execute"/>
88 </form>
89 </xsl:if>
90 <xsl:if test="$phase='EXECUTING' or $phase='QUEUED'">
91 <p>Use your browser's reload to update the phase information.</p>
92 <form method="post">
93 <xsl:attribute name="action">
94 <xsl:value-of select="$jobId"/>/phase</xsl:attribute>
95 <input type="hidden" name="PHASE" value="ABORT"/>
96 <input type="submit" value="Abort execution"/>
97 </form></xsl:if>
98 <p>
99 <form method="post">
100 <xsl:attribute name="action">
101 <xsl:value-of select="$jobId"/></xsl:attribute>
102 <input type="hidden" name="ACTION" value="DELETE"/>
103 <input type="submit" value="Delete job"/></form></p>
104 <p>
105 <form method="post">
106 <xsl:attribute name="action">
107 <xsl:value-of select="$jobId"/>/destruction</xsl:attribute>
108 <input type="submit" value="Change destruction time to"/>
109 <input type="text" name="DESTRUCTION">
110 <xsl:attribute name="value"><xsl:value-of select="uws:destruction"/></xsl:attribute>
111 <xsl:attribute name="size">23</xsl:attribute>
112 </input> </form> </p>
113 <p>
114 <a href="../dlasync">List of known jobs</a></p>
115 </xsl:template>
116 </xsl:stylesheet>
117 <!-- vi:et:sw=2:sta
118 -->