Index: gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes-and-performers/etc/collectionConfig.xml
===================================================================
--- gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes-and-performers/etc/collectionConfig.xml	(revision 37125)
+++ gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes-and-performers/etc/collectionConfig.xml	(revision 37126)
@@ -27,25 +27,80 @@
 	</displayItemList>
 	<format>
-			<gsf:template name="choose-title">
-				<gsf:choose-metadata>
-					<gsf:metadata name="ex.im.Work"/>
-					<gsf:metadata name="dc.Title"/>
-					<gsf:metadata name="exp.Title"/>
-					<gsf:metadata name="ex.dc.Title"/>
-					<gsf:metadata name="ex.Title"/>
-					<gsf:metadata name="Title"/>
-					<gsf:default>Untitled</gsf:default>
-				</gsf:choose-metadata>
-			</gsf:template>
-
-			<xsl:template name="document-link-mirador-ahref">
-			  <xsl:param name="embed"/>
-			  <xsl:variable name="href"><xsl:value-of select="$library_name"/><xsl:text>/collection/</xsl:text><xsl:value-of select="/page/pageResponse/collection/@name"/><xsl:text>/document/</xsl:text><xsl:choose><xsl:when test="@OID"><xsl:value-of select="@OID"/></xsl:when><xsl:when test="@OIDmetadata"><xsl:variable name="OIDmeta" select="@OIDmetadata"/><xsl:value-of select="metadataList/metadata[@name='{$OIDmeta}']"/></xsl:when><xsl:otherwise><xsl:value-of select="@nodeID"/></xsl:otherwise></xsl:choose><xsl:text>?book=mirador&amp;ed=1</xsl:text></xsl:variable>			  
-			  <a>
-			    <xsl:attribute name="href"><xsl:value-of select="$href"/></xsl:attribute>
-			    <xsl:copy-of select="$embed"/>
-			  </a>
-			  </xsl:template>
-
+	  <gsf:template name="choose-title">
+	    <gsf:choose-metadata>
+	      <gsf:metadata name="ex.im.Work"/>
+	      <gsf:metadata name="dc.Title"/>
+	      <gsf:metadata name="exp.Title"/>
+	      <gsf:metadata name="ex.dc.Title"/>
+	      <gsf:metadata name="ex.Title"/>
+	      <gsf:metadata name="Title"/>
+	      <gsf:default>Untitled</gsf:default>
+	    </gsf:choose-metadata>
+	  </gsf:template>
+	  
+	  <xsl:template name="document-link-mirador-ahref">
+	    <xsl:param name="embed"/>
+	    <xsl:variable name="href"><xsl:value-of select="$library_name"/><xsl:text>/collection/</xsl:text><xsl:value-of select="/page/pageResponse/collection/@name"/><xsl:text>/document/</xsl:text><xsl:choose><xsl:when test="@OID"><xsl:value-of select="@OID"/></xsl:when><xsl:when test="@OIDmetadata"><xsl:variable name="OIDmeta" select="@OIDmetadata"/><xsl:value-of select="metadataList/metadata[@name='{$OIDmeta}']"/></xsl:when><xsl:otherwise><xsl:value-of select="@nodeID"/></xsl:otherwise></xsl:choose><xsl:text>?book=mirador&amp;ed=1</xsl:text></xsl:variable>			  
+	    <a>
+	      <xsl:attribute name="href"><xsl:value-of select="$href"/></xsl:attribute>
+	      <xsl:copy-of select="$embed"/>
+	    </a>
+	  </xsl:template>
+
+<!--
+	  <xsl:template match="documentNode-CSVMetadata-or-IIIFViewer">
+	    <gsf:switch>
+	      <gsf:metadata name="HasGoogleVisionDocumentOCRJSON"/>
+	      <gsf:when test="exists">			  
+		<td valign="top">
+		  <xsl:call-template name="document-link-mirador-ahref">
+		    <xsl:with-param name="embed"><gsf:icon style="vertical-align:middle;" type="document"/></xsl:with-param>
+		  </xsl:call-template>				  
+		</td>
+		<td>
+		  <xsl:call-template name="document-link-mirador-ahref">
+		    <xsl:with-param name="embed">
+		      <xsl:call-template name="choose-title"/>
+		      < ! - - The following currently isn't triggered, as Programmes don't have Artist metadata - - >
+		      <gsf:switch>
+			<gsf:metadata name="ex.im.Artist"/>
+			<gsf:when test="exists">, performed by<gsf:metadata name="ex.im.Artist"/></gsf:when>
+		      </gsf:switch>				      
+		    </xsl:with-param>
+		  </xsl:call-template>			    
+		</td>
+	      </gsf:when>
+	      <gsf:otherwise>
+		<td valign="top">
+		  <gsf:link type="document">
+		    <gsf:choose-metadata>
+		      <gsf:metadata name="thumbicon"/>
+		      <gsf:metadata name="srcicon"/>
+		      <gsf:default>
+			<gsf:icon style="vertical-align:middle;" type="document"/>
+		      </gsf:default>
+		    </gsf:choose-metadata>
+		  </gsf:link>
+		</td>
+		<td valign="top">
+		  <gsf:link type="document">
+		    <xsl:call-template name="choose-title"/>
+		    <gsf:switch>
+		      <gsf:metadata name="ex.im.Composer"/>
+		      <gsf:when test="exists">
+			<i> (<gsf:metadata name="ex.im.Composer"/>)</i>
+		      </gsf:when>
+		    </gsf:switch>
+		    <gsf:switch>
+		      <gsf:metadata name="ex.im.Artist"/>
+		      <gsf:when test="exists">, performed by <gsf:metadata name="ex.im.Artist"/></gsf:when>
+		    </gsf:switch>
+		  </gsf:link>
+		</td>			
+	      </gsf:otherwise>
+	    </gsf:switch>
+	  </xsl:template>
+	  -->
+			  <!--
 			<xsl:template name="document-link-mirador">
 			  <a>
