1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <xsl:stylesheet version="1.0"
|
---|
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
---|
4 |
|
---|
5 | <xsl:include href="style.xsl"/>
|
---|
6 |
|
---|
7 | <xsl:output method="html"/>
|
---|
8 |
|
---|
9 | <xsl:template match="page">
|
---|
10 |
|
---|
11 | <xsl:variable name="clusterName"><xsl:value-of select="request/paramList/param[@name='action']/@value"/></xsl:variable>
|
---|
12 |
|
---|
13 | <html>
|
---|
14 | <xsl:call-template name="greenstoneHead"/>
|
---|
15 | <body xsl:use-attribute-sets="body-style">
|
---|
16 | <center>
|
---|
17 | <xsl:call-template name="clusterPageBanner">
|
---|
18 | <xsl:with-param name="clusterName" select="$clusterName"/>
|
---|
19 | </xsl:call-template>
|
---|
20 | <xsl:apply-templates select="request">
|
---|
21 | <xsl:with-param name="clusterName" select="$clusterName"/>
|
---|
22 | </xsl:apply-templates>
|
---|
23 | <xsl:apply-templates select="response">
|
---|
24 | <xsl:with-param name="clusterName" select="$clusterName"/>
|
---|
25 | </xsl:apply-templates>
|
---|
26 | </center>
|
---|
27 | <xsl:call-template name="greenstoneFooter"/>
|
---|
28 | </body>
|
---|
29 | </html>
|
---|
30 | </xsl:template>
|
---|
31 |
|
---|
32 | <xsl:template match="request">
|
---|
33 | <xsl:param name="clusterName">cluster-name</xsl:param>
|
---|
34 | <xsl:variable name='library' select='ancestor::page/config/library_name'/>
|
---|
35 | <xsl:variable name='subaction' select="paramList/param[@name='subaction']/@value"/>
|
---|
36 | <h3><xsl:value-of select="$subaction"/></h3><p/>
|
---|
37 | <form name="BuildForm" method="get" action="/gsdl3/{$library}">
|
---|
38 | <xsl:apply-templates select="description/paramList"/>
|
---|
39 | <input type="hidden" name="a" value="{$clusterName}"/>
|
---|
40 | <input type="hidden" name="sa" value="{$subaction}"/>
|
---|
41 | <input type="submit"><xsl:attribute name="value"><xsl:call-template name="text"><xsl:with-param name="key">service/go</xsl:with-param></xsl:call-template></xsl:attribute></input>
|
---|
42 | </form>
|
---|
43 | <xsl:call-template name="greenBar"/>
|
---|
44 | </xsl:template>
|
---|
45 |
|
---|
46 | <!-- need to look at generalising params between services -->
|
---|
47 | <xsl:template match="description/paramList">
|
---|
48 | <xsl:param name="cluster">build</xsl:param>
|
---|
49 | <p/><table width="537">
|
---|
50 | <xsl:for-each select="param">
|
---|
51 | <xsl:choose>
|
---|
52 | <!-- boolean params -->
|
---|
53 | <xsl:when test="@type= 'boolean'">
|
---|
54 | <tr><td><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template></td><td><select name="{@shortname}">
|
---|
55 | <option value="0"><xsl:if test="@default='0'"><xsl:attribute name='selected'></xsl:attribute></xsl:if><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/off</xsl:with-param></xsl:call-template></option>
|
---|
56 | <option value="1"><xsl:if test="@default='1'"><xsl:attribute name='selected'></xsl:attribute></xsl:if><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/on</xsl:with-param></xsl:call-template></option>
|
---|
57 | </select></td></tr>
|
---|
58 | </xsl:when>
|
---|
59 | <!-- integer params -->
|
---|
60 | <xsl:when test="@type= 'integer'">
|
---|
61 | <tr><td><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template></td><td><input type="text" name="{@shortname}" size="3" value="{@default}"/></td></tr>
|
---|
62 | </xsl:when>
|
---|
63 | <!-- enum params -->
|
---|
64 | <xsl:when test="@type= 'enum'">
|
---|
65 | <xsl:variable name="param" select="@name"/>
|
---|
66 | <xsl:variable name="current"><xsl:value-of select="@default"/></xsl:variable>
|
---|
67 | <tr><td><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template>
|
---|
68 | </td><td><select name="{@shortname}">
|
---|
69 | <xsl:for-each select="element">
|
---|
70 |
|
---|
71 | <option value="{@name}"><xsl:if test="@name=$current"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="$param"/>/<xsl:value-of select="@name"/></xsl:with-param></xsl:call-template></option>
|
---|
72 | </xsl:for-each>
|
---|
73 | </select></td></tr>
|
---|
74 | </xsl:when>
|
---|
75 | <!-- input params -->
|
---|
76 | <xsl:when test="@type= 'input'">
|
---|
77 | <tr><td><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template></td><td><input type="text" name="{@shortname}" size="50" value="{@default}"/></td></tr>
|
---|
78 | </xsl:when>
|
---|
79 | </xsl:choose>
|
---|
80 | </xsl:for-each>
|
---|
81 | </table>
|
---|
82 | </xsl:template>
|
---|
83 |
|
---|
84 | <xsl:template match="response">
|
---|
85 | <xsl:param name="clusterName">cluster-name</xsl:param>
|
---|
86 | <p/><xsl:value-of select="status"/>
|
---|
87 | <xsl:call-template name="greenBar"/>
|
---|
88 | </xsl:template>
|
---|
89 |
|
---|
90 |
|
---|
91 | </xsl:stylesheet>
|
---|