Changeset 4253 for trunk/gsdl3/web/interfaces/default/transform
- Timestamp:
- 2003-05-08T15:40:07+12:00 (21 years ago)
- Location:
- trunk/gsdl3/web/interfaces/default/transform
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/web/interfaces/default/transform/applet.xsl
r4047 r4253 9 9 <xsl:template name="pageHead"> 10 10 <head> 11 <title><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title> 11 <title> 12 <xsl:value-of select="ancestor-or-self::page/pageResponse/applet"/> 13 </title> 12 14 </head> 13 15 </xsl:template> 14 16 15 17 <xsl:template match="pageResponse"> 16 <xsl:variable name="collName"><xsl:value-of select=" ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>18 <xsl:variable name="collName"><xsl:value-of select="../pageRequest/paramList/param[@name='c']/@value"/></xsl:variable> 17 19 <center> 18 20 <xsl:call-template name="collectionPageBanner"> -
trunk/gsdl3/web/interfaces/default/transform/basicquery.xsl
r4146 r4253 1 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 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"/> 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 <xsl:include href="querytools.xsl"/> 8 9 <xsl:output method="html"/> 9 10 10 11 <xsl:template name="pageHead"> 11 12 <head> 12 <title><xsl:call-template name="text"><xsl:with-param name="key"> nzdl</xsl:with-param></xsl:call-template></title>13 <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title> 13 14 </head> 14 15 </xsl:template> … … 16 17 <xsl:template match="pageResponse"> 17 18 <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable> 18 19 <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/> 19 20 <center> 20 21 <xsl:call-template name="collectionPageBanner"> … … 26 27 </center> 27 28 28 <!-- Process the query response -->29 29 <xsl:if test="documentNodeList"> 30 <xsl:call-template name="greenBarResults"/> 31 32 <!-- If query term information is available, display it --> 30 <xsl:call-template name="query-response"> 31 <xsl:with-param name="library" select="$library"/> 32 <xsl:with-param name="collName" select="$collName"/> 33 </xsl:call-template> 34 </xsl:if> 35 <xsl:call-template name="greenBar"/> 36 </xsl:template> 37 38 <xsl:template name="query-response"> 39 <xsl:param name="library"/> 40 <xsl:param name="collName"/> 41 <xsl:call-template name="greenBarResults"/> 42 43 <!-- If query term information is available, display it --> 44 <br/> 45 <xsl:if test="count(termList/term) > 0"> 46 <small> 47 <xsl:call-template name="text"><xsl:with-param name="key">query.wordcount</xsl:with-param></xsl:call-template> 48 <xsl:for-each select="termList/term"> 49 <xsl:if test="position() > 1">, </xsl:if> 50 <xsl:value-of select="@name"/>: <xsl:value-of select="@freq"/> 51 </xsl:for-each> 52 </small> 33 53 <br/> 34 <xsl:if test="count(termList/term) > 0"> 35 <small> 36 <xsl:call-template name="text"><xsl:with-param name="key">query.wordcount</xsl:with-param></xsl:call-template> 37 <xsl:for-each select="termList/term"> 38 <xsl:if test="position() > 1">, </xsl:if> 39 <xsl:value-of select="@name"/>: <xsl:value-of select="@freq"/> 40 </xsl:for-each> 41 </small> 42 <br/> 43 </xsl:if> 44 45 <!-- If the number of matching documents is known, display it --> 46 <xsl:variable name="numDocsMatched" select="metadataList/metadata[@name='numDocsMatched']/@value"/> 47 <xsl:if test="$numDocsMatched"> 48 <xsl:choose> 49 <xsl:when test="$numDocsMatched='0'"> 50 <xsl:call-template name="text"><xsl:with-param name="key">query.nodocsmatch</xsl:with-param></xsl:call-template> 51 </xsl:when> 52 <xsl:when test="$numDocsMatched='1'"> 53 <xsl:call-template name="text"><xsl:with-param name="key">query.onedocsmatch</xsl:with-param></xsl:call-template> 54 </xsl:when> 55 <xsl:otherwise> 56 <xsl:value-of select="$numDocsMatched"/> documents matched the query. 57 </xsl:otherwise> 58 </xsl:choose> 59 </xsl:if> 60 61 <!-- Display the matching documents --> 62 <table> 63 <tr valign="top"> 64 <xsl:for-each select="documentNodeList/documentNode"> 54 </xsl:if> 55 56 <!-- If the number of matching documents is known, display it --> 57 <xsl:variable name="numDocsMatched" select="metadataList/metadata[@name='numDocsMatched']/@value"/> 58 <xsl:if test="$numDocsMatched"> 59 <xsl:choose> 60 <xsl:when test="$numDocsMatched='0'"> 61 <xsl:call-template name="text"><xsl:with-param name="key">query.nodocsmatch</xsl:with-param></xsl:call-template> 62 </xsl:when> 63 <xsl:when test="$numDocsMatched='1'"> 64 <xsl:call-template name="text"><xsl:with-param name="key">query.onedocsmatch</xsl:with-param></xsl:call-template> 65 </xsl:when> 66 <xsl:otherwise> 67 <xsl:value-of select="$numDocsMatched"/> documents matched the query. 68 </xsl:otherwise> 69 </xsl:choose> 70 </xsl:if> 71 72 <!-- next and prev links at top of results--> 73 <xsl:call-template name="result-navigation"><xsl:with-param name="library" select="$library"/></xsl:call-template> 74 <!-- Display the matching documents --> 75 <xsl:variable name="hp"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable> 76 <xsl:variable name="hn" select="ancestor::page/pageRequest/paramList/param[@name='hn']/@value"/> 77 <table> 78 <tr valign="top"> 79 <xsl:for-each select="documentNodeList/documentNode"> 80 <xsl:if test="position()> (($hn - 1)*$hp) and position() <= ($hn * $hp)"> 65 81 <tr> 66 82 <xsl:apply-templates select="."> … … 68 84 </xsl:apply-templates> 69 85 </tr> 70 </xsl:for-each> 71 </tr> 72 </table> 73 </xsl:if> 74 <xsl:call-template name="greenBar"/> 86 </xsl:if> 87 </xsl:for-each> 88 </tr> 89 </table> 90 <!-- next and prev links at bottom of page --> 91 <xsl:call-template name="result-navigation"><xsl:with-param name="library" select="$library"/></xsl:call-template> 75 92 </xsl:template> 76 93 77 94 78 <xsl:template match="service">79 <xsl:param name="collName">coll-name</xsl:param>80 <xsl:variable name="subaction"><xsl:value-of select="../request/@subaction"/></xsl:variable>81 <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>82 <h3><xsl:value-of select="display/name"/></h3><p/>83 <form name="QueryForm" method="get" action="/gsdl3/{$library}">84 <xsl:apply-templates select="paramList"/>85 <input type="hidden" name="a" value="q"/>86 <input type="hidden" name="sa" value="{$subaction}"/>87 <input type="hidden" name="rt" value="r"/>88 <input type="hidden" name="s" value="{@name}"/>89 <input type="hidden" name="c" value="{$collName}"/>90 <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>91 </form>92 </xsl:template>93 95 94 95 <xsl:template match="paramList"> 96 <xsl:template match="service"> 97 <xsl:param name="collName"/> 98 <xsl:variable name="subaction" select="../pageRequest/@subaction"/> 99 <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/> 100 <h3><xsl:value-of select="display/name"/></h3><p/> 101 <form name="QueryForm" method="get" action="/gsdl3/{$library}"> 102 <input type="hidden" name="a" value="q"/> 103 <input type="hidden" name="sa" value="{$subaction}"/> 104 <input type="hidden" name="rt" value="r"/> 105 <input type="hidden" name="s" value="{@name}"/> 106 <input type="hidden" name="c" value="{$collName}"/> 107 <input type="hidden" name="hn" value="1"/> 108 <xsl:apply-templates select="paramList"/> 109 <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input> 110 </form> 111 </xsl:template> 112 113 114 <xsl:template match="paramList"> 115 <p/><table width="537"> 116 <xsl:for-each select="param"> 117 <xsl:choose> 118 <xsl:when test="@type='multi'"> 119 <tr><td colspan='2'> 120 <xsl:apply-templates select='.'/></td></tr> 121 </xsl:when> 122 <xsl:otherwise> 123 <xsl:variable name="pname" select="@name"/> 124 <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> 125 <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> 126 </xsl:otherwise> 127 </xsl:choose> 128 </xsl:for-each> 129 </table> 130 </xsl:template> 131 132 133 <!-- a param list that puts params in pairs- wont work as is with new 134 param handling stuff --> 135 <!-- 136 <xsl:template match="paramList"> 96 137 <p/><table width="537"> 97 <xsl:for-each select="param"> 98 <xsl:choose> 99 <xsl:when test="@type='multi'"> 100 <tr><td colspan='2'> 101 <xsl:apply-templates select='.'/></td></tr> 102 </xsl:when> 103 <xsl:otherwise> 104 <xsl:variable name="pname" select="@name"/> 105 <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."/></td></tr> 106 </xsl:otherwise> 107 </xsl:choose> 108 </xsl:for-each> 109 </table> 110 </xsl:template> 111 112 113 <!-- a param list that puts params in pairs- wont work as is with new 114 param handling stuff --> 115 <!-- 116 <xsl:template match="paramList"> 117 <p/><table width="537"> 118 <xsl:choose> 119 <xsl:when test='count(param)>4'> 120 <xsl:for-each select="param[position() mod 2 = 1]"> 121 <tr><xsl:apply-templates select="."/> 122 <xsl:if test="following-sibling::param[1]"><xsl:apply-templates select='following-sibling::param[1]'/></xsl:if></tr> 138 <xsl:choose> 139 <xsl:when test='count(param)>4'> 140 <xsl:for-each select="param[position() mod 2 = 1]"> 141 <tr><xsl:apply-templates select="."/> 142 <xsl:if test="following-sibling::param[1]"><xsl:apply-templates select='following-sibling::param[1]'/></xsl:if></tr> 123 143 </xsl:for-each> 124 144 </xsl:when> 125 <xsl:otherwise>126 <xsl:for-each select="param">127 <tr><xsl:apply-templates select='.'/></tr>145 <xsl:otherwise> 146 <xsl:for-each select="param"> 147 <tr><xsl:apply-templates select='.'/></tr> 128 148 </xsl:for-each> 129 149 </xsl:otherwise> … … 131 151 </table> 132 152 </xsl:template> 133 -->153 --> 134 154 135 136 <xsl:template match="documentNode"> 137 <xsl:param name="collName"/> 138 <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/> 139 140 <td> 141 <a><xsl:attribute name="href"><xsl:value-of select='$library'/>?a=d&c=<xsl:value-of select='$collName'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&sib=1</xsl:if></xsl:attribute> 142 <xsl:apply-templates select="." mode="displayNodeIcon"/> 143 </a> 144 </td> 145 <td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td> 146 </xsl:template> 147 148 149 <xsl:template name="greenBarResults"> 150 <p/> 151 <center> 152 <img src="interfaces/default/images/qryresb.gif" width="537" height="17"/> 153 </center> 154 </xsl:template> 155 155 <!-- the default doc node template for the query results --> 156 <!-- eventually shouldn't need sib arg here --> 157 <xsl:template match="documentNode"> 158 <xsl:param name="collName"/> 159 <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/> 160 161 <td> 162 <a><xsl:attribute name="href"><xsl:value-of select='$library'/>?a=d&c=<xsl:value-of select='$collName'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&sib=1</xsl:if></xsl:attribute> 163 <xsl:apply-templates select="." mode="displayNodeIcon"/> 164 </a> 165 </td> 166 <td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td> 167 </xsl:template> 168 169 170 <xsl:template name="greenBarResults"> 171 <p/> 172 <center> 173 <img src="interfaces/default/images/qryresb.gif" width="537" height="17"/> 174 </center> 175 </xsl:template> 176 156 177 </xsl:stylesheet> -
trunk/gsdl3/web/interfaces/default/transform/config_format.xsl
r4047 r4253 27 27 <xsl:if test=".//gsf:link"> 28 28 <xslt:param name="collName">coll-name</xslt:param> 29 <xslt:variable name='library' select='ancestor::page/ config/library_name'/>29 <xslt:variable name='library' select='ancestor::page/pageExtra/config/library_name'/> 30 30 </xsl:if> 31 31 <xsl:apply-templates/> … … 36 36 <xsl:choose> 37 37 <xsl:when test="@type='classifier'"> 38 <a><xslt:attribute name='href'><xslt:value-of select='$library'/>?a=b& s=<xslt:value-of select='$serviceName'/>&c=<xslt:value-of select='$collName'/>&cl=<xslt:value-of select='@nodeID'/><xslt:if test="classifierNode|documentNode">.pr</xslt:if></xslt:attribute>38 <a><xslt:attribute name='href'><xslt:value-of select='$library'/>?a=b&rt=r&s=<xslt:value-of select='$serviceName'/>&c=<xslt:value-of select='$collName'/>&cl=<xslt:value-of select='@nodeID'/><xslt:if test="classifierNode|documentNode">.pr</xslt:if><xslt:if test="parent::node()[@orientation='horizontal']">&sib=1</xslt:if></xslt:attribute> 39 39 <xsl:apply-templates/> 40 40 </a> … … 62 62 63 63 <xsl:template match="gsf:metadata"> 64 <xslt:value-of><xsl:attribute name="select">metadataList/metadata[@name='<xsl:value-of select="@name"/>']</xsl:attribute></xslt:value-of> 64 <xsl:choose> 65 <xsl:when test="@select='parent'"> 66 <xslt:value-of><xsl:attribute name="select">parent::node()/metadataList/metadata[@name='<xsl:value-of select="@name"/>']</xsl:attribute></xslt:value-of> 67 </xsl:when> 68 <xsl:when test="@select='ancestors'"> 69 Ancestor metadata 70 </xsl:when> 71 <xsl:otherwise> 72 <xslt:value-of><xsl:attribute name="select">metadataList/metadata[@name='<xsl:value-of select="@name"/>']</xsl:attribute></xslt:value-of> 73 </xsl:otherwise> 74 </xsl:choose> 65 75 </xsl:template> 66 76 -
trunk/gsdl3/web/interfaces/default/transform/document.xsl
r4146 r4253 20 20 </xsl:template> 21 21 22 <!-- this is hard coded for GATE, should somehow do it dynamically-->22 <!-- this is hard coded for GATE, should somehow do it dynamically--> 23 23 <xsl:template name="css-style"> 24 24 <style type="text/css"> … … 31 31 </style> 32 32 </xsl:template> 33 33 34 34 <xsl:template match="pageResponse"> 35 35 <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable> 36 36 <center> 37 <xsl:call-template name="collectionPageBanner">38 37 <xsl:call-template name="collectionPageBanner"> 38 <xsl:with-param name="collName" select="$collName"/> 39 39 </xsl:call-template> 40 40 41 <!-- display the document --> 42 <xsl:call-template name="display-document"> 43 <xsl:with-param name="collName" select="$collName"/> 44 </xsl:call-template> 45 </center> 46 47 <xsl:call-template name="greenBar"/> 48 </xsl:template> 49 50 <xsl:template name="display-document"> 51 <xsl:param name="collName"/> 41 52 <!-- Display table of contents --> 42 53 <p/> 43 54 <table width="537" cellpadding="0" cellspacing="0"> 44 55 <tr> 45 <xsl:apply-templates select="document"> 46 <xsl:with-param name="collName" select="$collName"/> 47 </xsl:apply-templates> 56 <!-- modes are table-of-contents and paged-naviagtion--> 57 <!--<xsl:apply-templates select="document" mode='paged-navigation'>--> 58 <xsl:apply-templates select="document" mode='table-of-contents'> 59 <xsl:with-param name="collName" select="$collName"/> 60 </xsl:apply-templates> 48 61 </tr> 49 62 </table> 50 63 51 64 <!-- Display document content --> 52 65 <xsl:apply-templates select="descendant::documentNode/nodeContent"/> 53 </center> 54 <xsl:call-template name="greenBar"/> 55 </xsl:template> 56 57 58 <xsl:template match="nodeContent"> 59 <p/> 60 <table width="537" cellpadding="0" cellspacing="0"> 61 <tr> 62 <td align="left"> 63 <xsl:for-each select="node()"> 64 <xsl:choose> 65 <xsl:when test="not(name())"><xsl:value-of select="." disable-output-escaping="yes"/></xsl:when> 66 <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise> 67 </xsl:choose> 68 </xsl:for-each> 69 </td> 70 </tr> 71 </table> 72 </xsl:template> 73 74 75 <xsl:template match="annotation"> 76 <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span></xsl:template> 77 78 79 <xsl:template match="document"> 80 <xsl:param name="collName"/> 66 </xsl:template> 67 68 <!-- the actual text/content --> 69 <xsl:template match="nodeContent"> 70 <p/> 71 <table width="537" cellpadding="0" cellspacing="0"> 72 <tr> 73 <td align="left"> 74 <xsl:for-each select="node()"> 75 <xsl:choose> 76 <xsl:when test="not(name())"><xsl:value-of select="." disable-output-escaping="yes"/></xsl:when> 77 <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise> 78 </xsl:choose> 79 </xsl:for-each> 80 </td> 81 </tr> 82 </table> 83 </xsl:template> 84 85 86 <xsl:template match="annotation"> 87 <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span></xsl:template> 88 89 <xsl:template match="document" mode="table-of-contents"> 90 <xsl:param name="collName"/> 81 91 <xsl:variable name="httpPath" select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/> 82 92 <xsl:variable name="assocfilepath" select="metadataList/metadata[@name='assocfilepath']"/> 83 <!-- Display table of contents --> 84 <td valign="top" align="left" width="200"> 93 <!-- Display cover image --> 94 <td valign="top" align="left" width="200"> 95 <img><xsl:attribute name='src'><xsl:value-of select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='assocfilepath']"/>/cover.jpg</xsl:attribute></img> 96 <p /> 97 <!-- display the enrich service options here --> 98 <xsl:apply-templates select="../serviceList"> 99 <xsl:with-param name="collName" select="$collName"/> 100 </xsl:apply-templates> 101 102 </td> 103 <!-- Display the hierarchical structure --> 104 <td valign="top"> 105 <xsl:apply-templates select="documentNode[@nodeID]"> 106 <xsl:with-param name="collName" select="$collName"/> 107 <xsl:with-param name="depth" select="0"/> 108 </xsl:apply-templates> 109 </td> 110 111 </xsl:template> 112 113 <!-- paged naviagtion : INCOMPLETE!!--> 114 <xsl:template match="document" mode="paged-navigation"> 115 <xsl:param name="collName"/> 116 <xsl:variable name="library" select="ancestor::page/config/library_name"/> 117 <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/> 118 <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/> 119 <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/> 120 <td valign="left"> 121 <table> 122 <xsl:choose> 123 <xsl:when test="$pos=-1"><!-- a doc --> 124 <tr valign="top"> 125 <td align="left"> 126 </td> 127 <td align="center"><center> 128 <b><xsl:value-of select="$children"/> pages.</b> 129 </center></td> 130 <td align="right"> 131 <a href="{$library}?a=d&c={$collName}&d={@selectedNode}.fc"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a> 132 </td> 133 </tr> 134 </xsl:when> 135 136 <xsl:otherwise> <!-- an internal node --> 137 <tr valign="top"> 138 <td align="left"> 139 <xsl:if test=" not ( $pos = 1 )"> 140 <a href="{$library}?a=d&c={$collName}&d={@selectedNode}.ps"><img src="interfaces/nzdl/images/less.gif" border="0" align="absbottom" /></a> 141 </xsl:if> 142 </td> 143 <td align="center"><center> 144 <b>Page <xsl:value-of select="$pos"/> of <xsl:value-of select="$length"/>.</b> 145 </center></td> 146 <td align="right"> 147 <xsl:if test=" not($pos = $length)"> 148 <a href="{$library}?a=d&c={$collName}&d={@selectedNode}.ns"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a> 149 </xsl:if> 150 </td> 151 </tr> 152 </xsl:otherwise> 153 </xsl:choose> 154 <tr valign="middle"> 155 <td align='center' valign='top' colspan='3'> goto form 156 </td> 157 </tr> 158 </table> 159 </td> 160 <td valign="top" align="right" width="200"> 85 161 <img><xsl:attribute name='src'><xsl:value-of select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='assocfilepath']"/>/cover.jpg</xsl:attribute></img> 86 162 <p /> … … 89 165 <xsl:with-param name="collName" select="$collName"/> 90 166 </xsl:apply-templates> 91 92 </td> 93 <td valign="top"> 167 168 </td> 169 </xsl:template> 170 171 172 173 <xsl:template match="documentNode"> 174 <xsl:param name="collName"/> 175 <xsl:param name="depth"/> 176 <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/> 177 <xsl:variable name="space" select="$depth * 25"/> 178 179 <table> 180 <tr valign="top"> 181 <td> 182 <xsl:if test="not($depth = '0')"> 183 <img src="interfaces/default/images/space.gif" width="{$space}"/> 184 </xsl:if> 185 </td> 186 187 <!-- Display the appropriate image, depending on the node type --> 188 <td valign="top"> 189 <a><xsl:attribute name="href"><xsl:value-of select='$library'/>?a=d&c=<xsl:value-of select='$collName'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&sib=1</xsl:if></xsl:attribute> 190 <xsl:apply-templates select="." mode="displayNodeIcon"/> 191 </a> 192 </td> 193 194 <!-- Display associated title, bolded if the node has content --> 195 <td valign="top"> 196 <xsl:choose> 197 <xsl:when test="nodeContent"> 198 <b><xsl:value-of select="metadataList/metadata[@name='Title']"/></b> 199 </xsl:when> 200 <xsl:otherwise> 201 <xsl:value-of select="metadataList/metadata[@name='Title']"/> 202 </xsl:otherwise> 203 </xsl:choose> 204 </td> 205 </tr> 206 </table> 207 208 209 <!-- Apply recursively to the children of this node --> 94 210 <xsl:apply-templates select="documentNode[@nodeID]"> 95 211 <xsl:with-param name="collName" select="$collName"/> 96 <xsl:with-param name="depth" select=" 0"/>212 <xsl:with-param name="depth" select="$depth + 1"/> 97 213 </xsl:apply-templates> 98 </td> 99 </xsl:template> 100 101 102 <xsl:template match="documentNode"> 103 <xsl:param name="collName"/> 104 <xsl:param name="depth"/> 105 <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/> 106 <xsl:variable name="space" select="$depth * 25"/> 107 108 <table> 109 <tr valign="top"> 110 <td> 111 <xsl:if test="not($depth = '0')"> 112 <img src="interfaces/default/images/space.gif" width="{$space}"/> 113 </xsl:if> 114 </td> 115 116 <!-- Display the appropriate image, depending on the node type --> 117 <td valign="top"> 118 <a><xsl:attribute name="href"><xsl:value-of select='$library'/>?a=d&c=<xsl:value-of select='$collName'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&sib=1</xsl:if></xsl:attribute> 119 <xsl:apply-templates select="." mode="displayNodeIcon"/> 120 </a> 121 </td> 122 123 <!-- Display associated title, bolded if the node has content --> 124 <td valign="top"> 125 <xsl:choose> 126 <xsl:when test="nodeContent"> 127 <b><xsl:value-of select="metadataList/metadata[@name='Title']"/></b> 128 </xsl:when> 129 <xsl:otherwise> 130 <xsl:value-of select="metadataList/metadata[@name='Title']"/> 131 </xsl:otherwise> 132 </xsl:choose> 133 </td> 134 </tr> 135 </table> 136 137 <!-- Apply recursively to the children of this node --> 138 <xsl:apply-templates select="documentNode[@nodeID]"> 139 <xsl:with-param name="collName" select="$collName"/> 140 <xsl:with-param name="depth" select="$depth + 1"/> 141 </xsl:apply-templates> 142 </xsl:template> 214 </xsl:template> 215 216 143 217 144 218 <xsl:template match="serviceList"> … … 156 230 <xsl:if test='ancestor::page/pageRequest/paramList/param[@name="sib"]'> 157 231 <input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='ancestor::page/pageRequest/paramList/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if> 158 <input type='hidden' name='s' value='{@name}'/>232 <input type='hidden' name='s' value='{@name}'/> 159 233 <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input> 160 234 </form> -
trunk/gsdl3/web/interfaces/default/transform/process.xsl
r4146 r4253 8 8 <xsl:output method="html"/> 9 9 10 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title--> 10 11 <xsl:template name="pageHead"> 11 12 <head> 12 <title><xsl: call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title>13 <title><xsl:value-of select="ancestor-or-self::page/pageResponse/serviceCluster/metadataList/metadata[@name='Titles']"/><xsl:text> </xsl:text></title> 13 14 </head> 14 15 </xsl:template> … … 30 31 31 32 <xsl:template match="service"> 32 <xsl:param name="clusterName" >cluster-name</xsl:param>33 <xsl:param name="clusterName"/> 33 34 <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/> 34 35 <xsl:variable name='subaction' select="ancestor::page/pageRequest/@subaction"/> … … 50 51 51 52 52 <xsl:template match="paramList"> 53 <p/><table width="537"> 54 <xsl:for-each select="param"> 55 <xsl:choose> 56 <xsl:when test="@type='multi'"> 57 <tr><td colspan='2'> 58 <xsl:apply-templates select='.'/></td></tr> 59 </xsl:when> 60 <xsl:otherwise> 61 <xsl:variable name="pname" select="@name"/> 62 <tr valign="top"><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."/></td></tr> 63 </xsl:otherwise> 64 </xsl:choose> 65 </xsl:for-each> 66 </table> 67 </xsl:template> 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&rt=s&c=<xsl:value-of select='$clusterName'/>&s=<xsl:value-of select='ancestor::page/pageResponse/service/@name'/>&o=xml&ro=1&l=<xsl:value-of select='ancestor::page/pageRequest/@lang'/>&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> 68 80 69 <xsl:template match="status"> 70 <xsl:param name="clusterName">cluster-name</xsl:param> 71 <center/> 72 <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.<param name='library'><xsl:attribute name="value"><xsl:value-of select='ancestor::page/pageExtra/config/library_name'/>?a=pr&rt=s&c=<xsl:value-of select='$clusterName'/>&s=<xsl:value-of select='ancestor::page/pageResponse/service/@name'/>&o=xml&ro=1&l=<xsl:value-of select='ancestor::page/pageRequest/@lang'/>&pid=<xsl:value-of select="@pid"/><xsl:apply-templates select="ancestor::page/pageResponse/service/paramList" mode="cgi"/></xsl:attribute></param><param name='initial_text'><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></param><param name='initial_code'><xsl:attribute name="value"><xsl:value-of select="@code"/></xsl:attribute></param></applet> 73 <xsl:call-template name="greenBar"/> 74 </xsl:template> 75 76 <!-- puts all the params into a=p&p=h type form - need to change this if use 81 <!-- puts all the params into a=p&p=h type form - need to change this if use 77 82 multi params in a process type service --> 78 <xsl:template match="paramList" mode="cgi"> 79 <xsl:for-each select="param">&<xsl:value-of select="@shortname"/>=<xsl:value-of select="@default"/></xsl:for-each> 80 </xsl:template> 81 83 <xsl:template match="paramList" mode="cgi"> 84 <xsl:for-each select="param"> 85 <xsl:variable name='pname' select="@name"/> 86 <xsl:text>&</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 82 89 </xsl:stylesheet> 83 90 -
trunk/gsdl3/web/interfaces/default/transform/service-params.xsl
r4047 r4253 10 10 <!-- boolean params --> 11 11 <xsl:template match="param[@type='boolean']"> 12 <xsl:param name="default" select="@default"/>12 <xsl:param name="default"/> 13 13 <xsl:variable name="pname" select='@name'/> 14 14 <xsl:variable name='pdisplay' select='ancestor::service/display/param[@name=$pname]'/> … … 21 21 <!-- integer params --> 22 22 <xsl:template match="param[@type='integer']"> 23 <xsl:param name="default" select="@default"/>23 <xsl:param name="default"/> 24 24 <input type="text" name="{@shortname}" size="3" value="{$default}"/> 25 25 </xsl:template> … … 27 27 <!-- single selection enum params --> 28 28 <xsl:template match="param[@type='enum_single']"> 29 <xsl:param name="default" select="@default"/>29 <xsl:param name="default"/> 30 30 <xsl:variable name="pname"><xsl:value-of select='@name'/></xsl:variable> 31 31 <xsl:variable name='pdisplay' select='ancestor::service/display/param[@name=$pname]'/> 32 <xsl:variable name="current"><xsl:value-of select="$default"/></xsl:variable> 33 <select name="{@shortname}"> 34 <xsl:for-each select="option"> 35 <xsl:variable name='op_name' select='@name'/> 36 <option value="{@name}"><xsl:if test="@name=$current"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select='$pdisplay/option[@name=$op_name]'/></option> 37 </xsl:for-each> 38 </select> 32 <xsl:choose> 33 <xsl:when test="count(option) = 1"> 34 <xsl:value-of select='$pdisplay/option'/> 35 </xsl:when> 36 <xsl:otherwise> 37 <select name="{@shortname}"> 38 <xsl:for-each select="option"> 39 <xsl:variable name='op_name' select='@name'/> 40 <option value="{@name}"><xsl:if test="@name=$default"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:value-of select='$pdisplay/option[@name=$op_name]'/></option> 41 </xsl:for-each> 42 </select> 43 </xsl:otherwise> 44 </xsl:choose> 39 45 </xsl:template> 40 46 … … 55 61 <!-- string params --> 56 62 <xsl:template match="param[@type='string']"> 57 <xsl:param name="default" select="@default"/> 58 <xsl:variable name="pname" select='@name'/> 59 <input type="text" name="{@shortname}" size="30" value="{$default}"/> 63 <xsl:param name="default"/> 64 <input type="text" name="{@shortname}" size="50" value="{$default}"/> 60 65 </xsl:template> 61 66 62 67 <!-- large string params --> 63 68 <xsl:template match="param[@type='text']"> 64 <xsl:param name="default" select="@default"/> 65 <xsl:variable name="pname" select='@name'/> 69 <xsl:param name="default"/> 66 70 <textarea name="{@shortname}" cols="50" rows="3"><xsl:value-of select='$default'/></textarea> 67 71 </xsl:template> 72 68 73 <!-- multi params - params that are combinations of other params --> 69 74 <xsl:template match="param[@type='multi']"> … … 74 79 <xsl:for-each select="param"> 75 80 <xsl:variable name='pname' select='@name'/> 81 76 82 <td><xsl:value-of select="ancestor::service/display/param[@name=$pname]/name"/></td> 77 83 </xsl:for-each> … … 84 90 <xsl:param name="occurs">1</xsl:param> 85 91 <xsl:variable name="pos" select="@occurs - $occurs"/> 86 <xsl:choose> 87 <xsl:when test="default"> 88 <tr><xsl:for-each select="param"> 89 <td><xsl:if test="not(@ignore) or @ignore != $pos"> 92 <tr><xsl:for-each select="param"> 93 <td><xsl:if test="not(@ignore) or @ignore != $pos"> 90 94 <xsl:variable name="pname" select="@name"/> 91 <xsl:variable name="values"><xsl:value-of select="../default[@name=$pname]"/></xsl:variable> 92 <xsl:apply-templates select='.'><xsl:with-param name="default"><xsl:value-of select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($values, $occurs)"/></xsl:with-param></xsl:apply-templates> 93 </xsl:if></td> 94 </xsl:for-each></tr> 95 </xsl:when> 96 <xsl:otherwise> 97 <tr><xsl:for-each select="param"> 98 <td><xsl:if test="not(@ignore) or @ignore != $pos"> 99 <xsl:variable name="pname" select="@name"/> 100 <xsl:apply-templates select='.'/> 101 </xsl:if></td> 102 </xsl:for-each></tr> 103 </xsl:otherwise> 104 </xsl:choose> 95 <xsl:variable name="values" select="ancestor::page/pageRequest/paramList/param[@name=$pname]/@value"/> 96 <xsl:apply-templates select='.'><xsl:with-param name="default"><xsl:value-of select="java:org.greenstone.gsdl3.util.XSLTUtil.getNumberedItem($values, $pos)"/></xsl:with-param></xsl:apply-templates> 97 </xsl:if></td> 98 </xsl:for-each></tr> 105 99 <!-- recursively call this template to get multiple entries --> 106 100 <xsl:if test="$occurs > 1"> -
trunk/gsdl3/web/interfaces/default/transform/style.xsl
r4150 r4253 42 42 </xsl:attribute-set> 43 43 44 <!-- this should probably use a greenstone image rather than nzdl image -->45 44 <xsl:template name="greenstonePageBanner"> 46 45 <center> … … 129 128 <xsl:template match="documentNode" mode="displayNodeIcon"> 130 129 131 <!-- Root node: book icon (open or closed) -->132 <xsl:if test="@nodeType='root'">133 <xsl:choose>134 135 <img border="0" width="28" height="23"136 137 138 139 140 <img border="0" width="18" height="11"141 142 143 144 </xsl:choose>145 </xsl:if>146 147 <!-- Interior node: folder icon (open or closed) -->148 <xsl:if test="@nodeType='interior'">149 <xsl:choose>150 151 <img border="0" width="23" height="15"152 153 154 155 156 <img border="0" width="23" height="15"157 158 159 160 </xsl:choose>161 </xsl:if>162 130 <!-- Root node: book icon (open or closed) --> 131 <xsl:if test="@nodeType='root'"> 132 <xsl:choose> 133 <xsl:when test="documentNode"> 134 <img border="0" width="28" height="23" 135 src="interfaces/default/images/openbook.gif" 136 alt="Close this book"/> 137 </xsl:when> 138 <xsl:otherwise> 139 <img border="0" width="18" height="11" 140 src="interfaces/default/images/book.gif" 141 alt="Open this document and view contents"/> 142 </xsl:otherwise> 143 </xsl:choose> 144 </xsl:if> 145 146 <!-- Interior node: folder icon (open or closed) --> 147 <xsl:if test="@nodeType='interior'"> 148 <xsl:choose> 149 <xsl:when test="documentNode"> 150 <img border="0" width="23" height="15" 151 src="interfaces/default/images/openfldr.gif" 152 alt="Close this folder"/> 153 </xsl:when> 154 <xsl:otherwise> 155 <img border="0" width="23" height="15" 156 src="interfaces/default/images/clsdfldr.gif" 157 alt="Open this folder and view contents"/> 158 </xsl:otherwise> 159 </xsl:choose> 160 </xsl:if> 161 163 162 <!-- Leaf node: page icon --> 164 163 <xsl:if test="@nodeType='leaf'"> … … 181 180 182 181 the text elem to be processed must be in the form 183 <text name="query /about"/>182 <text name="query.about"/> 184 183 185 184 --> 186 185 187 <xsl:template name="text" match="text"> 188 <xsl:param name="key"><xsl:value-of select="@name"/></xsl:param> 189 <xsl:variable name="path">ancestor::page/pageExtra/display/<xsl:value-of select='$key'/></xsl:variable> 190 <xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path)"/></xsl:variable> 191 <xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when> 192 <xsl:otherwise> 193 194 <!-- no match found, output the name of the text string --> 195 _<xsl:value-of select="$key"/>_</xsl:otherwise> 196 </xsl:choose> 197 </xsl:template> 198 199 200 <!-- may not have to use this anymore--> 201 <xsl:template name="text-old" match="text-old"> 202 203 <xsl:param name="key"><xsl:value-of select="@name"/></xsl:param> 204 205 <!-- try the current language --> 206 207 <xsl:variable name="path1">ancestor::page/translate/current/text/<xsl:value-of select="$key"/></xsl:variable> 208 <xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path1)"/></xsl:variable> 209 <xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when> 210 <xsl:otherwise> 211 212 <!-- try the default language --> 213 <xsl:variable name="path2">ancestor::page/translate/default/text/<xsl:value-of select="$key"/></xsl:variable> 214 <xsl:variable name="string2"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path2)"/></xsl:variable> 215 <xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when> 216 <xsl:otherwise> 217 218 <!-- no match found, output the name of the text string --> 219 _<xsl:value-of select="$key"/>_</xsl:otherwise> 220 </xsl:choose> 221 </xsl:otherwise> 222 </xsl:choose> 223 </xsl:template> 224 186 <!-- should we look in the display element, or dynamically get from resource bundles - would this mean they are reloaded everytime??--> 187 <xsl:template name="text" match="text"> 188 <xsl:param name="key"><xsl:value-of select="@name"/></xsl:param> 189 <xsl:variable name="path">ancestor::page/pageExtra/display/<xsl:value-of select='$key'/></xsl:variable> 190 <xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path)"/></xsl:variable> 191 <xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when> 192 <xsl:otherwise> 193 <!-- no match found, output the name of the text string --> 194 _<xsl:value-of select="$key"/>_</xsl:otherwise> 195 </xsl:choose> 196 </xsl:template> 197 225 198 </xsl:stylesheet> -
trunk/gsdl3/web/interfaces/default/transform/system.xsl
r4102 r4253 7 7 <xsl:template name="pageHead"> 8 8 <head> 9 <title><xsl:call-template name="text"><xsl:with-param name="key"> nzdl</xsl:with-param></xsl:call-template></title>9 <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title> 10 10 </head> 11 11 </xsl:template>
Note:
See TracChangeset
for help on using the changeset viewer.