@@ -53,5 +108,6 @@
 			    <gsf:icon type="document" style="vertical-align:middle;"/><xsl:call-template name="choose-title"/>
 			  </a>
-			  </xsl:template>
+			</xsl:template>
+			  -->
 			  
 			  <!--
@@ -76,22 +132,30 @@
 			</xsl:template>
 		</format>
-	<search type="lucene">
+	<search type="solr">
 		<index name="text">
 			<displayItem lang="en" name="name">text</displayItem>
 		</index>
 		<index name="ex.im.Work,dc.Title,ex.dc.Title,Title">
-			<displayItem lang="en" name="name">titles</displayItem>
+			<displayItem lang="en" name="name">work titles</displayItem>
 		</index>
-		<index name="Source">
-			<displayItem lang="en" name="name">filenames</displayItem>
+		<index name="ex.im.Artist">
+			<displayItem lang="en" name="name">artists</displayItem>
+		</index>
+		<index name="ex.im.Composer">
+			<displayItem lang="en" name="name">composers</displayItem>
+		</index>
+		<index name="ex.im.Venue">
+			<displayItem lang="en" name="name">venues</displayItem>
 		</index>
 		<defaultIndex name="text"/>
+
 		<level name="document">
 			<displayItem lang="en" name="name">document</displayItem>
 		</level>
 		<level name="section">
-			<displayItem lang="en" name="name">section</displayItem>
+			<displayItem lang="en" name="name">page</displayItem>
 		</level>
 		<defaultLevel name="document"/>
+		
 		<sort name="rank">
 			<displayItem lang="en" name="name">rank</displayItem>
@@ -100,48 +164,95 @@
 			<displayItem lang="en" name="name">natural (build) order</displayItem>
 		</sort>
