btingle avatar btingle committed c6adf79

experimental browse mode for /institutionItems/

Comments (0)

Files changed (3)

style/crossQuery/queryParser/oac4/queryParser.xsl

 	<facet field="institution-doublelist" select="**" sortGroupsBy="value"/>
 	<facet field="facet-onlineItems" select="*"/>
 	<facet field="oac4-tab" select="**"/>
-	<!-- facet field="facet-subject" select="**"/ -->
+	<facet field="facet-subject" select="**"/>
 	<facet field="facet-institution" select="**" sortGroupsBy="value"/>
 
 	<xsl:variable name="howMany">
                 style="{$stylesheet}" startDoc="{$startDoc}" maxDocs="0" normalizeScores="false">
 	<facet field="facet-{$facetcomplete}" select="*[1-10000]" />
 	<and maxSnippets="0">
-	<and field="oac4-tab"><term><xsl:text>*::*</xsl:text></term></and>
+	<and field="oac4-tab"><term><xsl:value-of select="concat(if ($group) then $group else '*', '::*')"/></term></and>
 		<xsl:apply-templates select="$parsed/query/*" mode="freeform"/>
+
 	<xsl:if test="$Institution != ''">
                         <and field="institution-doublelist"><term><xsl:value-of select="concat(
                                 substring($Institution,1,1),
                                 '::',
                                 $Institution,'*')"/></term></and>
 	</xsl:if>
+        <xsl:if test="$institution != ''">
+            <and field="facet-institution">
+                <term><xsl:value-of select="$institution"/></term>
+            </and>
+	</xsl:if>
 			<xsl:apply-templates select="parameters"/>
 	</and>
 	</query>
 			</xsl:otherwise>
 		</xsl:choose>
       		<facet field="facet-onlineItems" select="*"/>
+      		<facet field="facet-collection-title" select="*[1-5]"/>
 		<xsl:choose>
 			<xsl:when test="$facet-subject ne ''">
 				<xsl:variable name="q1">&quot;</xsl:variable>

style/crossQuery/resultFormatter/oac4/institutions.xsl

 <xsl:param name="contributing"/>
 <xsl:param name="style"/>
 <xsl:param name="keyword"/>
+<xsl:param name="limit"/>
 <xsl:param name="group" select="'collection'"/>
 <xsl:variable name="beforeGroup" select="if (substring-before($group,'::')) 
 		then substring-before($group,'::') else $group"/>
 
 <xsl:variable name="layout" select="document($layoutFile)"/>
 
+<xsl:variable name="instUrlBase" select="if ($limit='online') then '/institutionItems/' else '/institutions/'"/>
+
 
   <!-- default match identity transform -->
   <xsl:template match="@*|node()">
 					</xsl:choose>
 				</div>
 				<div class="institutions-right">
-				<a href="/institutions/{replace(@value,'\s','+')}::{replace(replace(../@value,',$',''),'\s','+')}">
+				<a href="{$instUrlBase}{replace(@value,'\s','+')}::{replace(replace(../@value,',$',''),'\s','+')}">
 				<xsl:value-of select="../@value"/>
 				</a>
 				<xsl:text> </xsl:text>
-				<a href="/institutions/{replace(@value,'\s','+')}">
+				<a href="{$instUrlBase}{replace(@value,'\s','+')}">
 				<xsl:value-of select="@value"/>
 				</a>
 				</div>
 					</xsl:choose>
 				</div>
 				<div class="institutions-right">
-				<a href="/institutions/{replace(@value,'\s','+')}"><xsl:value-of select="@value"/></a>
+				<a href="{$instUrlBase}{replace(@value,'\s','+')}"><xsl:value-of select="@value"/></a>
 				</div>
 			</div>
 			<xsl:apply-templates select="group[not(@value='onlineItems')]" mode="double2"/>
 
-
 		</xsl:otherwise>
 	</xsl:choose>
 </xsl:template>
 			</xsl:choose>
 		</div>
 		<div class="institutions-right indent">
-		<a href="/institutions/{replace(../@value,'\s','+')}::{replace(@value,'\s','+')}"><xsl:value-of select="@value"/></a>
+		<a href="{$instUrlBase}{replace(../@value,'\s','+')}::{replace(@value,'\s','+')}"><xsl:value-of select="@value"/></a>
 		</div>
 	</div>
 </xsl:template>

style/crossQuery/resultFormatter/oac4/limitFormatter.xsl

 <xsl:param name="style"/>
 <xsl:param name="keyword"/>
 <xsl:param name="decade"/>
-<xsl:param name="institution"/>
 <xsl:param name="facet-subject"/>
 <xsl:param name="facet-coverage"/>
+<xsl:param name="institution"/>
 <xsl:param name="relation"/>
 <xsl:param name="group" select="'collection'"/>
 <xsl:variable name="beforeGroup" select="if (substring-before($group,'::')) 
 <xsl:variable name="page" select="/"/>
 
 <xsl:template match="/">
-	<xsl:apply-templates select="$page/crossQueryResult/facet[@field='facet-institution' or @field='facet-decade' or @field='facet-onlineItems']" mode="searchLimits"/>
-	<xsl:if test="$relation">
-	<xsl:apply-templates select="$page/crossQueryResult/facet[@field='facet-subject' or @field='facet-coverage']" mode="searchLimits"/>
-	</xsl:if>
+  <xsl:choose>
+    <xsl:when test="$relation">
+      <xsl:apply-templates select="$page/crossQueryResult/facet[@field='facet-institution' or @field='facet-decade' or @field='facet-onlineItems']" mode="searchLimits"/>
+      <xsl:apply-templates select="$page/crossQueryResult/facet[@field='facet-subject' or @field='facet-coverage']" mode="searchLimits"/>
+    </xsl:when>
+    <xsl:when test="$institution">
+      <xsl:apply-templates select="$page/crossQueryResult/facet[@field='facet-subject' or @field='facet-coverage' or @field='facet-decade' or @field='facet-collection-title']" mode="searchLimits"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="$page/crossQueryResult/facet[@field='facet-institution' or @field='facet-decade' or @field='facet-onlineItems']" mode="searchLimits"/>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
   <!-- default match identity transform -->
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.