items.xsl

(taken from UK HIP 3.04)


<?xml version="1.0"?>
<!--
    Copyright (c) 2001-2002 by epixtech, inc.  All rights reserved.

****************************************************
Items table
****************************************************
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:myDate="http://www.dynix.com/java.util.Date"
xmlns:URLEncoder="/com.dynix.util.IpacURLEncoder"
exclude-result-prefixes="myDate">
<xsl:output method="html" indent="no"/>
<xsl:template match="items"/>
<xsl:template name="items_view">

...approx 15 lines missing here...

               <xsl:otherwise>
                <xsl:value-of select="concat('http://', /searchresponse/httpserver/host)"/>
               </xsl:otherwise>
        </xsl:choose>
    </xsl:variable>



<!--                 FLOOR PLAN JAVASCRIPT                  -->
<!--                                                        -->
<!--  start of JavaScript functions to display floor plans  -->
<!--  coded by Dave Pattern (d.c.pattern@hud.ac.uk)         -->
<!--                                                        -->
<!--  "items" holds a string of all the item attributes.    -->
<!--                                                        -->
<!--  The "addInfo" and "endItem" functions populate the    -->
<!--  "items" string with the required data.                -->
<!--                                                        -->
<!--  The "checkMaps" function searches for specific text   -->
<!--  and uses a regular expression (regex) to match. You   -->
<!--  can either build your own regex or you can specify    -->
<!--  two strings of text to match against (they should     -->
<!--  listed in the order in which they should appear).     -->
<!--  The first attribute of each "showMap" call should     -->
<!--  be the relevant image name.                           -->
<!--                                                        -->
<!--  If you are building your own regex, then you'll       -->
<!--  need to bear in mind that each row of item info       -->
<!--  is split with a "|", so beware of using greedy        -->
<!--  regex matches - e.g. use [^|]+ to match any           -->
<!--  character within a single item row.                   -->
<!--                                                        -->
<!--  You might find the 2 commented out lines useful       -->
<!--  for testing - simply remove the "//" to enable.       -->
<!--                                                        -->
<!--  The script assumes that your floor plan images are    -->
<!--  stored in a sub-directory called "maps" in the        -->
<!--  "hipres.war" folder on your HIP server - e.g.         -->
<!--                                                        -->
<!--     ..\jboss\server\default\deploy\hipres.war\maps\    -->
<!--                                                        -->
<!--  but you can easily alter the <img> tag to pick them   -->
<!--  up from anywhere                                      -->
<!--                                                        -->


<script language="javascript">
&lt;!&#045;&#045;

    var items = '';

    function checkMaps( ) {
//	document.write('<p /><div style="border:1px solid red; padding:5px"><tt>' + items + '</tt></div><p />');

	showMap( 'plan1.gif', 'Loan Collection Floor 3' );
	showMap( 'plan2.gif', 'Music Library', 'Score and Parts' );
        showMap( 'plan3.gif', 'Audiovisual Collection Floor 5[^|]+Available' );
    }


    function addInfo( text ) {
	items = items + text + ' ';
    }

    function endItem( ) {
	items = items + '|';
    }

    function showMap( map, text1, text2 ) {

	if( contains( text1, text2 ) ) {
//	    alert( 'displaying map ' + map );
	    document.write('<p /><img src="/hipres/maps/' + map + '" />');
	}
    }

    function contains( text1, text2 ) {

	var match = false;
	var re    = new RegExp( text1 );

	if( text2 ) {
	    var re = new RegExp( text1 + '[^|]+' + text2 );
	}

        if ( items.match( re ) ) { 
	    match = true
	}

	return( match );
    }


//-->
</script>

<!--                                                    -->
<!-- end of JavaScript functions to display floor plans -->
<!--                                                    -->




<table>
	<xsl:attribute name="class"><xsl:value-of select="$css_table_background"/></xsl:attribute>
	<xsl:attribute name="cellpadding">1</xsl:attribute>
	<xsl:attribute name="cellspacing">0</xsl:attribute>
	<xsl:attribute name="width">100%</xsl:attribute>
	<xsl:attribute name="border">0</xsl:attribute>
<tr>
<td>
	<xsl:attribute name="bgcolor"><xsl:value-of select="$simple_search_bgcolor"/></xsl:attribute>
<table>
	<xsl:attribute name="class"><xsl:value-of select="$css_table_background"/></xsl:attribute>
	<xsl:attribute name="cellpadding">3</xsl:attribute>
	<xsl:attribute name="cellspacing">0</xsl:attribute>

