Changeset 4253


Ignore:
Timestamp:
2003-05-08T15:40:07+12:00 (21 years ago)
Author:
kjdon
Message:

lots of changes for lots of stuff

Location:
trunk/gsdl3/web/interfaces/default/transform
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/web/interfaces/default/transform/applet.xsl

    r4047 r4253  
    99  <xsl:template name="pageHead">
    1010    <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>
    1214    </head>
    1315  </xsl:template>
    1416
    1517  <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>
    1719    <center>
    1820      <xsl:call-template name="collectionPageBanner">
  • trunk/gsdl3/web/interfaces/default/transform/basicquery.xsl

    r4146 r4253  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    22<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"/>
    910
    1011  <xsl:template name="pageHead">
    1112    <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>
    1314    </head>
    1415  </xsl:template>
     
    1617  <xsl:template match="pageResponse">
    1718    <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'/>
    1920    <center>
    2021      <xsl:call-template name="collectionPageBanner">
     
    2627    </center>
    2728
    28     <!-- Process the query response -->   
    2929    <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>
    3353      <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()&gt; (($hn - 1)*$hp) and position() &lt;= ($hn * $hp)">
    6581        <tr>
    6682          <xsl:apply-templates select=".">
     
    6884          </xsl:apply-templates>
    6985        </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>
    7592  </xsl:template>
    7693
    7794
    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>
    9395
    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">
    96137  <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>
    123143</xsl:for-each>
    124144</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>
    128148</xsl:for-each>
    129149</xsl:otherwise>
     
    131151</table>
    132152</xsl:template>
    133 -->
     153  -->
    134154
    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&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&amp;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&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&amp;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 
    156177</xsl:stylesheet> 
  • trunk/gsdl3/web/interfaces/default/transform/config_format.xsl

    r4047 r4253  
    2727      <xsl:if test=".//gsf:link">
    2828    <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'/>
    3030      </xsl:if>
    3131      <xsl:apply-templates/>
     
    3636    <xsl:choose>
    3737      <xsl:when test="@type='classifier'">
    38     <a><xslt:attribute name='href'><xslt:value-of select='$library'/>?a=b&amp;s=<xslt:value-of select='$serviceName'/>&amp;c=<xslt:value-of select='$collName'/>&amp;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&amp;rt=r&amp;s=<xslt:value-of select='$serviceName'/>&amp;c=<xslt:value-of select='$collName'/>&amp;cl=<xslt:value-of select='@nodeID'/><xslt:if test="classifierNode|documentNode">.pr</xslt:if><xslt:if test="parent::node()[@orientation='horizontal']">&amp;sib=1</xslt:if></xslt:attribute>
    3939      <xsl:apply-templates/>
    4040    </a>
     
    6262
    6363  <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>
    6575  </xsl:template>
    6676
  • trunk/gsdl3/web/interfaces/default/transform/document.xsl

    r4146 r4253  
    2020  </xsl:template>
    2121
    22 <!-- this is hard coded for GATE, should somehow do it dynamically-->
     22  <!-- this is hard coded for GATE, should somehow do it dynamically-->
    2323  <xsl:template name="css-style">
    2424    <style type="text/css">
     
    3131    </style>
    3232  </xsl:template>
    33 
     33 
    3434  <xsl:template match="pageResponse">
    3535    <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
    3636    <center>
    37     <xsl:call-template name="collectionPageBanner">
    38       <xsl:with-param name="collName" select="$collName"/>
     37      <xsl:call-template name="collectionPageBanner">
     38    <xsl:with-param name="collName" select="$collName"/>
    3939      </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"/>
    4152    <!-- Display table of contents -->
    4253    <p/>
    4354    <table width="537" cellpadding="0" cellspacing="0">
    4455      <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>
    4861      </tr>
    4962    </table>
    50    
     63   
    5164    <!-- Display document content -->
    5265    <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"/>
    8191    <xsl:variable name="httpPath" select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
    8292    <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&amp;c={$collName}&amp;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&amp;c={$collName}&amp;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&amp;c={$collName}&amp;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">
    85161    <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>
    86162      <p />
     
    89165    <xsl:with-param name="collName" select="$collName"/>
    90166      </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&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&amp;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 -->
    94210    <xsl:apply-templates select="documentNode[@nodeID]">
    95211      <xsl:with-param name="collName" select="$collName"/>
    96       <xsl:with-param name="depth" select="0"/>
     212      <xsl:with-param name="depth" select="$depth + 1"/>
    97213    </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&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&amp;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
    143217
    144218  <xsl:template match="serviceList">
     
    156230    <xsl:if test='ancestor::page/pageRequest/paramList/param[@name="sib"]'>
    157231    <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}'/>
    159233    <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
    160234      </form>
  • trunk/gsdl3/web/interfaces/default/transform/process.xsl

    r4146 r4253  
    88  <xsl:output method="html"/> 
    99
     10  <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
    1011  <xsl:template name="pageHead">
    1112    <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>
    1314    </head>
    1415  </xsl:template>
     
    3031
    3132  <xsl:template match="service">
    32     <xsl:param name="clusterName">cluster-name</xsl:param>
     33    <xsl:param name="clusterName"/>
    3334    <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
    3435    <xsl:variable name='subaction' select="ancestor::page/pageRequest/@subaction"/>
     
    5051 
    5152
    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&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>
    6880
    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&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><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
    7782  multi params in a process type service -->
    78 <xsl:template match="paramList" mode="cgi">
    79 <xsl:for-each select="param">&amp;<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>&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 
    8289</xsl:stylesheet> 
    8390
  • trunk/gsdl3/web/interfaces/default/transform/service-params.xsl

    r4047 r4253  
    1010<!-- boolean params -->
    1111  <xsl:template match="param[@type='boolean']">
    12     <xsl:param name="default" select="@default"/>
     12    <xsl:param name="default"/>
    1313    <xsl:variable name="pname" select='@name'/>
    1414    <xsl:variable name='pdisplay' select='ancestor::service/display/param[@name=$pname]'/>
     
    2121  <!-- integer params -->
    2222  <xsl:template match="param[@type='integer']">
    23     <xsl:param name="default" select="@default"/>
     23    <xsl:param name="default"/>
    2424    <input type="text" name="{@shortname}" size="3" value="{$default}"/>
    2525  </xsl:template>
     
    2727  <!-- single selection enum params -->
    2828  <xsl:template match="param[@type='enum_single']">
    29     <xsl:param name="default" select="@default"/>
     29    <xsl:param name="default"/>
    3030    <xsl:variable name="pname"><xsl:value-of select='@name'/></xsl:variable>
    3131    <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>
    3945  </xsl:template>
    4046
     
    5561  <!-- string params -->
    5662  <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}"/>
    6065  </xsl:template>
    6166 
    6267  <!-- large string  params -->
    6368  <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"/>
    6670    <textarea name="{@shortname}" cols="50" rows="3"><xsl:value-of select='$default'/></textarea>
    6771  </xsl:template>
     72
    6873  <!-- multi params - params that are combinations of other params -->
    6974  <xsl:template match="param[@type='multi']">
     
    7479    <xsl:for-each select="param">
    7580      <xsl:variable name='pname' select='@name'/>
     81     
    7682      <td><xsl:value-of select="ancestor::service/display/param[@name=$pname]/name"/></td>
    7783    </xsl:for-each>
     
    8490    <xsl:param name="occurs">1</xsl:param>
    8591    <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">
    9094        <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>
    10599    <!-- recursively call this template to get multiple entries -->
    106100    <xsl:if test="$occurs &gt; 1">
  • trunk/gsdl3/web/interfaces/default/transform/style.xsl

    r4150 r4253  
    4242  </xsl:attribute-set>
    4343   
    44   <!-- this should probably use a greenstone image rather than nzdl image -->
    4544  <xsl:template name="greenstonePageBanner">
    4645    <center>
     
    129128  <xsl:template match="documentNode" mode="displayNodeIcon">
    130129   
    131   <!-- Root node: book icon (open or closed) -->
    132   <xsl:if test="@nodeType='root'">
    133     <xsl:choose>
    134       <xsl:when test="documentNode">
    135     <img border="0" width="28" height="23"
    136          src="interfaces/default/images/openbook.gif"
    137          alt="Close this book"/>
    138       </xsl:when>
    139       <xsl:otherwise>
    140     <img border="0" width="18" height="11"
    141          src="interfaces/default/images/book.gif"
    142          alt="Open this document and view contents"/>
    143       </xsl:otherwise>
    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       <xsl:when test="documentNode">
    151     <img border="0" width="23" height="15"
    152          src="interfaces/default/images/openfldr.gif"
    153          alt="Close this folder"/>
    154       </xsl:when>
    155       <xsl:otherwise>
    156     <img border="0" width="23" height="15"
    157          src="interfaces/default/images/clsdfldr.gif"
    158          alt="Open this folder and view contents"/>
    159       </xsl:otherwise>
    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   
    163162  <!-- Leaf node: page icon -->
    164163  <xsl:if test="@nodeType='leaf'">
     
    181180
    182181the text elem to be processed must be in the form
    183 <text name="query/about"/>
     182<text name="query.about"/>
    184183
    185184-->
    186185
    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 
    225198</xsl:stylesheet> 
  • trunk/gsdl3/web/interfaces/default/transform/system.xsl

    r4102 r4253  
    77    <xsl:template name="pageHead">
    88    <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>
    1010    </head>
    1111  </xsl:template>
Note: See TracChangeset for help on using the changeset viewer.