Index: main/trunk/model-sites-dev/heritage-nz/collect/pdf-reports/etc/collectionConfig.xml
===================================================================
--- main/trunk/model-sites-dev/heritage-nz/collect/pdf-reports/etc/collectionConfig.xml	(revision 33158)
+++ main/trunk/model-sites-dev/heritage-nz/collect/pdf-reports/etc/collectionConfig.xml	(revision 33190)
@@ -76,4 +76,10 @@
 			<displayItem lang="en" name="name">Authors</displayItem>
 		</index>
+		<index name="Date">
+			<displayItem lang="en" name="name">Year Published</displayItem>
+		</index>
+		<index name="TLA">
+			<displayItem lang="en" name="name">Territorial Authorities</displayItem>
+		</index>
 		<index name="AuthorityNo">
 			<displayItem lang="en" name="name">Authority Number</displayItem>
@@ -173,5 +179,5 @@
 			<plugin name="CSVPlugin">
 			  <option name="-process_exp" value="\/?UNBOUND.*\.csv$"/>
-			  <option name="-block_exp" value=".*\.xls$"/>
+			  <option name="-block_exp" value="^Archaeological report PDFs.*\.xlsx?$"/>
 			  <option name="-metadata_value_separator" value="\s*\|\s*"/>
 			</plugin>
@@ -180,4 +186,5 @@
 			<plugin name="EmailPlugin"/>
 			<plugin name="PDFv2Plugin">
+			  <option name="-keep_original_filename" />
 <!--
 			  <option name="-convert_to" value="paged_pretty_html"/>
@@ -288,5 +295,7 @@
 			<option name="-removeprefix" value="\&quot;|\'|\(|(\d+\s*)"/>
 -->
-			<option name="-removeprefix" value="\&quot;|\'|\(|(\d+\s*)|(\d+\w*\s+and\s+\d+\w*)"/>
+<!--
+			<option name="-removeprefix" value="\&quot;|\'|\(|(\d+\s*)|(\d+\w*\s+and\s+\d+\w*)"/> -->
+			<option name="-removeprefix" value=".*?(?=[A-Z][a-z])"/>
 			<option name="-removesuffix" value="\):.*$"/>
 		</classifier>
@@ -302,8 +311,10 @@
 		<classifier name="AZCompactList">
 			<option name="-metadata" value="Author"/>
-		</classifier>
+			<option name="-allvalues" />
+		</classifier>
+
 		<classifier name="DateList">
 			<option name="-metadata" value="Date"/>
-			<option name="-buttonname" value="Date Published"/>
+			<option name="-buttonname" value="Year Published"/>
 		</classifier>
 		
@@ -314,84 +325,187 @@
 		</classifier>
 
+<!--
 		<classifier name="AZCompactList">
 		  <option name="-metadata" value="AuthorityNo"/>
 		  <option name="-buttonname" value="Authority Number"/>
 		</classifier>
+-->
+
+<!--
+		<classifier name="DateList">
+		  <option name="-metadata" value="AuthorityNo"/>
+		  <option name="-buttonname" value="Authority Number"/>
+		  <option name="-removesuffix" value="(-|/).*$"/>
+-->
+
+		<classifier name="AZCompactList">
+		  <option name="-metadata" value="AuthorityNo"/>
+		  <option name="-buttonname" value="Authority Number"/>
+		  <option name="-removeprefix" value="^(various|no number|Appln ).*"/>
+		  <option name="-removesuffix" value="((-|/).*)|( 84)|(685eq)$"/>
+
+		<format>
+		  <gsf:template match="documentNode">
+
+		    <gsf:switch>
+		      <gsf:metadata name="Plugin"/>
+		      <gsf:when test="equals" test-value="CSVPlugin">
+			<td valign="top">
+			  <gsf:link type="document">
+			    <gsf:icon type="document"/>
+			  </gsf:link>
+			</td>
+			<td valign="top">
+			  <gsf:link type="document">
+			    <!-- Defined in the global format statement -->
+			    <i><!--Authority Number --><gsf:metadata name="AuthorityNo"/>:</i> <xsl:call-template name="choose-title"/>
+			  </gsf:link>
+			</td>
+			
+		      </gsf:when>
+		      <gsf:otherwise>
+			<td valign="top">
+			  <gsf:link type="source">
+			    <gsf:choose-metadata>
+			      <gsf:metadata name="thumbicon"/>
+			      <gsf:metadata name="srcicon"/>
+			    </gsf:choose-metadata>
+			  </gsf:link>						
+			</td>
+			<td valign="top">
+			  <gsf:link type="document">
+			    <!-- Defined in the global format statement -->
+			    <i><!-- Authority Number --><gsf:metadata name="AuthorityNo"/>:</i> <xsl:call-template name="choose-title"/>
+			  </gsf:link>
+			</td>
+				
+		      </gsf:otherwise>
+		    </gsf:switch>
+		    
+		  </gsf:template>
+		</format>
+		</classifier>
+
 
 		<classifier name="AZCompactList">
 		  <option name="-metadata" value="SiteNo"/>
 		  <option name="-buttonname" value="NZAA Site Number"/>
