Index: trunk/cstr/perllib/classify/CSTRList.pm
===================================================================
--- trunk/cstr/perllib/classify/CSTRList.pm	(revision 910)
+++ trunk/cstr/perllib/classify/CSTRList.pm	(revision 911)
@@ -80,5 +80,6 @@
 
     # organise into classification structure
-    my %classifyinfo = ('classifytype'=>'List',
+    my %classifyinfo = ('thistype'=>'Invisible',
+			'childtype'=>'VList',
 			'Title'=>'Browse',
 			'contains'=>[]);
Index: trunk/cstr/src/recpt/Makefile.in
===================================================================
--- trunk/cstr/src/recpt/Makefile.in	(revision 910)
+++ trunk/cstr/src/recpt/Makefile.in	(revision 911)
@@ -64,13 +64,12 @@
 
 
-HEADERS = cstrbrowsetools.h cstrdocaction.h cstrqueryaction.h \
-	  cstrquerytools.h
+HEADERS = cstrdocaction.h cstrbrowsetools.h cstrpagedbrowserclass.h
 
-SOURCES = cstrlibrarymain.cpp cstrbrowsetools.cpp cstrdocaction.cpp \
-	  cstrqueryaction.cpp cstrquerytools.cpp
+SOURCES = cstrlibrarymain.cpp cstrdocaction.cpp cstrbrowsetools.cpp \
+	  cstrpagedbrowserclass.cpp
 
 
-OBJECTS = cstrlibrarymain.o cstrbrowsetools.o cstrdocaction.o \
-	  cstrqueryaction.o cstrquerytools.o
+OBJECTS = cstrlibrarymain.o cstrdocaction.o cstrbrowsetools.o \
+	  cstrpagedbrowserclass.o
 
 
@@ -79,7 +78,7 @@
 all : $(EXEC)
 
-install: $(EXEC)
-	cp $(EXEC) /home/nzdl/nzdl-1.2/cgi-bin;
-#	strip /home/httpd/cgi-bin/$(EXEC)
+install: 
+	cp $(EXEC) $(GD)/fast-cgi-bin/$(EXEC); \
+	strip $(GD)/fast-cgi-bin/$(EXEC)
 
 clean:
@@ -94,4 +93,13 @@
 
 CSTRLIBRARY_OBJS = $(OBJECTS) \
+    $(MAINRECPTDIR)/querytools.o \
+    $(MAINRECPTDIR)/browsetools.o \
+    $(MAINRECPTDIR)/browserclass.o \
+    $(MAINRECPTDIR)/vlistbrowserclass.o \
+    $(MAINRECPTDIR)/hlistbrowserclass.o \
+    $(MAINRECPTDIR)/datelistbrowserclass.o \
+    $(MAINRECPTDIR)/invbrowserclass.o \
+    $(MAINRECPTDIR)/pagedbrowserclass.o \
+    $(MAINRECPTDIR)/htmlbrowserclass.o \
     $(MAINRECPTDIR)/receptionist.o \
     $(MAINRECPTDIR)/recptconfig.o \
Index: trunk/cstr/src/recpt/cstrbrowsetools.cpp
===================================================================
--- trunk/cstr/src/recpt/cstrbrowsetools.cpp	(revision 910)
+++ trunk/cstr/src/recpt/cstrbrowsetools.cpp	(revision 911)
@@ -26,102 +26,12 @@
  *********************************************************************/
 
-/*
-   $Log$
-   Revision 1.1  2000/02/01 22:32:37  sjboddie
-   Initial revision
-
-   Revision 1.1  1999/09/07 21:49:41  sjboddie
-   new cstr receptionist
-
- */
-
-
 #include "cstrbrowsetools.h"
 #include "OIDtools.h"
 #include "cgiutils.h"
-
-// simply checks to see if formatstring begins with a <td> tag
-static bool is_table_content (const text_t &formatstring) {
-  text_t::const_iterator here = formatstring.begin();
-  text_t::const_iterator end = formatstring.end();
-  
-  while (here != end) {
-    if (*here != ' ') {
-      if (*here == '<') {
-	if ((*(here+1) == 't' || *(here+1) == 'T') &&
-	    (*(here+2) == 'd' || *(here+2) == 'D') &&
-	    (*(here+3) == '>' || *(here+3) == ' '))
-	  return true;
-      } else return false;
-    }
-    here ++;
-  }
-  return false;
-}
-
-static bool is_table_content (const format_t *formatlistptr) {
-
-  if (formatlistptr == NULL) return false;
-  
-  if (formatlistptr->command == comText)
-    return is_table_content (formatlistptr->text);
-    
-  return false;
-}
-
-
-// output_controls displays the detach, expand/contract contents,
-// expand/contract text and highlighting/no highlighting buttons
-static void output_controls (cgiargsclass &args, const text_tarray &ibuttons,
-			     recptproto */*collectproto*/, displayclass &disp, 
-			     outconvertclass &outconvert, ostream &textout, 
-			     ostream &/*logout*/) {
-
-  if (args["u"] != "1") {
-  
-    FilterResponse_t response;
-    text_tset metadata;
-    text_tarray buttons;
-
-    text_t &arg_gg = args["gg"];
-
-    text_tarray::const_iterator here = ibuttons.begin();
-    text_tarray::const_iterator end = ibuttons.end();
-
-    while (here != end) {
-    
-      if (*here == "Detach")
-	buttons.push_back ("_document:imagedetach_");
-      else if (*here == "Highlight" && arg_gg == "text") {
-	if (args["hl"] == "1") 
-	  buttons.push_back ("_document:imagenohighlight_");
-	else 
-	  buttons.push_back ("_document:imagehighlight_");
-	//      } else if (*here == "Expand Contents") {
-	//	if (args["gc"] == "1")
-	//	  buttons.push_back ("_document:imagecontracttoc_");
-	//	else 
-	//	  buttons.push_back ("_document:imageexpandtoc_");
-      } else if (*here == "Expand Text" && arg_gg == "text") {
-	if (args.getintarg("gt"))
-	  buttons.push_back ("_document:imagecontracttext_");
-	else 
-	  buttons.push_back ("_document:imageexpandtext_");
-      }
-      here ++;
-    }
-
-    here = buttons.begin();
-    end = buttons.end();
-    int count = 0;
-    while (here != end) {
-      if ((count != 0) && ((count % 3) == 0)) textout << "<br>\n";
-      textout << outconvert << disp << *here;
-      count ++;
-      here ++;
-    }
-  }
-}
-
+#include "browsetools.h"
+
+
+
+// outputs the postscript, abstract, figures etc buttons
 static void output_cstr_controls (cgiargsclass &args, const text_t &source, 
 				  const text_t &description, const text_t &figures, 
@@ -156,692 +66,181 @@
 }
 
-/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-Functions for generating a document type tables of contents. These aren't really tables of
-contents at all, just a title, some navigation buttons and arrows and maybe a page ? of ?
-type thing. These should only be called for document level tocs (i.e. when the "d" argument 
-is set) as I don't think it makes sense to display top level classifications in this way.
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
-void output_document_toc (cgiargsclass &args, const formatinfo_t &formatinfo,
-			  recptproto *collectproto, displayclass &disp, 
-			  outconvertclass &outconvert, ostream &textout, 
-			  ostream &logout) {
-
+
+
+void output_cstr_toc (cgiargsclass &args, browsermapclass *browsermap,
+                 formatinfo_t &formatinfo, recptproto *collectproto,
+                 displayclass &disp, outconvertclass &outconvert,
+				ostream &textout, ostream &logout) {
+
+  int tabcount = 0;
+  bool havecontrols = false;
+  bool fulltoc = false;
+
+
+  if (args["cl"] != "search") {
+    // see if there's a FullTOC string
+    text_t cl_top, full_toc;
+    get_top (args["cl"], cl_top);
+    if (get_formatstring (cl_top, "FullTOC", formatinfo.formatstrings, full_toc))
+      if (full_toc == "true") fulltoc = true;
+  }
   text_t &arg_d = args["d"];
-  if (arg_d.empty()) return;
-
-  text_tset metadata;
-  FilterResponse_t response;
-  ResultDocInfo_t docinfo;
-  text_t booktop, facsimiles, figures, description, source, summary;
-  text_t &collection = args["c"];
-
-  metadata.insert ("Title");
-  if (get_info (arg_d, collection, metadata, false, collectproto, response, logout)) {
-
-    metadata.erase (metadata.begin(), metadata.end());
-    docinfo = response.docInfo[0];
-
-    textout 
-      << "\n<!-- Table of Contents produced by cstrbrowsetools::output_document_toc -->\n\n";
-
-    // get title and author of book
-    get_top (arg_d, booktop);
-    metadata.insert ("facsimiles");
-    metadata.insert ("figures");
-    metadata.insert ("Description");
-    metadata.insert ("Source");
-    metadata.insert ("Summary");
-    get_info (booktop, collection, metadata, false, collectproto, response, logout);
-    facsimiles = response.docInfo[0].metadata[0].values[0];
-    figures = response.docInfo[0].metadata[1].values[0];
-    description = response.docInfo[0].metadata[2].values[0];
-    source = response.docInfo[0].metadata[3].values[0];
-    summary = response.docInfo[0].metadata[4].values[0];
-
-    metadata.erase (metadata.begin(), metadata.end());
+  // get the facsimile image (if there is one) and the control buttons
+  // if we're inside a book
+  if ((!fulltoc) && (!arg_d.empty())) {
+
+    // this code from old cstr browsetools outputdocument_toc
+    text_tset metadata;
+    FilterResponse_t response;
+    ResultDocInfo_t docinfo;
+    text_t booktop, facsimiles, figures, description, source, summary;
+    text_t &collection = args["c"];
+
+    metadata.insert ("Title");
+    if (get_info (arg_d, collection, metadata, false, collectproto, response, logout)) {
+
+      metadata.erase (metadata.begin(), metadata.end());
+      docinfo = response.docInfo[0];
+      
+      textout 
+	<< "\n<!-- Table of Contents produced by cstrbrowsetools::output_document_toc -->\n\n";
+
+      // get title and author of book
+      get_top (arg_d, booktop);
+      metadata.insert ("facsimiles");
+      metadata.insert ("figures");
+      metadata.insert ("Description");
+      metadata.insert ("Source");
+      metadata.insert ("Summary");
+      get_info (booktop, collection, metadata, false, collectproto, response, logout);
+      facsimiles = response.docInfo[0].metadata["facsimiles"].values[0];
+      figures = response.docInfo[0].metadata["figures"].values[0];
+      description = response.docInfo[0].metadata["Description"].values[0];
+      source = response.docInfo[0].metadata["Source"].values[0];
+      summary = response.docInfo[0].metadata["Summary"].values[0];
+
+      metadata.erase (metadata.begin(), metadata.end());
   
-    textout << outconvert << disp 
-	    << "<p><center>\n"
-	    << "<table cellpadding=0 cellspacing=0 width=_pagewidth_>\n"
-	    << "<tr valign=top><td>\n";
-
-    // don't want arrows and page number if text expanded
-    if (formatinfo.DocumentArrowsBottom && !args.getintarg ("gt")) {
+      textout << outconvert << disp 
+	      << "<p><center>\n"
+	      << "<table cellpadding=0 cellspacing=0 width=_pagewidth_>\n"
+	      << "<tr valign=top><td>\n";
+
+      /*      
+      // don't want arrows and page number if text expanded
+      if (formatinfo.DocumentArrowsBottom && !args.getintarg ("gt")) {
     
-      // previous arrow
-      textout << outconvert << disp << "<table><tr valign=top>\n"
-	      << "<td align=left>_document:prevarrow_</td>\n";
+	// previous arrow
+	textout << outconvert << disp << "<table><tr valign=top>\n"
+		<< "<td align=left>_document:prevarrow_</td>\n";
     
-      // page ? of ? text
-      textout << "<td align=center>\n";
-      
-      if (is_number (docinfo.metadata[0].values[0])) {
-	text_t doctop;
-	metadata.insert ("Title");
-	get_top (arg_d, doctop);
-	// get title of last sibling
-	if (get_info (doctop + ".lc", collection, metadata, false, collectproto, response, logout)) {
-	  if (is_number (response.docInfo[0].metadata[0].values[0])) {
-	    textout << outconvert << disp << "_document:page_" << docinfo.metadata[0].values[0]
-		    << "_document:of_" << response.docInfo[0].metadata[0].values[0];
-	  } else {
-	    textout << outconvert << docinfo.metadata[0].values[0];
+	// page ? of ? text
+	textout << "<td align=center>\n";
+	
+	if (is_number (docinfo.metadata["Title"].values[0])) {
+	  text_t doctop;
+	  metadata.insert ("Title");
+	  get_top (arg_d, doctop);
+	  // get title of last sibling
+	  if (get_info (doctop + ".lc", collection, metadata, false, collectproto, response, logout)) {
+	    if (is_number (response.docInfo[0].metadata["Title"].values[0])) {
+	      textout << outconvert << disp << "_document:page_" << docinfo.metadata["Title"].values[0]
+		      << "_document:of_" << response.docInfo[0].metadata["Title"].values[0];
+	    } else {
+	      textout << outconvert << docinfo.metadata["Title"].values[0];
+	    }
 	  }
-	}
-      } else {
-	textout << outconvert << docinfo.metadata[0].values[0];
+	} else {
+	  textout << outconvert << docinfo.metadata["Title"].values[0];
       }
   
-      // next arrow
-      textout << outconvert << disp << "</td>\n<td align=right>_document:nextarrow_</td>\n</table>\n";
+	// next arrow
+	textout << outconvert << disp << "</td>\n<td align=right>_document:nextarrow_</td>\n</table>\n";
+      }
+      
+      // goto line ****** ????????????
+      //if (formatinfo.DocumentGoTo)
+      textout << outconvert << disp << "_document:gotoform_";
+      */
+
+      //if (formatinfo.DocumentArrowsBottom && !args.getintarg ("gt")) {
+	if (args.getintarg("gc") == 1) {
+	
+	  // expanded table of contents
+	  expanded_contents (args, tabcount, fulltoc, browsermap, formatinfo, 
+			     collectproto, disp, outconvert, textout, logout);
+	} else {
+	  
+	  // contracted table of contents
+	  contracted_contents (args, tabcount, fulltoc, browsermap, formatinfo, 
+			       collectproto, disp, outconvert, textout, logout);
+	}
+	// }
+      // control buttons
+      output_controls (args, formatinfo.DocumentButtons, collectproto, 
+		       disp, outconvert, textout, logout);
+      textout << "</td><td valign=top>\n";
+
+      if (!summary.empty())
+	textout << outconvert << summary << "\n";
+
+      output_cstr_controls (args, source, description, figures, 
+			    disp, outconvert, textout);
+
+      textout << "</td>\n";
+    
+      // facsimile image
+      // only want the first facsimile (some documents have two)
+      if (!facsimiles.empty()) {
+	text_t::const_iterator fbegin = facsimiles.begin();
+	facsimiles = substr (fbegin, findchar (fbegin, facsimiles.end(), ','));
+	textout << outconvert << disp << "<td valign=top><a href=\"_httpcurrentdocument_&gg=facsimiles\">"
+		<< "<img src=\"_httpcollimg_/_thisOID_/" 
+		<< facsimiles << "\" width=150 height=250></a>" << "</td>\n";
+      }
+      
+
+      textout << "</td></tr></table></center>\n";
+      textout << "\n<!-- end of Table of Contents -->\n";
+      
     }
 
-    // goto line ****** ????????????
-    //if (formatinfo.DocumentGoTo)
-    //  textout << outconvert << disp << "_document:gotoform_";
-
-    // control buttons
-    output_controls (args, formatinfo.DocumentButtons, collectproto, 
-		     disp, outconvert, textout, logout);
+    /*    textout << "<p><table cellpadding=0 cellspacing=0><tr>\n";
+    textout << "<td valign=top";
+    if (formatinfo.DocumentContents) textout << " width=200>\n";
+    else textout << " width=100%>\n";
+    if (formatinfo.DocumentImages) 
+      output_cover_image (args, collectproto, disp, outconvert, textout, logout);
+    else if (formatinfo.DocumentTitles)
+      output_titles (args, collectproto, formatinfo, disp, outconvert, textout, logout);
+    output_controls (args, formatinfo.DocumentButtons, collectproto, disp, 
+		     outconvert, textout, logout);
     textout << "</td><td valign=top>\n";
-
-    if (!summary.empty())
-      textout << outconvert << summary << "\n";
-
-    output_cstr_controls (args, source, description, figures, 
-			  disp, outconvert, textout);
-
-    textout << "</td>\n";
-    
-    // facsimile image
-    // only want the first facsimile (some documents have two)
-    if (!facsimiles.empty()) {
-      text_t::const_iterator fbegin = facsimiles.begin();
-      facsimiles = substr (fbegin, findchar (fbegin, facsimiles.end(), ','));
-      textout << outconvert << disp << "<td valign=top><a href=\"_httpcurrentdocument_&gg=facsimiles\">"
-	      << "<img src=\"_httpcollection_/archives/_thisOID_/" 
-	      << facsimiles << "\" width=150 height=250></a>" << "</td>\n";
+    havecontrols = true; */
+  }
+  /*
+  if (formatinfo.DocumentContents || args["d"].empty()) {
+    if (args.getintarg("gc") == 1) {
+      
+      // expanded table of contents
+      expanded_contents (args, tabcount, fulltoc, browsermap, formatinfo, 
+			 collectproto, disp, outconvert, textout, logout);
+    } else {
+      
+      // contracted table of contents
+      contracted_contents (args, tabcount, fulltoc, browsermap, formatinfo, 
+			   collectproto, disp, outconvert, textout, logout);
     }
-
-
-    textout << "</td></tr></table></center>\n";
-    textout << "\n<!-- end of Table of Contents -->\n";
-
-  }
+  }
+  */
+  if (havecontrols) textout << "</td></tr></table>\n";
 }
 
 
-/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-Functions for generating a "Hierarchy" type table of contents. These can be used either
-at top classification level or at document level (the difference being that a cover
-image and control buttons may be displayed at document level).
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
-// prototypes
-
-static void output_contracted_hierarchy_toc (const text_t &classifytype, text_t &formatstring, 
-					     cgiargsclass &args, recptproto *collectproto, 
-					     displayclass &disp, outconvertclass &outconvert, 
-					     ostream &textout, ostream &logout);
-
-static void output_expanded_hierarchy_toc (cgiargsclass &args, recptproto *collectproto,
-					   displayclass &disp, outconvertclass &outconvert,
-					   ostream &textout, ostream &logout);
-
-static void output_parents_toc (cgiargsclass &args, const FilterResponse_t &parents,
-				int &tabcount, displayclass &disp,
-				format_t *formatlistptr, outconvertclass &outconvert, 
-				ostream &textout, ostream &logout);
-
-static void output_siblings_toc (const text_t &classifytype, cgiargsclass &args, 
-				 const FilterResponse_t &siblings, int &tabcount, 
-				 displayclass &disp, format_t *formatlistptr, 
-				 outconvertclass &outconvert, ostream &textout, 
-				 ostream &logout);
-
-static void output_stdlist (cgiargsclass &args, ResultDocInfo_tarray::iterator &here,
-			    ResultDocInfo_tarray::iterator &end, bool intable,
-			    displayclass &disp, format_t *formatlistptr, 
-			     outconvertclass &outconvert, ostream &textout);
-
-static void output_datelist (cgiargsclass &args, ResultDocInfo_tarray::iterator &here,
-			     ResultDocInfo_tarray::iterator &end, bool intable,
-			     displayclass &disp, format_t *formatlistptr, 
-			     outconvertclass &outconvert, ostream &textout);
-
-
-void output_standard_toc (const text_t &classifytype, const formatinfo_t &formatinfo,
-			  text_t &formatstring, cgiargsclass &args, 
-			  recptproto *collectproto, displayclass &disp, 
-			  outconvertclass &outconvert, ostream &textout, 
-			  ostream &logout) {
-
-  bool havecontrols = false;
-
-  textout << "\n<!-- Table of Contents produced by cstrbrowsetools::output_standard_toc -->\n\n";
-
-  // get the cover image (if there is one) and the control buttons
-  // if we're inside a book
-  if (!args["d"].empty()) {
-    textout << "<p><table cellpadding=0 cellspacing=0><tr>\n";
-    textout << "<td valign=top width=200>\n";
-    //    if (cover) output_cover_image (args, collectproto, disp, outconvert, textout, logout);
-    output_controls (args, formatinfo.DocumentButtons, collectproto, disp, outconvert, textout, logout);
-    textout << "</td><td valign=top>\n";
-    havecontrols = true;
-  }
-  
-  // get table of contents
-  textout << "<table>\n";
-
-  if (args.getintarg("gc"))
-    output_expanded_hierarchy_toc(args, collectproto, disp, outconvert, textout, logout);
-  else
-    output_contracted_hierarchy_toc(classifytype, formatstring, args, collectproto, 
-				    disp, outconvert, textout, logout);
-
-  textout << "</table>\n";
-
-  if (havecontrols) textout << "</td></tr></table>\n";
-
-  textout << "\n<!-- end of Table of Contents -->\n";
-}
-
-
-void output_contracted_hierarchy_toc (const text_t &classifytype, text_t &formatstring, 
-				      cgiargsclass &args, recptproto *collectproto, 
-				      displayclass &disp, outconvertclass &outconvert, 
-				      ostream &textout, ostream &logout) {
-
-  int tabcount = 0;
-  text_tarray parents;
-  text_tset metadata;
-  FilterResponse_t fsiblings, fparents;
-  bool getParents = false;
-
-  text_t &arg_d = args["d"];
-  text_t OID = arg_d;
-  if (OID.empty()) OID = args["cl"];
-  text_t &collection = args["c"];
-
-  // if format string is empty use the default
-  if (formatstring.empty()) 
-    formatstring = "<td valign=top nowrap>[link][icon][/link]</td><td>{Or}{[Title],Untitled}</td>";
-
-  format_t *formatlistptr = new format_t();
-  parse_formatstring (formatstring, formatlistptr, metadata, getParents);
-
-  metadata.insert ("Date");
-  metadata.insert ("hastxt");
-  metadata.insert ("haschildren");
-  metadata.insert ("doctype");
-  metadata.insert ("classifytype");
-
-  if (has_children (OID, collection, collectproto, logout)) {
-      get_parents_array (OID + ".fc", parents);
-
-      if (!get_children (OID, collection, metadata, getParents,
-			 collectproto, fsiblings, logout))
-	return;
-  } else {
-    get_parents_array (OID, parents);
-    if (!get_children (OID + ".pr", collection, metadata, 
-		       getParents, collectproto, fsiblings, logout))
-	return;
-  }
-  if (!get_info (parents, collection, metadata, false, collectproto, fparents, logout)) return;
-  
-  if (!fparents.docInfo.empty()) 
-    output_parents_toc(args, fparents, tabcount, disp, 
-		       formatlistptr, outconvert, textout, logout);
-  
-  if (!fsiblings.docInfo.empty()) 
-    output_siblings_toc (classifytype, args, fsiblings, tabcount, disp, 
-			 formatlistptr, outconvert, textout, logout);
-}
-void output_parents_toc (cgiargsclass &args, const FilterResponse_t &parents,
-			 int &tabcount, displayclass &disp,
-			 format_t *formatlistptr, outconvertclass &outconvert,
-			 ostream &textout, ostream &/*logout*/) {
-
-  text_t tab, icon;
-  text_t &arg_cl = args["cl"];
-  text_t &arg_d = args["d"];
-  int numcols = parents.docInfo.size() + 1;
-  
-  bool intable = is_table_content (formatlistptr);
-  
-  ResultDocInfo_tarray::iterator thisparent = parents.docInfo.begin();
-  ResultDocInfo_tarray::iterator end = parents.docInfo.end();
-
-  int len = (*thisparent).metadata.size();
-  const text_t &classifytype = (*thisparent).metadata[len-1].values[0];
-
-  // don't want top level of any classifications to be displayed
-  if (arg_d.empty() && thisparent != end) {thisparent ++; numcols --;}
-
-  // don't want second level of classifications using classification links
-  if ((classifytype == "AZList" || classifytype == "DateList") && (thisparent != end))
-    {thisparent ++; numcols --;}
-
-  // the tab line
-  if (thisparent != end) {
-    text_t coltabs;
-    for (int i = 0; i < numcols; i ++) coltabs += "_document:tab_";
-    textout << outconvert << disp << "<tr>" << coltabs << "<td></td></tr>\n";
-  }
-
-  while (thisparent != end) {
-
-    const text_t &doctype = (*thisparent).metadata[len-2].values.back();
-
-    // set up icon and pointer
-    icon = "_document:icon";
-    if ((doctype != "classify") && ((*thisparent).OID == arg_d))
-      icon += "arrow";
-    if (doctype == "classify") icon += "openbookshelf_";
-    else if (is_top((*thisparent).OID)) icon += "openbook_";
-    else icon += "openfolder_";
-    
-    if (tabcount == 1) textout << "<td></td>\n";
-    else if (tabcount > 1) textout << "<td colspan=" << tabcount << "></td>";
-    
-    // set up the link
-    text_t link = "<a href=\"_httpdocument_";
-    if (is_top((*thisparent).OID) && args.getintarg("x")) link = "<a name=top>";
-    else 
-      if (doctype == "classify") link += "&cl=" + (*thisparent).OID + ".pr\">";
-      else 
-	if (is_top ((*thisparent).OID)) 
-	  if (arg_cl.empty())
-	    link = "<a name=top>";
-	  else if (arg_cl == "search")
-	    link = "<a href=\"_httpquery_\">";
-	  else
-	    link += "&cl=" + arg_cl + "\">";
-	else link += "&cl=" + arg_cl + "&d=" + (*thisparent).OID + ".pr\">";
-    
-    if ((numcols-tabcount) == 1) textout << "<td>";
-    else if ((numcols-tabcount) > 1) textout << "<td colspan=" 
-					     << (numcols-tabcount) << ">";
-
-    if (intable) textout << "<table><tr>";
-    
-    textout << outconvert << disp 
-	    << get_formatted_string (*thisparent, formatlistptr, link, icon);
-    
-    if (intable) textout << "</tr></table>";
-    textout << "</td></tr>\n";
-
-    tabcount ++;
-    thisparent ++;
-  }
-}
-
-
-void output_siblings_toc (const text_t &classifytype, cgiargsclass &args, 
-			  const FilterResponse_t &siblings, int &tabcount, 
-			  displayclass &disp, format_t *formatlistptr, 
-			  outconvertclass &outconvert, ostream &textout, 
-			  ostream &/*logout*/) {
-
-  bool intable = is_table_content (formatlistptr); 
-
-  ResultDocInfo_tarray::const_iterator thissibling = siblings.docInfo.begin();
-  ResultDocInfo_tarray::const_iterator sibend = siblings.docInfo.end();
-
-  if (thissibling == sibend) return;
-
-  // tabbing
-  if (tabcount) {
-    if (tabcount == 1) textout << "<tr><td></td>\n";
-    else if (tabcount > 1) textout << "<tr><td colspan=" << tabcount << "></td>";
-    textout << "<td><table>\n";
-  }
-
-  if (!intable) textout << "<tr><td>\n";
-  
-  if (classifytype == "DateList")
-    output_datelist (args, thissibling, sibend, intable, disp, 
-		     formatlistptr, outconvert, textout);
-  else 
-    output_stdlist (args, thissibling, sibend, intable, disp, 
-		    formatlistptr, outconvert, textout);
-
-  if (!intable) textout << "</td></tr></table>\n";
-  if (tabcount) textout << "</table></td></tr>\n";
-}
-
-void output_stdlist (cgiargsclass &args, ResultDocInfo_tarray::iterator &here,
-		     ResultDocInfo_tarray::iterator &end, bool intable,
-		     displayclass &disp, format_t *formatlistptr, 
-		     outconvertclass &outconvert, ostream &textout) {
-
-  text_t icon;
-  int count = 1;
-  int gt = args.getintarg("gt");
-  text_t &arg_cl = args["cl"];
-  text_t &arg_d = args["d"];
-
-  while (here != end) {
-
-    int len = (*here).metadata.size();
-    const text_t &doctype = (*here).metadata[len-2].values.back();
-    const text_t &hastxt = (*here).metadata[len-4].values.back(); 
-    const text_t &haschildren = (*here).metadata[len-3].values.back();
-
-    // set up icon and pointer
-    icon = "_document:icon";
-    if (doctype == "classify") {
-      if (((*here).OID == arg_cl) && (hastxt == "1"))
-    	icon += "arrow";
-    } else if ((*here).OID == arg_d) icon += "arrow";
-
-    if (haschildren == "0") icon += "smalltext_";
-    else if (doctype == "classify") icon += "closedbookshelf_";
-    else if (is_top((*here).OID)) icon += "closedbook_";
-    else icon += "closedfolder_";
-    
-    // set up link
-    text_t link = "<a href=\"_httpdocument_";
-    if (doctype == "classify") link += "&cl=" + (*here).OID + "\">";
-    else link += "&cl=" + arg_cl + "&d=" + (*here).OID + "\">";
-    if (gt) {
-      link = "<a href=\"#" + text_t(count) + "\">";
-      count ++;
-    }
-
-    if (intable) textout << "<tr>";
-    
-    textout << outconvert << disp 
-	    << get_formatted_string (*here, formatlistptr, link, icon) << "\n";
-    
-    if (intable) textout << "</tr>";
-
-    here ++;
-  }
-}
-
-
-void output_datelist (cgiargsclass &args, ResultDocInfo_tarray::iterator &here,
-		      ResultDocInfo_tarray::iterator &end, bool intable,
-		      displayclass &disp, format_t *formatlistptr, 
-		      outconvertclass &outconvert, ostream &textout) {
-
-  text_t lastyear = "0000";
-  text_t lastmonth = "00";
-
-  while (here != end) {
-
-    int len = (*here).metadata.size();
-    const text_t &doctype = (*here).metadata[len-2].values.back();
-    const text_t &date = (*here).metadata[len-5].values.back(); 
-
-    // bail on this document if it has no date
-    if (date.empty()) continue;
-
-    text_t::const_iterator datebegin = date.begin();
-
-    text_t link = "<a href=\"_httpdocument_&cl=";
-    text_t icon = "_document:iconclosedbook_";
-      
-    if (doctype == "classify") {
-      icon = "_document:iconclosedbookshelf_";
-      link += (*here).OID + "\">";
-    } else link += args["cl"] + "&d=" + (*here).OID + "\">";
-
-    text_t thisyear = substr (datebegin, datebegin+4);
-    text_t thismonth = substr (datebegin+4, datebegin+6); 
-
-    textout << "<tr>\n";
-
-    if (thisyear != lastyear) {
-      textout << outconvert << "<td><b>" << thisyear << "</b></td>";
-      lastyear = thisyear;
-    } else
-      textout << "<td></td>";
-
-    if (thismonth != lastmonth) {
-      textout << outconvert << disp << ("<td><b>_textmonth" + thismonth + "_</b></td>");
-      lastmonth = thismonth;
-    } else
-      textout << "<td></td>";
-
-    if (!intable) textout << "<td>\n";
-    
-    textout << outconvert << disp 
-	      << get_formatted_string (*here, formatlistptr, link, icon) << "\n";
-
-    if (!intable) textout << "</td>";
-      
-    textout << "</tr>\n";
-
-    here ++;
-  }
-}
-
-void output_expanded_hierarchy_toc (cgiargsclass &args, recptproto *collectproto,
-				    displayclass &disp, outconvertclass &outconvert,
-				    ostream &textout, ostream &logout) {
-
-  text_t OID, topOID, icon;
-  bool is_classify;
-  FilterResponse_t response;
-  int tabcols=0, totalcols=0, lasttabcols=0;
-
-  int gt = args.getintarg("gt");
-  text_t doclink = "<a href=\"_httpdocument_&cl=";
-
-  text_t &arg_d = args["d"];
-  text_t &arg_cl = args["cl"];
-
-  if (arg_d.empty()) {
-    if (arg_cl.empty()) return;
-    OID = arg_cl;
-    topOID = OID; // don't always want to expand from top if expanding classifications
-    is_classify=true;
-  } else {
-    OID = arg_d;
-    get_top (arg_d, topOID);
-    is_classify=false;
-  }
-
-  // Get OIDs and metadata of all topOIDs contents (and topOID itself)
-  text_tset metadata;
-  metadata.insert ("Title");
-  metadata.insert ("haschildren");
-  metadata.insert ("doctype");
-  //  metadata.insert ("hastxt");
-
-  get_contents (topOID, is_classify, metadata, totalcols, 
-		args["c"], collectproto, response, logout);
-  int excess = countchar (topOID.begin(), topOID.end(), '.');
-  totalcols -= excess;
-
-  // allow for pointer
-  if (!is_classify && !gt) totalcols += 2;
-  else totalcols += 1;
-
-  ResultDocInfo_tarray::iterator thissection = response.docInfo.begin();
-  ResultDocInfo_tarray::iterator lastsection = response.docInfo.end();
-  
-  int count = 1;
-  while (thissection != lastsection) {
-    
-    const text_t &title = (*thissection).metadata[0].values[0];
-    const int haschildren = (*thissection).metadata[1].values[0].getint();
-    const text_t &doctype = (*thissection).metadata[2].values[0];
-
-    text_t icontabs, tab, pointer;
-
-    // set up icon
-    icon = "_document:iconsmalltext_";
-    if (is_top((*thissection).OID))
-      if (classifytype == "Document") icon = "_document:iconopenbook_";
-      else 
-	if (doctype == "classify") icon = "_document:iconopenbookshelf_";
-	else icon = "_document:iconclosedbook_";
-    else if (haschildren) 
-      if (classifytype == "Document") icon = "_document:iconopenfolder_";
-      else icon = "_document:iconopenbookshelf_";
-    
-    // set up tabbing
-    if ((classifytype == "classify") && (doctype != "classify"))
-      tabcols = lasttabcols + 1;
-    else {
-      tabcols = countchar ((*thissection).OID.begin(), (*thissection).OID.end(), '.');
-      lasttabcols = tabcols;
-    }
-    tabcols -= excess;
-
-    for (int i = 0; i < tabcols; i++) 
-      icontabs += "_document:icontab_";
-    
-    // set up pointer
-    if (classifytype == "Document" && !gt) {
-      if ((*thissection).OID == OID) pointer = "_document:iconpointer_";
-      else pointer = "_document:icontab_";
-      tabcols ++;
-    }
-    
-    int colsremaining = totalcols - tabcols;
-
-    if (tabcols > 0) {
-      tab = "<td";
-      if (tabcols > 1) tab += " colspan=" + text_t(tabcols);
-      tab += ">" + icontabs + pointer + "</td>";
-    }
-
-    textout << outconvert << disp << "<tr>" << tab << "<td>";
-    
-    if ((classifytype == "Document") && (is_top((*thissection).OID)) && 
-	(args.getintarg("x")))
-      textout << outconvert << disp << icon << "</td><td";
-
-    else {
-      if (!gt) {
-	const text_t &thisOID = (*thissection).OID;
-	text_t link;
-	if (is_top (thisOID))
-	  if (classifytype == "classify")
-	    link = doclink + arg_cl + "&d=" + thisOID + "\">";
-	  else
-	    if (arg_cl.empty())
-	      link.clear();
-	    else if (arg_cl == "search")
-	      link = "<a href=\"_httpquery_\">";
-	    else
-	      link = doclink + arg_cl + "\">";
-	else
-	  if (haschildren)
-	    if (classifytype == "classify")
-	      link = doclink + thisOID + ".pr\">";
-	    else
-	      link = doclink + arg_cl + "&d=" + thisOID + ".pr\">";
-	  else
-	    if (classifytype == "classify")
-	      link = doclink + thisOID + "\">";
-	    else
-	      link = doclink + arg_cl + "&d=" + thisOID + "\">";
-	
-	textout << outconvert << disp << link;
-      } else {
-	textout << "<a href=\"#" << count << "\">";
-	count ++;
-      }
-    
-      textout << outconvert << disp << icon << "</a></td><td";
-    }
-    if (colsremaining > 1) textout << " colspan=" << colsremaining;
-    textout << outconvert << disp << ">" << title << "</td></tr>\n";
-
-    thissection ++;
-  }
-}
-
-/*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
-
-// set_arrow_macros sets the _httpprevarrow_ and _httpnextarrow_ macros
-// it shouldn't be called if OID is the top level of a book 
-// as the "hasprevious" and "hasnext" metadata won't be set
-// when the filter can't get OIDs parent info - one day I'll
-// fix this ;-)
-void set_arrow_macros (const text_t &OID, const text_t &classifytype,
-		       bool showtoppage, displayclass &disp, 
-		       recptproto *collectproto, const text_t &collection, 
-		       ostream &logout) {
-
-  if (OID.empty()) return;
-
-  text_tset metadata;
-  FilterResponse_t response;
-
-  metadata.insert ("haschildren");
-  metadata.insert ("hasnext");
-  metadata.insert ("hasprevious");
-  // get "haschildren", "hasnext" and "hasprevious" metadata for OID
-  if (get_info (OID, collection, metadata, false, collectproto, response, logout)) {
-
-    text_t haschildren = response.docInfo[0].metadata[0].values[0];
-    text_t hasnext = response.docInfo[0].metadata[1].values[0];
-    text_t hasprevious = response.docInfo[0].metadata[2].values[0];
-
-    if ((classifytype == "Hierarchy") || (classifytype == "Book")) {
-      if (haschildren == "1") 
-	disp.setmacro ("httpnextarrow", "document", 
-		       "_If_(_cgiargd_,_httpdocument_&cl=_cgiargcl_&d=_cgiargd_.fc,_httpdocument_&cl=_cgiargcl_.fc)");
-      else if (hasnext == "1")
-	disp.setmacro ("httpnextarrow", "document", 
-		       "_If_(_cgiargd_,_httpdocument_&cl=_cgiargcl_&d=_cgiargd_.ns,_httpdocument_&cl=_cgiargcl_.ns)");
-      else {
-	// see if parent has younger siblings
-	if (get_info (OID + ".pr", collection, metadata, false, collectproto, response, logout)) {
-	  if (!response.docInfo[0].metadata.empty() &&
-	      response.docInfo[0].metadata[1].values[0] == "1")
-	    disp.setmacro ("httpnextarrow", "document", 
-			   "_If_(_cgiargd_,_httpdocument_&cl=_cgiargcl_&d=_cgiargd_.pr.ns,_httpdocument_&cl=_cgiargcl_.pr.ns)");
-	}
-      }
-
-      if (hasprevious == "1") {
-	// see if OIDs older sibling has children
-	if (get_info (OID + ".ps", collection, metadata, false, collectproto, response, logout)) {
-	  if (response.docInfo[0].metadata[0].values[0] == "1")
-	    disp.setmacro ("httpprevarrow", "document", 
-			   "_If_(_cgiargd_,_httpdocument_&cl=_cgiargcl_&d=_cgiargd_.ps.lc,_httpdocument_&cl=_cgiargcl_.ps.lc)");
-	  else 
-	    disp.setmacro ("httpprevarrow", "document", 
-			   "_If_(_cgiargd_,_httpdocument_&cl=_cgiargcl_&d=_cgiargd_.ps,_httpdocument_&cl=_cgiargcl_.ps)");
-	} 
-      } else if (showtoppage && !is_top (OID))
-	disp.setmacro ("httpprevarrow", "document", 
-		       "_If_(_cgiargd_,_httpdocument_&cl=_cgiargcl_&d=_cgiargd_.pr,_httpdocument_&cl=_cgiargcl_.pr)");
-    }
-
-    else {
-      if (hasnext == "1")
-	disp.setmacro ("httpnextarrow", "document", 
-		       "_If_(_cgiargd_,_httpdocument_&cl=_cgiargcl_&d=_cgiargd_.ns,_httpdocument_&cl=_cgiargcl_.ns)");
-      if (hasprevious == "1")
-	disp.setmacro ("httpprevarrow", "document", 
-		       "_If_(_cgiargd_,_httpdocument_&cl=_cgiargcl_&d=_cgiargd_.ps,_httpdocument_&cl=_cgiargcl_.ps)");
-    }
-  }
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
Index: trunk/cstr/src/recpt/cstrbrowsetools.h
===================================================================
--- trunk/cstr/src/recpt/cstrbrowsetools.h	(revision 910)
+++ trunk/cstr/src/recpt/cstrbrowsetools.h	(revision 911)
@@ -36,24 +36,12 @@
 #include "recptproto.h"
 #include "formattools.h"
+#include "browsetools.h"
 
+void output_cstr_toc (cgiargsclass &args, browsermapclass *browsermap,
+                 formatinfo_t &formatinfo, recptproto *collectproto,
+                 displayclass &disp, outconvertclass &outconvert,
+                 ostream &textout, ostream &logout);
 
-void output_document_toc (cgiargsclass &args, const formatinfo_t &formatinfo,
-			  recptproto *collectproto, displayclass &disp, 
-			  outconvertclass &outconvert, ostream &textout, 
-			  ostream &logout);
-
-void output_standard_toc (const text_t &classifytype, const formatinfo_t &formatinfo,
-			  text_t &formatstring, cgiargsclass &args, 
-			  recptproto *collectproto, displayclass &disp, 
-			  outconvertclass &outconvert, ostream &textout, 
-			  ostream &logout);
-
-void set_arrow_macros (const text_t &OID, const text_t &classifytype,
-		       bool showtoppage, displayclass &disp, 
-		       recptproto *collectproto, const text_t &collection, 
-		       ostream &logout);
 
 #endif
 
-
-
Index: trunk/cstr/src/recpt/cstrdocaction.cpp
===================================================================
--- trunk/cstr/src/recpt/cstrdocaction.cpp	(revision 910)
+++ trunk/cstr/src/recpt/cstrdocaction.cpp	(revision 911)
@@ -28,6 +28,6 @@
 /*
    $Log$
-   Revision 1.1  2000/02/01 22:32:37  sjboddie
-   Initial revision
+   Revision 1.2  2000/02/06 21:25:21  sjboddie
+   updated cstr
 
    Revision 1.1  1999/09/07 21:49:42  sjboddie
@@ -40,4 +40,5 @@
 #include "cstrdocaction.h"
 #include "cstrbrowsetools.h"
+#include "browsetools.h"
 #include "OIDtools.h"
 #include "querytools.h"
@@ -92,5 +93,5 @@
 void cstrdocaction::set_java_macros (cgiargsclass &args, displayclass &disp) {
 
-  text_t javaimagescontent = "_javaextras__javapostscript_";
+  text_t javaimagescontent = "<!----java images content------->\n_javaextras__javapostscript_";
 
   text_t &arg_gg = args["gg"];
@@ -134,4 +135,5 @@
     button_here ++;
   }
+  javaimagescontent += "<!--end java img content--->\n";
   disp.setmacro ("javaimagescontent", "document", javaimagescontent);
 }
@@ -205,7 +207,7 @@
       disp.setmacro ("header", "document", "_textheader_");
 
-      disp.setmacro ("thisOID", "Global", response.docInfo[0].metadata[2].values[0]);
-
-      text_t &classifytype = response.docInfo[0].metadata[1].values[0];
+      disp.setmacro ("thisOID", "Global", response.docInfo[0].metadata["archivedir"].values[0]);
+
+      text_t &classifytype = response.docInfo[0].metadata["classifytype"].values[0];
       if (classifytype.empty()) classifytype = "Book"; // defaults to Book
 
@@ -228,6 +230,6 @@
       if (get_info (classtop, collection, metadata, false, collectproto, response, logout)) {
 	  
-	text_t &title = response.docInfo[0].metadata[0].values[0];
-	text_t &classifytype = response.docInfo[0].metadata[1].values[0];
+	text_t &title = response.docInfo[0].metadata["Title"].values[0];
+	text_t &classifytype = response.docInfo[0].metadata["classifytype"].values[0];
 
 	disp.setmacro ("pagetitle", "document", "_text" + title + "page_");
@@ -284,5 +286,5 @@
 	while (this_figure != end_figure) {
 	  textout << outconvert << disp 
-		  << "<p><center><img border=1 src=\"_httpcollection_/archives/_thisOID_/" 
+		  << "<p><center><img border=1 src=\"_httpcollimg_/_thisOID_/" 
 		  << *this_figure << "\"></center>\n";
 	  this_figure ++;
@@ -306,5 +308,5 @@
 	while (this_facs != end_facs) {
 	  textout << outconvert << disp 
-		    << "<p><center><img border=1 src=\"_httpcollection_/archives/_thisOID_/" 
+		    << "<p><center><img border=1 src=\"_httpcollimg_/_thisOID_/" 
 		  << *this_facs << "\"></center>\n";
 	  this_facs ++;
@@ -359,6 +361,4 @@
     }
     
-    int metasize = metadata.size();
-    
     if (get_info (OID, collection, metadata, getParents, collectproto, inforesponse, logout)) {
       int hastxt = inforesponse.docInfo[0].metadata["hastxt"].values[0].getint();
@@ -438,2 +438,56 @@
   }
 }
+
+
+bool cstrdocaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 
+				browsermapclass *browsers, displayclass &disp, 
+				outconvertclass &outconvert, ostream &textout, 
+				ostream &logout) {
+
+
+  // must have a valid collection server
+  recptproto *collectproto = protos->getrecptproto (args["c"], logout);
+  if (collectproto == NULL) {
+    logout << "cstrdocaction::do_action called with NULL collectproto\n";
+    textout << outconvert << disp << "_document:header_\n" 
+	    << "Error: Attempt to get document without setting collection\n"
+	    << "_document:footer_\n";
+  } else {  
+    
+    text_t OID = args["d"];
+    if (OID.empty()) OID = args["cl"];
+    if (OID.empty()) {
+      textout << outconvert << disp << "Document contains no data_document:footer_\n";
+      return true;
+    }
+
+    textout << outconvert << disp << "_document:header_\n"
+	    << "_document:content_\n";
+
+    if (args["d"].empty()) {
+      output_toc (args, browsers, formatinfo, collectproto, 
+		  disp, outconvert, textout, logout);
+    } else {
+      output_cstr_toc (args, browsers, formatinfo, collectproto, 
+		       disp, outconvert, textout, logout);
+
+      textout << "<p>\n";
+      output_document (OID, args, collectproto, disp, outconvert, textout, logout);
+    }
+
+    textout << outconvert << disp << "_document:footer_\n";
+  }
+  return true;
+}
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/cstr/src/recpt/cstrdocaction.h
===================================================================
--- trunk/cstr/src/recpt/cstrdocaction.h	(revision 910)
+++ trunk/cstr/src/recpt/cstrdocaction.h	(revision 911)
@@ -43,4 +43,5 @@
 			ostream &logout);
 
+
 public:
   cstrdocaction ();
@@ -51,9 +52,14 @@
 			 response_t &response,text_t &response_data, 
 			 ostream &logout);
-
-    //  void define_internal_macros (const ColInfoResponse_t &collectinfo, displayclass &disp, 
-    //			       cgiargsclass &args, recptproto *collectproto, 
-    //			       ostream &logout);
-
+  
+  //  void define_internal_macros (const ColInfoResponse_t &collectinfo, displayclass &disp, 
+				   //			       cgiargsclass &args, recptproto *collectproto, 
+				   //			       ostream &logout);
+    
+  bool do_action (cgiargsclass &args, recptprotolistclass *protos, 
+		  browsermapclass *browsers, displayclass &disp, 
+		  outconvertclass &outconvert, ostream &textout, 
+		  ostream &logout);
+  
 };
 
@@ -63,2 +69,4 @@
 
 
+
+
Index: trunk/cstr/src/recpt/cstrlibrarymain.cpp
===================================================================
--- trunk/cstr/src/recpt/cstrlibrarymain.cpp	(revision 910)
+++ trunk/cstr/src/recpt/cstrlibrarymain.cpp	(revision 911)
@@ -28,6 +28,6 @@
 /*
    $Log$
-   Revision 1.1  2000/02/01 22:32:37  sjboddie
-   Initial revision
+   Revision 1.2  2000/02/06 21:25:22  sjboddie
+   updated cstr
 
    Revision 1.1  1999/09/07 21:49:43  sjboddie
@@ -64,5 +64,5 @@
 #include "datelistbrowserclass.h"
 #include "invbrowserclass.h"
-#include "pagedbrowserclass.h"
+#include "cstrpagedbrowserclass.h"
 #include "htmlbrowserclass.h"
 
@@ -172,5 +172,5 @@
   recpt.add_browser (&ainvbrowserclass);
 
-  pagedbrowserclass apagedbrowserclass;
+  cstrpagedbrowserclass apagedbrowserclass;
   recpt.add_browser (&apagedbrowserclass);
 
@@ -182,2 +182,5 @@
 }
 
+
+
+
Index: trunk/cstr/src/recpt/cstrpagedbrowserclass.cpp
===================================================================
--- trunk/cstr/src/recpt/cstrpagedbrowserclass.cpp	(revision 911)
+++ trunk/cstr/src/recpt/cstrpagedbrowserclass.cpp	(revision 911)
@@ -0,0 +1,115 @@
+/**********************************************************************
+ *
+ * pagedbrowserclass.cpp -- 
+ * Copyright (C) 1999  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * 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.
+ *
+ * 
+ *
+ *********************************************************************/
+
+
+#include "cstrpagedbrowserclass.h"
+#include <assert.h>
+#include "OIDtools.h"
+
+cstrpagedbrowserclass::cstrpagedbrowserclass () {
+}
+
+cstrpagedbrowserclass::~cstrpagedbrowserclass () {
+}
+
+
+int cstrpagedbrowserclass::output_section_group (FilterResponse_t &sections, cgiargsclass &args,
+					     const text_t &/*collection*/, int /*colnumber*/, 
+					     format_t * /*formatlistptr*/, bool /*use_table*/, 
+					     text_tset &/*metadata*/, bool &/*getParents*/,
+					     recptproto * /*collectproto*/, displayclass &disp, 
+					     outconvertclass &outconvert, ostream &textout, 
+					     ostream &/*logout*/) {
+
+  text_t &arg_d = args["d"];
+
+  // this browser class only handles document levels
+  if (arg_d.empty()) return 0;
+
+  // dont want page nums and arrows if text is expanded
+  if (!args.getintarg("gt")) {
+    text_t previousOID, previoustitle, nextOID, nexttitle;
+    text_t previousarrow, nextarrow;
+    bool found = false;
+    
+    text_t pagenum;
+    // this should be our list of pages
+    
+    ResultDocInfo_tarray::iterator thissection = sections.docInfo.begin();
+    ResultDocInfo_tarray::iterator endsection = sections.docInfo.end();
+    
+    while (thissection != endsection) {
+      if (arg_d == (*thissection).OID) {
+	found = true;
+	pagenum= "<td><center><b>_document:textpage_" +
+	  (*thissection).metadata["Title"].values[0] + "\n";
+	if (thissection != sections.docInfo.begin()) {
+	  previousOID = (*(thissection-1)).OID;
+	  previoustitle = (*(thissection-1)).metadata["Title"].values[0];
+	} else 
+	  previousarrow = "_document:parentarrow_";
+	
+	if (thissection != sections.docInfo.end()) {
+	  nextOID = (*(thissection+1)).OID;
+	  nexttitle = (*(thissection+1)).metadata["Title"].values[0];
+	}
+	break;
+      }
+      thissection ++;
+    }
+
+    int numpages = sections.docInfo.size();
+    //pagenum += "_document:textnumpages_(" + text_t(numpages) + ")</center></td>\n";
+    pagenum += "_document:of_" + text_t(numpages) + "</b></center></td>\n";
+    if (!found)
+      nextarrow = "<a href=\"_httpdocument_&cl=" + args["cl"] + "&d=" + sections.docInfo[0].OID + 
+	"\">" + sections.docInfo[0].metadata["Title"].values[0] + "_iconnext_</a>\n";
+    else {
+      if (!previousOID.empty())
+	previousarrow = "<a href=\"_httpdocument_&cl=" + args["cl"] + "&d=" + 
+	  previousOID + "\">_iconprev_</a>\n";
+      if (!nextOID.empty())
+	nextarrow = "<a href=\"_httpdocument_&cl=" + args["cl"] + "&d=" + 
+	  nextOID + "\">_iconnext_</a>\n";
+    }
+  
+    textout << outconvert << disp << "<table><tr valign=top>"
+	    << " <td align=right>" << previousarrow << "</td>\n"
+	    << "<td align=center>" << pagenum << "</td>\n"
+	    << "<td align=left>" << nextarrow << "</td></tr>\n"
+            << "<tr valign=middle>\n"
+            << "<td align=center valign=top colspan=3>_document:gotoform_</td>"
+	    << "</tr></table>\n";
+  }
+  else { // just output goto form
+    textout << outconvert << disp << "<center>_document:gotoform_ </center>";
+  }
+  return 0;
+}
+
+
+
Index: trunk/cstr/src/recpt/cstrpagedbrowserclass.h
===================================================================
--- trunk/cstr/src/recpt/cstrpagedbrowserclass.h	(revision 911)
+++ trunk/cstr/src/recpt/cstrpagedbrowserclass.h	(revision 911)
@@ -0,0 +1,57 @@
+
+
+
+/**********************************************************************
+ *
+ * cstrpagedbrowserclass.h -- 
+ * Copyright (C) 1999  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * 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.
+ *
+ * 
+ *
+ *********************************************************************/
+
+
+#ifndef CSTRPAGEDBROWSERCLASS_H
+#define CSTRPAGEDBROWSERCLASS_H
+
+#include "pagedbrowserclass.h"
+
+class cstrpagedbrowserclass : public pagedbrowserclass {
+protected:
+
+public:
+
+  cstrpagedbrowserclass ();
+  virtual ~cstrpagedbrowserclass ();
+
+  int output_section_group (FilterResponse_t &sections, cgiargsclass &args,
+			    const text_t &collection, int colnumber, format_t *formatlistptr, 
+			    bool use_table, text_tset &metadata, bool &getParents,
+			    recptproto *collectproto, displayclass &disp, 
+			    outconvertclass &outconvert, ostream &textout, ostream &logout);
+
+};
+
+#endif
+
+
+
+
Index: trunk/cstr/src/recpt/cstrqueryaction.cpp
===================================================================
--- trunk/cstr/src/recpt/cstrqueryaction.cpp	(revision 910)
+++ 	(revision )
@@ -1,192 +1,0 @@
-/**********************************************************************
- *
- * cstrqueryaction.cpp -- 
- * Copyright (C) 1999  The New Zealand Digital Library Project
- *
- * A component of the Greenstone digital library software
- * from the New Zealand Digital Library Project at the
- * University of Waikato, New Zealand.
- *
- * 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.
- *
- * $Id$
- *
- *********************************************************************/
-
-/*
-   $Log$
-   Revision 1.1  2000/02/01 22:32:37  sjboddie
-   Initial revision
-
-   Revision 1.1  1999/09/07 21:49:43  sjboddie
-   new cstr receptionist
-
-
- */
-
-
-#include "cstrqueryaction.h"
-#include "cstrquerytools.h"
-#include "formattools.h"
-#include "OIDtools.h"
-#include "text_t.h"
-
-
-struct ltint 
-{
-  bool operator()(const int &t1, const int &t2) const
-  { return t1 < t2; }
-};
-
-
-bool cstrqueryaction::do_action (cgiargsclass &args, const ColInfoResponse_t &collectinfo, 
-				 recptproto *collectproto, displayclass &disp, 
-				 outconvertclass &outconvert, ostream &textout, 
-				 ostream &logout) {
-
-  if (formatstring.empty()) {
-    text_tmap::const_iterator result = collectinfo.format.find("result");
-    if (result != collectinfo.format.end())
-      formatstring = (*result).second;
-  }
-
-  // if we still don't have a format string use the default
-  if (formatstring.empty()) 
-    formatstring = "<td valign=top nowrap>[link]_icontext_[/link]</td><td>[Title]</td>";
-
-  if (collectproto == NULL) {
-    logout << "cstrqueryaction::do_action called with NULL collectproto\n";
-    textout << outconvert << disp << "_query:header_\n" 
-	    << "Error: Attempt to do query without setting collection\n"
-	    << "_query:footer_\n";
-  } else {  
-
-    FilterRequest_t request;
-    FilterResponse_t response;
-    format_t *formatlistptr = new format_t();
-
-    parse_formatstring (formatstring, formatlistptr, request.fields, request.getParents);
-
-    request.fields.push_back ("Title"); 
-    int metasize = request.fields.size();
-
-    // do the query
-    request.filterResultOptions = FROID | FRmetadata | FRtermFreq;
-    if (!do_query (request, args, collectproto, response, logout))
-      return false;
-    
-    // set macros 
-    define_query_macros (args, disp, response);
-    
-    // output the header
-    textout << outconvert << disp << "_query:header_\n"
-	    << "_query:content_";
-
-    // output the results
-    textout << "<table cellspacing=4>\n";
-    ResultDocInfo_tarray::const_iterator this_doc = response.docInfo.begin();
-    ResultDocInfo_tarray::const_iterator end_doc = response.docInfo.end();
-
-    text_t top;
-    map<text_t, int, lttext_t> topOIDs;
-    map<int, ResultDocInfo_tarray, ltint> OIDs;
-    int count = 0;
-
-    // sort the result set to get document pages together
-    while (this_doc != end_doc) {
-      // don't include docs that didn't match phrases (if there were any)
-      // those that did match will have been sorted to the top
-      if ((*this_doc).num_phrase_match < num_phrases) break;
-
-      get_top ((*this_doc).OID, top);
-      map<text_t, int, lttext_t>::const_iterator it = topOIDs.find (top);
-      if (it == topOIDs.end()) {
-	// haven't seen this document before
-	topOIDs[top] = count;
-	OIDs[count].push_back (*this_doc);
-	count ++;
-      } else {
-	OIDs[(*it).second].push_back (*this_doc);
-      }
-      this_doc ++;
-    }
-
-    text_t link, icon;
-    map<int, ResultDocInfo_tarray, ltint>::iterator here = OIDs.begin();
-    map<int, ResultDocInfo_tarray, ltint>::iterator end = OIDs.end();
-    count = 1;
-    bool done = false;
-    int arg_r = args.getintarg("r");
-    int arg_o = args.getintarg("o");
-    int arg_m = args.getintarg("m");
-    while (here != end) {
-      ResultDocInfo_tarray::const_iterator thisOID = (*here).second.begin();
-      ResultDocInfo_tarray::const_iterator lastOID = (*here).second.end();
-      
-      icon.clear();
-      link.clear(); // link will always be empty as we're including the link in the icon
-      bool first = true;
-
-      while (thisOID != lastOID) {
-
-	if (count < arg_r) {thisOID ++; count ++; continue;}
-	if ((count >= (arg_o + arg_r)) || count > arg_m) {
-	  done = true; 
-	  if (!icon.empty()) {
-	    textout << outconvert << disp << "<tr>\n"
-		    << get_formatted_string (*thisOID, formatlistptr, link, icon) << "\n"
-		    << "</tr>\n";
-	  }
-	  break;
-
-	} else {
-
-	  const text_t &title = (*thisOID).metadata[metasize-1].values.back();
-	  
-	  if (title.empty() && ((*here).second.size() == 1)) 
-	    icon = "<a href=\"_httpdocument_&cl=search&d=" + (*thisOID).OID + "\">_iconclosedbook_</a>";
-	  else {
-	    if (first) icon += "_icontext_<br>";
-	    icon += "<a href=\"_httpdocument_&cl=search&d=" + (*thisOID).OID + "\">page " +
-	      title + "</a><br>\n";
-	  }
-	  
-	  if ((thisOID + 1) == lastOID) {
-	    textout << outconvert << disp << "<tr>\n"
-		    << get_formatted_string (*thisOID, formatlistptr, link, icon) << "\n"
-		    << "</tr>\n";
-	  }
-	  count ++;
-	}
-	if (done) break;
-	first = false;
-	thisOID ++;
-      }
-      here ++;
-    }
-
-    textout << "</table>\n";
-
-    delete (formatlistptr);
-
-    // output the footer
-    textout << outconvert << disp << "_query:footer_";
-  }
-  
-  return true;
-}
-
-
-
Index: trunk/cstr/src/recpt/cstrqueryaction.h
===================================================================
--- trunk/cstr/src/recpt/cstrqueryaction.h	(revision 910)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/**********************************************************************
- *
- * cstrqueryaction.h -- 
- * Copyright (C) 1999  The New Zealand Digital Library Project
- *
- * A component of the Greenstone digital library software
- * from the New Zealand Digital Library Project at the
- * University of Waikato, New Zealand.
- *
- * 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.
- *
- * $Id$
- *
- *********************************************************************/
-
-
-#ifndef CSTRQUERYACTION_H
-#define CSTRQUERYACTION_H
-
-#include "gsdlconf.h"
-#include "queryaction.h"
-
-
-class cstrqueryaction : public queryaction {
-
-public:
-  cstrqueryaction () {}
-  virtual ~cstrqueryaction () {}
-  
-  bool do_action (cgiargsclass &args, const ColInfoResponse_t &collectinfo, 
-		  recptproto *collectproto, displayclass &disp, 
-		  outconvertclass &outconvert, ostream &textout, 
-		  ostream &logout);
-};
-
-
-#endif
Index: trunk/cstr/src/recpt/cstrquerytools.cpp
===================================================================
--- trunk/cstr/src/recpt/cstrquerytools.cpp	(revision 910)
+++ 	(revision )
@@ -1,230 +1,0 @@
-/**********************************************************************
- *
- * cstrquerytools.cpp -- 
- * Copyright (C) 1999  The New Zealand Digital Library Project
- *
- * A component of the Greenstone digital library software
- * from the New Zealand Digital Library Project at the
- * University of Waikato, New Zealand.
- *
- * 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.
- *
- * $Id$
- *
- *********************************************************************/
-
-/*
-   $Log$
-   Revision 1.1  2000/02/01 22:32:37  sjboddie
-   Initial revision
-
-   Revision 1.1  1999/09/07 21:49:44  sjboddie
-   new cstr receptionist
-
-
- */
-
-
-// this is overridden for cstr as we're always going to get
-// maxdocs matches. They can then be sorted in the 
-// cstrqueryaction
-
-#include "cstrquerytools.h"
-
-
-// do_query sets the filter options and makes the protocol call to
-// do a query. The results are returned in response. 
-// request.filterResultOptions and request.fields (if required)
-// should be set by the calling function.
-
-bool do_query (FilterRequest_t &request, cgiargsclass &args, 
-	       recptproto *collectproto, FilterResponse_t &response, 
-	       ostream &logout) {
-
-  request.filterName = "QueryFilter";
-
-  comerror_t err;
-  OptionValue_t option;
-  text_t formattedstring = args["q"];
-  format_querystring (formattedstring, args.getintarg("b"));  
-  
-  option.name = "Term";
-  option.value = formattedstring;
-  request.filterOptions.push_back (option);
-
-  option.name = "QueryType";
-  option.value = (args.getintarg("t")) ? "ranked" : "boolean";
-  request.filterOptions.push_back (option);
-
-  option.name = "Casefold";
-  option.value = (args.getintarg("k")) ? "true" : "false";
-  request.filterOptions.push_back (option);
-
-  option.name = "Stem";
-  option.value = (args.getintarg("s")) ? "true" : "false";
-  request.filterOptions.push_back (option);
-
-  if (!args["h"].empty()) {
-    option.name = "Index";
-    option.value = args["h"];
-    request.filterOptions.push_back (option);
-  }
-
-  if (!args["j"].empty()) {
-    option.name = "Subcollection";
-    option.value = args["j"];
-    request.filterOptions.push_back (option);
-  }
-
-  if (!args["n"].empty()) {
-    option.name = "Language";
-    option.value = args["n"];
-    request.filterOptions.push_back (option);
-  }
-
-  // fill in the second query if needed
-  if (!args["cq2"].empty()) {
-    option.name = "CombineQuery";
-    option.value = args["cq2"];
-    request.filterOptions.push_back (option);
-    
-    text_t formattedstring2 = args["q2"];
-    format_querystring (formattedstring2, args.getintarg("b"));
-
-    option.name = "Term";
-    option.value = formattedstring2;
-    request.filterOptions.push_back (option);
-
-    option.name = "QueryType";
-    option.value = (args.getintarg("t")) ? "ranked" : "boolean";
-    request.filterOptions.push_back (option);
-
-    option.name = "Casefold";
-    option.value = (args.getintarg("k")) ? "true" : "false";
-    request.filterOptions.push_back (option);
-
-    option.name = "Stem";
-    option.value = (args.getintarg("s")) ? "true" : "false";
-    request.filterOptions.push_back (option);
-
-    if (!args["h2"].empty()) {
-      option.name = "Index";
-      option.value = args["h2"];
-      request.filterOptions.push_back (option);
-    }
-
-    if (!args["j2"].empty()) {
-      option.name = "Subcollection";
-      option.value = args["j2"];
-      request.filterOptions.push_back (option);
-    }
-
-    if (!args["n2"].empty()) {
-      option.name = "Language";
-      option.value = args["n2"];
-      request.filterOptions.push_back (option);
-    }
-  }
-
-  // we always want to retrieve all documents (i.e. 1 to maxdocs)
-  // for this collection
-  option.name = "Maxdocs";
-  option.value = args["m"];
-  request.filterOptions.push_back (option);
-  
-  option.name = "StartResults";
-  option.value = 1;
-  request.filterOptions.push_back (option);
-
-  option.name = "EndResults";
-  option.value = args["m"];
-  request.filterOptions.push_back (option);
-
-  collectproto->filter (args["c"], request, response, err, logout);
-
-  if (err != noError) {
-    outconvertclass text_t2ascii;
-    logout << text_t2ascii
-	   << "Error: call to QueryFilter failed in queryaction ("
-	   << get_comerror_string (err) << ")\n";
-    return false;
-  }
-  return true;
-}
-
-void format_querystring (text_t &querystring, int querymode) {
-  text_t formattedstring;
-
-  text_t::const_iterator here = querystring.begin();
-  text_t::const_iterator end = querystring.end();
-
-  // space is used to insert spaces between Chinese
-  // characters. No space is needed before the first
-  // Chinese character.
-  bool space = false;
-
-  // want to remove ()|!& from querystring so boolean queries are just
-  // "all the words" queries (unless querymode is advanced)
-  while (here != end) {
-    if ((querymode == 0) && (*here == '(' || *here == ')' || *here == '|' ||
-			     *here == '!' || *here == '&')) {
-      formattedstring.push_back(' ');
-    } else {
-      if ((*here >= 0x4e00 && *here <= 0x9fa5) ||
-	  (*here >= 0xf900 && *here <= 0xfa2d)) {
-	// Chinese character
-	if (space) formattedstring.push_back (0x200b);
-	formattedstring.push_back (*here);
-	formattedstring.push_back (0x200b);
-	space = true;
-      } else {
-	// non-Chinese character
-	formattedstring.push_back (*here);
-	space = false;
-      }
-    }
-    here ++;
-  }
-  querystring = formattedstring;
-}
-
-void get_phrases (const text_t &querystring, text_tarray &phrases) {
-
-  phrases.erase (phrases.begin(), phrases.end());
-  if (!querystring.empty()) {
-    
-    text_t::const_iterator end = querystring.end();
-    text_t::const_iterator here = findchar (querystring.begin(), end, '"');
-    if (here != end) {
-      text_t tmptext;
-      bool foundquote = false;
-      while (here != end) {
-	if (*here == '"') {
-	  if (foundquote) {
-	    if (!tmptext.empty()) {
-	      phrases.push_back(tmptext);
-	      tmptext.clear();
-	    }
-	    foundquote = false;
-	  } else foundquote = true;
-	} else {
-	  if (foundquote) tmptext.push_back (*here);
-	}
-	here ++;
-      }
-    }
-  }
-}
-
Index: trunk/cstr/src/recpt/cstrquerytools.h
===================================================================
--- trunk/cstr/src/recpt/cstrquerytools.h	(revision 910)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/**********************************************************************
- *
- * cstrquerytools.h -- 
- * Copyright (C) 1999  The New Zealand Digital Library Project
- *
- * A component of the Greenstone digital library software
- * from the New Zealand Digital Library Project at the
- * University of Waikato, New Zealand.
- *
- * 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.
- *
- * $Id$
- *
- *********************************************************************/
-
-
-#ifndef CSTRQUERYTOOLS_H
-#define CSTRQUERYTOOLS_H
-
-#include "cgiargs.h"
-#include "recptproto.h"
-
-bool do_query (FilterRequest_t &request, cgiargsclass &args, 
-	       recptproto *collectproto, FilterResponse_t &response, 
-	       ostream &logout);
-void format_querystring (text_t &querystring, int querymode);
-void get_phrases (const text_t &querystring, text_tarray &phrases);
-
-#endif