...approx 70 lines missing here...

							<xsl:when test="($pos mod 2) = 0">
								<xsl:attribute name="class"><xsl:value-of select...
								<xsl:attribute name="bgcolor"><xsl:value-of sele...
							</xsl:when>
							<xsl:otherwise>
								<xsl:attribute name="class"><xsl:value-of select...
							</xsl:otherwise>
							</xsl:choose>
							<xsl:attribute name="title"><xsl:value-of select="$full_...
							<xsl:value-of select="data/text"/>
						</a>



<!--              FLOOR PLAN JAVASCRIPT                   -->
<!--                                                      -->
<!-- start of JavaScript code to insert an attribute      -->
<!--                                                      -->

<script language="javascript">
&lt;!&#045;&#045;
    addInfo( "<xsl:value-of select="data/text"/>" );
//-->
</script>

<!--                                                    -->
<!-- end of JavaScript code to insert an attribute      -->
<!--                                                    -->



						</xsl:when>
						<xsl:otherwise>
							<xsl:text disable-output-escaping="yes">&nbsp;</xsl...
						</xsl:otherwise>
						</xsl:choose>
					</td>
				</xsl:if>
			</xsl:for-each>
			<!-- CALL fixed element -->
			<xsl:if test="boolean(normalize-space(CALL/data/text))">
				<td>

...approx 90 lines missing here...

                        </xsl:when>
                        <xsl:otherwise>
                                <a>
                                    <xsl:attribute name="name">requestLink<xsl:value-of select='position()'/></xsl:a...
                                    <xsl:attribute name="class"><xsl:value-of select="$css_tiny_anchor"/></xsl:attri...
                                    <xsl:attribute name="href">javascript:AddCopy('bkey<xsl:value-of select="$bibkey"/>...
                                    <xsl:attribute name="id">requestlink<xsl:value-of select='position()'/></xsl:at...
                                    <xsl:value-of select="$full_bib_add_copy"/>

                                </a>
                        </xsl:otherwise>
                    </xsl:choose>


                  </xsl:if>

			</td>
		</tr>






<!--             FLOOR PLAN JAVASCRIPT                   -->
<!--                                                     -->
<!-- start of JavaScript code to signal end of item      -->
<!--                                                     -->

<script language="javascript">
&lt;!&#045;&#045;
    endItem(  );
//-->
</script>

<!--                                                   -->
<!-- end of JavaScript code to signal end of item      -->
<!--                                                   -->






<!-- <xsl:if test="($patron_empowerment_disable = $false-->
<!--                                        and-->
<!--                  $display_item_level_display=$true-->
<!--                                  and-->
<!--                  ($forceSuppressMyList = $false or $forceSuppressMyList = '')-->
<!--                                  and-->
<!--                  $display_my_list_button=$true)">-->
<!---->
<!--   <xsl:variable name="mylist_size"><xsl:value-of select="number(//bookbag/size)"/></xsl:variable>-->
<!--   <xsl:if test="$mylist_size = 'NaN' or $mylist_size < $max_mylist">-->

...approx 80 lines missing here...

				   <xsl:attribute name="value"><xsl:value-of select="$items_other_location...
				   <xsl:attribute name="onClick">javascript:location='<xsl:value-of selec...
			   </xsl:if>
		    </input>
		</xsl:if>
	</td>
    <xsl:call-template name="sources_with_items_link">
        <xsl:with-param name="use_all" select="$true"/>
    </xsl:call-template>
	<xsl:call-template name="itempagenumbers_table">
        <xsl:with-param name="itemview" select="$true"/>
    </xsl:call-template>
</tr>
</table>




<!--              FLOOR PLAN JAVASCRIPT                   -->
<!--                                                      -->
<!-- start of JavaScript code to display floor plans      -->
<!--                                                      -->

<script language="javascript">
&lt;!&#045;&#045;

    checkMaps( );

//-->
</script>

<!--                                                      -->
<!-- end of JavaScript code to display floor plans        -->
<!--                                                      -->




</right>
</xsl:template>

<xsl:template name="sources_with_items_link">
    <xsl:param name="use_all" select="$false"/>
<xsl:comment>
****************************************************
Adds the return to source list link used in deduping
****************************************************
</xsl:comment>
    <td>
        <xsl:attribute name="nowrap">true</xsl:attribute>
        <xsl:attribute name="valign">bottom</xsl:attribute>
        <xsl:attribute name="align">left</xsl:attribute>
        <xsl:if test="$use_all = $true">
            <xsl:attribute name="width">100%</xsl:attribute>
        </xsl:if>
        <xsl:if test="/searchresponse/yoursearch/deduping_broadcast_search = 3">
            <xsl:variable name="isbn"><xsl:value-of select="/searchresponse/yoursearch/searchdata/link_is...
            <xsl:variable name="issnd"><xsl:value-of select="/searchresponse/yoursearch/searchdata/link...

...rest of file