Index: /collections/trunk/niupepa/etc/collect.cfg
===================================================================
--- /collections/trunk/niupepa/etc/collect.cfg	(revision 14142)
+++ /collections/trunk/niupepa/etc/collect.cfg	(revision 14142)
@@ -0,0 +1,327 @@
+creator                greenstone@cs.waikato.ac.nz
+maintainer             greenstone@cs.waikato.ac.nz
+public                 true
+
+subcollection          commentaries   Filename/\.commentary$/
+subcollection          abstracts      Filename/\.abstract$/
+subcollection          papers         !Filename/\.(abstract|commentary)$/
+indexsubcollections    papers,commentaries,abstracts papers commentaries abstracts
+defaultsubcollection   papers,commentaries,abstracts
+
+indexes                section:text
+defaultindex           section:text
+
+plugin                 GAPlug 
+plugin                 NPPlug -create_log
+plugin                 ArcPlug 
+plugin                 RecPlug
+
+classify               NPepaList
+classify               NPDateList
+
+format AllowExtendedOptions true
+
+format                 SearchVList "<td valign=top>[link][icon][/link]</td><td>{If}{[parent:Series],[parent:Series],[Series]}: {If}{[parent(All': '):Title],[parent(All': '):Title]: }[link][Title][/link]</td>"
+
+# [link] is overridden for CL1VList in this collection (to include links/icons to abstracts as well as papers)
+format                 CL1VList "
+    <td valign=middle>
+      {If}{[doctype] eq 'Commentary',[link]_document:iconcommentary_[/link]}
+      {If}{[doctype] eq 'doc',<!-- then -->
+	  {If}{[abstract],<a href='_httpdocumentnogg_&d=[DocOID]abstract&gg=text'>_document:iconabstract_</a>}
+      }
+    </td>
+    <td valign=top>
+      {If}{[doctype] ne 'Commentary',[link][icon][/link]}
+    </td>
+    <td valign=top>
+      [Title]{If}{[numleafdocs], <i>(_numissues_([numleafdocs]))</i>}
+    </td>
+    <td valign=top>{If}{[Date],[Date]}</td>"
+
+format                 CL2DateList "<td valign=top>{If}{[abstract],<a href=_httpdocumentnogg_&cl=_cgiargcl_&d=[abstract]&gg=text>_document:iconabstract_}[link][icon][/link]</td><td>[Series]: [Title]</td><td>[Date]</td>"
+
+
+format                 DocumentHeading "
+    <script language='JavaScript'>
+
+      function news\_start\_url (docid) \{
+        var cutat=docid.indexOf('.');
+        var news\_start = docid;
+	if (cutat<0) \{
+          var newslen = news\_start.length;
+	  if (newslen>8) \{
+	    var abtail = news\_start.substr(newslen-8,8);
+            if (abtail == \"abstract\") \{
+	      news\_start = news\_start.substr(0,newslen-8);
+	    \}
+	  \}
+	\}
+	else \{
+          news\_start = docid.substr(0,cutat);
+        \}
+        document.location = \"_httpdocumentnogg_&gg=prev&d=\"+news\_start;
+      \}
+
+      function commentary\_url (docid) \{
+        var cutat=docid.indexOf('_');
+        var series = docid.substr(0,cutat);
+	var commentary = \"_httpdocumentnogg_&gg=text&d=\" + series + \"commentary\";
+        document.location = commentary
+      \}
+
+      function series\_imgtag (docid) \{
+        var cutat=docid.indexOf('c');
+        var series = docid.substr(0,cutat);
+	var imgtag = \"<img src='_httpcollection_/index/assoc/\" + series + \".dir/coveron.gif'\";
+        document.write(imgtag)
+      \}
+
+      function view\_abstract (docid) \{
+        var cutat=docid.indexOf('.');
+        var news\_start\_abstract = docid.substr(0,cutat) + \"abstract\";
+
+        var aburlstart = \"_escdocbutton_(_httpdocumentnogg_&gg=text&cl=_cgiargcl_&d=\";
+        var aburlend   = \",_document:textabstract_,_document:texticonabstract_)\";
+
+	var aburl = aburlstart + news\_start\_abstract + aburlend;
+        document.write(aburl);
+        \}
+
+      function view\_newspaper (docid) \{
+        var doclen = docid.length;
+	news\_start = docid.substr(0,doclen-8);
+
+        var nsurlstart = \"_escdocbutton_(_httpdocumentnogg_&gg=text&cl=_cgiargcl_&d=\";
+        var nsurlend   = \",_document:textviewpaper_,_document:texticonviewpaper_)\";
+
+	var nsurl = nsurlstart + news\_start + nsurlend;
+        document.write(nsurl);
+      \}
+
+      function commentary\_banner (docid) \{
+        var cutat=docid.indexOf('_');
+        var series = docid.substr(0,cutat);
+	var commentary = \"_httpdocumentnogg_&gg=text&d=\" + series + \"commentary\";
+	var imgbase = \"_httpcollection_/index/assoc/\" + series + \".dir/cover\";
+	var imgon = imgbase + \"on.gif\";
+	var imgof = imgbase + \"of.gif\";
+	var comurlstart = \"_escgsimage_(\";
+	var comurlend = \",\"+imgof+\",\"+imgon+\",comm,_document:texticoncommentary_)\";
+	var comurl = comurlstart + commentary + comurlend;
+        document.write(comurl);
+      \}
+
+      function commentary\_image (docid) \{
+        var cutat=docid.indexOf('_');
+        var series = docid.substr(0,cutat);
+	var imgbase = \"_httpcollection_/index/assoc/\" + series + \".dir/cover\";
+	var imgon = imgbase + \"on.gif\";
+	var imgtag = \"<img src='\" + imgon + \"'>\";
+        document.write(imgtag);
+      \}
+
+    </script>
+
+
+    <center><table width='_pagewidth_'><tr><td>
+
+    <!-- ##### Commentary ##### -->
+    {If}{[doctype] eq 'Commentary',
+      <table border=0 cellspacing=0 cellpadding=0>
+        <tr>
+	  <td colspan='3'>
+            <h3>    	   	    
+              [Title]
+            </h3>
+	  </td>
+	</tr>
+        <tr>
+	  <td colspan='3'>
+    	    <nobr>[DocumentButtonDetach][DocumentButtonHighlight]</nobr>
+	  </td>
+	</tr>
+      </table>
+
+    </td><td align=right>
+
+      <table border=0 cellspacing=0 cellpadding=0>
+        <tr>
+	  <td align=right>
+	      <script>series\_imgtag(\"[DocOID]\")</script>
+	  </td>
+        </tr>
+      </table>
+    }
+
+    <!-- ##### Abstract ##### -->
+    {If}{[doctype] eq 'Description',
+      <table border=0 cellspacing=0 cellpadding=0>
+        <tr>
+	  <td colspan='3'>
+            <h3>    	   	    
+	      _abstract_
+	      <a href='javascript:news\_start\_url(\"[DocOID]\")'><!--
+	        -->{If}{[parent(Top):Title], [parent(Top):Title], [Title]}<br>
+	           {If}{[parent(Top):Date], [parent(Top):Date], [Date]}
+	      </a>
+            </h3>
+	  </td>
+	</tr>
+        <tr>
+	  <td colspan='3'>
+	    <nobr>_document:imageabstractintro_<script>view\_newspaper(\"[DocOID]\")</script></nobr>
+    	    <nobr>[DocumentButtonDetach][DocumentButtonHighlight]</nobr>
+	  </td>
+	</tr>
+      </table>
+
+    </td><td align=right>
+
+      <table border=0 cellspacing=0 cellpadding=0>
+        <tr>
+	  <td align=right>
+	    {If}{[parent(Top):hascom] eq '1',
+	      <script>commentary\_banner(\"[DocOID]\")</script>
+	      <br>
+	      <small><a href='javascript:commentary\_url(\"[DocOID]\")'>_document:texticoncommentary_</a></small>
+	    ,<!-- else -->
+	      <script>commentary\_image(\"[DocOID]\")</script>
+	    }<!-- endif -->
+	  </td>
+        </tr>
+      </table>
+    }
+
+    <!-- ##### Basic Newspaper Document ##### -->
+    {If}{[doctype] eq 'doc',
+      <table border=0 cellspacing=0 cellpadding=0>
+        <tr>
+	  <td colspan='3'>
+            <h3>    	   	    
+	      <a href='javascript:news\_start\_url(\"[DocOID]\")'><!--
+                 -->{If}{[parent(Top):Title], [parent(Top):Title], [Title]}<br>
+	            {If}{[parent(Top):Date], [parent(Top):Date], [Date]}
+	      </a>
+            </h3>
+	  </td>
+	</tr>
+	<tr>
+	  <td colspan='3'>
+	    <center><b>_page_ [Title]</b> _document:textnumpages_(_numpages_)</center>
+	  </td>
+	</tr> 
+
+	<tr valign=middle>
+	  <td align=right>{If}{_document:prevarrow_,_document:prevarrow_}</td>
+	  <td align=center valign=top>_document:gotoform_</td>
+	  <td align=left>{If}{_document:nextarrow_,_document:nextarrow_}</td>
+	</tr>
+        <tr>
+          <td colspan='3'>
+	    {If}{_cgiarggg_ eq 'full',
+	      <nobr>
+	        {If}{[hastxt] eq '1',_document:imageviewtext_}
+	        {If}{[hasprevimg] eq '1',_document:imageprevimage_}
+	        {If}{[parent(Top):abstract],<script>view\_abstract(\"[DocOID]\")</script>}
+	      </nobr>
+	    }
+	    {If}{_cgiarggg_ eq 'prev',
+	      <nobr>
+	        {If}{[hastxt] eq '1',_document:imageviewtext_}
+	        {If}{[hasimg] eq '1',_document:imagefullimage_}
+	        {If}{[parent(Top):abstract],<script>view\_abstract(\"[DocOID]\")</script>}
+	      </nobr>
+	    }
+	    {If}{_cgiarggg_ eq 'text',
+	      <nobr>
+	        {If}{[hastxt] eq '1',
+	          {If}{[hasimg] eq '1',_document:imagefullimage_}
+ 	          {If}{[hasprevimg] eq '1',_document:imageprevimage_}
+	          {If}{[parent(Top):abstract],<script>view\_abstract(\"[DocOID]\")</script>}
+		, <!-- else -->
+  	          {If}{[hasimg] eq '1',_document:imagefullimage_}
+	          {If}{[parent(Top):abstract],<script>view\_abstract(\"[DocOID]\")</script>}
+		}
+	      </nobr>
+	    }
+	    {If}{_cgiarggg_,,
+	      <nobr>
+  	        {If}{[hastxt] eq '1',
+  	          {If}{[hasimg] eq '1',_document:imagefullimage_}
+	          {If}{[hasprevimg] eq '1',_document:imageprevimage_}
+	          {If}{[parent(Top):abstract],<script>view\_abstract(\"[DocOID]\")</script>}
+		, <!-- else -->
+  	          {If}{[hasimg] eq '1',_document:imagefullimage_}
+	          {If}{[parent(Top):abstract],<script>view\_abstract(\"[DocOID]\")</script>}
+		}
+	      </nobr>
+	    }
+	    <br><nobr>[DocumentButtonDetach]{If}{[hastxt] eq '1',[DocumentButtonHighlight]}</nobr>
+	  </td>
+        </tr>
+      </table>
+
+    </td><td align=right>
+
+      <table border=0 cellspacing=0 cellpadding=0>
+        <tr>
+	  <td align=right>
+	    {If}{[parent(Top):hascom] eq '1',
+	      <script>commentary\_banner(\"[DocOID]\")</script>
+	      <br>
+	      <small><a href='javascript:commentary\_url(\"[DocOID]\")'>_document:texticoncommentary_</a></small>
+	    ,<!-- else -->
+	      <script>commentary\_image(\"[DocOID]\")</script>
+	    }<!-- endif -->
+	  </td>
+        </tr>
+      </table>
+    }
+
+    </td></tr></table><br>_iconblankbar_</center>
+
+  {If}{[doctype] eq 'doc',
+    {If}{[hastxt] eq '0',
+    <center><table width=_pagewidth_>
+      <table width=_pagewidth_>
+        <tr><td align=center>
+	  {If}{[hasimg] eq '0',
+	    _missingtext_,
+            {If}{_cgiarggg_ eq 'full',<p><img src='_httpcollection_/index/assoc/_thisOID_/[Source].gif'}
+            {If}{_cgiarggg_ eq 'prev',<p><img src='_httpcollection_/index/assoc/_thisOID_/[Source]_p.gif'}
+            {If}{_cgiarggg_ eq 'text',<p><img src='_httpcollection_/index/assoc/_thisOID_/[Source]_p.gif'}
+            {If}{_cgiarggg_,,<p><img src='_httpcollection_/index/assoc/_thisOID_/[Source]_p.gif'}
+	  }
+        </td></tr>
+      </table>
+    </center>}
+  }
+<!-- end -->"
+
+format DocumentText "
+  <center><table width=_pagewidth_>
+    <table width=_pagewidth_>
+      <tr><td>
+    {If}{[doctype] eq 'doc',
+        {If}{_cgiarggg_ eq 'full',<p><img src='_httpcollection_/index/assoc/_thisOID_/[Source].gif'}
+        {If}{_cgiarggg_ eq 'prev',<p><img src='_httpcollection_/index/assoc/_thisOID_/[Source]_p.gif'}
+        {If}{_cgiarggg_ eq 'text',[Text]}
+        {If}{_cgiarggg_,,[Text]}
+    ,<!-- else -->
+        [Text]
+    }
+      </td></tr>
+    </table>
+  </center>"
+
+# add this line not because we have a custom receptionist, but because we
+# want the default language to be Maori.
+receptionist           _gwcgi_?a=p&p=about&c=niupepa&l=mi&nw=utf-8
+
+collectionmeta         collectionname      "Niupepa: Maori Newspapers"
+collectionmeta         iconcollection      "_httpprefix_/collect/niupepa/images/niupepa.gif"
+collectionmeta         iconcollectionsmall "_httpprefix_/collect/niupepa/images/niupepsm.gif"
+
+
+
Index: /collections/trunk/niupepa/macros/about.dm
===================================================================
--- /collections/trunk/niupepa/macros/about.dm	(revision 14142)
+++ /collections/trunk/niupepa/macros/about.dm	(revision 14142)
@@ -0,0 +1,312 @@
+package about
+
+_globallinks_ {_helplink__preflink__nzdllink_}
+
+#######################################################################
+# Icons
+#######################################################################
+
+_titlehome_ {home}
+_titlehome_ [l=mi] {kÄinga}
+_imagethispage_ {_titlehome_}
+
+# don't want link to 'about' page
+_imagecollection_  {<img src="_iconcollection_" border=0>}
+
+_imagemined_  {<a href="http://www.minedu.govt.nz/">_iconmined_</a>}
+
+_iconmined_  {<img src="_httpprefix_/collect/niupepa/images/mined.gif" border=0>}
+
+##############
+# about page #
+##############
+
+# this was used for niupepa survey that Te Taka ran
+_pagescriptextraold_ {
+<!--
+function popupSurvey() \{
+   // check if the cookie has been set
+   if (retrieveCookie ("niupepasurvey_visited") == null) \{
+     setCookie ("niupepasurvey_visited", "true", "forever");
+     setCookie ("niupepasurvey_blocked", "true", "session");
+     return;
+   \} 
+   
+   if (retrieveCookie ("niupepasurvey_blocked" ) != null) \{
+      return; // we are blocking the popup at the moment
+   \}
+   // if we have got here, popup the survey
+   // block the popup for the rest of this session - in case they don't submit
+   setCookie ("niupepasurvey_blocked", "true", "session");
+
+    // open the popup
+    window.open('_httpcollection_/html/questions.html','questions','height=800,width=650,scrollbars=yes,resizable=yes');
+\}
+
+
+function retrieveCookie( cookieName ) \{
+  /* retrieved in the format
+  cookieName4=value; cookieName3=value; cookieName2=value; cookieName1=value
+  only cookies for this domain and path will be retrieved */
+	
+  var cookieJar = document.cookie.split( "; " );
+  for( var x = 0; x < cookieJar.length; x++ ) \{
+    var oneCookie = cookieJar[x].split( "=" );
+    if( oneCookie[0] == escape( cookieName ) ) \{ 
+      return unescape( oneCookie[1] ); 
+    \}
+  \}
+  return null;
+\}
+
+function setCookie( cookieName, cookieValue, lifeTime) \{
+  if (!cookieName) \{return false;\}
+  var expires = "";
+  if (lifeTime == "forever") \{
+    expires = ";expires=Sun, 31 Dec 2006 12:00:00 GMT";
+  \}
+  document.cookie = cookieName + "=" + cookieValue + expires;
+  
+\}
+//-->
+}
+
+_header_ {_cgihead_
+_htmlhead_(class="bgimage")
+_startspacer__pagebanner_
+}
+
+# this was used for niupepa survey run by Te Taka
+_headerold_ {_cgihead_
+_htmlhead_(class="bgimage")
+<script language="javascript" type="text/javascript">
+<!--
+popupSurvey();
+// -->
+</script>
+_startspacer__pagebanner_
+}
+
+_aboutextra_  {
+<table border=0 width=_pagewidth_>
+<tr><td align=right>
+_If_("_cgiargl_" eq "mi",<a href="_httppageabout_&l=en">English</a>,
+<a href="_httppageabout_&l=mi&nw=utf-8">MÄori</a>)
+</td></tr></table>
+}
+
+_pagetitle_  {_collectionname_}
+
+_content_  {
+<center>
+<div class="navbar">
+<p class="navbar">
+_optnavigationbar_
+</p>
+</div>
+<small><i>
+_textxselect_
+</i></small>
+</center>
+_aboutextra_
+
+<p><center><h3>_textxwelcome_</h3></center>
+
+_textxwelcome2_
+
+<p>_textxbackground_
+
+<p>_textxgrateful_
+
+<br>&nbsp;<p>&nbsp;
+<div class="divbar">&nbsp;</div>
+
+<p><a name="background"><h3>_textxbackground2_</h3></a>
+
+_textxbackground3_
+
+<div class="divbar">&nbsp;</div>
+
+<p><a name="supportorgs"><h3>_textxsupporgs_</h3></a>
+
+<p><table><tr valign=top>
+<td>_imagemined_</td>
+<td>_textyaymined_</td>
+</tr></table>
+
+_textxsupportorgs2_
+}
+
+_textxselect_  {select one of the buttons on the above bar to access the niupepa}
+_textxselect_ [l=mi] {pÄwhiritia tÄtehi
+pÄtene ki runga ake nei kia pÄnui ai ngÄ niupepa}
+
+_textxwelcome_  {Welcome to the MÄori Niupepa Collection}
+_textxwelcome_ [l=mi] {Nau mai ki te Kohikohinga Niupepa MÄori}
+
+_textxwelcome2_  {
+<p>Here we have a collection of historic newspapers published primarily for
+a MÄori audience between 1842 and 1932. The newspapers can be <a
+href="_httpquery_"><b>searched</b></a> (full text), <a
+href="_httpbrowseSeries_"><b>browsed</b></a> (by series) or accessed by <a
+href="_httpbrowseDate_"><b>date</b></a>. This collection has been made
+available by the <a href="http://www.nzdl.org">New Zealand Digital Library
+Project</a>, at the <a href="http://www.cs.waikato.ac.nz/cs/">Department of
+Computer Science</a>, <a href="http://www.waikato.ac.nz">University of
+Waikato</a>.</p>
+}
+
+_textxwelcome2_ [l=mi] { 
+<p>Kua whakaemitia mai ki konei he kohikohinga niupepa i tÄngia
+mÅ ngÄ kaipÄnui MÄori o ngÄ tau
+1842-1932. E taea te pÄnui niupepa mÄ te <a
+href="_httpquery_">rapu kupu</a>, i te <a
+href="_httpbrowseSeries_">rÄrangi taitara</a>, me te rÄrangi
+<a href="_httpbrowseDate_">wÄtaka</a> hoki. He mea i
+whakatÅ«ria e te kaupapa <a href="http://www.nzdl.org">New Zealand
+Digital Library</a>, i te <a href="http://www.cs.waikato.ac.nz/cs/">Tari
+Rorohiko</a>, o te <a href="http://www.waikato.ac.nz">Whare WÄnanga
+o Waikato</a>.</p>
+}
+
+_textxbackground_  {<a href="#background">Background
+information</a> about the collection can be accessed below.}
+
+_textxbackground_ [l=mi] {Kei raro nei he <a
+href="#background">kupu whakamÄrama</a> e pÄ ana ki te kohikohinga
+nei.}
+
+_textxgrateful_  {We are grateful for the support of many
+organisations that have assisted in making this collection freely
+available, in particular the <a href="http://www.minedu.govt.nz">Ministry
+of Education</a> and university libraries throughout New Zealand. Please
+see our <a href="#supportorgs">supporting organisations</a> section below.}
+
+_textxgrateful_ [l=mi] {Ka nui te mihi ki ngÄ
+rÅpÅ« tautoko i te kaupapa nei. NÄ tÄ rÄtou tautoko kua
+kore he utu, mÄ koutou, mÅ te titiro ki ngÄ niupepa nei. Ko te <a
+href="http://www.minedu.govt.nz">TÄhuhu o te MÄtauranga</a>
+tÄrÄ, me Ätehi whare pukapuka e noho mai nei ki ngÄ whare
+wÄnanga o te motu. Tirohia ngÄ <a
+href="#supportorgs">rÅpÅ« tautoko</a>.}
+
+_textxbackground2_  {Background Information}
+_textxbackground2_ [l=mi] {He Kupu WhakamÄrama}
+
+_textxbackground3_  {
+<p>The niupepa collection consists of over 17,000 pages taken from 34
+separate periodicals. It is based on &quot;Niupepa 1842-1933&quot;, a
+microfiche collection produced by the <a
+href="http://www.natlib.govt.nz/en/using/8atl.html">Alexander
+Turnbull Library</a>. 70% of the collection is written solely in
+MÄori, 27% is bilingual and about 3% is written in English. There
+were three main types of niupepa published; government sponsored,
+MÄori initiated, and religious.
+
+<p>There are four main parts to the MÄori niupepa collection:
+<ul>
+  <li>facsimile images of the original pages
+  <li>text extracted from the newspapers (for searching)
+  <li>bibliographic commentaries for each newspaper title
+  <li><a href="_httppagex_(abexpl)">English abstracts</a> for each issue
+</ul>
+
+<p>Further information about the Niupepa Collection can be found in <i>Rere
+Atu Taku Manu! Discovering History, Language & Politics in the MÄori
+Language Newspapers</i>. Edited by Jennifer Curnow, Ngapare Hopa, and Jane
+McRae. Auckland University Press (2002). 
+}
+
+_textxbackground3_ [l=mi] {
+
+<p>He nui ake i te 17,700 whÄrangi, mai i te 34 niupepa kei te kohikohinga
+nei. He mea hanga i te &quot;Niupepa 1842-1933&quot;, te kohinga kua
+whakaemihia e te <a
+href="http://www.natlib.govt.nz/en/using/8atl.html">Alexander
+Turnbull Library</a> ki runga i te kiriata mororiki. E 70% kei te
+reo MÄori, 27% kei ngÄ reo e rua, Ä, kua Ähua 3% kei te reo
+PÄkehÄ. E toru ngÄ kaupapa matua o ngÄ niupepa nei: he
+hÄpainga kÄwanatanga; he pÄnui rÄnei nÅ
+ngÄ iwi MÄori; he kupu whakapono rÄnei nÅ ngÄ hÄhi.
+
+<p>E whÄ ngÄ wÄhanga nui o te kohikohinga niupepa MÄori:
+<ul>
+  <li>ngÄ whakaahua o te whÄrangi niupepa
+  <li>ngÄ kupu kua tangohia (mÅ te rapu) i aua whÄrangi
+  <li>he kupu whakataki mÅ ia niupepa
+  <li>he <a href="_httppagex_(abexpl)">rÄpopototanga reo PÄkehÄ</a>
+</ul>
+
+<p>MÅ Ätehi atu kÅrero pÄnuitia te pukapuka <i>Rere
+Atu Taku Manu! Discovering History, Language & Politics in the MÄori
+Language Newspapers</i>. NÄ Jennifer Curnow, rÄtou ko Ngapare Hopa, ko Jane McRae. Auckland University Press (2002). 
+}
+
+_textxsupporgs_  {Supporting Organisations}
+_textxsupporgs_ [l=mi] {RÅpÅ« Tautoko}
+
+_textyaymined_  {The <a
+href="http://www.minedu.govt.nz">Ministry of Education</a> are the
+principal sponsors of this project.}
+
+_textyaymined_ [l=mi] {Ko te tino tautoko o te kaupapa nei,
+i puta i te <a href="http://www.minedu.govt.nz">TÄhuhu o te
+MÄtauranga</a>.}
+
+_textxsupportorgs2_  {
+<p>Financial support was also generously given by the following
+university libraries:
+<ul>
+  <li><a href="http://www.waikato.ac.nz/library/">Waikato University Library</a>
+  <li><a href="http://www.library.otago.ac.nz">Otago University Library</a>
+  <li><a href="http://www.massey.ac.nz/~wwwlib/">Massey University Library</a>
+  <li><a href="http://www.victoria.ac.nz/library/">Victoria University Library</a>
+  <li><a href="http://www2.auckland.ac.nz/lbr/">Auckland University Library</a>
+  <li><a href="http://library.canterbury.ac.nz"</a>Canterbury University Library</a>
+  <li><a href="http://prod.lincoln.ac.nz/libr/default.htm"</a>Lincoln University Library</a>
+</ul>
+
+<p>The newspapers are also available on 35mm microfilm and microfiche. They
+can be borrowed on interloan through your local library or purchased from
+the <a href="http://www.natlib.govt.nz/en/using/8atl.html">Alexander Turnbull Library</a>.
+
+<p>Digital image capture was provided by <a
+href="http://www.micrographics.co.nz">New Zealand Micrographic Services
+Ltd.</a>
+
+<p>Commentaries on titles provided by Gail Dallimore.
+
+<p><a href="_httppagex_(abexpl)">English abstracts</a> are provided by a
+team working through the Department of MÄori Studies at the University
+of Auckland.
+}
+
+_textxsupportorgs2_ [l=mi] { 
+<p>ArÄ anÅ hoki ngÄ tautoko i tukua mai e ngÄ whare
+pukapuka o ngÄ whare wÄnanga:
+<ul>
+  <li><a href="http://www.waikato.ac.nz/library/">Te Whare Pukapuka o te Whare WÄnanga o Waikato</a>
+  <li><a href="http://www.library.otago.ac.nz">Te Whare Pukapuka o te Whare WÄnanga o Otago</a>
+  <li><a href="http://www.massey.ac.nz/~wwwlib/">Te Whare Pukapuka o te Whare WÄnanga o Massey</a>
+  <li><a href="http://www.victoria.ac.nz/library/">Te Whare Pukapuka o te Whare WÄnanga o Victoria</a>
+  <li><a href="http://www2.auckland.ac.nz/lbr/">Te Whare Pukapuka o te Whare WÄnanga o Auckland</a>
+  <li><a href="http://library.canterbury.ac.nz"</a>Te Whare Pukapuka o te Whare WÄnanga o Canterbury</a>
+  <li><a href="http://prod.lincoln.ac.nz/libr/default.htm"</a>Te Whare Pukapuka o te Whare WÄnanga o Lincoln</a>
+</ul>
+
+<p>Kei runga te kohinga &quot;Niupepa 1842-1933&quot; i te kiriata
+mÅkito 35mm me te kiriata mororiki. Ka taea te tono atu ki te
+whare pukapuka o tÅ rohe, ka taea rÄnei te hoko, mai i te <a
+href="http://www.natlib.govt.nz/en/using/8atl.html">Alexander
+Turnbull Library</a>.
+
+<p>NÄ te <a href="http://www.micrographics.co.nz">New Zealand
+Micrographic Services Ltd.</a> i whakawhiti ngÄ whakaahua, mai i te
+kiriata mÅkito ki te whakatakotoranga TIFF.
+
+<p>NÄ Gail Dallimore ngÄ kupu whakataki.
+
+<p>NÄ tÄtehi rÅpu rangahau i te Tari MÄori o te Whare
+WÄnanga o TÄmaki i whakarite ngÄ <a
+href="_httppagex_(abexpl)">rÄpopototanga reo PÄkehÄ</a>.
+}
Index: /collections/trunk/niupepa/macros/extra.dm
===================================================================
--- /collections/trunk/niupepa/macros/extra.dm	(revision 14142)
+++ /collections/trunk/niupepa/macros/extra.dm	(revision 14142)
@@ -0,0 +1,645 @@
+package Global
+
+_iconblankbar_ {<div class="divbar">&nbsp;</div>}
+_missingtext_  {Text has yet to be digitised for this page}
+
+##_cgiarggg_ {text}
+
+_escdocbutton_ {<div class=\\"button\\"><span class=\\"button\\" title=\\"_3_\\"><a href=\\"_1_\\">_2_</a></span></div>}
+
+_escgsimage_ {<a href=\\"_1_\\" onMouseover=\\"roll('_4_',1);\\" onMouseOut=\\"roll('_4_',0);\\"><img name=\\"_4_\\" src=\\"_2_\\" onLoad=\\"gbutton(this,'_3_');\\" border=0 alt=\\"_5_\\" title=\\"_5_\\"></a>}
+
+_escgsimage_ [v=1] {<a href=\\"_1_\\">_5_</a><br>}
+
+# old gsimage needed for document icon 
+# gsimage should be used to define an instance of a flashy image
+# parameters are:
+# 1. the url to go to when the button is clicked
+# 2. the url of the "off" image
+# 3. the url of the "on" image
+# 4. the name of the image (must be unique)
+# 5. image alt text
+# (border=0 required for netscape4, it won't apply this from a style sheet)
+_gsimage_ {<a href="_1_" onMouseover="roll('_4_',1);" onMouseOut="roll('_4_',0);"><img name="_4_" class="link" src="_2_" alt="_5_" title="_5_" onLoad="gbutton(this,'_3_');" border="0"></a>}
+
+_gsimage_ [v=1] {<a href="_1_">_5_</a><br>}
+
+# httpdocument and httpcurrentdocument are used by this extra.dm and 
+# collect.cfg along with gg=full etc. I have added nogg versions of these 
+# two macros which these two files must now use. This is because the 
+# new cgiarg parsing parses gg=text&gg=full into gg=text,full rather 
+# than gg=full as used to happen. So we need to avoid having gg=xxx more 
+# than once in the URL
+_httppagex_           {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=p&p=_1_}
+_httppagestatus_      {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=status&p=frameset}
+_httppagetranslator_  {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=lang&p=translang}
+_httppagecollector_   {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=collector&p=intro}
+_httpclearhistory_    {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=dh}
+
+_httpcurrentdocument_ {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&cl=_cgiargcl_&d=_cgiargd_}
+_httpcurrentdocumentnogg_{_gwcgi_?e=_compressedoptions_&cl=_cgiargcl_&d=_cgiargd_}
+_httpquery_           {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=q}
+_httpBrowse_          {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=br}
+
+# _httpdoc_ is the same as _httpdocument_ - _httpdocument_
+# may occasionally be altered by the server however
+_httpdocument_        {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=d}
+_httpdocumentnogg_    {_gwcgi_?e=_compressedoptions_&a=d}
+_httpdoc_             {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=d}
+
+_httpextlink_         {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=extlink}
+_httpbuild_           {_gwcgi_?gg=_cgiarggg_&e=_compressedoptions_&a=bc}
+
+
+package Global
+
+# add NZDL button and make HOME button go to about page
+_httppagehome_  {_httppagex_(about)}
+
+_numissues_  {_If_("_1_" eq "1",1 issue,_1_ issues)} 
+_numissues_ [l=mi] {_1_ niupepa}
+
+_globallinks_ {_homelink__helplink__preflink__nzdllink_}
+
+_homelink_ {_navtab_(_httppagex_(about),_linktextHOME_,_textdescrhome_)}
+_nzdllink_ {_navtab_(http://www.nzdl.org,NZDL,_textimagenzdl_)}
+_textimagenzdl_  {New Zealand Digital Library}
+
+_textbiblio_  {Bibliographic Details}
+_textbackground_  {Background}
+_textsubmat_  {Subject Matter}
+_textavail_  {Availability}
+_commentary_  {Commentary}
+
+_missingtext_  {Text has yet to be digitised for this page}
+
+_iconclosedbook_  {<img src="_httpprefix_/collect/niupepa/images/np.gif" valign=top width=20 height=20 border=0 alt="_texticonclosedbook_">}
+_texticonclosedbook_  {view niupepa}
+_texticonclosedbook_ [l=mi] {tirohia niupepa}
+
+_textbiblio_ [l=mi] {KÅrero TÄ}
+_textbackground_ [l=mi] {He WhakamÄrama}
+_textsubmat_ [l=mi] {Kaupapa}
+_textavail_ [l=mi] {Nohoanga}
+_commentary_ [l=mi] {Kupu Whakataki}
+
+_abstract_  {<i>Abstract</i><br>}
+
+_abstract_ [l=mi] {<i>RÄpopoto reo PÄkehÄ</i><br>}
+
+#######################################################################
+# index option macros
+#######################################################################
+
+_stx_  {}
+
+_ab_  {english abstracts}
+_ab_ [l=mi] {ngÄ rÄpopoto reo PÄkehÄ anake}
+_cm_  {bibliographic commentaries}
+_cm_ [l=mi] {ngÄ kupu whakataki anake}
+_pc_  {papers, commentaries, and abstracts}
+_pc_ [l=mi] {ngÄ niupepa, kupu whakataki, me ngÄ rÄpopoto}
+_pp_  {newspapers}
+_pp_ [l=mi] {ngÄ niupepa anake}
+
+
+#######################################################################
+#######################################################################
+
+
+package preferences
+
+_globallinks_ {_homelink__helplink__nzdllink_}
+_homelink_ {_navtab_(_httppagex_(about),_linktextHOME_,_textdescrhome_)}
+_nzdllink_ {_navtab_(http://www.nzdl.org,NZDL,_textimagenzdl_)}
+
+#######################################################################
+#######################################################################
+
+
+package document
+
+_httpthiscommentary_  {}
+_httpiconthispaper_  {}
+
+_httppageabexpl_  {_httppagex_(abexpl)}
+
+_iconabstract_  {<img src="_httpprefix_/collect/niupepa/images/iabstr.gif" valign=top border=0 alt="_texticonabstract_">}
+_iconabstract_ [v=1] {_texticonabstract_}
+
+_iconcommentary_  {<img src="_httpprefix_/collect/niupepa/images/icomm.gif" valign=top border=0 alt="_texticoncommentary_">}
+_iconcommentary_ [v=1] {_texticoncommentary_}
+
+_prevarrow_  {_If_(_httpprevarrow_,<a href="_httpprevarrow__1_">_iconprev_</a>)}
+_nextarrow_  {_If_(_httpnextarrow_,<a href="_httpnextarrow__1_">_iconnext_</a>)}
+
+# can't use _docbutton_ macro for detach button as we need to include target
+_imagedetach_ {<div class="button"><span class="button"><a href="_httpcurrentdocumentnogg_&amp;x=1&amp;gg=_cgiarggg_" target="\_blank" title="_texticondetach_">_textDETACH_</a></span></div>}
+
+_imagefullimage_ {_docbutton_(_httpcurrentdocumentnogg_&amp;gg=full,_textfullimage_,_texticonfullimage_)}
+
+_imageprevimage_ {_docbutton_(_httpcurrentdocumentnogg_&amp;gg=prev,_textprevimage_,_texticonprevimage_)}
+
+_imageviewtext_ {_docbutton_(_httpcurrentdocumentnogg_&amp;gg=text,_textviewtext_,_texticonviewtext_)}
+
+_imagepdf_ {_docbutton_(_document:httpcurrentpdf_,_textpdf_,_texticonpdf_)}
+_httpcurrentpdf_  {_httpprefix_/collect/niupepa/index/assoc/_thisOID_/paper.pdf}
+
+_imageviewabstract_ {_docbutton_(_httpcurrentdocumentnogg_&amp;gg=text&amp;cl=_cgiargcl_&amp;d=_1_,_textabstract_,_texticonabstract_)}
+
+_imageviewpaper_ {_docbutton_(_httpcurrentdocument_&amp;cl=_cgiargcl_&amp;d=_1_,_textviewpaper_,_texticonviewpaper_)}
+
+_imageabstractintro_ {_docbutton_(_document:httppageabexpl_,_textabstractintro_,_texticonabstractintro_)}
+
+_imagethispaper_  {_If_(_httpthiscommentary_,_linkthispaper_,_nolinkthispaper_)}
+
+_linkthispaper_  {_gsimage_(_document:httpthiscommentary_,_document:httpiconthispaper_of.gif,_document:httpiconthispaper_on.gif,comm,_document:texticoncommentary_)<br><small><a href="_document:httpthiscommentary_">_document:texticoncommentary_</a></small>}
+
+# this occurs when we're at a commentary page - (no alt text, no link)
+_nolinkthispaper_  {<img src="_httpiconthispaper_on.gif" border="0">}
+
+_texticonsmalltext_  {_texticoncommentary_}
+_textabstract_ {VIEW ABSTRACT}
+_texticonabstract_  {View the english abstract}
+_textfullimage_ {FULLSIZE IMAGE}
+_texticonfullimage_  {View fullsize image of this page}
+_textprevimage_ {PREVIEW IMAGE}
+_texticonprevimage_  {View preview image of this page}
+_textviewtext_ {TEXT}
+_texticonviewtext_  {View the text of this page}
+_textpdf_ {PDF}
+_texticonpdf_  {View the PDF version of this paper}
+
+_texticoncommentary_  {View the commentary of this paper}
+_texticonviewabstract_  {View the English abstract of this issue}
+_textviewpaper_ {VIEW NEWSPAPER}
+_texticonviewpaper_  {View niupepa issue}
+_textabstractintro_ {INTRO TO ABSTRACTS}
+_texticonabstractintro_  {View introduction to English abstracts}
+
+_texticonsmalltext_ [l=mi] {Tirohia kupu whakataki}
+_textabstract_ [l=mi] {TIROHIA RAPOPOTO}
+_texticonabstract_ [l=mi] {Tirohia ngÄ whakarÄpopoto reo PÄkehÄ}
+_textfullimage_ [l=mi] {WHAKAAHUA NUI}
+_texticonfullimage_ [l=mi] {Titiro ki te whakaahua nui o tÄnei whÄrangi niupepa}
+_textprevimage_ [l=mi] {WHAKAAHUA ITI}
+_texticonprevimage_ [l=mi] {Titiro ki te whakaahua iti o tÄnei whÄrangi niupepa}
+_textviewtext_ [l=mi] {KUPU}
+_texticonviewtext_ [l=mi] {Titiro ki ngÄ kupu kua tangohia i tÄnei whÄrangi niupepa}
+_texticoncommentary_ [l=mi] {Tirohia ngÄ kupu whakataki o tÄnei niupepa}
+_texticonviewabstract_ [l=mi] {Tirohia te rÄpopoto reo PÄkehÄ e pÄ ana ki tÄnei wÄhanga}
+_textviewpaper_ [l=mi] {TIROHIA NIUPEPA}
+_texticonviewpaper_ [l=mi] {Tirohia te whÄrangi niupepa}
+_textabstractintro_ [l=mi] {KUPU WHAKATAKI}
+_texticonabstractintro_ [l=mi] {He whakamÄrama i ngÄ rÄpopoto reo PÄkehÄ}
+
+
+package query
+
+_textsimplesearch_ [l=mi] {Tirohia ki _indexselection_ _If_(_jselection_, _jselection_) _If_(_gselection_, at _gselection_ level)_If_(_nselection_, in _nselection_ language) mÅ _querytypeselection_ o ngÄ kupu}
+
+
+#################
+package help
+#################
+
+_globallinks_ {_homelink__preflink__nzdllink_}
+_homelink_ {_navtab_(_httppagex_(about),_linktextHOME_,_textdescrhome_)}
+_nzdllink_ {_navtab_(http://www.nzdl.org,NZDL,_textimagenzdl_)}
+
+_content_  {
+<div class="navbar">
+<p class="navbar">
+_optnavigationbar_
+</p>
+</div>
+_texthelptopics_
+<div class="divbar">&nbsp;</div>
+<a name=finding-information></a>
+<h2>_textsimplehelpheading_</h2>
+_simplehelp_
+<div class="divbar">&nbsp;</div>
+<a name="nav-expl"></a>
+<h2>_textnavexpl_</h2>
+_textexplainbuttons_
+<div class="divbar">&nbsp;</div>
+<a name=lang-prefs></a>
+<h2>_textlangprefs_</h2>
+_texthelppreferences_
+<div class="divbar">&nbsp;</div>
+<a name=searching></a>
+<h2>_textsearching_</h2>
+_texthelpsearching_
+<div class="divbar">&nbsp;</div>
+}
+
+_textfindinfo_  {How to find information}
+_textfindinfo_ [l=mi] {NgÄ huarahi hei rapu kÅrero}
+_textnavexpl_  {Navigation buttons}
+_textnavexpl_ [l=mi] {PÄtene whakahaere}
+_textlangprefs_  {Language preferences}
+_textlangprefs_ [l=mi] {NgÄ Whiringa}
+_textsearching_  {Searching}
+_textsearching_ [l=mi] {Rapu kÅrero}
+_textsearchterms_  {Search terms}
+_textsearchterms_ [l=mi] {NgÄ kupu hei rapu}
+_textquerytype_  {Query type}
+_textquerytype_ [l=mi] {NgÄ tÅ«momo rapu}
+_textstem_  {Case sensitivity and stemming}
+_textstem_ [l=mi] {NgÄ pÅ« matua, pÅ« iti me ngÄ kÅ«muri hoki}
+
+_texthelptopics_  {
+<h2 align=left>Topics</h2>
+<ul>
+  <li><a href="\#finding-information">_textfindinfo_</a>
+  <li><a href="\#nav-expl">_textnavexpl_</a>
+  <li><a href="\#lang-prefs">_textlangprefs_</a>
+  <li><a href="\#searching">_textsearching_</a>
+  <ul>
+    <li><a href="\#query-terms">_textsearchterms_</a>
+    <li><a href="\#query-type">_textquerytype_</a>
+    <li><a href="\#stemming">_textstem_</a>
+</ul>
+</ul>
+}
+
+# don't ask why we need the exact same macro in here twice - there appears
+# to be a bug in the macroprecdence stuff
+_texthelptopics_ [l=mi] {
+<h2 align=left>Kaupapa</h2>
+<ul>
+  <li><a href="\#finding-information">_textfindinfo_</a>
+  <li><a href="\#nav-expl">_textnavexpl_</a>
+  <li><a href="\#lang-prefs">_textlangprefs_</a>
+  <li><a href="\#searching">_textsearching_</a>
+  <ul>
+    <li><a href="\#query-terms">_textsearchterms_</a>
+    <li><a href="\#query-type">_textquerytype_</a>
+    <li><a href="\#stemming">_textstem_</a>
+</ul>
+</ul>
+}
+
+_textSeriesshort_  {access the niupepa by series}
+_textSeriesshort_ [l=mi] {tirohia te rÄrangi taitara}
+_textDateshort_  {access the niupepa by date}
+_textDateshort_ [l=mi] {tirohia te rÄrangi e pÄ ana ki te wÄ}
+
+_textSerieslong_  {
+<p>You can <i>access the niupepa by series</i> by pressing the
+<i>series</i> button.  This brings up a list of all niupepa series. Each
+series also contains a brief commentary, and some series contain English
+abstracts.
+}
+
+_textSerieslong_ [l=mi] {
+<p>E taea te titiro ki te rÄrangi o ngÄ
+niupepa. PÄwhiritia te pÄtene rÄrangi taitara. Kei ia niupepa
+he kupu whakataki, Ä, kei Ätehi hoki he whakarÄpopototanga i te reo
+PÄkeha.
+}
+
+_textDatelong_  {
+<p>You can <i>access the niupepa by date</i> by pressing the <i>dates</i> button. 
+This brings up a list of all the niupepa issues, sorted chronologically.
+}
+
+_textDatelong_ [l=mi] {
+<p>E taea hoki te titiro ki te rÄrangi o ngÄ niupepa e
+pÄ ana ki te wÄ i puta. PÄwhiritia te pÄtene wÄtaka.
+}
+
+_textSearchlong_  { <p>You can <i>search for particular words</i> that
+appear in the text from the "search" page. See also <a href="\#searching">searching</a>.
+}
+
+_textSearchlong_ [l=mi] { <p>E taea te rapu kÅrero i te
+whÄrangi rapu. Tirohia hoki te <a href="\#searching">rapu kupu</a>.
+}
+
+_textaboutexplainbuttons_  {Different navigation buttons will
+appear in certain sections of the collection. An explanation of these is
+given below.<p>}
+
+_textaboutexplainbuttons_ [l=mi] {I a koe e tÄ«rotiro haere
+ana ki te kohikohinga nei ka puta mai he pÄtene whakahaere. E whai mai
+ana he whakamÄrama mÅ aua pÄtene.<p>}
+
+_textexplainbuttons_  {
+<p>_textaboutexplainbuttons_
+
+<table cellspacing="0" cellpadding="2" border="0">
+<tr valign=top><td><img src="_httpimg_/bshelf.gif" border="0"></td><td>_textxbshelf_</td></tr>
+<tr valign=top><td><img src="_httpprefix_/collect/niupepa/images/np.gif" border="0"></td><td>_textxpaper_</td></tr>
+<tr valign=top><td><img src="_httpprefix_/collect/niupepa/images/icomm.gif" border="0"></td><td>_textxcomm_</td></tr>
+<tr valign="top"><td><img src="_httpprefix_/collect/niupepa/images/iabstr.gif" border="0"></td><td>_textxabstr_</td></tr>
+
+<tr><td><img src="_httpimg_/more.gif"></td><td>_textxnext_</td></tr>
+<tr><td><img src="_httpimg_/less.gif"></td><td>_textxprev_</td></tr>
+
+<tr><td>_document:imagedetach_</td><td valign="center">_document:texticondetach_</td></tr>
+<tr><td>_document:imagefullimage_</td><td valign="center">_document:texticonfullimage_</td></tr>
+<tr><td>_document:imageprevimage_</td><td valign="center">_document:texticonprevimage_</td></tr>
+<tr><td>_document:imagehighlight_</td><td valign="center">_document:texticonhighlight_</td></tr>
+<tr><td>_document:imageviewabstract_</td><td valign="center">_document:texticonabstract_</td></tr>
+<tr><td>_document:imageviewtext_</td><td valign="center">_document:texticonviewtext_</td></tr>
+</table>
+}
+
+_textxbshelf_  {Click on a bookshelf icon when browsing the
+niupepa series to view a list of all the issues in that series}
+
+_textxbshelf_ [l=mi] {Titiro ki ngÄ niupepa katoa kua puta i taua taitara}
+
+_textxcomm_  {Click on the 'c' icon when browsing a niupepa
+series to view a commentary of that series}
+
+_textxcomm_ [l=mi] {Titiro ki ngÄ kupu whakataki e pÄ ana ki tÄnei taitara}
+
+_textxpaper_  {Click on a newspaper icon to read the corresponding niupepa issue}
+
+_textxpaper_ [l=mi] {Titiro ki tÄtehi o ngÄ niupepa i puta mai i taua rÄ}
+
+_textxabstr_  {Click on an abstract icon to read English abstracts of the given issue}
+
+_textxabstr_ [l=mi] {Titiro ki te whakarÄpopototanga reo PÄkehÄ e pÄ ana ki tÄnei niupepa}
+
+_textxnext_  {While viewing a niupepa click the forward arrow to go to the next page}
+
+_textxnext_ [l=mi] {Titiro ki te whÄrangi o mua}
+
+_textxprev_  {While viewing a niupepa click the back arrow to go to the previous page}
+
+_textxprev_ [l=mi] {Titiro ki te whÄrangi o muri}
+
+
+_texthelppreferences_  {
+<p>When you click the <i>preferences</i> button at the top of the page you will
+be able to change some features of the interface to suit your own requirements.
+
+<p>Each collection has a default presentation language, but you can switch to
+a different language if you like.  You can also alter the encoding scheme
+used by Greenstone for output to the browser -- the software chooses
+sensible defaults, but with some browsers better visual results can be used
+by switching to a different encoding scheme. All collections allow you to
+switch from the standard graphical interface format to a textual one. This
+is particularly useful for visually impaired users who use large screen
+fonts or speech synthesizers for output.
+}
+
+_texthelppreferences_ [l=mi] {
+<p>Kei runga ake ko te pÄtene whiriwhiringa. Ko tÄnei hei whakarerekÄ i
+ngÄ whiringa. Me whakarite Änei kia pai ai te titiro i tÄu ake
+rorohiko.
+
+<p>Kei ia kohikohinga o te NZDL he reo tÅ«turu hei kÅrerorero i
+waenganui i te kohikohinga me te kaipÄnui. E taea te
+whakarerekÄ i tÄnei reo kÅrerorero.
+
+<p>Ka taea hoki te whakarerekÄ i ngÄ whakatakotoranga pÅ« me ngÄ
+whakatakotoranga whÄrangi. Ka mÄmÄ ake te whakatakotoranga
+whÄrangi kore-whakaahua mÅ ngÄ tÄngata e kÄpÅ haere
+ana.
+}
+
+_texthelpsearching_  {
+
+<a name=query-terms></a>
+<h3>Search terms</h3>
+
+<p>Whatever you type into the query box is interpreted as a list of words
+called "search terms."  Each term contains nothing but alphabetic characters
+and digits.  Terms are separated by white space.  If any other characters such
+as punctuation appear, they serve to separate terms just as though they were
+spaces.  And then they are ignored.  You can't search for words that include
+punctuation.
+
+<p>For example, the query<p>
+    <ul><kbd>Agro-forestry in the Pacific Islands: Systems for Sustainability (1993)</kbd></ul>
+      <p>will be treated the same as<p>
+    <ul><kbd>Agro forestry in the Pacific Islands  Systems for Sustainability  1993 </kbd></ul><p>
+
+<a name=query-type></a>
+<h3>Query type</h3>
+
+<p>There are two different kinds of query.
+
+<ul>
+  <li>Queries for <b>all</b> of the words.  These look for documents (or
+      chapters, or titles) that contain all the words you have specified.
+      Documents that satisfy the query are displayed, in alphabetical
+      order.<p>
+
+  <li>Queries for <b>some</b> of the words.  Just list some terms that are
+      likely to appear in the documents you are looking for.  Documents are
+      displayed in order of how closely they match the query.  When determining
+
+      the degree of match,
+
+      <p><ul>
+        <li> the more search terms a document contains, the closer it matches;
+        <li> rare terms are more important than common ones;
+        <li> short documents match better than long ones.
+      </ul>
+</ul>
+
+<p>Use as many search terms as you like--a whole sentence, or even a whole
+paragraph.  If you specify only one term, documents will be ordered by its
+frequency of occurrence.<p>
+
+<a name=stemming></a>
+<h3 align=left>Case sensitivity and stemming</h3>
+<p>Two pairs of buttons on the <i>preferences</i> page control the kind of
+text matching in the searches that you make. The first set (labeled "case
+differences") controls whether upper and lower case must match.  The second
+("word endings") controls whether to ignore word endings or not.  It is
+possible to get a large query box, so that you can easily do
+paragraph-sized searching. It is surprisingly quick to search for large
+amounts of text.
+
+<p>For example, if the buttons <i>ignore case differences</i> and
+<i>ignore word endings</i> are selected, the query<p>
+    <ul><kbd>African building</kbd></ul>
+      <p>will be treated the same as<p>
+      <ul><kbd>africa builds</kbd></ul><p>
+      because the uppercase letter in "African" will be transformed to
+      lowercase, and  the suffixes "n" and "ing" will be removed from
+      "African" and "building" respectively (also, "s" would be removed from
+      "builds").
+}
+
+_texthelpsearching_ [l=mi] {
+
+<a name=query-terms></a>
+<h3>NgÄ kupu hei rapu</h3>
+
+<p>Koia nei ngÄ kupu ka tuhia ki roto i te pouaka rapu. Me tuhi ko ngÄ reta me ngÄ
+nama anake. Kaua e tuhia ngÄ tohutÅ, he uaua te kite i ngÄ tohu tÅ i roto 
+i ngÄ niupepa. Me noho te mokowÄ (wÄhi wÄtea) i waenganui i ngÄ kupu.
+Kaua e tuhi ngÄ tohutuhi (pÄrÄ i te '?' me te '/'), ka tangohia aua tohu e te
+rorohiko nei, ka whakauruhia ko te mokowÄ.
+
+<p>Hei tauira, hei tuku atu i Änei kupu rapu;
+    <ul><kbd>huihuinga-a-motu / Whanganui (1860-1885)</kbd></ul>
+       <p>ka rapua kÄtia e te rorohiko Änei kupu;
+    <ul><kbd>huihuinga a motu Whanganui 1860 1885</kbd></ul><p>
+<p>(arÄ, kua tangohia ngÄ tohutuhi)
+
+<p><br><a name=query-type></a>
+<h3>NgÄ tÅ«momo rapu</h3>
+
+<p>E rua ngÄ tÅ«momo rapu, ko te rapu ngÄwari, ko te rapu
+matatau. Whakaritea tÄtehi i te whÄrangi whiriwhiringa.
+
+<ul>
+  <li>Ka taea hoki te rapu i <b>te katoa</b> o Äu kupu rapu, arÄ,
+      ko ngÄ pukapuka ka whakahokia mai, he mea e mau ana i te katoa o aua
+      kupu. Ka whakarÄrangitia aua pukapuka ki te
+      whakarÄrangi-Ä-pÅ«.<p>
+
+  <li>Ka taea hoki te rapu i <b>Ätehi</b> o Äu kupu rapu, arÄ,
+      ko ngÄ pukapuka ka whakahokia mai he mea kua mau Ätehi o aua
+      kupu. Ka whakarÄrangitia ngÄ pukapuka e pÄ ana ki te
+      ritenga o Äu kupu rapu. Ka puta tuatahitia mai ngÄ
+      pukapuka,
+      
+      <p><ul>
+        <li> e mau ana te maha o Äu kupu rapu;
+	<li> e mau ana ngÄ kupu uaua te kite o Äu kupu rapu;
+	<li> e iti ana, ka whai mai ko ngÄ pukapuka nui.
+      </ul>
+</ul>
+
+<p>Me tuhi te maha o ngÄ kupu rapu hei arahi i te rapu ki tÄu e
+hiahia ana.<p>
+
+<p><br><a name=stemming></a>
+<h3 align=left>NgÄ pÅ« matua, ngÄ pÅ« iti, me ngÄ kÅ«muri hoki</h3>
+
+<p>He whiringa mÅ te pÅ« matua me te pÅ« iti. Äe,
+me tika te rapu i ngÄ pÅ« matua me ngÄ pÅ« iti, kÄore
+rÄnei, hei aha te Äta titiro ki ngÄ pÅ« matua me ngÄ pÅ« iti.
+
+<p>He whiringa anÅ mÅ te kÅ«muri o te kupu. Äe, me
+tika te rapu i ngÄ kÅ«muri. KÄore rÄnei, hei aha te Äta
+titiro ki ngÄ kÅ«muri. MÅ ngÄ kupu rapu PÄkehÄ
+anake te whiringa kÅ«muri.
+
+<p>Hei tauira, mehemea ka kÅwhiritia te <i>hei aha te pÅ« matua me te pÅ«
+iti</i>, Ä, ka kÅwhiritia hoki te <i>hei aha te kÅ«muri o te kupu</i>
+kÄtahi ka tukua Änei kupu hei rapu;
+<p>
+  <ul><kbd>Aotearoa building</kbd></ul>
+    <p>ka Årite te whakahoki mai o ngÄ pukapuka ki Änei kupu rapu
+  <ul><kbd>aotearoa builds</kbd></ul>
+<p>Ka pÄnei i te mea, kÄore te rapu i te Äta titiro mehemea he pÅ«
+matua, he pÅ« iti rÄnei, Ä, ka tangohia hoki ngÄ kÅ«muri (pÄrÄ
+i te "ing", me te "s") i tÄnei whakaritenga.
+}
+
+#-------------------------------------------------------------
+
+
+package abexpl
+
+_imagethispage_ {}
+_pagetitle_ {English Abstracts of the MÄori Language Newspapers}
+
+_content_ {
+<div class="navbar">
+<p class="navbar">
+_optnavigationbar_
+</p>
+</div>
+<h2>English Abstracts of the MÄori Language Newspapers</h2>
+
+<p><i>The English abstracts are being created by a research team at
+the Department of Maori Studies of the University of Auckland. This
+translation work began in 1999 and was funded for a three-year period
+by grants from the Royal Society of New Zealand's Marsden Fund and the
+Trustees of the National Library of New Zealand. The research team
+over that period comprised Professor Ngapare Hopa, Dr Jane McRae,
+Jenifer Curnow, and the postgraduate researchers who wrote the English
+abstracts - Tane Mokena, Dinah Paul, Hazel Petrie, Yvonne Sutherland,
+Lyn Waymouth. The team worked in association with the History of Print
+Culture in New Zealand, the Alexander Turnbull Library, and the
+Computer Science Department of the University of Waikato where
+Professors Mark Apperley and Ian Witten, Te Taka Keegan and others are
+carrying out the on-line conversion of the newspapers and English
+abstracts. Specific help with production of the abstracts is
+acknowledged from Hineira Woodard for translation queries, Stephen
+Innes of the University of Auckland Library's New Zealand &amp;
+Pacific Collection for access to research material, and Roberta Wilson
+for assistance with computers. As further funding is obtained, more
+English abstracts will be included on the website.</i></p>
+      
+<h3>Introduction &amp; Conventions</h3>
+
+<p>We have created the English abstracts to facilitate use of the
+Maori-language newspapers by those who do not read Maori. They are
+designed to guide readers and researchers to particular articles or
+information and to give an impression of a whole newspaper
+issue. Every item in an issue is noted but the abstracts are not an
+account of the entire content. They briefly summarise the main
+subjects of long items, such as editorials, articles, and letters, and
+record, sometimes by a complete translation, small items such as
+notices, advertisements, short news reports. In sum the abstracts
+represent a very abbreviated form of a newspaper, and so to ensure a
+complete reading of any item you will need to refer to, or seek
+translation of, the Maori text. We suggest, therefore, that you do not
+quote from the abstracts.</p>
+
+<p>The abstracts follow the order of items in the newspapers and
+include the titles and subtitles from them. Apart from occasional
+interpolations in square brackets to clarify, inform or query, the
+abstracts report only what is in the newspaper. Where English
+translation is published in the paper, this is noted after a brief
+statement of content. Abbreviations used are listed below.</p>
+
+<p>A few Maori words remain in the abstracts, with translation in
+brackets. These remain either because we regard them as key words for
+researchers of Maori language and culture (words such as waiata,
+whakapapa, whakataukÄ«), or because there is no equivalent in
+English for the word or the word has different meanings in different
+contexts (words such as mana, mÄkutu, tohunga, pÄ). We
+have used the Maori word 'Pakeha' in the abstracts to refer to those
+in New Zealand who are not Maori, because this use is common in the
+newspapers and in current New Zealand speech.</p>
+
+<p>Maori names - personal, place and tribal - have been written
+according to modern spelling. Long vowels have been marked in all
+names, as far as these are known, on the basis of authorities such as
+the Dictionary of New Zealand Biography, of unambiguous component
+words in a name, or of common usage.  In the case of Pakeha whose
+names have been transliterated to Maori, the translators have given
+the original name only when it is evident who the person is; otherwise
+the transliterated form remains.</p>
+
+<p>We hope that you will find the abstracts of value to your research
+and enjoyable for the window they open onto 19th and early 20th
+century Maori life and New Zealand society. We have made every effort
+to make accurate abstracts of the contents, but we remind you that
+these are simply summaries. We have not given them the time or
+research required for full and explicit translations. Given so many
+newspapers, the very diverse content, and the historical context, we
+may have overlooked some things and misjudged others.  If in your
+reading you notice errors or omissions, we would be very grateful if
+you would notify us by email (to j.mcrae@auckland.ac.nz) so that we
+may correct them.</p>
+
+
+<p>The following abbreviations have been used in the abstracts:</p>
+<table border="0">
+<tr valign="top"><td>CMS</td><td>Church Missionary Society</td></tr>
+<tr valign="top"><td>WMMS</td><td>Wesleyan Methodist Missionary Society</td></tr>
+<tr valign="top"><td>MHR</td><td>Member of the House of Representatives</td></tr>
+<tr valign="top"><td>MP</td><td>Member of Parliament</td></tr>
+<tr valign="top"><td>MLC</td><td>Member of the Legislative Council</td></tr>
+</table>
+
+<table border="0" width="_pagewidth_">
+<tr><td align="right">
+<small>Updated in August, 2002</small>
+</td></tr>
+</table>
+}
Index: /collections/trunk/niupepa/perllib/classify/NPDateList.pm
===================================================================
--- /collections/trunk/niupepa/perllib/classify/NPDateList.pm	(revision 14142)
+++ /collections/trunk/niupepa/perllib/classify/NPDateList.pm	(revision 14142)
@@ -0,0 +1,80 @@
+###########################################################################
+#
+# NPDateList.pm -- classifier plugin for sorting by date
+# A component of the Greenstone digital library software
+# from the New Zealand Digital Library Project at the 
+# University of Waikato, New Zealand.
+#
+# Copyright (C) 1999 New Zealand Digital Library Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###########################################################################
+
+# overridden for niupepa as we don't want to include abstracts directly in lists
+
+package NPDateList;
+
+use DateList;
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
+sub BEGIN {
+    @NPDateList::ISA = ('DateList');
+}
+
+my $arguments;
+
+my $options = { 'name'     => "NPDateList",
+		'desc'     => "Niupepa specific DateList",
+		'abstract' => "no",
+		'inherits' => "yes" };
+
+sub new {
+    my ($class) = shift (@_);
+    my ($classifierslist,$inputargs,$hashArgOptLists) = @_;
+    push(@$classifierslist, $class);
+
+    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
+    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
+
+    my $self = new DateList($classifierslist, $inputargs, $hashArgOptLists);
+
+    return bless $self, $class;
+}
+
+sub classify {
+    my $self = shift (@_);
+    my ($doc_obj) = @_;
+
+    # want to ignore abstracts
+    my $doctype = $doc_obj->get_metadata_element($doc_obj->get_top_section(), 'doctype');
+    return if (defined $doctype && $doctype eq 'Description');
+
+    my $doc_OID = $doc_obj->get_OID();
+    my $date = $doc_obj->get_metadata_element ($doc_obj->get_top_section(), 'Date');
+
+    # if this document doesn't contain Date element we won't 
+    # include it in this classification
+    if (defined $date && $date =~ /\d/) {
+	if (defined $self->{'list'}->{$doc_OID}) {
+	    print STDERR "WARNING: DateList::classify called multiple times for $doc_OID\n";
+	} 
+	$self->{'list'}->{$doc_OID} = $date;
+    }
+}
+
+1;
Index: /collections/trunk/niupepa/perllib/classify/NPepaList.pm
===================================================================
--- /collections/trunk/niupepa/perllib/classify/NPepaList.pm	(revision 14142)
+++ /collections/trunk/niupepa/perllib/classify/NPepaList.pm	(revision 14142)
@@ -0,0 +1,154 @@
+###########################################################################
+#
+# NpepaList.pm -- website plugin
+#
+# A component of the Greenstone digital library software
+# from the New Zealand Digital Library Project at the 
+# University of Waikato, New Zealand.
+#
+# Copyright (C) 1999 New Zealand Digital Library Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###########################################################################
+
+# There should probably be a general classifier to do this kind of stuff
+
+package NPepaList;
+
+use BasClas;
+
+use strict;
+no strict 'refs'; # allow filehandles to be variables and viceversa
+
+sub BEGIN {
+    @NPepaList::ISA = ('BasClas');
+}
+
+my $arguments;
+
+my $options = { 'name'     => "NPepaList",
+		'desc'     => "Classifies Niupepa documents by series",
+		'abstract' => "no",
+		'inherits' => "yes" };
+
+sub new {
+    my ($class) = shift (@_);
+    
+    my ($classifierslist,$inputargs,$hashArgOptLists) = @_;
+    push(@$classifierslist, $class);
+
+    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
+    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
+
+    my $self = new BasClas($classifierslist, $inputargs, $hashArgOptLists);
+
+    if ($self->{'info_only'}) {
+	# don't worry about any options etc
+	return bless $self, $class;
+    }
+
+    $self->{'list'} = {};
+    $self->{'metaname'} = "Series";
+    $self->{'sortname'} = "Date";
+    
+    return bless $self, $class;
+
+}
+
+sub init {
+    my $self = shift (@_);
+
+    $self->{'list'} = {};
+}
+
+
+sub classify {
+    my $self = shift (@_);
+    my ($doc_obj) = @_;
+
+    my $doc_OID = $doc_obj->get_OID();
+
+    # want to ignore abstracts
+    my $doctype = $doc_obj->get_metadata_element($doc_obj->get_top_section(), 'doctype');
+    return if (defined $doctype && $doctype eq 'Description');
+
+    my $date = $doc_obj->get_metadata_element($doc_obj->get_top_section(),
+					      $self->{'sortname'});
+    # commentaries have no date but we want them to sort to the top
+    $date = '00000000' unless defined $date;
+
+    my $series = $doc_obj->get_metadata_element ($doc_obj->get_top_section(),
+						 $self->{'metaname'});
+
+    if (defined $series) {
+	if (!defined $self->{'list'}->{$series}) {
+	    $self->{'list'}->{$series} = {};
+	}
+	if (defined $self->{'list'}->{$series}->{$doc_OID}) {
+	    print STDERR "WARNING: NPepaList::classify called multiple times for $doc_OID\n";
+	} 
+	$self->{'list'}->{$series}->{$doc_OID} = $date;
+    } else {
+	print STDERR "WARNING: NpepaList::classify $doc_OID has no Series metadata\n";
+    }
+}
+
+
+sub bydate {
+    # series names are expected to end with their date
+    my ($adate) = $a =~ /([\d-]+)$/;
+    my ($bdate) = $b =~ /([\d-]+)$/;
+    $adate =~ s/-\d+$//;
+    $bdate =~ s/-\d+$//;
+    return $adate <=> $bdate;
+}
+
+sub get_classify_info {
+    my $self = shift (@_);
+
+    my $classifyinfo = $self->get_entry ('Series', 'VList', 'Invisible');
+
+    foreach my $series (sort bydate keys %{$self->{'list'}}) {
+	my $cinfo = $self->get_entry ($series, 'VList');
+	foreach my $OID (sort {$self->{'list'}->{$series}->{$a} 
+			    cmp $self->{'list'}->{$series}->{$b};} keys %{$self->{'list'}->{$series}}) {
+	    push (@{$cinfo->{'contains'}}, {'OID'=>$OID});
+	}
+	push (@{$classifyinfo->{'contains'}}, $cinfo);
+    }
+
+    return $classifyinfo;
+}
+
+sub get_entry {
+    my $self = shift (@_);
+    my ($title, $childtype, $thistype) = @_;
+    
+    # organise into classification structure
+    my %classifyinfo = ('childtype'=>$childtype,
+			'Title'=>$title,
+			'contains'=>[]);
+    $classifyinfo{'thistype'} = $thistype 
+	if defined $thistype && $thistype =~ /\w/;
+
+    return \%classifyinfo;
+}
+
+sub set_number{
+    return;
+}
+
+1;
Index: /collections/trunk/niupepa/perllib/niupepabuildproc.pm
===================================================================
--- /collections/trunk/niupepa/perllib/niupepabuildproc.pm	(revision 14142)
+++ /collections/trunk/niupepa/perllib/niupepabuildproc.pm	(revision 14142)
@@ -0,0 +1,79 @@
+###########################################################################
+#
+# mgbuildproc.pm -- 
+# A component of the Greenstone digital library software
+# from the New Zealand Digital Library Project at the 
+# University of Waikato, New Zealand.
+#
+# Copyright (C) 1999 New Zealand Digital Library Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###########################################################################
+
+### NOTE if you want to change the collection to use MGPP, then change the 
+### three mgbuildproc bits in here to mgppbuildproc.
+
+package niupepabuildproc;
+
+use mgbuildproc;
+use unicode;
+
+BEGIN {
+    @niupepabuildproc::ISA = ('mgbuildproc');
+}
+
+
+sub new {
+    my $class = shift @_;
+    my $self = new mgbuildproc (@_);
+    return bless $self, $class;
+}
+
+# We want to strip out the macrons if we're indexing the text - we then
+# strip any macrons from search terms at runtime so that we'll hit all
+# versions of a word, with or without macrons.
+
+# Note that this behaviour may not be best in all cases with Maori text as
+# there are examples of completely different words being spelt the same
+# except for their respective macrons. For this collection it seems like
+# the best solution though.
+sub filter_text {
+    my $self = shift(@_);
+    
+    if ($self->{'indexing_text'}) {
+	my $unicode_array = &unicode::utf82unicode($_[1]);
+	foreach my $c (@$unicode_array) {
+	    if ($c == 256) {$c = ord("A");}
+	    elsif ($c == 257) {$c = ord("a");}
+	    elsif ($c == 274) {$c = ord("E");}
+	    elsif ($c == 275) {$c = ord("e");}
+	    elsif ($c == 298) {$c = ord("I");}
+	    elsif ($c == 299) {$c = ord("i");}
+	    elsif ($c == 332) {$c = ord("O");}
+	    elsif ($c == 333) {$c = ord("o");}
+	    elsif ($c == 362) {$c = ord("U");}
+	    elsif ($c == 363) {$c = ord("u");}
+	}
+	$_[1] = &unicode::unicode2utf8($unicode_array);
+    }
+}
+
+# all documents are "paged" for this collection
+sub get_document_type {
+    return ("Invisible", "Paged");
+}
+
+1;
Index: /collections/trunk/niupepa/perllib/plugins/AbstractPlug.pm
===================================================================
--- /collections/trunk/niupepa/perllib/plugins/AbstractPlug.pm	(revision 14142)
+++ /collections/trunk/niupepa/perllib/plugins/AbstractPlug.pm	(revision 14142)
@@ -0,0 +1,179 @@
+###########################################################################
+#
+# AbstractPlug.pm --
+# A component of the Greenstone digital library software
+# from the New Zealand Digital Library Project at the 
+# University of Waikato, New Zealand.
+#
+# Copyright (C) 1999 New Zealand Digital Library Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###########################################################################
+
+
+#***************
+
+# don't bother using this anymore - simply split up abstracts manually with
+# the help of the format_abstract.pl script
+
+#***************
+
+
+# AbstractPlug processes the abstracts created for the Niupepa collection
+# (they're word documents). Each series has just one word document that
+# contains all the abstracts for that series.
+# Word files should be named something like 01abstract.doc (the series number
+# at the beginning is the important thing).
+
+# Use this plugin (along with import.pl) to split word documents into 
+# multiple files - this is done as an initial step - instead of creating
+# meaningful files in the archives directory this plugin will create all the 
+# split abstract files in niupepa/newabstracts. these files should then be 
+# copied into the correct place in the real import directory so that import.pl
+# can be rerun.
+# This is kind of an ugly way to do it but NPPlug needs to know if a matching
+# abstract exists when it's processing an issue and it can't know that until
+# the doc files are split up by issue.
+
+# any archives created by this plugin are an unwanted side-effect (as I'm too
+# lazy to override the read() function in this plugin so BasPlug::read() will
+# create an empty gml file for each doc file we process).
+
+package AbstractPlug;
+
+use ConvertToPlug;
+use util;
+
+sub BEGIN {
+    @ISA = ('ConvertToPlug');
+}
+
+sub get_default_process_exp {
+    my $self = shift (@_);
+
+    return q^(?i)\.doc$^;
+}
+
+# do plugin specific processing of doc_obj
+sub process {
+    my $self = shift (@_);
+    my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj) = @_;
+
+    my ($seriesnum) = $file =~ /^(\d+)/;
+    my $dir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "newabstracts", $seriesnum);
+
+    &util::mk_all_dir ($dir) unless -d $dir;
+
+    # clean up the html we got from the conversion process
+    $self->clean_html ($textref);
+
+    # process each issue
+    $$textref =~ s/<p(?:\s[^>]*)?>\s*\n
+		   [^\n]+\n # series title line
+		   <\/p>\n
+		   <p(?:\s[^>]*)?>\s*\n
+		   <b>(.*?)<\/b>.*?\n # issue line (i.e. volume, issue number, date)
+		   <\/p>\n
+		   (<table[^>]*>.*?<\/table>)? # the table itself (may not always be defined)
+	          /$self->process_issue($1, $2, $seriesnum, $dir)/isgxe;
+}
+
+sub process_issue {
+    my $self = shift @_;
+    my ($issue, $text, $seriesnum, $dir) = @_;
+
+    my $OID = $seriesnum . "_";
+
+    my ($volume) = $issue =~ /vol(?:ume)?\s*\.?\s*(\d+)/i;
+    if (defined $volume) {
+	$OID .= $volume . "_";
+#	print STDERR "volume: $volume ($issue)\n";
+    } else {
+	$OID .= "_";
+	my $outhandle = $self->{'outhandle'};
+	print $outhandle "AbstractPlug: Warning: No volume found ($issue)\n";
+    }
+
+    my ($number) = $issue =~ /(?:no|num(?:ber)?)\s*\.?\s*(\d+)/i;
+    if (defined $number) {
+	$OID .= $number;
+#	print STDERR "number: $number ($issue)\n";
+    } else {
+	my $outhandle = $self->{'outhandle'};
+	print $outhandle "AbstractPlug: Warning: No number found ($issue)\n";
+    }
+
+    my $abfile = &util::filename_cat ($dir, "$OID.abstract");
+    open (ABFILE, ">$abfile") || die;
+
+    # links to page numbers
+    if (defined $text) {
+	$text =~ s/(td(?:\s[^>]*)?>\s*\n
+		   <p(?:\s[^>]*)?>\s*\n)
+	           (pp?\s*\.\s*(\d+)(?:-\d+)?)(\s*\n)
+		  /$1<a href=\"_httpdocument_&cl=_cgiargcl_&d=${OID}\.$3&gg=prev\">$2<\/a>$4/isgx;
+
+        print ABFILE $text;
+    } else {
+	# some don't have any abstract information - we'll just use
+	# the issue line to prevent a completely empty page
+        print ABFILE $issue;
+    }
+    close ABFILE;
+}
+
+sub clean_html {
+    my $self = shift (@_);
+    my ($textref) = @_;
+
+    $$textref =~ s/^.*?<body[^>]*>//is; # remove html headers
+    $$textref =~ s/(<div[^>]+>|<\/div>)//isg; # don't really need divs either
+    $$textref =~ s/\s*?border=\"\d+\"//igs; # many tables have borders that we don't want
+    $$textref =~ s/\s*?(row|col)span=\"1\"//igs; # rowspan|colspan=1 don't seem real useful
+    $$textref =~ s/\s*?line\-height:[^;]+;//igs; # don't really want hard-coded line heights either
+    $$textref =~ s/(<td)/$1 valign=top/igs; # like to valign tables
+
+    # convert macron characters to _amn_ type macros
+
+    # the following characters aren't actually what they should be for utf-8 macron 
+    # characters
+    # conversion to utf-8 by wvHtml doesn't appear to correctly encode macrons.
+    $$textref =~ s/\xC3\xA2/_amn_/g;
+    $$textref =~ s/\xC3\xA7/_emn_/g;
+    $$textref =~ s/\xC3\xB4/_omn_/g;
+    $$textref =~ s/\xC3\xBB/_umn_/g;
+    $$textref =~ s/\xC3\x94/_Omn_/g;
+
+    # there might also be some umlauts used in some places
+    $$textref =~ s/\xC3\xAF/_imn_/g;
+
+    # pound sign
+    $$textref =~ s/\xC2\xA3/&\#163/g;
+
+    # check if we've missed any (if this warning is triggered then the corresponding 
+    # character(s) should be added to the above lists
+    if ($$textref =~ /([^\x00-\x7F])/) {
+	my $outhandle = $self->{'outhandle'};
+	print $outhandle "AbstractPlug: Warning: multibyte character found which ";
+	print $outhandle "could not be processed ($1)\n";
+    }
+
+    $$textref =~ s/\n+/\n/g; # remove all those extra blank lines
+}
+
+
+1;
+
Index: /collections/trunk/niupepa/perllib/plugins/NPPlug.pm
===================================================================
--- /collections/trunk/niupepa/perllib/plugins/NPPlug.pm	(revision 14142)
+++ /collections/trunk/niupepa/perllib/plugins/NPPlug.pm	(revision 14142)
@@ -0,0 +1,498 @@
+###########################################################################
+#
+# NPPlug.pm -- Plugin for the niupepa collection
+# A component of the Greenstone digital library software
+# from the New Zealand Digital Library Project at the 
+# University of Waikato, New Zealand.
+#
+# Copyright (C) 1999 New Zealand Digital Library Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+###########################################################################
+
+# The niupepa collection has a file structure as follows:
+# Each niupepa series has its own directory containing some/all 
+# of the following:
+
+# meta.txt - file contains metadata to be associated with all documents
+# in series.
+# *.issue - each issue should have a .issue file which may or may not
+# contain metadata to associate with the issue. also contains the list
+# of filenames that make up the issue (i.e. one for each page). meta.txt
+# is read before *.issue so metadata in .issue files will override that in
+# meta.txt
+# *.commentary - the commentary of the niupepa series (1 per series)
+# text/*.txt/htm - text/html files of issue pages (1 per page) -
+# text files are expected to be either .htm or .txt (lower case).
+# images/*.gif - image files of issue pages (1 per page)
+# abstracts/*.abstract - html files of issue abstracts (1 per issue) 
+
+
+package NPPlug;
+
+use BasPlug;
+use util;
+use strict;
+use unicode;
+
+sub BEGIN {
+    @NPPlug::ISA = ('BasPlug');
+}
+
+
+my $arguments =
+    [
+     { 'name' => "create_log",
+       'desc' => "To create a log file",
+       'type' => "flag" },
+     { 'name' => "logfile",
+       'desc' => "The log file path",
+       'type' => "string",
+       'deft' => "./log.txt"}
+     ];
+
+my $options = { 'name'     => "NPPlug",
+		'desc'     => "{NPPlug.desc}",
+		'abstract' => "no",
+		'inherits' => "yes",
+		'args'     => $arguments };
+
+sub new {
+    my ($class) = shift(@_);
+
+    my ($pluginlist,$inputargs,$hashArgOptLists) = @_;
+    push(@$pluginlist, $class);
+    
+    if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
+    if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
+   
+    my $self = new BasPlug($pluginlist, $inputargs, $hashArgOptLists);
+
+    $self->{'commentaries'} = {};
+    $self->{'num_issues'} = 0;
+    $self->{'num_text_pages'} = 0;
+    $self->{'num_image_pages'} = 0;
+    $self->{'num_abstracts'} = 0;
+    return bless $self, $class;
+}
+
+
+sub get_default_process_exp {
+    my $self = shift (@_);
+    
+    # the last option is an attempt to encode the concept of an html query ...
+    return q^(?i)(\.issue)$^;
+}
+
+
+sub is_recursive {
+    my $self = shift (@_);
+
+    return 0; # this is not a recursive plugin
+}
+
+sub begin {
+    my $self = shift (@_);
+    my ($pluginfo, $base_dir, $processor, $maxdocs) = @_;
+
+    # open up logfile
+    # note that we append to logfile as building will otherwise
+    # overwrite a file generated at import time
+    if ($self->{'create_log'}) {
+	open (LOGFILE, ">>$self->{'logfile'}") || die 
+	    "NPPlug.pm: Couldn't open log file $self->{'logfile'}\n";
+
+	my @time = localtime (time);
+
+	print LOGFILE "------------------------------------------------------------\n";
+	print LOGFILE "Log start $time[3]/$time[4]/" . (1900 + $time[5]) . "\n";
+	print LOGFILE "------------------------------------------------------------\n";
+    }
+}
+
+sub end {
+    my $self = shift (@_);
+
+    if ($self->{'create_log'}) {
+	my $numseries = 0;
+	my $numcommentaries = 0;
+
+	# record missing commentaries in logfile
+	foreach my $key (keys %{$self->{'commentaries'}}) {
+	    $numseries ++;
+	    if (!$self->{'commentaries'}->{$key}) {
+		print LOGFILE "Commentary missing for series $key\n";
+	    } else {
+		$numcommentaries ++;
+	    }
+	}
+	
+	print LOGFILE "\n\nStatistics:\n";
+	print LOGFILE "series: $numseries\n";
+	print LOGFILE "commentaries: $numcommentaries\n";
+	print LOGFILE "issues: $self->{'num_issues'}\n";
+	print LOGFILE "abstracts: $self->{'num_abstracts'}\n";
+	print LOGFILE "text pages: $self->{'num_text_pages'}\n";
+	print LOGFILE "image pages: $self->{'num_image_pages'}\n";
+
+	# close logfile
+	close LOGFILE;
+    }
+}
+
+# return number of files processed, undef if can't process
+# Note that $base_dir might be "" and that $file might 
+# include directories
+sub read {
+    my $self = shift (@_);
+    my ($pluginfo, $base_dir, $file, $metadata, $processor, $maxdocs, $total_count, $gli) = @_;
+
+    my $filename = &util::filename_cat($base_dir, $file);
+
+    # we don't want RecPlug to go recursing into the text, images or 
+    # abstracts directories
+    return 0 if (-d $filename && $filename =~ /(abstracts|images|text)/);
+
+    return 0 if $filename =~ /meta\.txt$/i;
+
+    return undef unless ($filename =~ /\.(issue|commentary|gif)$/i && (-e $filename));
+
+    $self->{'verbosity'} = $processor->{'verbosity'};
+    print STDERR "NPPlug: processing $filename\n" if $self->{'verbosity'};
+
+    my ($dir);
+    ($dir, $file) = $filename =~ /^(.*?)([^\/\\]*)$/;
+    my ($issuekey) = $file =~ /^([^\.\_]*)/;
+
+    if ($filename =~ /\.commentary$/i) {
+	# commentary
+	$self->{'num_processed'} 
+	  += $self->process_commentary ($filename, $issuekey, $dir, $file, $processor);
+	return 1;
+    }
+
+    if ($filename =~ /(.*)on\.gif$/i) {
+	my $root = $1;
+	# create surrogate document to store cover image (on and off) for
+	# newspaper
+
+	$issuekey =~ s/on$//;
+
+	my $doc_obj = new doc  ($dir, "indexed_doc");
+	my $cover = &util::filename_cat ($dir, $issuekey);
+
+	$self->associate_cover_images ($doc_obj, $cover, "" );
+	$doc_obj->set_OID ($issuekey);
+	$processor->process ($doc_obj);
+
+	return 0;
+    }
+    if ($filename =~ /(.*)of\.gif$/i) {
+	# block it
+	return 0;
+    }
+    if ($filename =~ /\.gif$/i) {
+	# Let some other plugin have a go
+	return undef;
+    }
+
+    my $numprocessed = 0;
+    $self->{'commentaries'}->{$issuekey} = 0
+	unless defined $self->{'commentaries'}->{$issuekey};
+
+    my ($abstractfile) = $file =~ /^([^\.]*)\.issue/i;
+    my $abstractOID = $abstractfile . "abstract";
+    $abstractfile .= ".abstract";
+    my $afile = &util::filename_cat($dir, "abstracts", $abstractfile);
+    my $hasabstract = 0;
+    if (-e $afile) {$hasabstract = 1;}
+    else {$abstractOID = undef;}
+
+    # process the .issue file
+    my %meta = ();
+    $numprocessed += $self->process_issue ($filename, $issuekey, $dir, $file, 
+					   $abstractOID, $processor, \%meta);
+
+    # process abstract of this issue
+    if ($hasabstract) {
+	$numprocessed += $self->process_abstract ($afile, $issuekey, $dir, 
+						  $abstractfile, $processor, \%meta);
+    }
+
+    $self->{'num_processed'} += $numprocessed;
+
+
+
+    return 1;
+}
+
+sub process_issue {
+    my $self = shift (@_);
+    my ($filename, $issuekey, $dir, $file, $abstract, $processor, $meta) = @_;
+
+    $self->{'num_issues'} ++;
+    my $doc_obj = new doc ($file, "indexed_doc");
+    my $topsection = $doc_obj->get_top_section();
+    $self->associate_cover_images ($doc_obj, $dir, $issuekey);
+    $doc_obj->set_utf8_metadata_element ($topsection, 'Title', $self->get_title_string($file));
+    $doc_obj->set_utf8_metadata_element ($topsection, 'abstract', $abstract) if defined $abstract;
+    $self->set_main_metadata ($doc_obj, $dir);
+
+    my $com_filename = &util::filename_cat($dir,"$issuekey.commentary");
+    if (-e $com_filename) {
+	$doc_obj->set_utf8_metadata_element ($topsection, "hascom", "1");
+    }
+
+    # process issue's pdf if one exists
+    my ($pdffile) = $file =~ /^([^\.]*)\.issue/i;
+    $pdffile .= ".pdf";
+    $pdffile = &util::filename_cat($dir, "pdf", $pdffile);
+    if (-e $pdffile) {
+	$doc_obj->set_utf8_metadata_element ($topsection, "haspdf", "1");
+	$doc_obj->associate_file($pdffile, "paper.pdf");
+    } else {
+	$doc_obj->set_utf8_metadata_element ($topsection, "haspdf", "0");
+    }
+
+    open (ISSUEFILE, $filename) || die "couldn't open $filename\n";
+    my $line = "";
+    while (defined ($line = <ISSUEFILE>)) {
+	next unless $line =~ /\w/;
+	chomp $line;
+	if ($line =~ /^<([^>]*)>(.*?)\s*$/) {
+	    $doc_obj->set_utf8_metadata_element ($topsection, $1, $2);
+	    $meta->{$1} = $2;
+	} else {
+	    # should be a section name
+	    $line =~ s/^\s+//;
+	    $line =~ s/\s+$//;
+	    my ($pagenum) = $line =~ /([^_]*)$/;
+#	    $doc_obj->create_named_section($pagenum); <-- can't do this anymore as pagenum may 
+#	                                                  be something like "cover"
+	    my $cursection = $doc_obj->insert_section($doc_obj->get_end_child($topsection));
+
+#	    $doc_obj->set_utf8_metadata_element($pagenum, 'Title', $pagenum);
+	    $doc_obj->set_utf8_metadata_element($cursection, 'Title', $pagenum);
+#	    $self->process_text ($dir, $line, $doc_obj, $pagenum);
+	    $self->process_text ($dir, $line, $doc_obj, $cursection);
+#	    $self->process_images ($dir, $line, $doc_obj, $pagenum);
+	    $self->process_images ($dir, $line, $doc_obj, $cursection);
+	}
+    }
+    $file =~ s/\.issue//i;
+    $doc_obj->set_OID ($file);
+    $processor->process ($doc_obj);
+    return 1;
+}
+
+sub process_images {
+    my $self = shift (@_);
+    my ($dir, $page, $doc_obj, $cursection) = @_;
+
+    my $filename = &util::filename_cat ($dir, "images", $page);
+
+    if (-e "$filename.gif") {
+	$self->{'num_image_pages'} ++;
+	$doc_obj->set_utf8_metadata_element ($cursection, "hasimg", "1");
+	$doc_obj->set_utf8_metadata_element ($cursection, "Source", $page);
+	$doc_obj->associate_file("$filename.gif", "$page.gif", "image/gif");	
+    } elsif ($self->{'create_log'}) {
+	$doc_obj->set_utf8_metadata_element ($cursection, "hasimg", "0");
+	print LOGFILE "no fullsize image file for $page\n";
+    }
+
+    if (-e "${filename}_p.gif") {
+	$doc_obj->set_utf8_metadata_element ($cursection, "hasprevimg", "1");
+	$doc_obj->set_utf8_metadata_element ($cursection, "Source", $page);
+	$doc_obj->associate_file("${filename}_p.gif", "${page}_p.gif", "image/gif");	
+    } elsif ($self->{'create_log'}) {
+	$doc_obj->set_utf8_metadata_element ($cursection, "hasprevimg", "0");
+	print LOGFILE "no preview image file for $page\n";
+    }
+}
+
+sub process_text {
+    my $self = shift (@_);
+    my ($dir, $page, $doc_obj, $cursection) = @_;
+    my ($text);
+
+    my $filename = &util::filename_cat ($dir, "text", $page);
+    if (-e "$filename.htm") {
+	$text = $self->get_text ("$filename.htm");
+    } elsif (-e "$filename.txt") {
+	$text = $self->get_text ("$filename.txt");
+    }
+
+    if (defined $text) {
+	$self->{'num_text_pages'} ++;
+	$doc_obj->add_utf8_text ($cursection, $text);
+    } elsif ($self->{'create_log'}) {
+	print LOGFILE "no txt or htm file for $page\n";
+    }
+}
+
+sub process_abstract {
+    my $self = shift (@_);
+    my ($filename, $issuekey, $dir, $file, $processor, $meta) = @_;
+
+    my $text = $self->get_text ($filename);
+    if (defined $text) {
+	$self->{'num_abstracts'} ++;
+	my $doc_obj = new doc ($file, "indexed_doc");
+	my $cursection = $doc_obj->get_top_section();
+	$self->associate_cover_images ($doc_obj, $dir, $issuekey);
+	$doc_obj->set_utf8_metadata_element ($cursection, 'Title', $self->get_title_string($file));
+	$self->set_main_metadata ($doc_obj, $dir);
+	map { $doc_obj->set_utf8_metadata_element ($cursection, $_, $meta->{$_}); } keys %$meta;
+	$doc_obj->set_utf8_metadata_element ($cursection, "doctype", "Description");
+	$doc_obj->add_utf8_text ($cursection, $text);
+	$file =~ s/\.abstract//i;
+	$doc_obj->set_OID ($file . "abstract");
+	$processor->process ($doc_obj);
+	return 1;
+    }
+
+    if ($self->{'create_log'}) {
+	print LOGFILE "abstract file $filename doesn't exist\n";
+    }
+    return 0;
+}
+
+sub process_commentary { 
+    my $self = shift (@_);
+    my ($filename, $issuekey, $dir, $file, $processor) = @_;
+
+    my $text = $self->get_text ($filename);
+
+    return 0 unless defined $text;
+
+    $self->{'commentaries'}->{$issuekey} = 1;
+    my $doc_obj = new doc ($file, "indexed_doc");
+    my $cursection = $doc_obj->get_top_section();
+    $self->associate_cover_images ($doc_obj, $dir, $issuekey);
+    $doc_obj->set_utf8_metadata_element ($cursection, 'Title', "_commentary_");
+    $self->set_main_metadata ($doc_obj, $dir);
+    $doc_obj->set_utf8_metadata_element ($cursection, "doctype", "Commentary");
+    $doc_obj->add_utf8_text ($cursection, $text);
+    $doc_obj->set_OID ($issuekey . "commentary");
+    $processor->process ($doc_obj);
+    return 1;
+}
+
+sub associate_cover_images {
+    my $self = shift (@_);
+    my ($doc_obj, $dir, $issuekey) = @_;
+
+    my $cover = &util::filename_cat ($dir, $issuekey);
+    $doc_obj->associate_file("${cover}on.gif", "${issuekey}/coveron.gif", "image/gif");
+    $doc_obj->associate_file("${cover}of.gif", "${issuekey}/coverof.gif", "image/gif");
+}
+
+# reads in the meta.txt file and sets metadata
+sub set_main_metadata {
+    my $self = shift (@_);
+    my ($doc_obj, $dir) = @_;
+
+    my $metafile = &util::filename_cat ($dir, "meta.txt");
+    return unless (-e $metafile);
+
+    if (!open (METAFILE, $metafile)) {
+	print STDERR "NPPlug: Couldn't read $metafile\n" if $self->{'verbosity'};
+	return;
+    }
+
+    my $cursection = $doc_obj->get_top_section();
+    my $line = "";
+    while (defined ($line = <METAFILE>)) {
+	next unless $line =~ /\w/;
+	chomp $line;
+	if ($line =~ /<([^>]*)>(.*)$/) {
+	    # note we're using set_metadata_element (not add_metadata_element)
+	    # this will override any previously set metadata of the same name
+	    $doc_obj->set_utf8_metadata_element ($cursection, $1, $2);
+	} elsif ($self->{'verbosity'}) {
+	    print STDERR "NPPlug: Badly formatted line in $metafile\n";
+	    print STDERR "meta.txt lines should be formatted '<metaname>metavalue'\n";
+	}
+    }
+}
+
+sub get_text {
+    my $self = shift (@_);
+    my ($filename) = @_;
+
+    if (open (FILE, $filename)) {
+	my $text = "";
+	my $line = "";
+	if ($filename =~ /\.(htm|commentary|abstract)$/i) {
+	    my $savedtext = "";
+	    my $foundbody = 0;
+	    while (defined ($line = <FILE>)) {
+		if ($line =~ s/.*?<body[^>]*>//i) {
+		    $foundbody = 1;
+		}
+		$line =~ s/(<\/?html[^>]*>|<\/?head[^>]*>|<\/p>|<\/?font[^>]*>|<\/?body[^>]*>)//ig;
+		if ($foundbody) {
+		    $text .= $line; 
+		} else {
+		    $savedtext .= $line;
+		}
+	    }
+	    close FILE;
+	    if (!$foundbody) {$text = $savedtext;}
+	    if ($filename =~ /\.(commentary|abstract)$/i) {
+		# commentaries and abstracts should already be utf8
+		return $text;
+	    } else {
+		# a few extended ascii characters have snuck through 
+		# in some text files so we need to convert them to utf8
+		return &unicode::ascii2utf8(\$text);
+	    }
+
+	} else {
+	    while (defined ($line = <FILE>)) {
+		$line = "<p>\n" unless $line =~ /\w/;
+		$text .= $line;
+	    }
+	    close FILE;
+	    # a few extended ascii characters have snuck through 
+	    # in some text files so we need to convert them to utf8
+	    return &unicode::ascii2utf8(\$text);
+	}
+
+    } else {
+	print STDERR "NPPlug: Warning: get_text() couldn't open $filename\n" 
+	    if $self->{'verbosity'};
+	return undef;
+    }
+}
+
+sub get_title_string {
+    my $self = shift (@_);
+    my ($filename) = @_;
+
+    $filename =~ s/\.(issue|abstract)$//i;
+    my ($series, $vol, $num) = split /\_/, $filename;
+    my $title = "";
+    $title .= "_vol_ $vol" if defined $vol && $vol =~ /\w/;
+    if (defined $num && $num =~ /\w/) {
+	$title .= ", " if defined $vol && $vol =~ /\w/;
+	$title .= "_num_ $num";
+    }
+    return $title;
+}
+
+1;