+
+
+		<facet name="ex.im.Artist">
+			<displayItem lang="en" name="name">artist</displayItem>
+		</facet>
+		<facet name="ex.im.Composer">
+			<displayItem lang="en" name="name">composer</displayItem>
+		</facet>
+		<facet name="ex.im.Venue">
+			<displayItem lang="en" name="name">venue</displayItem>
+		</facet>
 		<searchType name="plain"/>
-		<searchType name="simpleform"/>
 		<searchType name="advancedform"/>
+	
 		<format>
-			<gsf:template match="documentNode">
-			  <td valign="top">
-			    <!--
-				  <gsf:link type="document"><gsf:icon style="vertical-align:middle;" type="document"/> (Page view)</gsf:link>
-			    -->
-				  <xsl:call-template name="document-link-mirador-ahref">
-				    <xsl:with-param name="embed"><gsf:icon style="vertical-align:middle;" type="document"/></xsl:with-param>
-				  </xsl:call-template>
-				  
-			  </td>
-			  <!--
-				<td valign="top">
-					<xsl:call-template name="document-link-mirador"/>
-				</td>
-			  -->
-				<td>
-				  <!--
-					<gsf:link type="document">
-						<xsl:call-template name="choose-title"/>
-					</gsf:link>
-					-->
-				  <xsl:call-template name="document-link-mirador-ahref">
-				    <xsl:with-param name="embed">
-				      <xsl:call-template name="choose-title"/>
-				      <gsf:switch>
-					<gsf:metadata name="ex.im.Artist"/>
-					<gsf:when test="exists">, performed by<gsf:metadata name="ex.im.Artist"/></gsf:when>
-				      </gsf:switch>				      
-				    </xsl:with-param>
-				  </xsl:call-template>
-					
-				</td>
-			</gsf:template>
+		  <gsf:template match="documentNode">
+		    <!--
+		    <xsl:call-template name="documentNode-CSVMetadata-or-IIIFViewer"/>
+-->
+		    
+		    <gsf:switch>
+		      <gsf:metadata name="HasGoogleVisionDocumentOCRJSON"/>
+		      <gsf:when test="exists">			  
+			<td valign="top">
+			  <xsl:call-template name="document-link-mirador-ahref">
+			    <xsl:with-param name="embed"><gsf:icon style="vertical-align:middle;" type="document"/></xsl:with-param>
+			  </xsl:call-template>				  
+			</td>
+			<td>
+			  <xsl:call-template name="document-link-mirador-ahref">
+			    <xsl:with-param name="embed">
+			      <xsl:call-template name="choose-title"/>
+			      <!-- The following currently isn't triggered, as Programmes don't have Artist metadata -->
+			      <gsf:switch>
+				<gsf:metadata name="ex.im.Artist"/>
+				<gsf:when test="exists">, performed by<gsf:metadata name="ex.im.Artist"/></gsf:when>
+			      </gsf:switch>				      
+			    </xsl:with-param>
+			  </xsl:call-template>			    
+			</td>
+		      </gsf:when>
+		      <gsf:otherwise>
+			<td valign="top">
+			  <gsf:link type="document">
+			    <gsf:choose-metadata>
+			      <gsf:metadata name="thumbicon"/>
+			      <gsf:metadata name="srcicon"/>
+			      <gsf:default>
+				<gsf:icon style="vertical-align:middle;" type="document"/>
+			      </gsf:default>
+			    </gsf:choose-metadata>
+			  </gsf:link>
+			</td>
+			<td valign="top">
+			  <gsf:link type="document">
+			    <xsl:call-template name="choose-title"/>
+			    <gsf:switch>
+			      <gsf:metadata name="ex.im.Composer"/>
+			      <gsf:when test="exists">
+				<i> (<gsf:metadata name="ex.im.Composer"/>)</i>
+			      </gsf:when>
+			    </gsf:switch>
+			    <gsf:switch>
+			      <gsf:metadata name="ex.im.Artist"/>
+			      <gsf:when test="exists">, performed by <gsf:metadata name="ex.im.Artist"/></gsf:when>
+			    </gsf:switch>
+			  </gsf:link>
+			</td>			
+		      </gsf:otherwise>
+		    </gsf:switch>
+		   
+		    
+		  </gsf:template>
+
 		</format>
 	</search>
