Changeset 33280 for main

Show
Ignore:
Timestamp:
02.07.2019 14:03:18 (8 weeks ago)
Author:
kjdon
Message:

first stab at getting proper gs3 help page. still some bits to fill in

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/help.xsl

    r33213 r33280  
    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     xmlns:java="http://xml.apache.org/xslt/java" 
    5     xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil" 
    6     xmlns:gslib="http://www.greenstone.org/skinning" 
    7     extension-element-prefixes="java util" 
    8     exclude-result-prefixes="java util"> 
     3        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
     4        xmlns:java="http://xml.apache.org/xslt/java" 
     5        xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil" 
     6        xmlns:gslib="http://www.greenstone.org/skinning" 
     7        xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" 
     8        extension-element-prefixes="java util" 
     9        exclude-result-prefixes="java util"> 
     10   
     11  <!-- use the 'main' layout --> 
     12  <xsl:include href="layouts/main.xsl"/> 
     13  <xsl:variable name="help_interface_name" select="concat($interface_name, '2')"/> 
     14   
     15  <!-- set page title --> 
     16  <xsl:template name="pageTitle"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></xsl:template> 
    917 
    10     <!-- use the 'main' layout --> 
    11     <xsl:include href="layouts/main.xsl"/> 
    12     <xsl:variable name="help_interface_name" select="concat($interface_name, '2')"/> 
    13      
    14     <!-- set page title --> 
    15     <xsl:template name="pageTitle"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></xsl:template> 
     18  <!-- set page breadcrumbs --> 
     19  <xsl:template name="breadcrumbs"> 
     20    <gslib:siteLink/><gslib:rightArrow/> 
     21    <xsl:if test="/page/pageResponse/collection"> 
     22      <gslib:collectionNameLinked/><gslib:rightArrow/> 
     23    </xsl:if> 
     24  </xsl:template> 
    1625 
    17     <!-- set page breadcrumbs --> 
    18     <xsl:template name="breadcrumbs"> 
    19         <gslib:siteLink/><gslib:rightArrow/> 
    20         <xsl:if test="/page/pageResponse/collection"> 
    21             <gslib:collectionNameLinked/><gslib:rightArrow/> 
    22         </xsl:if> 
    23     </xsl:template> 
    24  
    25     <!-- the page content --> 
    26     <xsl:template match="page"> 
    27         <xsl:call-template name="helpTopics"/> 
    28         <xsl:choose> 
     26  <!-- the page content --> 
     27  <xsl:template match="page"> 
     28    <xsl:choose> 
    2929      <xsl:when test="/page/pageResponse/collection"> 
    30             <xsl:call-template name="findingInformationHelp"/> 
    31     </xsl:when> 
     30    <xsl:call-template name="collectionHelp"/> 
     31      </xsl:when> 
    3232      <xsl:otherwise> 
    3333    <xsl:call-template name="homePageHelp"/> 
    34     </xsl:otherwise> 
    35         </xsl:choose> 
    36         <xsl:call-template name="readingDocsHelp"/> 
    37         <xsl:call-template name="searchingHelp"/> 
    38         <xsl:call-template name="preferencesHelp"/> 
    39     </xsl:template> 
    40      
    41     <xsl:template name="helpTopics"> 
    42          
    43     </xsl:template> 
     34      </xsl:otherwise> 
     35    </xsl:choose> 
     36  </xsl:template> 
     37 
     38   
    4439 
    4540  <xsl:template name="homePageHelp"> 
    4641    home page help 
     42    what should go here?? 
    4743  </xsl:template> 
    48     <xsl:template name="findingInformationHelp"> 
    49         <xsl:variable name="searchEnabled"> 
    50             <xsl:choose> 
    51                 <xsl:when test="/page/pageResponse/collection[@name=$collName]/serviceList/service[@type='query']">1</xsl:when> 
    52                 <xsl:otherwise>0</xsl:otherwise> 
    53             </xsl:choose> 
    54         </xsl:variable> 
    55          
    56         <xsl:variable name="numClassifiers"> 
    57             <xsl:value-of select="count(/page/pageResponse/collection[@name=$collName]/serviceList/service[@name = 'ClassifierBrowse']/classifierList/classifier)"/> 
    58         </xsl:variable> 
     44   
     45  <xsl:template name="collectionHelp"> 
     46    <!-- Using the {0} collection --> 
     47    <h2><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.collection_title', $collName)"/></h2> 
    5948 
    60         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.findinginformationtitle', $collName)"/> 
    61         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.findinginformation', $searchEnabled + $numClassifiers)"/> 
    62          
    63         <!-- using actual <ul> and <li> tags here would cause the XML parser to break --> 
    64         <xsl:text disable-output-escaping="yes">&lt;ul&gt;</xsl:text> 
    65         <xsl:if test="$searchEnabled = 1"> 
    66             <xsl:text disable-output-escaping="yes">&lt;li&gt;</xsl:text> 
    67             <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchdesc')"/> 
    68             <xsl:text disable-output-escaping="yes">&lt;/li&gt;</xsl:text> 
    69         </xsl:if> 
    70          
    71         <xsl:for-each select="/page/pageResponse/collection[@name=$collName]/serviceList/service[@name = 'ClassifierBrowse']/classifierList/classifier"> 
    72             <xsl:text disable-output-escaping="yes">&lt;li&gt;</xsl:text> 
    73             <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.browsedesc', ./displayItem[@name = 'name'])"/> 
    74             <xsl:text disable-output-escaping="yes">&lt;/li&gt;</xsl:text> 
    75         </xsl:for-each> 
    76         <xsl:text disable-output-escaping="yes">&lt;/ul&gt;</xsl:text> 
    77     </xsl:template> 
    78      
    79     <xsl:template name="readingDocsHelp"> 
    80         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.readingdocstitle')"/> 
    81         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.readingdocs')"/> 
    82          
    83         <table> 
    84             <tr> 
    85                 <td colspan="2"><img src="interfaces/{$interface_name}/images/bookshelf.png"/></td> 
    86                 <td><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.openbookshelf')"/></td> 
    87             </tr> 
    88             <tr> 
    89                 <td><img src="interfaces/{$interface_name}/images/previous.png"/></td> 
    90                 <td><img src="interfaces/{$interface_name}/images/next.png"/></td> 
    91                 <td><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.sectionarrows')"/></td> 
    92             </tr> 
    93         </table> 
    94     </xsl:template> 
    95      
    96     <xsl:template name="searchingHelp"> 
    97         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchingtitle')"/> 
    98         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searching')"/> 
    99          
    100         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.querytermstitle')"/> 
    101         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.queryterms')"/> 
    102          
    103         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.querytypetitle')"/> 
    104         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.querytype')"/> 
    105          
    106         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.queryscopetitle')"/> 
    107         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.queryscope')"/> 
    108     </xsl:template> 
    109      
    110     <xsl:template name="preferencesHelp"> 
    111         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.changingpreferencestitle')"/> 
    112         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.changingpreferences')"/> 
    113          
    114         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.collectionpreferencestitle')"/> 
    115         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.collectionpreferences')"/> 
    116          
    117         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.languagepreferencestitle')"/> 
    118         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.languagepreferences')"/> 
    119          
    120         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.presentationpreferencestitle')"/> 
    121         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.presentationpreferences')"/> 
    122          
    123         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchpreferencestitle')"/> 
    124         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchpreferences1')"/> 
    125         <xsl:if test="/page/pageResponse/collection[@name=$collName and (@type='mgpp' or @type='mg')]"> 
    126             <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.mgsearchpreferences')"/> 
    127         </xsl:if> 
    128         <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchpreferences2')"/> 
    129     </xsl:template> 
     49    <!-- general intro text --> 
     50    <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.collection_general')"/><br/><br/> 
     51 
     52    <xsl:call-template name="browsingHelp"/> 
     53    <xsl:if test="/page/pageResponse/collection/serviceList/service[@type='query']"> 
     54      <xsl:call-template name="searchingHelp"/> 
     55      <xsl:call-template name="searchParamsHelp"/> 
     56      <xsl:call-template name="searchResultsHelp"/> 
     57    </xsl:if> 
     58    <xsl:call-template name="documentHelp"/> 
     59    <xsl:if test="/page/pageResponse/interfaceOptions/option[@name='favouritesBaskets']/@value='true'"> 
     60      <xsl:call-template name="favouritesHelp"/> 
     61    </xsl:if> 
     62    <xsl:if test="/page/pageResponse/interfaceOptions/option[@name='berryBaskets']/@value='true'"> 
     63      <xsl:call-template name="berrybasketsHelp"/> 
     64    </xsl:if> 
     65    <xsl:if test="//format/gsf:option[@name='RSS']/@value= 'true'"> 
     66      <xsl:call-template name="rssHelp"/> 
     67    </xsl:if> 
     68  </xsl:template> 
     69 
     70  <xsl:template name="browsingHelp"> 
     71    <xsl:variable name="bookshelf"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.icon_bookshelf')"/></xsl:variable> 
     72    <xsl:variable name="book"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.icon_book')"/></xsl:variable> 
     73    <xsl:variable name="page"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.icon_page')"/></xsl:variable> 
     74    <xsl:variable name="plus"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.icon_plus')"/></xsl:variable> 
     75    <xsl:variable name="pdf"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.icon_pdf')"/></xsl:variable> 
     76    <xsl:variable name="word"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.icon_word')"/></xsl:variable> 
     77    <xsl:variable name="mp3"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.icon_mp3')"/></xsl:variable> 
     78    <h3><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.browsing_title')"/></h3><br/> 
     79    <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.browsing_general')"/> 
     80    <dl> 
     81      <dt><img src="interfaces/{$interface_name}/images/bshelf.gif" title="{$bookshelf}"/></dt> 
     82      <xsl:variable name="plus_icon"><img src="interfaces/{$interface_name}/images/expand.png" alt="plus icon"/></xsl:variable> 
     83      <dd><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceTextWithDOM($help_interface_name, /page/@lang, 'help.browsing_bookshelf', $plus_icon)"/></dd> 
     84      <xsl:variable name="book_icon"><img src="interfaces/{$interface_name}/images/book.png" alt="{$book}" title="{$book}"/></xsl:variable> 
     85      <xsl:variable name="page_icon"><img src="interfaces/{$interface_name}/images/itext.gif" alt="{$page}" title="{$page}"/> </xsl:variable> 
     86      <dt><xsl:copy-of select="$book_icon"/><gsf:space/> <xsl:copy-of select="$page_icon"/></dt> 
     87      <dd><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceTextWithDOM($help_interface_name, /page/@lang, 'help.browsing_book', $book_icon, $page_icon)"/></dd> 
     88       <dt><img src="interfaces/{$interface_name}/images/ipdf.gif" alt="{$pdf}" title="{$pdf}"/><gsf:space/><img src="interfaces/{$interface_name}/images/imsword.gif" alt="{$word}" title="{$word}"/><gsf:space/><img src="interfaces/{$interface_name}/images/imp3.gif" alt="{$mp3}" title="{$mp3}"/> ...</dt> 
     89      <dd><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.browsing_srcicon')"/></dd> 
     90      </dl> 
     91  </xsl:template> 
     92 
     93  <xsl:template name="searchingHelp"> 
     94    <h3><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searching_title')"/></h3><br/> 
     95    <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searching_quick')"/><br/><br/> 
     96    <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searching_more')"/> 
     97    <dl> 
     98      <xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']"> 
     99    <xsl:variable name="qname"><xsl:value-of select="@name"/></xsl:variable> 
     100      <dt><xsl:value-of select="displayItem[@name='name']"/></dt> 
     101      <dd><xsl:choose><xsl:when test="$qname='TextQuery'"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searching_text')"/></xsl:when> 
     102      <xsl:when test="$qname='FieldQuery'"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searching_form')"/></xsl:when> 
     103      <xsl:when test="$qname='AdvancedFieldQuery'"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searching_adv')"/></xsl:when> 
     104      <xsl:otherwise><xsl:value-of select="$qname"/></xsl:otherwise> 
     105    </xsl:choose> 
     106    </dd> 
     107      </xsl:for-each> 
     108    </dl> 
     109  </xsl:template> 
     110  <xsl:template name="searchParamsHelp"> 
     111       <h3><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchparams_title')"/></h3><br/> 
     112       <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchparams_general')"/><br/> 
     113       <ul> 
     114    <xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']/paramList/param[@type != 'invisible' and @type != 'enum_multi' and @type != 'multi' and not(@name=preceding::param/@name)]"> 
     115      <xsl:variable name="pname">help.sp_<xsl:value-of select="@name"/></xsl:variable> 
     116      <li><b><xsl:value-of select="displayItem[@name='name']"/>: </b><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, $pname)"/></li> 
     117    </xsl:for-each> 
     118    <xsl:if test="not(/page/pageResponse/collection/serviceList/service[@type='query']/paramList/param[@name='hitsPerPage'])"> 
     119      <li><b><xsl:value-of disable-output-escaping="yes" select="util:getGenericText('ServiceRack', /page/@lang, 'param.hitsPerPage')"/>: </b><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.sp_hitsPerPage')"/></li> 
     120    </xsl:if> 
     121       </ul> 
     122  </xsl:template> 
     123  <xsl:template name="searchResultsHelp"> 
     124    <h3><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchresults_title')"/></h3><br/> 
     125    <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchresults_general')"/><br/> 
     126    <xsl:if test="/page/pageResponse/collection/serviceList/service[@type='query']/metadataList/metadata[@name='does_facetsearch']/@value='true'"> 
     127      <dl> 
     128      <dt><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchresults_facet_title')"/></dt> 
     129      <dd><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.searchresults_facets')"/></dd> 
     130      </dl> 
     131    </xsl:if> 
     132    <br/> 
     133  </xsl:template> 
     134 
     135  <xsl:template name="documentHelp"> 
     136    <h3><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.document_title')"/></h3><br/> 
     137    <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.document_general')"/><br/><br/> 
     138    TODO: put some stuff here about icons found on doc pages. toc/paged docs. highlighter, image zoomer,  
     139  </xsl:template> 
     140  <xsl:template name="favouritesHelp"> 
     141    <xsl:variable name="fav_icon"><img src="interfaces/{$interface_name}/images/favourite-star-transparent-unselected32.png" width="16" height="16" alt="favourites unselected"/></xsl:variable> 
     142    <xsl:variable name="fav_icon_selected"><img src="interfaces/{$interface_name}/images/favourite-star-transparent-selected32.png" width="16" height="16" alt="favourites selected"/></xsl:variable> 
     143    <h3><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.favourites_title')"/></h3><br/> 
     144    <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceTextWithDOM($help_interface_name, /page/@lang, 'help.favourites', $fav_icon, $fav_icon_selected)"/><br/><br/> 
     145  </xsl:template> 
     146 
     147  <xsl:template name="berrybasketsHelp"> 
     148    <xsl:variable name="berry_icon"><img src="interfaces/{$interface_name}/images/berry.png" alt="berry icon" width="16" height="16"/></xsl:variable> 
     149    <h3><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.berrybasket_title')"/></h3><br/> 
     150    <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceTextWithDOM($help_interface_name, /page/@lang, 'help.berrybasket', $berry_icon)"/><br/><br/> 
     151  </xsl:template> 
     152   
     153  <xsl:template name="rssHelp"> 
     154    <xsl:variable name="rss"><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.icon_rss')"/></xsl:variable> 
     155    <xsl:variable name="rss_icon"><img src="interfaces/{$interface_name}/images/rssicon.png" alt="{$rss}" title="{$rss}"/></xsl:variable> 
     156    <h3><xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText($help_interface_name, /page/@lang, 'help.rss_title')"/></h3><br/> 
     157    <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceTextWithDOM($help_interface_name, /page/@lang, 'help.rss', $rss_icon)"/><br/><br/> 
     158  </xsl:template> 
     159 
     160  
    130161</xsl:stylesheet>