Index: trunk/gsdl/src/recpt/documentaction.cpp
===================================================================
--- trunk/gsdl/src/recpt/documentaction.cpp	(revision 757)
+++ trunk/gsdl/src/recpt/documentaction.cpp	(revision 758)
@@ -28,4 +28,8 @@
 /*
    $Log$
+   Revision 1.30  1999/11/01 21:54:27  sjboddie
+   changes for cross-collection searching - changes to arguments
+   of many functions
+
    Revision 1.29  1999/10/24 07:23:40  sjboddie
    added FullTOC option
@@ -288,39 +292,35 @@
 }
 
-void documentaction::get_cgihead_info (cgiargsclass &args, response_t &response,
-				       text_t &response_data, ostream &logout) {
-
-  if ((!args["d"].empty()) && (args["il"] == "w"))
-    {
-      text_t &oid = args["d"];
-      text_t &collection = args["c"];
-
-      recptprotolistclass* protocols = recpt->get_recptprotolist_ptr();
-      recptproto* collectproto = protocols->getrecptproto (collection, logout);
-
+void documentaction::get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
+				       response_t &response,text_t &response_data, 
+				       ostream &logout) {
+
+  if ((args["il"] == "w") && (!args["d"].empty())) {
+
+    recptproto* collectproto = protos->getrecptproto (args["c"], logout);
+    if (collectproto != NULL) {
+      
       text_tset metadata;
       FilterResponse_t filt_response;
+      text_t top;
 
       metadata.insert ("URL");
-    
-      // get metadata for this document and it's parents
-      if (get_info (oid, collection, metadata, true, collectproto, filt_response, logout)) 
-	{
-	  text_t url = *(filt_response.docInfo[0].metadata[0].values.begin());
-
-	  response = location;
-	  response_data = url;
-	}
-      else
-	{
-	  // error, no URL
-	  logout << "Error: documentaction::get_cgihead_info failed on get_info" << endl;
-	}
-    }
-  else
-    {
-      response = content;
-      response_data = "text/html";
-    }
+      
+      // get metadata for parent document
+      get_top (args["d"], top);
+      if (get_info (top, args["c"], metadata, false, collectproto, filt_response, logout)) {
+	text_t url = filt_response.docInfo[0].metadata[0].values[0];
+	
+	response = location;
+	response_data = url;
+	return;
+      } else {
+	// error, no URL
+	logout << "Error: documentaction::get_cgihead_info failed on get_info" << endl;
+      }
+    }
+  }
+  response = content;
+  response_data = "text/html";
 }
 
@@ -420,7 +420,6 @@
 // define all the macros which might be used by other actions
 // to produce pages. 
-void documentaction::define_external_macros (const ColInfoResponse_t &/*collectinfo*/, 
-					     displayclass &disp, cgiargsclass &args, 
-					     recptproto *collectproto, ostream &logout) {
+void documentaction::define_external_macros (displayclass &disp, cgiargsclass &args, 
+					     recptprotolistclass *protos, ostream &logout) {
   
   // define_external_macros sets the following macros:
@@ -443,7 +442,10 @@
   
 
-  // can't do anything if collectproto is null (i.e. no collection was specified)
+  // must have a valid collection server to continue
+  text_t &collection = args["c"];
+  if (collection.empty()) return;
+  recptproto *collectproto = protos->getrecptproto (collection, logout);
   if (collectproto == NULL) return;
-
+  
   outconvertclass text_t2ascii;
   comerror_t err;
@@ -451,5 +453,4 @@
   FilterResponse_t response;
   text_tset metadata;
-  text_t &collection = args["c"];
 
   // don't want navigation bar if page is 'detached'
@@ -557,7 +558,6 @@
 // by this action. we also load up the formatinfo structure 
 // here (it's used in do_action as well as here)
-void documentaction::define_internal_macros (const ColInfoResponse_t &collectinfo, 
-					     displayclass &disp, cgiargsclass &args, 
-					     recptproto *collectproto, ostream &logout) {
+void documentaction::define_internal_macros (displayclass &disp, cgiargsclass &args, 
+					     recptprotolistclass *protos, ostream &logout) {
   
   // define_internal_macros sets the following macros:
@@ -579,14 +579,22 @@
   //                        to the archivedir metadata element
 
-  // can't do anything if collectproto is null (i.e. no collection was specified)
+
+  // must have a valid collection server to continue
+  text_t &collection = args["c"];
+  if (collection.empty()) return;
+  recptproto *collectproto = protos->getrecptproto (collection, logout);
   if (collectproto == NULL) return;
-  
+
   text_tset metadata;
   FilterResponse_t response;
   text_t &arg_d = args["d"];
   text_t &arg_cl = args["cl"];
-  text_t &collection = args["c"];
   int gt = args.getintarg("gt");
-  load_formatinfo (collectinfo.format, gt);
+
+  // get info on current collection and load up formatinfo
+  ColInfoResponse_t cinfo;
+  comerror_t err;
+  collectproto->get_collectinfo (collection, cinfo, err, logout);
+  load_formatinfo (cinfo.format, gt);
 
   if (!formatinfo.DocumentArrowsBottom)
@@ -677,9 +685,12 @@
 
 
-bool documentaction::do_action (cgiargsclass &args, const ColInfoResponse_t &/*collectinfo*/,
-				recptproto *collectproto, displayclass &disp, 
+bool documentaction::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 << "documentaction::do_action called with NULL collectproto\n";
@@ -688,5 +699,5 @@
 	    << "_document:footer_\n";
   } else {  
-
+    
     text_t OID = args["d"];
     if (OID.empty()) OID = args["cl"];
@@ -700,6 +711,6 @@
     
     // output the table of contents
-    output_toc (args, recpt->get_browsermap_ptr(), formatinfo, 
-		collectproto, disp, outconvert, textout, logout);
+    output_toc (args, browsers, formatinfo, collectproto, 
+		disp, outconvert, textout, logout);
 
     // output the document text
@@ -768,7 +779,19 @@
   if (!args["q"].empty() && args.getintarg("hl")) {
     FilterRequest_t request;
+    comerror_t err;
     request.filterResultOptions = FRmatchTerms;
-    if (do_query (request, args, collectproto, queryresponse, logout))
+    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;
+    }
   }
 
Index: trunk/gsdl/src/recpt/documentaction.h
===================================================================
--- trunk/gsdl/src/recpt/documentaction.h	(revision 757)
+++ trunk/gsdl/src/recpt/documentaction.h	(revision 758)
@@ -78,22 +78,19 @@
   text_t get_action_name () {return "d";}
 
-  void set_receptionist (receptionist *therecpt) {recpt=therecpt;}
-
   bool check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args, 
 		      ostream &logout);
 
-  void get_cgihead_info (cgiargsclass &args, response_t &response,
-                         text_t &response_data, ostream &logout);
+  void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
+			 response_t &response,text_t &response_data, 
+			 ostream &logout);
 
-  void define_external_macros (const ColInfoResponse_t &collectinfo, 
-			       displayclass &disp, cgiargsclass &args, 
-			       recptproto *collectproto, ostream &logout);
+  void define_external_macros (displayclass &disp, cgiargsclass &args, 
+			       recptprotolistclass *protos, ostream &logout);
 
-  void define_internal_macros (const ColInfoResponse_t &collectinfo, 
-			       displayclass &disp, cgiargsclass &args, 
-			       recptproto *collectproto, ostream &logout);
+  void define_internal_macros (displayclass &disp, cgiargsclass &args, 
+			       recptprotolistclass *protos, ostream &logout);
 
-  bool do_action (cgiargsclass &args, const ColInfoResponse_t &collectinfo, 
-		  recptproto *collectproto, displayclass &disp, 
+  bool do_action (cgiargsclass &args, recptprotolistclass *protos, 
+		  browsermapclass *browsers, displayclass &disp, 
 		  outconvertclass &outconvert, ostream &textout, 
 		  ostream &logout);