+	
 	<infodb type="jdbm"/>
+	
 	<import>
 		<pluginList>
 			<plugin name="ZIPPlugin"/>
 			<plugin name="GreenstoneXMLPlugin"/>
+			<plugin name="CSVPlugin">
+				<option name="-use_namespace_for_field_names" value="ex.im"/>
+				<option name="-OIDtype" value="assigned"/>
+				<option name="-OIDmetadata" value="ex.im.GSFriendlyID"/>
+				<option name="-metadata_value_separator" value=",(?!\s\w\.)"/>
+				<option name="-metadata_separate_fields" value="ex.im.Artist,ex.im.Composer"/>
+				<option name="-store_field_values_as_document_text"/>
+			</plugin>			
 			<plugin name="GoogleVisionPagedImagePlugin">
 				<option name="-enable_cache"/>
@@ -190,6 +301,6 @@
 			<option name="-numeric_partition_type_within_level" value="approximate_size"/>
 			<option name="-metadata_selection_mode_within_level" value="firstvalue"/>
-		</classifier>
-		<format>
+
+		    <format>
 			<gsf:template match="documentNode">
 			  <td valign="top">
@@ -202,7 +313,4 @@
 				</td>
 				<td valign="top">
-				  <!--
-				  <xsl:call-template name="document-link-mirador"/>
-				  -->
 				  <xsl:call-template name="document-link-mirador-ahref">
 				    <xsl:with-param name="embed">
@@ -245,5 +353,87 @@
 				</gsf:link>
 			</gsf:template>
+		    </format>			
+		</classifier>
+
+		<classifier name="AZCompactList">
+			<option name="-metadata" value="ex.im.Work,Title"/>
+			<option name="-buttonname" value="Performances"/>
+			<option name="-mingroup" value="2"/>
+		</classifier>
+		<classifier name="AZCompactList">
+			<option name="-metadata" value="ex.im.No"/>
+			<option name="-buttonname" value="IntermusE IDs"/>
+		</classifier>
+		<classifier name="AZCompactList">
+			<option name="-metadata" value="ex.im.Artist"/>
+			<option name="-buttonname" value="Artists"/>
+			<option name="-removesuffix" value="\s*\([^)]*\)"/>
+		</classifier>
+		<classifier name="AZCompactList">
+			<option name="-metadata" value="ex.im.Composer"/>
+			<option name="-buttonname" value="Composers"/>
+			<option name="-removeprefix" value="arr(\.?)\s*"/>
+		</classifier>
+		<classifier name="AZCompactList">
+			<option name="-metadata" value="ex.im.Venue"/>
+			<option name="-buttonname" value="Venues"/>
+		</classifier>
+
+
+
+		<format>
+			<gsf:template match="documentNode">
+				<td valign="top">
+					<gsf:link type="document">
+						<gsf:choose-metadata>
+							<gsf:metadata name="thumbicon"/>
+							<gsf:metadata name="srcicon"/>
+							<gsf:default>
+								<gsf:icon style="vertical-align:middle;" type="document"/>
+							</gsf:default>
+						</gsf:choose-metadata>
+					</gsf:link>
+				</td>
+				<td valign="top">
+					<gsf:link type="document">
+<!--
+Defined in the global format statement
+-->
+						<xsl:call-template name="choose-title"/>
+						<gsf:switch>
+							<gsf:metadata name="ex.im.Composer"/>
+							<gsf:when test="exists">
+								<i> (<gsf:metadata name="ex.im.Composer"/>)</i>
+							</gsf:when>
+						</gsf:switch>
+						<gsf:switch>
+							<gsf:metadata name="ex.im.Artist"/>
+							<gsf:when test="exists">, performed by <gsf:metadata name="ex.im.Artist"/></gsf:when>
+						</gsf:switch>
+					</gsf:link>
+				</td>
+			</gsf:template>
+			<gsf:template match="classifierNode[@classifierStyle = 'VList']">
+				<td valign="top">
+					<gsf:link styleXX="static" type="classifier">
+						<gsf:icon style="vertical-align:middle;" type="classifier"/>
+					</gsf:link>
+					<gsf:link styleXX="static" type="classifier">
+						<span style="padding: 2px 2px 2px 0px;">[<gsf:metadata name="numleafdocs"/>]</span>
+					</gsf:link>
+				</td>
+				<td valign="top">
+					<gsf:link type="classifier">
+						<gsf:metadata name="Title"/>
+					</gsf:link>
+				</td>
+			</gsf:template>
+			<gsf:template match="classifierNode[@classifierStyle = 'HList']">
+				<gsf:link style="static" type="classifier">
+					<gsf:metadata name="Title"/>
+				</gsf:link>
+			</gsf:template>
 		</format>
