Changeset 4027


Ignore:
Timestamp:
2003-03-28T10:17:03+12:00 (21 years ago)
Author:
kjdon
Message:

now displays small forms for additional enrich services that may be available for transforming the doc in some way

File:
1 edited

Legend:

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

    r4002 r4027  
    66
    77<xsl:include href="style.xsl"/>
     8<xsl:include href="service-params.xsl"/>
    89<xsl:output method="html"/>
    910<!--
     
    1112-->
    1213
    13 <!--
    14 <xsl:template match="page">
    15   <xsl:variable name="collName" select="pageRequest/paramList/param[@name='c']/@value"/>
     14  <xsl:template name="pageHead">
     15    <xsl:variable name="docID" select="ancestor::page/pageResponse/document/@selectedNode"/>
     16    <head>
     17      <title><xsl:for-each select='ancestor::page/pageResponse/document/descendant::documentNode[@nodeID=$docID]/ancestor-or-self::documentNode'><xsl:if test='position()!=1'>::</xsl:if><xsl:value-of select="metadataList/metadata[@name='Title']"/></xsl:for-each></title>
     18      <xsl:call-template name="css-style"/>
     19    </head>
     20  </xsl:template>
    1621
    17   <html>
    18     <xsl:call-template name="greenstoneHead"/>
     22<!-- this is hard coded for GATE, should somehow do it dynamically-->
     23  <xsl:template name="css-style">
     24    <style type="text/css">
     25      <xsl:text disable-output-escaping="yes">
     26    span.Location {  display:inline; color : red }
     27    span.Person {  display:inline; color : green }
     28    span.Organization {  display:inline; color : yellow }
     29    span.Date {  display:inline; color : blue }
     30      </xsl:text>
     31    </style>
     32  </xsl:template>
    1933
    20     <body xsl:use-attribute-sets="body-style">
    21       <xsl:apply-templates select="pageResponse">
    22         <xsl:with-param name="collName" select="$collName"/>
    23       </xsl:apply-templates>
    24       <xsl:call-template name="greenstoneFooter"/>
    25     </body>
    26   </html>
    27 </xsl:template>
    28 -->
    29 
    30 <xsl:template match="pageResponse">
     34  <xsl:template match="pageResponse">
    3135    <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
    3236    <center>
    3337    <xsl:call-template name="collectionPageBanner">
    3438      <xsl:with-param name="collName" select="$collName"/>
    35      <!-- <xsl:with-param name="collIcon" select="collection/metadataList/metadata[@name='colIcon']"/>
    36       <xsl:with-param name="httpPath" select="collection/metadataList/metadata[@name='httpPath']"/>-->
    3739      </xsl:call-template>
    3840
     
    4648      </tr>
    4749    </table>
    48 
     50   
    4951    <!-- Display document content -->
    5052    <p/>
     
    6769  <td valign="top" align="left" width="200">
    6870    <img src="cover.jpg"/> <!-- TO DO -->
     71      <p />
     72      <!-- display the enrich service options here -->
     73      <xsl:apply-templates select="../serviceList">
     74    <xsl:with-param name="collName" select="$collName"/>
     75      </xsl:apply-templates>
     76
    6977  </td>
    7078  <td valign="top">
     
    119127</xsl:template>
    120128
     129  <xsl:template match="serviceList">
     130    <xsl:param name="collName"/>
     131    <xsl:variable name="docID" select="ancestor::page/pageRequest/paramList/param[@name='d']/@value"/>
     132    <xsl:variable name='library' select='ancestor::page/config/library_name'/>
     133    <xsl:for-each select="service">
     134      <table border='1' cellspacing='0'><tr><td>
     135      <p /><xsl:value-of select="display/name"/><p/>
     136      <form name="EnrichForm" method="get" action="/gsdl3/{$library}">
     137    <xsl:apply-templates select="paramList"/>
     138    <input type='hidden' name='a' value='d'/>
     139    <input type='hidden' name='d' value='{$docID}'/>
     140    <input type='hidden' name='c' value='{$collName}'/>
     141    <xsl:if test='ancestor::page/pageRequest/paramList/param[@name="sib"]'>
     142    <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>
     143    <input type='hidden' name='s' value='{@name}'/>
     144    <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
     145      </form>
     146      </td></tr></table>
     147    </xsl:for-each>
     148  </xsl:template>
     149
     150  <xsl:template match="paramList" mode="hidden">
     151    <xsl:for-each select="param">
     152      <input type='hidden' name='{@name}' value='{@value}'/><xsl:text>
     153    </xsl:text>
     154    </xsl:for-each>
     155  </xsl:template>
     156
     157  <xsl:template match="paramList">
     158  <p/><table>
     159  <xsl:for-each select="param">
     160    <xsl:choose>
     161      <xsl:when test="@type='multi'">
     162        <tr><td colspan='2'>
     163        <xsl:apply-templates select='.'/></td></tr>
     164      </xsl:when>
     165      <xsl:otherwise>
     166        <xsl:variable name="pname" select="@name"/>
     167        <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."/></td></tr>
     168      </xsl:otherwise>
     169    </xsl:choose>
     170  </xsl:for-each>
     171  </table>
     172</xsl:template>
    121173
    122174</xsl:stylesheet>
     175
     176
     177
     178
Note: See TracChangeset for help on using the changeset viewer.