Changeset 2785 for trunk/gsdl/src


Ignore:
Timestamp:
2001-10-09T17:21:29+13:00 (23 years ago)
Author:
sjboddie
Message:

The build process now creates a summary of how many files were included,
which were rejected, etc. A link to a page containing this summary is
provided from the final page of the collector (once the collection is built
successfully) and from the default "about this collection" text for
collections built by the collector.

Also did a little bit of tidying in a couple of places

Location:
trunk/gsdl/src/recpt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/collectoraction.cpp

    r2774 r2785  
    10301030  // _faillog_ - set to last 6 lines of .bld file if build failed
    10311031  // _gsdlhome_ - the gsdlhome path (dm_safe)
    1032 
    10331032  // _sourcelist_ -- "input source" text boxes
    10341033  // _badsources_ -- will be set to "1" if we've come from the
     
    11541153    collectorbar += get_button (collector_page, "grey", "view", false);
    11551154  }
     1155
     1156  collectorbar += "</tr></table>\n";
     1157  disp.setmacro ("collectorbar", "collector", collectorbar);
    11561158
    11571159  if (collector_page == "bildfail") {
     
    11751177    disp.setmacro ("faillog", "collector", dm_safe(faillog));
    11761178  }
    1177 
    1178   collectorbar += "</tr></table>\n";
    1179   disp.setmacro ("collectorbar", "collector", collectorbar);
    11801179
    11811180  if (collector_page == "srce" || collector_page == "existing")
     
    16591658  }
    16601659   
     1660  text_t collectdir = get_collectdir (args);
     1661
    16611662  // set up build options
    16621663  text_t options = "-make_writable -remove_import -out \"";
    16631664  options += filename_cat (tmpdir, collection + ".bld");
    1664   options += "\" -collectdir \"" + get_collectdir (args) + "\"";
     1665  options += "\" -collectdir \"" + collectdir + "\" -statsfile \"";
     1666  options += filename_cat(collectdir, collection, "etc", "import.log") + "\"";
    16651667
    16661668  if (args["bc1esrce"] == 1) {
  • trunk/gsdl/src/recpt/pageaction.cpp

    r2782 r2785  
    2828#include "receptionist.h"
    2929#include "fileutil.h"
     30#include "gsdltools.h"
    3031#include <time.h>
    3132
     
    327328}
    328329
     330void pageaction::set_macro_to_file_contents (displayclass &disp, const text_t &macroname,
     331                         const text_t &packagename, const text_t &filename) {
     332
     333  text_t filecontent;
     334  char *filenamec = filename.getcstr();
     335  ifstream file_in (filenamec);
     336  delete filenamec;
     337  if (file_in) {
     338    char c;
     339    file_in.get(c);
     340    while (!file_in.eof ()) {
     341      if (c == '\n') filecontent += "<br>";
     342      filecontent.push_back(c);
     343      file_in.get(c);
     344    }
     345    file_in.close();
     346  }
     347  disp.setmacro (macroname, packagename, dm_safe(filecontent));
     348}
     349
    329350void pageaction::define_internal_macros (displayclass &disp, cgiargsclass &args,
    330351                     recptprotolistclass *protos, ostream &logout) {
     
    383404  // if page is "docs"
    384405  // _documentation_       links to PDF documents if they're available
     406
     407
     408  // if page is "bsummary"
     409  // _importlog_           set to contents of collections import.log file
     410  // _faillog_             set to contents of collections fail.log file
    385411
    386412 
     
    418444  //setting _queryformcontent_ so that the query interface is consistent.
    419445  if(arg_p == "about"){
    420     text_t collection = args["c"];
    421      //check that the protocol is alive
    422     recptproto* colproto = protos->getrecptproto (collection, logout);
    423     if(colproto == NULL) {
    424       logout << "ERROR: Null collection protocol trying to query"
    425          << collection.getcstr() << "\n";
    426       return;
    427     }
    428    
    429     //check the collection is responding/in place
    430     ColInfoResponse_t *colinfo = recpt->get_collectinfo_ptr(colproto, collection,
    431                                 logout);
    432     if(colinfo == NULL){
    433       logout << "ERROR: Null returned for get_collectinfo_ptr on "
    434          << collection.getcstr() << "in queryaction::define_query_interface\n";
    435       return;
    436     }
    437    
    438    
    439     text_tmap::iterator check = colinfo->format.find("QueryInterface");
    440     if(check != colinfo->format.end()){
    441       if((*check).second=="DateSearch"){
    442     text_t current = "_basicqueryform_ _datesearch_";
     446    if (cinfo != NULL) {
     447      text_tmap::iterator check = cinfo->format.find("QueryInterface");
     448      if(check != cinfo->format.end()){
     449    if((*check).second=="DateSearch"){
     450      text_t current = "_basicqueryform_ _datesearch_";
    443451   
    444     disp.setmacro("queryformcontent","query",current);
    445       }
    446     }
    447   }
    448 
    449 
     452      disp.setmacro("queryformcontent","query",current);
     453    }
     454      }
     455    }
     456  }
    450457
    451458  if (arg_p == "home") {
     
    454461    if (collector_disabled) disp.setmacro ("textgocollector", "home", "");
    455462  }
    456 
    457 
    458  
    459463 
    460464  else if (arg_p == "preferences") {
     
    462466    // _collectionoption_
    463467
    464     if (args["ccs"] == "1" && collectproto != NULL && (cinfo->ccsCols.size() > 1)) {
     468    if ((args["ccs"] == "1") && (cinfo->ccsCols.size() > 1)) {
    465469      text_t collectionoption = "_textcollectionoption_";
    466470      text_tarray::const_iterator col_here = cinfo->ccsCols.begin();
     
    675679    set_documentation_macro (disp);
    676680
     681  } else if (arg_p == "bsummary" && !arg_c.empty()) {
     682
     683    set_macro_to_file_contents (disp, "importlog", "bsummary",
     684                filename_cat(gsdlhome, "collect", arg_c, "etc", "import.log"));
     685    set_macro_to_file_contents (disp, "faillog", "bsummary",
     686                filename_cat(gsdlhome, "collect", arg_c, "etc", "fail.log"));
    677687  }
    678688}
  • trunk/gsdl/src/recpt/pageaction.h

    r2767 r2785  
    7575  void set_documentation_macro (displayclass &disp);
    7676
     77  void set_macro_to_file_contents (displayclass &disp, const text_t &macroname,
     78                   const text_t &packagename, const text_t &filename);
     79
    7780  bool status_disabled;
    7881  bool collector_disabled;
Note: See TracChangeset for help on using the changeset viewer.