+		
 	</browse>
 	<display>
@@ -255,4 +445,13 @@
 		     <gsf:metadata name="Image"/>
 
+		     <gsf:metadata name="ex.im.No"/>
+		     <gsf:metadata name="ex.im.Work"/>
+		     <gsf:metadata name="ex.im.Date"/>
+		     <gsf:metadata name="ex.im.Artist"/>
+		     <gsf:metadata name="ex.im.Venue"/>
+		     <gsf:metadata name="ex.im.Composer"/>
+		     <gsf:metadata name="ex.im.Date"/>
+		     <gsf:metadata name="ex.im.ProgAndPage"/>
+		     
 		   </gsf:headMetaTags>
 
@@ -284,5 +483,5 @@
 			</gsf:template>
 			-->
-			<xsl:template name="documentHeadingOLD">
+			<xsl:template name="documentHeading">
 			  <!--
 			        <gsf:metadata hidden="true" name="HasGoogleVisionDocumentOCRJSON"/>
@@ -293,5 +492,8 @@
 				    **** currently needed to ensure ILT TOC gets Image (rather than Source) metadata ?????
 				-->
-				<!--
+				<gsf:metadata hidden="true" name="im.Programme" select="root"/>
+				<gsf:metadata hidden="true" name="ex.im.GSFriendlyProg"/>
+				<gsf:metadata hidden="true" name="ex.im.GSFriendlyPage"/>
+				
 				<xsl:if test="$bookswitch != 'mirador'">
 				  <span style="font-weight:bold; font-size: 120%;">
@@ -299,13 +501,13 @@
 				  </span>
 				</xsl:if>
-				-->
-				
-				<xsl:call-template name="choose-title"/>
+
 				<gsf:metadata-table>
-					<gsf:metadata name="ex.im.No">Catalogue No:</gsf:metadata>
-					<gsf:metadata name="ex.im.Work">Work:</gsf:metadata>
-					<gsf:metadata name="ex.im.Artist">Artist(s):</gsf:metadata>
-					<gsf:metadata name="ex.im.Venue">Venue:</gsf:metadata>
-					<gsf:metadata name="ex.im.Composer">Composer:</gsf:metadata>
+					<gsf:metadata name="ex.im.No"         >Performance ID:</gsf:metadata>
+					<gsf:metadata name="ex.im.Work"       >Work:          </gsf:metadata>
+					<gsf:metadata name="ex.im.Artist"     >Artist(s):     </gsf:metadata>
+					<gsf:metadata name="ex.im.Composer"   >Composer:      </gsf:metadata>
+					<gsf:metadata name="ex.im.Venue"      >Venue:         </gsf:metadata>
+					<gsf:metadata name="ex.im.Date"       >Date:          </gsf:metadata>
+					<gsf:metadata name="ex.im.ProgAndPage">Programme/Page:</gsf:metadata>
 				</gsf:metadata-table>
 			</xsl:template>
