source: trunk/gsdl3/web/interfaces/default/transform/process.xsl@ 4255

Last change on this file since 4255 was 4253, checked in by kjdon, 21 years ago

lots of changes for lots of stuff

  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
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 <xsl:include href="service-params.xsl"/>
7
8 <xsl:output method="html"/>
9
10 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
11 <xsl:template name="pageHead">
12 <head>
13 <title><xsl:value-of select="ancestor-or-self::page/pageResponse/serviceCluster/metadataList/metadata[@name='Titles']"/><xsl:text> </xsl:text></title>
14 </head>
15 </xsl:template>
16
17 <xsl:template match="pageResponse">
18 <xsl:variable name="clusterName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
19 <center>
20 <xsl:call-template name="clusterPageBanner">
21 <xsl:with-param name="clusterName" select="$clusterName"/>
22 </xsl:call-template>
23 <xsl:apply-templates select="service">
24 <xsl:with-param name="clusterName" select="$clusterName"/>
25 </xsl:apply-templates>
26 <xsl:apply-templates select="status">
27 <xsl:with-param name="clusterName" select="$clusterName"/>
28 </xsl:apply-templates>
29 </center>
30 </xsl:template>
31
32 <xsl:template match="service">
33 <xsl:param name="clusterName"/>
34 <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
35 <xsl:variable name='subaction' select="ancestor::page/pageRequest/@subaction"/>
36 <xsl:variable name='action' select="ancestor::page/pageRequest/@action"/>
37 <xsl:variable name='lang' select="ancestor::page/pageRequest/@lang"/>
38 <h3><xsl:value-of select="display/name"/></h3><p/>
39 <form name="BuildForm" method="get" action="/gsdl3/{$library}">
40 <xsl:apply-templates select="paramList"/>
41 <input type="hidden" name="a" value="{$action}"/>
42 <input type="hidden" name="c" value="{$clusterName}"/>
43 <input type="hidden" name="sa" value="p"/>
44 <input type="hidden" name='l' value='{$lang}'/>
45 <input type="hidden" name="s" value="{@name}"/>
46 <input type="hidden" name="rt" value="r"/>
47 <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
48 </form>
49 <xsl:call-template name="greenBar"/>
50 </xsl:template>
51
52
53 <xsl:template match="paramList">
54 <p/><table width="537">
55 <xsl:for-each select="param">
56 <xsl:choose>
57 <xsl:when test="@type='multi'">
58 <tr><td colspan='2'>
59 <xsl:apply-templates select='.'/></td></tr>
60 </xsl:when>
61 <xsl:otherwise>
62 <xsl:variable name="pname" select="@name"/>
63 <xsl:variable name="pvalue"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose></xsl:variable>
64 <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."><xsl:with-param name="default" select="$pvalue"/></xsl:apply-templates></td></tr>
65 </xsl:otherwise>
66 </xsl:choose>
67 </xsl:for-each>
68 </table>
69 </xsl:template>
70
71 <xsl:template match="status">
72 <xsl:param name="clusterName"/>
73 <center/>
74 <applet code="org.greenstone.gsdl3.build.StatusDisplay.class" codebase='lib/java' archive='gsdl3.jar, xercesImpl.jar, jaxp.jar, xml-apis.jar' width='537' height='100'>The status display applet.
75 <param name='library'><xsl:attribute name="value"><xsl:value-of select='ancestor::page/pageExtra/config/library_name'/>?a=pr&amp;rt=s&amp;c=<xsl:value-of select='$clusterName'/>&amp;s=<xsl:value-of select='ancestor::page/pageResponse/service/@name'/>&amp;o=xml&amp;ro=1&amp;l=<xsl:value-of select='ancestor::page/pageRequest/@lang'/>&amp;pid=<xsl:value-of select="@pid"/><xsl:apply-templates select="ancestor::page/pageResponse/service/paramList" mode="cgi"/></xsl:attribute></param>
76 <param name='initial_text'><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></param>
77 <param name='initial_code'><xsl:attribute name="value"><xsl:value-of select="@code"/></xsl:attribute></param></applet>
78 <xsl:call-template name="greenBar"/>
79 </xsl:template>
80
81 <!-- puts all the params into a=p&p=h type form - need to change this if use
82 multi params in a process type service -->
83 <xsl:template match="paramList" mode="cgi">
84 <xsl:for-each select="param">
85 <xsl:variable name='pname' select="@name"/>
86 <xsl:text>&amp;</xsl:text><xsl:value-of select="@shortname"/>=<xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose></xsl:for-each>
87 </xsl:template>
88
89</xsl:stylesheet>
90
Note: See TracBrowser for help on using the repository browser.