+		  <option name="-removesuffix" value="(-|/|,|\.| ).*$"/>
+
+
+		<format>
+		  <gsf:template match="documentNode">
+
+		    <gsf:switch>
+		      <gsf:metadata name="Plugin"/>
+		      <gsf:when test="equals" test-value="CSVPlugin">
+			<td valign="top">
+			  <gsf:link type="document">
+			    <gsf:icon type="document"/>
+			  </gsf:link>
+			</td>
+			<td valign="top">
+			  <gsf:link type="document">
+			    <!-- Defined in the global format statement -->
+			    <i><!--NZAA Site Number --><gsf:metadata name="SiteNo"/>:</i> <xsl:call-template name="choose-title"/>
+			  </gsf:link>
+			</td>
+			
+		      </gsf:when>
+		      <gsf:otherwise>
+			<td valign="top">
+			  <gsf:link type="source">
+			    <gsf:choose-metadata>
+			      <gsf:metadata name="thumbicon"/>
+			      <gsf:metadata name="srcicon"/>
+			    </gsf:choose-metadata>
+			  </gsf:link>						
+			</td>
+			<td valign="top">
+			  <gsf:link type="document">
+			    <!-- Defined in the global format statement -->
+			    <i><!-- NZAA Site Number --><gsf:metadata name="SiteNo"/>:</i> <xsl:call-template name="choose-title"/>
+			  </gsf:link>
+			</td>
+				
+		      </gsf:otherwise>
+		    </gsf:switch>
+		    
+		  </gsf:template>
+		</format>
+
 		</classifier>
 		
 		<format>
-			<gsf:template match="documentNode">
-
-			  <gsf:switch>
-			    <gsf:metadata name="Plugin"/>
-			    <gsf:when test="equals" test-value="CSVPlugin">
-				<td valign="top">
-					<gsf:link type="document">
-						<gsf:icon type="document"/>
-					</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="Date"/>
-							<gsf:when test="exists">&#160;<i>(<gsf:metadata name="Date"/>)</i></gsf:when>
-						</gsf:switch>
-					</gsf:link>
-				</td>
-
-			    </gsf:when>
-			    <gsf:otherwise>
-			          <td valign="top">
-<!--
-				        <gsf:link type="document">
-					  <gsf:icon type="document"/>
-					  </gsf:link>
+		  <gsf:template match="documentNode">
+		    
+		    <gsf:switch>
+		      <gsf:metadata name="Plugin"/>
+		      <gsf:when test="equals" test-value="CSVPlugin">
+			<td valign="top">
+			  <gsf:link type="document">
+			    <gsf:icon type="document"/>
+			  </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="Date"/>
+			      <gsf:when test="exists">&#160;<i>(<gsf:metadata name="Date"/>)</i></gsf:when>
+			    </gsf:switch>
+			  </gsf:link>
+			</td>
+			
+		      </gsf:when>
+		      <gsf:otherwise>
+			<td valign="top">
+			  <!--
+			      <gsf:link type="document">
+			        <gsf:icon type="document"/>
+			      </gsf:link>
 -->					  
 
