Ignore:
Timestamp:
06/16/09 13:48:50 (12 years ago)
Author:
oranfry
Message:

reorganising transform for new interface

Location:
greenstone3/trunk/web/interfaces/oran/transform
Files:
11 added
21 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/web/interfaces/oran/transform/util.xsl

    r18617 r19856  
    1414    <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/>     </xsl:variable>
    1515    <xsl:variable name="collections" select="/page/pageResponse/collectionList/collection"/>
    16    
     16
     17    <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable>
     18    <xsl:variable name="berryBasketOn" select="/page/pageRequest/paramList/param[@name='berrybasket' and @value='on']"/>
     19
    1720   
    1821    <xsl:template name="textDirectionAttribute">
    19     <xsl:attribute name="dir"><xsl:if test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:if></xsl:attribute>
    20     </xsl:template>
    21  
     22        <xsl:attribute name="dir">
     23            <xsl:choose>
     24                <xsl:when test="/page/@lang='ar' or /page/@lang='fa' or /page/@lang='he' or /page/@lang='ur' or /page/@lang='ps' or /page/@lang='prs'">rtl</xsl:when>
     25                <xsl:otherwise>ltr</xsl:otherwise>
     26            </xsl:choose>
     27        </xsl:attribute>
     28    </xsl:template> 
    2229 
    2330    <xsl:template name="defaultDividerBar">
     
    7885   
    7986    <xsl:template name="poweredByGS3TextBar">
    80             <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
    81   </xsl:template>
     87        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/>
     88    </xsl:template>
    8289 
    8390 
    8491    <!-- site home ....................................................................... -->
    8592
    86 <xsl:template name="homePageTitle">
     93<xsl:template name="siteHomePageTitle">
    8794 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
    8895<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/><xsl:text> </xsl:text>
     
    160167
    161168<!-- about page - collection home ....................................................................... -->
     169<xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
     170<xsl:param name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
     171<xsl:param name="pageType"/>
     172<xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
     173<xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
     174
     175
     176<xsl:template name="aboutCollectionPageTitle">
     177 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
     178<xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/><xsl:text> </xsl:text>
     179</xsl:template>
     180
     181   
     182<xsl:template name="collectionHomeLinkWithLogoIfAvailable">
     183<a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
     184      <xsl:choose>
     185        <xsl:when test="$this-element/displayItem[@name='icon']">
     186          <img border="0">
     187        <xsl:attribute name="src">
     188          <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
     189        </xsl:attribute>   
     190        <xsl:attribute name="alt">
     191          <xsl:value-of select="$this-element/displayItem[@name='name']"/>
     192        </xsl:attribute>
     193        <xsl:attribute name="title">
     194          <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
     195        </xsl:attribute>
     196          </img>
     197        </xsl:when>
     198        <xsl:otherwise>
     199          <xsl:value-of select="$this-element/displayItem[@name='name']"/>
     200        </xsl:otherwise>
     201      </xsl:choose>
     202    </a>
     203</xsl:template>
     204
     205
     206<xsl:template name="homeButtonTop">
     207<a href="{$library_name}?a=p&amp;sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
     208<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/></a>
     209</xsl:template>
     210
     211
     212<xsl:template name="helpButtonTop">
     213    <xsl:choose>
     214      <xsl:when test="$pageType='help'">
     215    <li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></a></li>
     216      </xsl:when>
     217      <xsl:otherwise>
     218    <li><a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
     219        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
     220      </a></li>
     221      </xsl:otherwise>
     222    </xsl:choose>
     223</xsl:template>
     224
     225
     226<xsl:template name="preferencesButtonTop">
     227    <xsl:choose>
     228      <xsl:when test="$pageType='pref'">
     229    <li><a><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a></li>
     230      </xsl:when>
     231      <xsl:otherwise>
     232    <li><a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
     233        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
     234      </a></li>
     235      </xsl:otherwise>
     236    </xsl:choose>
     237</xsl:template>
     238
     239<xsl:template name="servicesNavigationBar">
     240        <xsl:for-each select="$this-element/serviceList/service">
     241          <xsl:variable name="action"><xsl:choose>
     242          <xsl:when test="@name=$this-service">CURRENT</xsl:when>
     243          <xsl:when test="@type='query'">q</xsl:when>
     244          <xsl:when test="@type='browse'">b</xsl:when>
     245          <xsl:when test="@type='process'">pr</xsl:when>
     246          <xsl:when test="@type='applet'">a</xsl:when>
     247          <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
     248        </xsl:choose></xsl:variable>
     249          <xsl:choose>
     250        <xsl:when test="$action='CURRENT'">
     251          <li><a><xsl:value-of select="displayItem[@name='name']"/></a></li>
     252        </xsl:when>
     253        <xsl:when test="$action !='DO_NOT_DISPLAY'">
     254          <li><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></a></li>
     255        </xsl:when>
     256          </xsl:choose>
     257        </xsl:for-each>
     258</xsl:template>
     259
     260
     261<xsl:template name="collectionDescriptionTextAndServicesLinks">
     262    <xsl:apply-templates select="pageResponse/collection|serviceCluster"/>
     263</xsl:template>
     264
     265<xsl:template match="collection|serviceCluster">
     266      <xsl:value-of select="displayItem[@name='description']" disable-output-escaping="yes"/>
     267     
     268      <xsl:apply-templates select="serviceList">
     269    <xsl:with-param name="collName" select="$collName"/>
     270      </xsl:apply-templates>
     271</xsl:template>
     272
     273
     274 <xsl:template match="serviceList">
     275    <xsl:param name="collName"/>
     276    <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h3>
     277    <xsl:choose>
     278      <xsl:when test="service">
     279    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.servicehelp')"/>
     280      </xsl:when>
     281      <xsl:otherwise>
     282    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.noservices')"/>
     283      </xsl:otherwise>
     284    </xsl:choose>
     285   
     286   
     287    <xsl:if test="service">
     288      <ul id="servicelist">     
     289    <xsl:for-each select="service">
     290      <xsl:variable name="action"><xsl:choose>
     291          <xsl:when test="@type='query'">q</xsl:when>
     292          <xsl:when test="@type='browse'">b</xsl:when>
     293          <xsl:when test="@type='process'">pr</xsl:when>
     294          <xsl:when test="@type='applet'">a</xsl:when>
     295          <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
     296        </xsl:choose></xsl:variable>
     297      <xsl:if test="$action !='DO_NOT_DISPLAY'">
     298        <li><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/></li>
     299      </xsl:if>
     300    </xsl:for-each>
     301      </ul>
     302    </xsl:if>
     303  </xsl:template>
    162304
    163305
     
    166308<xsl:template name="collectionName">
    167309    <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/>
     310</xsl:template>
     311
     312<xsl:template name="collectionShortName">
     313    <xsl:value-of select="/page/pageResponse/collection/@name"/>
    168314</xsl:template>
    169315
     
    205351</xsl:template>
    206352
     353<!--
     354BERRY BASKET TEMPLATES
     355These get used on many different pages to add the
     356berry basket function to the site
     357-->
     358
     359<!-- put the drag&drop berry basket on the page -->
    207360<xsl:template name="berryBasket">
    208     <div id="berrybasket" class="hide" >
    209         <div id="baskethandle"><span></span></div>
    210         <div id ="berries"><span></span></div>
    211     </div>
    212 </xsl:template>
     361    <xsl:if test="$berryBasketOn">
     362        <div id="berrybasket" class="hide">
     363            <span>Berry Basket</span>
     364            <span id="berryBasketExpandCollapseLinks" style="display: none;">
     365                <a id="berryBasketExpandLink" href="javascript:showBasket()">Expand</a>
     366                <a id="berryBasketCollapseLink" style="display: none;" href="javascript:hideBasket()">Collapse</a>
     367            </span>
     368            <div id="baskethandle"><span><xsl:text> </xsl:text></span></div>
     369            <div id ="berries"><span><xsl:text> </xsl:text></span></div>
     370        </div>
     371    </xsl:if>
     372</xsl:template>
     373
     374<!-- include the required javascript and css for berry baskets -->
     375<xsl:template name="berryBasketHeadTags">
     376    <script type="text/javascript" src="interfaces/{$interface_name}/js/YAHOO.js"><xsl:text> </xsl:text></script>
     377    <script type="text/javascript" src="interfaces/{$interface_name}/js/event.js"><xsl:text> </xsl:text></script>
     378    <script type="text/javascript" src="interfaces/{$interface_name}/js/connection.js"><xsl:text> </xsl:text></script>
     379    <script type="text/javascript" src="interfaces/{$interface_name}/js/dom.js"><xsl:text> </xsl:text></script>
     380    <script type="text/javascript" src="interfaces/{$interface_name}/js/dragdrop.js"><xsl:text> </xsl:text></script>
     381    <script type="text/javascript" src="interfaces/{$interface_name}/js/ygDDPlayer.js"><xsl:text> </xsl:text></script>
     382    <script type="text/javascript" src="interfaces/{$interface_name}/js/ygDDOnTop.js"><xsl:text> </xsl:text></script>
     383    <script type="text/javascript" src="interfaces/{$interface_name}/js/berrybasket.js"><xsl:text> </xsl:text></script>
     384    <link rel="stylesheet" href="interfaces/{$interface_name}/style/berry.css" type="text/css"/> 
     385</xsl:template>
     386
     387<!--
     388create a little berry which can be drag&dropped onto the berry basket
     389used on classifier and search result pages
     390-->
     391<xsl:template name="documentBerryForClassifierOrSearchPage">
     392    <xsl:if test="$berryBasketOn">
     393        <img class="pick" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0">
     394            <xsl:attribute name="id"><xsl:value-of select="/page/pageResponse/collection/@name"/>:<xsl:value-of select="@nodeID"/></xsl:attribute>
     395        </img>
     396    </xsl:if>
     397</xsl:template>
     398
     399<!--
     400create little berrys which can be drag&dropped onto the berry basket
     401used on the document page
     402-->
     403<xsl:template name="documentBerryForDocumentPage">
     404    <xsl:variable name="selectedNode"><xsl:value-of select="/page/pageResponse/document/@selectedNode"/></xsl:variable>
     405    <xsl:variable name="rootNode"><xsl:value-of select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/></xsl:variable>
     406
     407    <xsl:if test="$berryBasketOn"> 
     408        <div id="documentberries">
     409            <img class='pick' id="{/page/pageResponse/collection/@name}:{$rootNode}" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0"/>
     410            <span id="{/page/pageResponse/collection/@name}:{$rootNode}:root" class="documentberry">the whole document</span>
     411
     412            <xsl:if test="$selectedNode != $rootNode">
     413                <img class='pick'  id="{/page/pageResponse/collection/@name}:{$selectedNode}" src="interfaces/{$interface_name}/images/berry.png" alt="in basket" width="15" height="15" border="0"/>
     414                <span id="{/page/pageResponse/collection/@name}:{$selectedNode}:section" class="documentberry">the current section</span>
     415            </xsl:if>
     416        </div>
     417    </xsl:if>
     418</xsl:template>
     419
     420
     421<!-- document page -->
     422<xsl:template name="documentTitle">
     423    <xsl:value-of select="/page/pageResponse/document/documentNode/metadataList/metadata[@name='Title']"/>
     424</xsl:template>
     425
     426
     427<xsl:template name="coverImage">
     428    <img><xsl:attribute name='src'><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
     429</xsl:template>
     430
     431<xsl:template name="previousNextButtons">
     432    <!-- prev -->
     433    <a>
     434        <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;d=<xsl:value-of select="@selectedNode"/>.pp&amp;sib=1&amp;p.s=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.a"]/@value'/></xsl:attribute>
     435        <img class="lessarrow" src="interfaces/{$interface_name}/images/previous.png"/>
     436    </a>
     437
     438    <!-- next -->
     439    <a>
     440        <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;d=<xsl:value-of select="@selectedNode"/>.np&amp;sib=1&amp;p.s=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='/page/pageRequest/paramList/param[@name="p.a"]/@value'/></xsl:attribute>
     441        <img class="morearrow" src="interfaces/{$interface_name}/images/next.png"/>
     442    </a>
     443
     444</xsl:template>
     445
     446
    213447
    214448</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.