Changeset 189


Ignore:
Timestamp:
1999-03-05T16:53:56+13:00 (25 years ago)
Author:
sjboddie
Message:

fixed some bugs

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

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/Makefile

    r188 r189  
    1111AR = ar
    1212CC = gcc
    13 CCFLAGS = -g -Wall -Wunused -pedantic -W -Woverloaded-virtual
     13CCFLAGS = -g -Wall -Wunused -pedantic -W -Woverloaded-virtual # -Wshadow
    1414DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DUSE_FASTCGI -DGSDLSERVER
    1515INCLUDES = -I../../lib -I../../packages/mg-1.3d -I../../packages/mg-1.3d/lib \
  • trunk/gsdl/src/recpt/OIDtools.cpp

    r188 r189  
    1212/*
    1313   $Log$
     14   Revision 1.2  1999/03/05 03:53:53  sjboddie
     15
     16   fixed some bugs
     17
    1418   Revision 1.1  1999/03/04 22:38:20  sjboddie
    1519
     
    2428// targetdoc. targetdoc will normally be either a document
    2529// or classification OID so this returns the CLSU, HASH etc.
    26 void targetdoc_gethead (const text_t &targetdoc, text_t &head) {
     30void get_head (const text_t &targetdoc, text_t &head) {
    2731
    2832  head.clear();
     
    3135}
    3236
     37
     38// returns (in top) the top level of targetdoc (i.e. everything
     39// up until the first dot)
     40void get_top (const text_t &targetdoc, text_t &top) {
     41
     42  top.clear();
     43  text_t::const_iterator begin = targetdoc.begin();
     44  text_t::const_iterator end = targetdoc.end();
     45
     46  top.appendrange (begin, findchar(begin, end, '.'));
     47}   
     48
     49
     50// checks if targetdoc is top level of a document (i.e. contains no dots)
     51bool is_top (const text_t &targetdoc) {
     52
     53  text_t::const_iterator here = targetdoc.begin();
     54  text_t::const_iterator end = targetdoc.end();
     55  here = findchar (here, end, '.');
     56
     57  if (here == end) return true;
     58  return false;
     59}
  • trunk/gsdl/src/recpt/OIDtools.h

    r188 r189  
    1919// targetdoc. targetdoc will normally be either a document
    2020// or classification OID so this returns the CLSU, HASH etc.
    21 void targetdoc_gethead (const text_t &targetdoc, text_t &head);
     21void get_head (const text_t &targetdoc, text_t &head);
    2222
     23// returns (in top) the top level of targetdoc (i.e. everything
     24// up until the first dot)
     25void get_top (const text_t &targetdoc, text_t &top);
     26
     27// checks if targetdoc is top level of a document (i.e. contains no dots)
     28bool is_top (const text_t &targetdoc);
    2329
    2430
  • trunk/gsdl/src/recpt/cgiwrapper.cpp

    r188 r189  
    1212/*
    1313   $Log$
     14   Revision 1.10  1999/03/05 03:53:54  sjboddie
     15
     16   fixed some bugs
     17
    1418   Revision 1.9  1999/03/04 22:38:21  sjboddie
    1519
     
    323327// collection then "collection" should be set, otherwise it
    324328// should equal "".
    325 void cgiwrapper (receptionist &recpt, const text_t &collection) {
     329void cgiwrapper (receptionist &recpt, text_t collection) {
    326330#ifdef USE_FASTCGI
    327331  fcgistreambuf outbuf;
  • trunk/gsdl/src/recpt/cgiwrapper.h

    r144 r189  
    2121// collection then "collection" should be set, otherwise it
    2222// should equal "".
    23 void cgiwrapper (receptionist &recpt, const text_t &collection);
     23void cgiwrapper (receptionist &recpt, text_t collection);
    2424
    2525
  • trunk/gsdl/src/recpt/librarymain.cpp

    r166 r189  
    1212/*
    1313   $Log$
     14   Revision 1.2  1999/03/05 03:53:54  sjboddie
     15
     16   fixed some bugs
     17
    1418   Revision 1.1  1999/02/21 22:35:22  rjmcnab
    1519
     
    3741  recpt.add_protocol (&nproto);
    3842
    39   cgiwrapper (recpt, "");
     43  cgiwrapper (recpt, "gberg");
    4044  return 0;
    4145}
  • trunk/gsdl/src/recpt/receptionist.cpp

    r173 r189  
    1212/*
    1313   $Log$
     14   Revision 1.10  1999/03/05 03:53:54  sjboddie
     15
     16   fixed some bugs
     17
    1418   Revision 1.9  1999/02/28 20:00:16  rjmcnab
    1519
     
    125129      // look in $GSDLHOME/collect/collection-name/etc/collect.cfg and
    126130      // then $GSDLHOME/etc/collect.cfg
    127       text_t thecollectdir = filename_cat (configinfo.gsdlhome, "collect");
     131      thecollectdir = filename_cat (configinfo.gsdlhome, "collect");
    128132      thecollectdir = filename_cat (thecollectdir, configinfo.collection);
    129133      text_t filename = filename_cat (thecollectdir, "etc");
     
    339343  action *a = actions.getaction (args["a"]);
    340344  if (a != NULL) {
    341     if (a->uses_display(args)) prepare_page (a, args, collectproto, disp, logout);
     345    if (a->uses_display(args)) prepare_page (a, args, collectproto, logout);
    342346    if (!a->do_action (args, collectproto, disp, (*outconverter), contentout, logout))
    343347      return false;
     
    553557// and opens the page ready for output
    554558void receptionist::prepare_page (action *a, cgiargsclass &args, recptproto */*collectproto*/,
    555                  displayclass &disp, ostream &logout) {
     559                 ostream &logout) {
    556560 
    557561  // set up page parameters
     
    579583
    580584  // define general macros
    581   define_general_macros (disp, args, logout);
     585  define_general_macros (args, logout);
    582586
    583587 
     
    598602}
    599603
    600 void receptionist::define_general_macros (displayclass &disp, cgiargsclass &args,
    601                       ostream &/*logout*/) {
     604void receptionist::define_general_macros (cgiargsclass &args, ostream &/*logout*/) {
    602605
    603606  disp.setmacro ("gwcgi", "Global", configinfo.gwcgi);
  • trunk/gsdl/src/recpt/receptionist.h

    r173 r189  
    5050  // and opens the page ready for output
    5151  void prepare_page (action *a, cgiargsclass &args, recptproto *collectproto,
    52              displayclass &disp, ostream &logout);
    53   void define_general_macros (displayclass &disp, cgiargsclass &args,
    54                   ostream &logout);
     52             ostream &logout);
     53  void define_general_macros (cgiargsclass &args, ostream &logout);
    5554
    5655public:
  • trunk/gsdl/src/recpt/subjectbrowseaction.cpp

    r188 r189  
    1212/*
    1313   $Log$
     14   Revision 1.2  1999/03/05 03:53:56  sjboddie
     15
     16   fixed some bugs
     17
    1418   Revision 1.1  1999/03/04 22:38:22  sjboddie
    1519
     
    2125#include "subjectbrowseaction.h"
    2226#include "OIDtools.h"
    23 
    2427
    2528subjectbrowseaction::subjectbrowseaction () {
     
    8891}
    8992
    90 bool subjectbrowseaction::do_action (cgiargsclass &args, recptproto */*collectproto*/,
     93bool subjectbrowseaction::do_action (cgiargsclass &args, recptproto *collectproto,
    9194                     displayclass &disp, outconvertclass &outconvert,
    92                      ostream &textout, ostream &/*logout*/) {
     95                     ostream &textout, ostream &logout) {
    9396
    9497  text_t browsebar, locator, output;
     98
     99  if (collectproto == NULL) return false;
    95100 
    96101  // get browse bar unless page has been detached
     
    99104 
    100105  // get top locator
    101   get_top_locator(args, 0, locator);   
     106  get_top_locator(args, collectproto, 0, locator, logout); 
    102107
    103108  // expand and output page
     
    122127
    123128void subjectbrowseaction::get_browse_bar(const text_t &classification, text_t &return_text) {
    124   if (classification.empty()) return_text = "_imagebarstandard_";
     129
     130  return_text = "\n\n<!-- imagebar produced by subjectbrowseaction::get_browse_bar -->\n\n";
     131  if (classification.empty()) return_text += "_imagebarstandard_";
    125132  else {
    126133    text_t head;
    127     targetdoc_gethead(classification, head);
    128     return_text = "_browse:imagebar" + head + "_";
     134    get_head(classification, head);
     135    return_text += "_browse:imagebar" + head + "_";
    129136  }
    130137}
     
    135142// get_top_locator returns (in return_text) the html for the top browsing section
    136143
    137 void subjectbrowseaction::get_top_locator(cgiargsclass &args, int oversize, text_t &return_text) {
     144void subjectbrowseaction::get_top_locator(cgiargsclass &args, recptproto *collectproto,
     145                      int oversize, text_t &return_text, ostream &logout) {
    138146 
    139147  text_t alphabet_arrows, doclink;
     
    141149  text_t &arg_cl = args["cl"];
    142150
    143   return_text = "<p><table width=\"100%\" cellpadding=0 cellspacing=0 border=0><tr>\n";
     151  return_text = "\n\n<!-- top_locator produced by subjectbrowseaction::get_top_locator -->\n\n";
     152  return_text += "<p><table width=\"100%\" cellpadding=0 cellspacing=0 border=0><tr>\n";
    144153 
    145154  if (args["x"] == "1") doclink = "<a href=\"_gwcgi_?e=_compressedoptions_&q=_urlsafequerystring_&x=1";
    146155  else doclink = "<a href=\"_gwcgi_?e=_compressedoptions_&q=_urlsafequerystring_";
    147156
    148   /*  // get book cover jpeg and detach/expand/collapse buttons
    149   if (!arg_d.empty() && !is_top_level(arg_d)) {
    150     text_t book_top, jpeg_file;
    151     gdbm_info info;
    152     get_book_top(booksection, book_top);
     157  // get book cover jpeg and detach/expand/collapse buttons
     158  //  if (!arg_d.empty() && !is_top (arg_d)) {
     159    text_t top, jpeg_file;
     160    get_top(arg_d, top);
     161
     162    comerror_t err;
     163    MetadataResponse_t resp;
     164    MetadataRequest_t req;
     165    req.OIDs.push_back (top);
     166    req.fields.push_back ("jobnum");
     167
     168    collectproto->get_metadata (args["c"], req, resp, err, logout);
     169
     170    /*
    153171    gdbm.getinfo(book_top, info);
    154172
  • trunk/gsdl/src/recpt/subjectbrowseaction.h

    r188 r189  
    2222protected:
    2323  void get_browse_bar(const text_t &classification, text_t &return_text);
    24   void get_top_locator(cgiargsclass &args, int oversize, text_t &return_text);
     24  void get_top_locator(cgiargsclass &args, recptproto *collectproto,
     25               int oversize, text_t &return_text, ostream &logout);
    2526
    2627public:
Note: See TracChangeset for help on using the changeset viewer.