-					<gsf:link type="source">
-						<gsf:choose-metadata>
-							<gsf:metadata name="thumbicon"/>
-							<gsf:metadata name="srcicon"/>
-						</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="Date"/>
-							<gsf:when test="exists">&#160;<i>(<gsf:metadata name="Date"/>)</i></gsf:when>
-						</gsf:switch>
-					</gsf:link>
-				</td>
-
-			    </gsf:otherwise>
-			  </gsf:switch>
-
-			</gsf:template>
-			<gsf:template match="classifierNode[@classifierStyle = 'VList']">
-				<td valign="top">
-					<gsf:link type="classifier">
-						<gsf:icon type="classifier"/>
-					</gsf:link>
-				</td>
-				<td valign="top">
-	                            <gsf:metadata name="Title"/>
-				</td>
-			</gsf:template>
-			<gsf:template match="classifierNode[@classifierStyle = 'HList']">
-				<gsf:link type="classifier">
-					<gsf:metadata name="Title"/>
-				</gsf:link>
-			</gsf:template>
+			  <gsf:link type="source">
+			    <gsf:choose-metadata>
+			      <gsf:metadata name="thumbicon"/>
+			      <gsf:metadata name="srcicon"/>
+			    </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="Date"/>
+			      <gsf:when test="exists">&#160;<i>(<gsf:metadata name="Date"/>)</i></gsf:when>
+			    </gsf:switch>
+			  </gsf:link>
+			</td>
+			
+		      </gsf:otherwise>
+		    </gsf:switch>
+		  </gsf:template>
+		  
+		  <gsf:template match="classifierNode[@classifierStyle = 'VList']">
+		    <td valign="top">
+		      <gsf:link type="classifier">
+			<gsf:icon type="classifier"/>
+		      </gsf:link>
+		    </td>
+		    <td valign="top">
+	              <gsf:metadata name="Title"/>
+		    </td>
+		  </gsf:template>
+		  <gsf:template match="classifierNode[@classifierStyle = 'HList']">
+		    <gsf:link type="classifier">
+		      <gsf:metadata name="Title"/>
+		    </gsf:link>
+		  </gsf:template>
 		</format>
 	</browse>
+
 	<display>
 		<format>
@@ -402,4 +516,5 @@
 			-->
 			<gsf:template name="documentHeading">
+<!--
                           <gsf:switch>
                             <gsf:metadata name="srcicon"/>
@@ -410,5 +525,5 @@
                             </gsf:when>
                           </gsf:switch>
-			  
+-->			  
                           <span style="font-weight:bold; font-size: 120%;">
                             <xsl:call-template name="choose-title"/>
@@ -471,5 +586,5 @@
 				  <tr>
 				    <td>
-				      Date Published:
+				      Year Published:
 				    </td>
 				    <td>
@@ -504,4 +619,50 @@
 				    </td>
 				  </tr>
+
+
+				  <gsf:switch>
+				    <gsf:metadata name="srcicon"/>
+				    <gsf:when test="exists">
+				      
+				      <tr>
+					<td>
+					  Report:
+					</td>
+					<td>
+					  <!--
+					  <xsl:template call="downloadLink">
+					    Download <span class="ui-icon ui-icon-circle-arrow-s"></span>
+					  </xsl:template>
+					  -->
+					  
+					  <xsl:variable name="SourceFile"><xsl:value-of disable-output-escaping="yes" 
+					     select="/page/pageResponse/document/metadataList/metadata[@name='SourceFile']" /></xsl:variable>
+					  <gsf:link type="source" downloadXXX="{$SourceFile}">
+					    
+					    <!--
+					    <span class="ui-icon ui-icon-circle-arrow-s" style="display:inline;"></span> 
+					    -->
+					    <gsf:metadata name="srcicon"/> Download 
+					  </gsf:link>
+
+					</td>
+				      </tr>
+				      
+				    </gsf:when>
+				    <gsf:otherwise>
+				      <tr>
+					<td>
+					  <xsl:comment>filler</xsl:comment>
+					</td>
+					<td>
+					  No electronic version of the report available
+					</td>
+				      </tr>
+
+				    </gsf:otherwise>
+
+				  </gsf:switch>
+				  
+
 				</tbody>
 			      </table>