Index: gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes-and-performers/transform/pages/document.xsl
===================================================================
--- gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes-and-performers/transform/pages/document.xsl	(revision 37125)
+++ gs3-installations/intermuse/trunk/sites/intermuse/collect/programmes-and-performers/transform/pages/document.xsl	(revision 37126)
@@ -131,5 +131,5 @@
   </xsl:template>
 
-  <xsl:template name="documentHeading">
+  <xsl:template name="documentHeadingOLD">
     <xsl:if test="$bookswitch != 'mirador'">
       <span style="font-weight:bold; font-size: 120%;">
@@ -148,4 +148,5 @@
   </xsl:template>
 
+ 
   <xsl:template name="documentPre">
     <xsl:variable name="httpCollection">library/sites/<xsl:value-of select="$site_name"/>/collect/<xsl:value-of select="/page/pageResponse/collection/@name"/></xsl:variable>
@@ -202,4 +203,62 @@
   </xsl:template>
       
+  <xsl:template name="documentNodeText">
+      <xsl:param name="force">0</xsl:param>
+      <xsl:variable name="im_programme"><gsf:metadata name="im.Programme" select="root"/></xsl:variable>
+      im_programme = <xsl:value-of select="$im_programme"/><br/>
+      <xsl:choose>
+	<xsl:when test="$im_programme != 'true'">
+	          <gsf:switch>
+		    <gsf:metadata name="ex.im.GSFriendlyProg"/>
+		    <gsf:when test="exists">			  
+
+			  <xsl:variable name="im_prognum"><gsf:metadata name="ex.im.GSFriendlyProg"/></xsl:variable>
+			  <xsl:variable name="im_pagenum"><gsf:metadata name="ex.im.GSFriendlyPage"/></xsl:variable>
+			  <style>
+			    div.progandpage {
+			      padding-top: 8px;
+			      padding-bottom: 8px;
+			    }
+			  </style>
+			  <div class="progandpage">
+			    <span style="display: inline-block; width: 160px;">Greenstone Viewer:</span>
+			    <a href="https://intermuse.sowemustthink.space/greenstone3/library/collection/{$collNameChecked}/document/HMS_{$im_prognum}.{$im_pagenum}">
+			      Programme HMS#<xsl:value-of select="$im_prognum"/>, Page <xsl:value-of select="$im_pagenum"/>
+			    </a>
+			  </div>
+			  <div class="progandpage">
+			    <span style="display: inline-block; width: 160px;">Mirador Viewer:</span>			    
+			    <a href="https://intermuse.sowemustthink.space/greenstone3/library/collection/{$collNameChecked}/document/HMS_{$im_prognum}?book=mirador&amp;ed=1&amp;gotoPage={$im_pagenum}">
+			      Programme HMS#<xsl:value-of select="$im_prognum"/>, Page <xsl:value-of select="$im_pagenum"/>
+			    </a>
+			  </div>
+		    </gsf:when>
+                  </gsf:switch>
+
+        </xsl:when>
+	<xsl:otherwise>
+	  <!-- The following is directly from default/transform/page/document.xsl -->
+	  <!-- **** consider replacing with <gsf:text> ???? ... or change the name of this outer template so it can still call the default inner one -->
+
+		<!-- Hides the "This document has no text." message -->
+		<xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
+		<xsl:choose>
+		  <xsl:when test="$force = '1' or not($noText = '1')">
+
+			<!-- Section text -->
+			<xsl:for-each select="nodeContent">
+			  <xsl:call-template name="displayMarkedUpTextAndAnnotations"/>
+			</xsl:for-each>
+                  </xsl:when>
+		  <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='ImageType'])">
+			<gsf:link type="source"><gsf:metadata name="Source"/></gsf:link>
+                  </xsl:when>
+		</xsl:choose>
+		<xsl:text> </xsl:text>
+
+       </xsl:otherwise>
+      </xsl:choose>			  
+  </xsl:template>
+
 
   <xsl:template name="documentContentMirador3">
