Index: tags/Old_DocumentColumn_Version/cstr/src/recpt/Makefile.in
===================================================================
--- tags/Old_DocumentColumn_Version/cstr/src/recpt/Makefile.in	(revision 1965)
+++ tags/Old_DocumentColumn_Version/cstr/src/recpt/Makefile.in	(revision 1965)
@@ -0,0 +1,152 @@
+###########################################################################
+#
+# Makefile -- Makefile for cstrlibrary
+# 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.
+#
+###########################################################################
+
+GD = ../../../..
+MAINRECPTDIR = $(GD)/src/recpt
+MAINCOLSERVRDIR = $(GD)/src/colservr
+
+AR = ar
+CC = @CC@
+CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual
+DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DGSDLSERVER \
+       -D_LITTLE_ENDIAN -DGSDLSERVER @DEFS@
+
+USE_FASTCGI = @USE_FASTCGI@
+ifneq ($(USE_FASTCGI), 1)
+INCLUDES = -I$(MAINRECPTDIR) -I$(MAINCOLSERVRDIR) -I$(GD)/lib \
+	   -I$(GD)/packages/mg -I$(GD)/packages/mg/lib -I$(GD)/packages/mg/src/text 
+else
+INCLUDES = -I$(MAINRECPTDIR) -I$(MAINCOLSERVRDIR) -I$(GD)/lib \
+	   -I$(GD)/packages/mg -I$(GD)/packages/mg/lib -I$(GD)/packages/mg/src/text \
+           -I$(GD)/packages/fcgi/include
+endif
+
+RANLIB = @RANLIB@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+
+GSDLOS = @gsdlos@
+
+
+COMPILE = $(CC) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
+LINK = $(CC) $(LDFLAGS) -o $@
+
+.SUFFIXES:
+.SUFFIXES: .c .o
+.c.o:
+	$(COMPILE) $<
+
+.SUFFIXES: .cpp .o
+.cpp.o:
+	$(COMPILE) $< 
+
+
+HEADERS = cstrdocaction.h
+
+SOURCES = cstrlibrarymain.cpp cstrdocaction.cpp
+
+
+OBJECTS = cstrlibrarymain.o cstrdocaction.o
+
+
+EXEC    = cstrlibrary
+
+all : $(EXEC)
+
+install:
+	install -m 755 -s $(EXEC) $(GD)/cgi-bin/$(EXEC)
+
+clean:
+	rm -f $(OBJECTS) $(EXEC)
+
+depend:
+	makedepend -Y -- $(DEFS) $(INCLUDES) $(CCFLAGS) -- $(SOURCES)
+
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+
+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 \
+    $(MAINRECPTDIR)/cgiwrapper.o \
+    $(MAINRECPTDIR)/cgiargs.o \
+    $(MAINRECPTDIR)/action.o \
+    $(MAINRECPTDIR)/converter.o \
+    $(MAINRECPTDIR)/cgiutils.o \
+    $(MAINRECPTDIR)/OIDtools.o \
+    $(MAINRECPTDIR)/htmlgen.o \
+    $(MAINRECPTDIR)/statusaction.o \
+    $(MAINRECPTDIR)/pageaction.o \
+    $(MAINRECPTDIR)/comtypes.o \
+    $(MAINRECPTDIR)/recptproto.o \
+    $(MAINRECPTDIR)/pingaction.o \
+    $(MAINRECPTDIR)/queryaction.o \
+    $(MAINRECPTDIR)/documentaction.o \
+    $(MAINRECPTDIR)/htmlutils.o \
+    $(MAINRECPTDIR)/nullproto.o \
+    $(MAINRECPTDIR)/infodbclass.o \
+    $(MAINRECPTDIR)/formattools.o \
+    $(MAINRECPTDIR)/tipaction.o \
+    $(MAINRECPTDIR)/authenaction.o \
+    $(MAINRECPTDIR)/usersaction.o \
+    $(MAINRECPTDIR)/userdb.o \
+    $(MAINRECPTDIR)/delhistoryaction.o \
+    $(MAINRECPTDIR)/historydb.o \
+    $(MAINCOLSERVRDIR)/mgq.o \
+    $(MAINCOLSERVRDIR)/querycache.o \
+    $(MAINCOLSERVRDIR)/queryinfo.o \
+    $(MAINCOLSERVRDIR)/collectserver.o \
+    $(MAINCOLSERVRDIR)/colservrconfig.o \
+    $(MAINCOLSERVRDIR)/maptools.o \
+    $(MAINCOLSERVRDIR)/filter.o \
+    $(MAINCOLSERVRDIR)/source.o \
+    $(MAINCOLSERVRDIR)/browsefilter.o \
+    $(MAINCOLSERVRDIR)/queryfilter.o \
+    $(MAINCOLSERVRDIR)/phrasequeryfilter.o \
+    $(MAINCOLSERVRDIR)/phrasesearch.o \
+    $(MAINCOLSERVRDIR)/mggdbmsource.o \
+    $(MAINCOLSERVRDIR)/mgsearch.o \
+    $(GD)/lib/gsdllib.a  \
+    $(GD)/packages/mg/src/text/libtextin.a \
+    $(GD)/packages/mg/lib/libmg.a
+
+ifneq ($(USE_FASTCGI), 1)
+CSTRLIB_OBJS = $(CSTRLIBRARY_OBJS)
+else
+CSTRLIB_OBJS = $(CSTRLIBRARY_OBJS) $(GD)/packages/fcgi/libfcgi/libfcgi.a
+endif
+
+cstrlibrary: $(CSTRLIB_OBJS)
+	$(LINK) $(CSTRLIB_OBJS) $(LIBS) 
Index: tags/Old_DocumentColumn_Version/cstr/src/recpt/cstrdocaction.cpp
===================================================================
--- tags/Old_DocumentColumn_Version/cstr/src/recpt/cstrdocaction.cpp	(revision 1965)
+++ tags/Old_DocumentColumn_Version/cstr/src/recpt/cstrdocaction.cpp	(revision 1965)
@@ -0,0 +1,402 @@
+/**********************************************************************
+ *
+ * cstrdocaction.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.3  2000/04/04 04:43:07  nzdl
+   caught cstr collection up with DocumentColumn stuff
+
+   Revision 1.2  2000/02/06 21:25:21  sjboddie
+   updated cstr
+
+   Revision 1.1  1999/09/07 21:49:42  sjboddie
+   new cstr receptionist
+
+ */
+
+
+#include <string.h>
+#include "cstrdocaction.h"
+#include "OIDtools.h"
+#include "querytools.h"
+#include "cgiutils.h"
+
+cstrdocaction::cstrdocaction () {
+  // this action uses cgi variable "gg" and "gga" as well as
+  // those used by the standard documentaction
+
+  cgiarginfo arg_ainfo;
+
+  // in this action "gg" is the format of the
+  // document to view (i.e. "text", "postscript", "abstract", "figures", or "facsimiles")
+  arg_ainfo.shortname = "gg";
+  arg_ainfo.longname = "document format";
+  arg_ainfo.multiplechar = true;
+  arg_ainfo.defaultstatus = cgiarginfo::weak;
+  arg_ainfo.argdefault = "text";
+  arg_ainfo.savedarginfo = cgiarginfo::can;
+  argsinfo.addarginfo (NULL, arg_ainfo);
+
+  // in this action "gga" is the path to the postscript
+  // when "gg" == "postscript
+  arg_ainfo.shortname = "gga";
+  arg_ainfo.longname = "postscript path";
+  arg_ainfo.multiplechar = true;
+  arg_ainfo.defaultstatus = cgiarginfo::none;
+  arg_ainfo.argdefault = "";
+  arg_ainfo.savedarginfo = cgiarginfo::mustnot;
+  argsinfo.addarginfo (NULL, arg_ainfo);
+
+}
+
+cstrdocaction::~cstrdocaction () {
+}
+
+void cstrdocaction::output_controls (cgiargsclass &args, const text_tarray &ibuttons,
+				     recptproto *collectproto, displayclass &disp, 
+				     outconvertclass &outconvert, ostream &textout, 
+				     ostream &logout) {
+
+
+  if (args["u"] != "1") {
+
+    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 Text") && arg_gg == "text") {
+	if (args.getintarg("gt"))
+	  buttons.push_back ("_document:imagecontracttext_");
+	else 
+	  buttons.push_back ("_document:imageexpandtext_");
+      }
+      here ++;
+    }
+
+    FilterResponse_t response;
+    text_tset metadata;
+    text_t top;
+    get_top (args["d"], top);
+    metadata.insert ("figures");
+    metadata.insert ("Description");
+    metadata.insert ("Source");
+    if (get_info (top, args["c"], metadata, false, collectproto, response, logout)) {
+      text_t &figures = response.docInfo[0].metadata["figures"].values[0];
+      text_t &description = response.docInfo[0].metadata["Description"].values[0];
+      text_t &source = response.docInfo[0].metadata["Source"].values[0];
+
+      if (!source.empty())
+	buttons.push_back ("_document:imagepostscript_(" + cgi_safe(source) + ")");
+      
+      if ((!description.empty()) && (arg_gg != "abstract"))
+	buttons.push_back ("_document:imageabstract_");
+      
+      if ((!figures.empty()) && (arg_gg != "figures"))
+	buttons.push_back ("_document:imagefigures_");
+      
+      if (arg_gg != "text")
+	buttons.push_back ("_document:imageviewtext_");
+    }
+      
+    here = buttons.begin();
+    end = buttons.end();
+    int count = 0;
+    while (here != end) {
+      if ((count != 0) && ((count % 2) == 0)) textout << "<br>\n";
+      textout << outconvert << disp << *here;
+      count ++;
+      here ++;
+    }
+  }
+}
+
+
+
+void cstrdocaction::get_cgihead_info (cgiargsclass &args, recptprotolistclass * /*protos*/,
+				      response_t &response,text_t &response_data, 
+				      ostream &/*logout*/) {
+
+  if (args["gg"] == "postscript") {
+    response = location;
+    response_data = args["gga"];
+  } else {
+    response = content;
+    response_data = "text/html";
+  }
+}
+
+
+void cstrdocaction::set_java_macros (cgiargsclass &args, displayclass &disp) {
+
+  text_t javaimagescontent = "<!----java images content------->\n_javaextras__javapostscript_";
+
+  text_t &arg_gg = args["gg"];
+  if (arg_gg == "text")
+    javaimagescontent += "_javaabstract__javafigures_";
+  else if (arg_gg == "abstract")
+    javaimagescontent += "_javafigures__javaviewtext_";
+  else if (arg_gg == "figures")
+    javaimagescontent += "_javaabstract__javaviewtext_";
+  else if (arg_gg == "facsimiles")
+    javaimagescontent += "_javaabstract__javaviewtext__javafigures_";
+	
+  int arg_gt = args.getintarg("gt");
+  int arg_hl = args.getintarg("hl");
+
+  text_tarray::const_iterator button_here = formatinfo.DocumentButtons.begin();
+  text_tarray::const_iterator button_end = formatinfo.DocumentButtons.end();
+
+  while (button_here != button_end) {
+    if (*button_here == "Detach") 
+      javaimagescontent += "_javadetach_";
+    else if (*button_here == "Expand Text" && arg_gg == "text") {
+      if (arg_gt == 1)
+	javaimagescontent += "_javacontracttext__javacontinue_";
+      else if (arg_gt == 2)
+	javaimagescontent += "_javacontracttext_";
+      else
+	javaimagescontent += "_javaexpandtext_";
+    } else if (*button_here == "Highlight" && arg_gg == "text") {
+      if (arg_hl == 1)
+	javaimagescontent += "_javanohighlighting_";
+      else 
+	javaimagescontent += "_javahighlighting_";
+    }
+    button_here ++;
+  }
+  javaimagescontent += "<!--end java img content--->\n";
+  disp.setmacro ("javaimagescontent", "document", javaimagescontent);
+}
+
+void cstrdocaction::output_document (const text_t &OID, cgiargsclass &args, 
+				     recptproto *collectproto, displayclass &disp, 
+				     outconvertclass &outconvert, ostream &textout, 
+				     ostream &logout) {
+  FilterResponse_t inforesponse;
+  text_tset metadata;
+  bool getParents = false;
+  text_t &collection = args["c"];
+  text_t &arg_gg = args["gg"];
+
+  if (arg_gg == "abstract") {
+    metadata.insert ("Description");
+    text_t top;
+    get_top (OID, top);
+    if (get_info (top, collection, metadata, getParents, collectproto, inforesponse, logout)) {
+      text_t &description = inforesponse.docInfo[0].metadata["Description"].values[0];
+
+      if (!description.empty())
+	textout << outconvert << disp << "<p>\n" << description << "\n";
+      else
+	textout << outconvert << disp << "_textnoabstract_";
+    }
+
+  } else if (arg_gg == "figures") {
+    metadata.insert ("figures");
+    text_t top;
+    get_top (OID, top);
+    if (get_info (top, collection, metadata, false, collectproto, inforesponse, logout)) {
+      text_t &figures = inforesponse.docInfo[0].metadata["figures"].values[0];
+
+      if (!figures.empty()) {
+	text_tarray figure_array;
+	splitchar (figures.begin(), figures.end(), ',', figure_array);
+	text_tarray::const_iterator this_figure = figure_array.begin();
+	text_tarray::const_iterator end_figure = figure_array.end();
+	while (this_figure != end_figure) {
+	  textout << outconvert << disp 
+		  << "<p><center><img border=1 src=\"_httpcollimg_/_thisOID_/" 
+		  << *this_figure << "\"></center>\n";
+	  this_figure ++;
+	}
+      } else {
+	textout << outconvert << disp << "_textnofigures_";
+      }
+    }
+
+  } else if (arg_gg == "facsimiles") {
+    metadata.insert ("facsimiles");
+    text_t top;
+    get_top (OID, top);
+    if (get_info (top, collection, metadata, false, collectproto, inforesponse, logout)) {
+
+      text_tarray::const_iterator this_facs = inforesponse.docInfo[0].metadata["facsimiles"].values.begin();
+      text_tarray::const_iterator end_facs = inforesponse.docInfo[0].metadata["facsimiles"].values.end();
+      while (this_facs != end_facs) {
+	textout << outconvert << disp 
+		<< "<p><center><img border=1 src=\"_httpcollimg_/_thisOID_/" 
+		<< *this_facs << "\"></center>\n";
+	this_facs ++;
+      }
+    } else {
+      textout << outconvert << disp << "_textnofacsimiles_";
+    }
+    
+  } else {
+
+    FilterResponse_t queryresponse;
+    bool highlight = false;
+    int wanttext = 0;
+    int arg_gt = args.getintarg("gt");
+    
+    // if we have a query string and highlighting is turned on we need
+    // to redo the query to get the terms for highlighting
+    if (!args["q"].empty() && args.getintarg("hl")) {
+      FilterRequest_t request;
+      request.filterResultOptions = FRmatchTerms;
+      comerror_t err;
+      text_t formattedstring = args["q"];
+      format_querystring(formattedstring, args.getintarg("b"));
+      set_queryfilter_options (request, formattedstring, args);
+      collectproto->filter (args["c"], request, queryresponse, err, logout);
+      if (err != noError) {
+	outconvertclass text_t2ascii;
+	logout << text_t2ascii
+	       << "documentaction::output_document: call to QueryFilter failed "
+	       << "for " << args["c"] << " collection (" << get_comerror_string (err) << ")\n";
+	highlight = false;
+      } else {
+	highlight = true;
+      }   
+
+    }
+    
+    format_t *formatlistptr = new format_t();
+    parse_formatstring (formatinfo.DocumentText, formatlistptr, metadata, getParents);
+    
+    metadata.insert ("hastxt");
+    metadata.insert ("haschildren");
+    
+    if (formatinfo.DocumentText == "[Text]")
+      wanttext = 1;
+    else {
+      char *docformat = formatinfo.DocumentText.getcstr();
+      if (strstr (docformat, "[Text]") != NULL)
+	wanttext = 2;
+      delete docformat;
+    }
+    
+    if (get_info (OID, collection, metadata, getParents, collectproto, inforesponse, logout)) {
+      int hastxt = inforesponse.docInfo[0].metadata["hastxt"].values[0].getint();
+      int haschildren = inforesponse.docInfo[0].metadata["haschildren"].values[0].getint();
+      
+      if (arg_gt == 0) {
+	output_text (inforesponse.docInfo[0], formatlistptr, queryresponse.termInfo, 
+		     OID, highlight, hastxt, wanttext, collection, collectproto, 
+		     disp, outconvert, textout, logout);
+	
+	
+      } else {
+	
+	ResultDocInfo_t thisdocinfo = inforesponse.docInfo[0];
+	
+	// text is to be expanded
+	text_t exOID = OID;
+	if (haschildren != 1) exOID = get_parent (OID);
+	if (exOID.empty()) exOID = OID;
+	
+	// if we're not in a document (i.e. we're in a top level classification)
+	// we need to pass the "classify" string to get_contents so that it 
+	// doesn't recurse all the way through each document in the classification
+	bool is_classify = false;
+	if (args["d"].empty()) is_classify = true;
+
+	get_contents (exOID, is_classify, metadata, collection, 
+		      collectproto, inforesponse, logout);
+	
+	ResultDocInfo_tarray::iterator sechere = inforesponse.docInfo.begin();
+	ResultDocInfo_tarray::iterator secend = inforesponse.docInfo.end();
+	
+	if (arg_gt == 1) {
+	  // check if there are more than 10 sections containing text to be expanded - 
+	  // if there are output warning message - this isn't a great way to do this
+	  // since the sections may be very large or very small - one day I'll fix it 
+	  // -- Stefan.
+	  int seccount = 0;
+	  while (sechere != secend) {
+	    int shastxt = (*sechere).metadata["hastxt"].values[0].getint();
+	    if (shastxt == 1) seccount ++;
+	    if (seccount > 10) break;
+	    sechere ++;
+	  }
+	  if (seccount > 10) {
+	    // more than 10 sections so output warning message and text 
+	    // for current section only
+	    textout << outconvert << disp << "_document:textltwarning_";
+
+	    output_text (thisdocinfo, formatlistptr, queryresponse.termInfo, 
+			 OID, highlight, hastxt, wanttext, collection, 
+			 collectproto, disp, outconvert, textout, logout);
+	  
+	  }
+	  else arg_gt = 2;
+	}
+	
+	if (arg_gt == 2) {
+	  // get the text for each section
+	  sechere = inforesponse.docInfo.begin();
+	  int count = 0;
+	  while (sechere != secend) {
+	    textout << outconvert << disp << "\n<p><a name=" << count << "></a>\n";
+
+	    int shastxt = (*sechere).metadata["hastxt"].values[0].getint();
+
+	    output_text (*sechere, formatlistptr, queryresponse.termInfo, 
+			 (*sechere).OID, highlight, shastxt, wanttext, collection, 
+			 collectproto, disp, outconvert, textout, logout);
+	    count ++;
+	    sechere ++;
+	  }
+	}
+      }
+    }
+    delete formatlistptr;
+  }
+}
+
+
+
+
+
+
+
+
+
+
+
+
Index: tags/Old_DocumentColumn_Version/cstr/src/recpt/cstrdocaction.h
===================================================================
--- tags/Old_DocumentColumn_Version/cstr/src/recpt/cstrdocaction.h	(revision 1965)
+++ tags/Old_DocumentColumn_Version/cstr/src/recpt/cstrdocaction.h	(revision 1965)
@@ -0,0 +1,66 @@
+/**********************************************************************
+ *
+ * cstrdocaction.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 CSTRDOCACTION_H
+#define CSTRDOCACTION_H
+
+#include "documentaction.h"
+
+class cstrdocaction : public documentaction {
+
+protected:
+
+  void output_controls (cgiargsclass &args, const text_tarray &ibuttons,
+			recptproto *collectproto, displayclass &disp, 
+			outconvertclass &outconvert, ostream &textout, 
+			ostream &logout);
+
+  void set_java_macros (cgiargsclass &args, displayclass &disp);
+
+  void output_document (const text_t &OID, cgiargsclass &args, 
+			recptproto *collectproto, displayclass &disp, 
+			outconvertclass &outconvert, ostream &textout, 
+			ostream &logout);
+
+
+public:
+  cstrdocaction ();
+  virtual ~cstrdocaction ();
+
+  void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
+			 response_t &response,text_t &response_data, 
+			 ostream &logout);
+};
+
+
+
+#endif
+
+
+
+
Index: tags/Old_DocumentColumn_Version/cstr/src/recpt/cstrlibrarymain.cpp
===================================================================
--- tags/Old_DocumentColumn_Version/cstr/src/recpt/cstrlibrarymain.cpp	(revision 1965)
+++ tags/Old_DocumentColumn_Version/cstr/src/recpt/cstrlibrarymain.cpp	(revision 1965)
@@ -0,0 +1,122 @@
+/**********************************************************************
+ *
+ * cstrlibrarymain.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 "receptionist.h"
+#include "collectset.h"
+#include "cgiwrapper.h"
+#include "nullproto.h"
+#include "fileutil.h"
+#include <assert.h>
+
+#include "action.h"
+#include "statusaction.h"
+#include "pageaction.h"
+#include "pingaction.h"
+#include "queryaction.h"
+#include "cstrdocaction.h"
+#include "authenaction.h"
+#include "usersaction.h"
+
+#include "browserclass.h"
+#include "vlistbrowserclass.h"
+#include "hlistbrowserclass.h"
+#include "datelistbrowserclass.h"
+#include "invbrowserclass.h"
+#include "pagedbrowserclass.h"
+#include "htmlbrowserclass.h"
+
+#include "recptconfig.h"
+
+int main () {
+  receptionist recpt;
+  nullproto nproto;
+
+  text_t gsdlhome, httpdomain, httpprefix;
+  // get gsdlhome (if we fail the error will be picked up later -- in
+  // cgiwrapper)
+  site_cfg_read (gsdlhome, httpdomain, httpprefix);
+  collectset *cservers = new collectset();
+  cservers->add_collection ("cstr", &recpt, gsdlhome, gsdlhome);
+
+  nproto.set_collectset(cservers);
+
+  // configure the receptionist server list
+  cservers->setReceptionistServers(recpt, gsdlhome);  
+  
+  // add the protocol to the receptionist
+  recpt.add_protocol (&nproto);
+
+  // the list of actions. Note: these actions will become invalid
+  // at the end of this function.
+  statusaction astatusaction;
+  astatusaction.set_receptionist (&recpt);
+  recpt.add_action (&astatusaction);
+
+  pageaction apageaction;
+  apageaction.set_receptionist (&recpt);
+  recpt.add_action (&apageaction);
+
+  pingaction apingaction;
+  recpt.add_action (&apingaction);
+
+  queryaction aqueryaction;
+  aqueryaction.set_receptionist (&recpt);
+  recpt.add_action (&aqueryaction);
+
+  cstrdocaction adocumentaction;
+  adocumentaction.set_receptionist (&recpt);
+  recpt.add_action (&adocumentaction);
+
+  usersaction ausersaction;
+  recpt.add_action (&ausersaction);
+
+  authenaction aauthenaction;
+  aauthenaction.set_receptionist(&recpt);
+  recpt.add_action (&aauthenaction);
+
+  // list of browsers
+  vlistbrowserclass avlistbrowserclass;
+  recpt.add_browser (&avlistbrowserclass);
+  recpt.setdefaultbrowser ("VList");
+
+  hlistbrowserclass ahlistbrowserclass;
+  recpt.add_browser (&ahlistbrowserclass);
+
+  datelistbrowserclass adatelistbrowserclass;
+  recpt.add_browser (&adatelistbrowserclass);
+
+  invbrowserclass ainvbrowserclass;
+  recpt.add_browser (&ainvbrowserclass);
+
+  pagedbrowserclass apagedbrowserclass;
+  recpt.add_browser (&apagedbrowserclass);
+
+  htmlbrowserclass ahtmlbrowserclass;
+  recpt.add_browser (&ahtmlbrowserclass);
+
+  cgiwrapper (recpt, "cstr");
+  return 0;
+}
