Changeset 26326 for main/trunk


Ignore:
Timestamp:
2012-10-17T13:53:31+13:00 (12 years ago)
Author:
sjm84
Message:

Changing how collection text is retrieved so that they can contain gsf elements. The downside is that it <fragment> elements turn up in the HTML. Possibly need a better solution in the future

Location:
main/trunk/greenstone3/web/interfaces/default/transform
Files:
1 added
1 edited

Legend:

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

    r26317 r26326  
    99    <xsl:param name="interface_name"/>
    1010    <xsl:param name="library_name"/>
    11  
     11    <xsl:param name="site_name"/>
     12    <xsl:param name="collName"/>
     13 
    1214    <xsl:output method="xml"/>
    1315    <xsl:namespace-alias stylesheet-prefix="xslt" result-prefix="xsl"/>
     
    6971    <xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>
    7072        <xsl:choose>
     73            <xsl:when test="@type='query'">
     74                <a>
     75                    <xslt:attribute name='href'>
     76                        <xslt:value-of select='$library_name'/>
     77                        <xsl:text>/collection/</xsl:text>
     78                        <xslt:value-of select='/page/pageResponse/collection/@name'/>
     79                        <xsl:text>/search/</xsl:text>
     80                        <xsl:choose>
     81                            <xsl:when test="@name">
     82                                <xsl:value-of select="@name"/>
     83                            </xsl:when>
     84                            <xsl:otherwise>
     85                                <xsl:text>TextQuery</xsl:text>
     86                            </xsl:otherwise>
     87                        </xsl:choose>
     88                    </xslt:attribute>
     89                    <xsl:apply-templates/>
     90                </a>
     91            </xsl:when>
    7192            <xsl:when test="@type='classifier'">
    7293                <a>
     
    7697                        <xslt:value-of select='/page/pageResponse/collection/@name'/>
    7798                        <xsl:text>/browse/</xsl:text>
    78                         <xslt:value-of select='util:replace(@nodeID, ".", "/")'/>
     99                        <xsl:choose>
     100                            <xsl:when test="@nodeID">
     101                                <xsl:value-of select="@nodeID"/>
     102                            </xsl:when>
     103                            <xsl:otherwise>
     104                                <xslt:value-of select='util:replace(@nodeID, ".", "/")'/>
     105                            </xsl:otherwise>
     106                        </xsl:choose>
    79107                    </xslt:attribute>
    80108                    <xsl:apply-templates/>
     
    94122              <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[contains(@name, '/weblink')]"/>
    95123            </xsl:when>
    96       <xsl:when test="@type='page'">
     124            <xsl:when test="@type='page'">
    97125                <a>
    98126                    <xslt:attribute name='href'>
    99127                        <xslt:value-of select='$library_name'/>
    100128                        <xsl:text>/collection/</xsl:text>
    101                         <xslt:value-of select='/page/pageResponse/collection/@name'/>/page/<xsl:value-of select="@page"/></xslt:attribute>
    102       <xsl:choose>
    103       <xsl:when test="@title"><xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute></xsl:when>
    104         <xsl:when test="@titlekey"><xslt:attribute name="title"><xslt:value-of disable-output-escaping="yes" select="util:getCollectionText($collName, $site_name, /page/@lang, '{@titlekey}')"/></xslt:attribute></xsl:when></xsl:choose>
     129                        <xslt:value-of select='/page/pageResponse/collection/@name'/>
     130                        <xsl:text>/page/</xsl:text>
     131                        <xsl:value-of select="@page"/>
     132                    </xslt:attribute>
     133                    <xsl:choose>
     134                        <xsl:when test="@title"><xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute></xsl:when>
     135                        <xsl:when test="@titlekey"><xslt:attribute name="title"><xslt:value-of disable-output-escaping="yes" select="util:getCollectionText($collName, $site_name, /page/@lang, '{@titlekey}')"/></xslt:attribute></xsl:when>
     136                    </xsl:choose>
    105137                    <xsl:apply-templates/>
    106138                </a>   
    107       </xsl:when>
     139            </xsl:when>
    108140            <xsl:when test="@type='equivdoc'">
    109141              <xsl:call-template name="gsf:equivlinkgs3"/>
     
    253285    <!-- With gsf:collectionText, a user can request a string from the collection's dictionary in the current lang -->
    254286    <xsl:template match="gsf:collectionText" name="gsf:collectionText">
    255     <xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>
    256       <xslt:value-of disable-output-escaping="yes" select="util:getCollectionText($collName, $site_name, /page/@lang, '{@name}', '{@args}')"/>
     287    <!--<xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>-->
     288        <xslt:value-of select="util:getCollectionText($collName, $site_name, /page/@lang, '{@name}')"/>
    257289    </xsl:template>
    258290
Note: See TracChangeset for help on using the changeset viewer.