Changeset 722


Ignore:
Timestamp:
1999-10-19T16:23:46+13:00 (25 years ago)
Author:
davidb
Message:

Collection building support through web pages
and internal and external link handling for collection documents

Location:
trunk/gsdl/src
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/browsefilter.cpp

    r534 r722  
    2828/*
    2929   $Log$
     30   Revision 1.8  1999/10/19 03:23:39  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.7  1999/09/07 04:57:20  sjboddie
    3135   added gpl notice
     
    106110  if (!file_exists(gdbm_filename)) {
    107111    logout << text_t2ascii
    108        << "error: gdbm database \""
     112       << "warning: gdbm database \"" //****
    109113       << gdbm_filename << "\" does not exist\n\n";
    110     return false;
     114    //    return false; //****
    111115  }
    112116
  • trunk/gsdl/src/colservr/collectserver.cpp

    r650 r722  
    2929/*
    3030   $Log$
     31   Revision 1.17  1999/10/19 03:23:39  davidb
     32   Collection building support through web pages
     33   and internal and external link handling for collection documents
     34
    3135   Revision 1.16  1999/10/10 08:20:35  sjboddie
    3236   - metadata now returns map rather than array
     
    123127    else if (key == "numwords") collectinfo.numWords = value.getint();
    124128    else if (key == "numbytes") collectinfo.numBytes = value.getint();
     129    else if (key == "collectionmeta" && cfgline.size() == 2)
     130      collectinfo.collectionmeta[cfgline[0]] = cfgline[1];
    125131    else if (key == "format" && cfgline.size() == 2)
    126132      collectinfo.format[cfgline[0]] = cfgline[1];
     133    else if (key == "building" && cfgline.size() == 2)
     134      collectinfo.building[cfgline[0]] = cfgline[1];
    127135    else if (key == "receptionist") collectinfo.receptionist = value;
    128136  }
  • trunk/gsdl/src/colservr/mggdbmsource.cpp

    r650 r722  
    2828/*
    2929   $Log$
     30   Revision 1.17  1999/10/19 03:23:40  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.16  1999/10/10 08:20:36  sjboddie
    3135   - metadata now returns map rather than array
     
    147151  if (!file_exists(gdbm_filename)) {
    148152    logout << text_t2ascii
    149        << "error: gdbm database \""
     153       << "warning: gdbm database \"" //****
    150154       << gdbm_filename << "\" does not exist\n\n";
    151     return false;
     155    // return false; //****
    152156  }
    153157 
  • trunk/gsdl/src/colservr/queryfilter.cpp

    r621 r722  
    2828/*
    2929   $Log$
     30   Revision 1.19  1999/10/19 03:23:40  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.18  1999/09/22 03:43:18  sjboddie
    3135   Endresults queryfilter option may now take '-1' for 'all'
     
    629633  if (!file_exists(gdbm_filename)) {
    630634    logout << text_t2ascii
    631        << "error: gdbm database \""
     635       << "warning: gdbm database \"" //****
    632636       << gdbm_filename << "\" does not exist\n\n";
    633     return false;
     637    //return false; //****
    634638  }
    635639
  • trunk/gsdl/src/recpt/Makefile.in

    r713 r722  
    6363                converter.h recptconfig.h cgiutils.h OIDtools.h browsetools.h htmlgen.h \
    6464        statusaction.h pageaction.h comtypes.h recptproto.h \
    65         pingaction.h queryaction.h documentaction.h htmlutils.h \
     65        pingaction.h queryaction.h documentaction.h \
     66        extlinkaction.h buildaction.h htmlutils.h \
    6667        querytools.h formattools.h tipaction.h authenaction.h infodbclass.h \
    6768                userdb.h usersaction.h vlistbrowserclass.h hlistbrowserclass.h \
     
    8081        htmlgen.cpp statusaction.cpp pageaction.cpp comtypes.cpp \
    8182        recptproto.cpp pingaction.cpp queryaction.cpp documentaction.cpp \
    82         htmlutils.cpp querytools.cpp formattools.cpp tipaction.cpp authenaction.cpp \
    83                 infodbclass.cpp userdb.cpp usersaction.cpp vlistbrowserclass.cpp \
    84         hlistbrowserclass.cpp datelistbrowserclass.cpp invbrowserclass.cpp \
    85         pagedbrowserclass.cpp htmlbrowserclass.h
     83        extlinkaction.cpp buildaction.cpp htmlutils.cpp querytools.cpp formattools.cpp \
     84        tipaction.cpp authenaction.cpp infodbclass.cpp userdb.cpp usersaction.cpp \
     85        vlistbrowserclass.cpp hlistbrowserclass.cpp datelistbrowserclass.cpp \
     86        invbrowserclass.cpp pagedbrowserclass.cpp htmlbrowserclass.cpp
     87
    8688
    8789RECPTSOURCES = recptmain.cpp
     
    9698        htmlgen.o statusaction.o pageaction.o comtypes.o \
    9799        recptproto.o pingaction.o queryaction.o documentaction.o \
    98         htmlutils.o querytools.o formattools.o tipaction.o authenaction.o \
     100        extlinkaction.o buildaction.o htmlutils.o querytools.o \
     101        formattools.o tipaction.o authenaction.o \
    99102                infodbclass.o userdb.o usersaction.o vlistbrowserclass.o \
    100103        hlistbrowserclass.o datelistbrowserclass.o invbrowserclass.o \
  • trunk/gsdl/src/recpt/authenaction.cpp

    r543 r722  
    2828/*
    2929   $Log$
     30   Revision 1.8  1999/10/19 03:23:41  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.7  1999/09/07 23:04:29  rjmcnab
    3135   removed some compiler warnings
     
    292296  disp.setmacro ("messagestatus", "authen", ("_authen:message" + args["us"]
    293297                         + "_"));
     298  // change style of header and footer if page is a frame
     299  if (args["sp"] != "frameset") {
     300    disp.setmacro ("header", "authen", "_status:infoheader_(Log in)");
     301    disp.setmacro ("header", "authenok", "_status:infoheader_(Log in)");
     302    disp.setmacro ("footer", "authen", "_status:infofooter_(Log in)");
     303    disp.setmacro ("footer", "authenok", "_status:infofooter_(Log in)");
     304  }
     305  else {
     306    //    disp.setmacro ("header", "authen", "_Global:header_"); //****
     307    //    disp.setmacro ("header", "authenok", "_Global:header_");
     308    //    disp.setmacro ("footer", "authen", "_Global:footer_");
     309    //    disp.setmacro ("footer", "authenok", "_Global:footer_");
     310    disp.setmacro ("header", "authen", "_:header_");
     311    disp.setmacro ("header", "authenok", "_:header_");
     312    disp.setmacro ("footer", "authen", "_:footer_");
     313    disp.setmacro ("footer", "authenok", "_:footer_");
     314  }
     315   
    294316
    295317  // get a list of saved configuration arguments (if possible)
  • trunk/gsdl/src/recpt/comtypes.h

    r671 r722  
    6868
    6969// ColInfoResponse ::= SEQUENCE {
    70 //   shortInfo     [0]  IMPLICIT ShortCollectionInfo,
    71 //   isPublic      [2]  IMPLICIT BOOLEAN,    -- whether has anonymous access
    72 //   isBeta        [3]  IMPLICIT BOOLEAN,    -- beta if still under development
    73 //   buildDate     [4]  IMPLICIT GeneralizedTime,
    74 //   languages     [5]  IMPLICIT StringSet,  -- languages in the collection
    75 //   numDocs       [6]  IMPLICIT INTEGER,
    76 //   numWords      [7]  IMPLICIT INTEGER OPTIONAL,
    77 //   numBytes      [8]  IMPLICIT INTEGER OPTIONAL
    78 //   format        [9]  IMPLICIT StringSet
    79 //   receptionist  [10] IMPLICIT GeneralString
     70//   shortInfo      [0]  IMPLICIT ShortCollectionInfo,
     71//   isPublic       [2]  IMPLICIT BOOLEAN,    -- whether has anonymous access
     72//   isBeta         [3]  IMPLICIT BOOLEAN,    -- beta if still under development
     73//   buildDate      [4]  IMPLICIT GeneralizedTime,
     74//   languages      [5]  IMPLICIT StringSet,  -- languages in the collection
     75//   numDocs        [6]  IMPLICIT INTEGER,
     76//   numWords       [7]  IMPLICIT INTEGER OPTIONAL,
     77//   numBytes       [8]  IMPLICIT INTEGER OPTIONAL
     78//   collectionmeta [9]  IMPLICIT StringSet
     79//   format         [10] IMPLICIT StringSet
     80//   building       [11] IMPLICIT StringSet
     81//   receptionist   [12] IMPLICIT GeneralString
    8082// }
    8183struct ColInfoResponse_t {
     
    9193  unsigned long numWords; // 0 if not known
    9294  unsigned long numBytes; // 0 if not known
     95  text_tmap collectionmeta;
    9396  text_tmap format;
     97  text_tmap building;
    9498  text_t receptionist;
    9599};
  • trunk/gsdl/src/recpt/documentaction.cpp

    r669 r722  
    2828/*
    2929   $Log$
     30   Revision 1.28  1999/10/19 03:23:42  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.27  1999/10/14 23:00:53  sjboddie
    3135   finished changes to browsing support
     
    167171  arg_ainfo.argdefault = "";
    168172  arg_ainfo.savedarginfo = cgiarginfo::can;
     173  argsinfo.addarginfo (NULL, arg_ainfo);
     174
     175  // whether or not a document should be retrieved from the
     176  // library or the Web.
     177  arg_ainfo.shortname = "il";
     178  arg_ainfo.longname = "internal link preference";
     179  arg_ainfo.multiplechar = false;
     180  arg_ainfo.defaultstatus = cgiarginfo::weak;
     181  arg_ainfo.argdefault = "l";
     182  arg_ainfo.savedarginfo = cgiarginfo::must;
    169183  argsinfo.addarginfo (NULL, arg_ainfo);
    170184
     
    271285}
    272286
    273 void documentaction::get_cgihead_info (cgiargsclass &/*args*/, response_t &response,
    274                        text_t &response_data, ostream &/*logout*/) {
    275   response = content;
    276   response_data = "text/html";
     287void documentaction::get_cgihead_info (cgiargsclass &args, response_t &response,
     288                       text_t &response_data, ostream &logout) {
     289
     290  if ((!args["d"].empty()) && (args["il"] == "w"))
     291    {
     292      text_t &oid = args["d"];
     293      text_t &collection = args["c"];
     294
     295      recptprotolistclass* protocols = recpt->get_recptprotolist_ptr();
     296      recptproto* collectproto = protocols->getrecptproto (collection, logout);
     297
     298      text_tset metadata;
     299      FilterResponse_t filt_response;
     300
     301      metadata.insert ("URL");
     302   
     303      // get metadata for this document and it's parents
     304      if (get_info (oid, collection, metadata, true, collectproto, filt_response, logout))
     305    {
     306      text_t url = *(filt_response.docInfo[0].metadata[0].values.begin());
     307
     308      response = location;
     309      response_data = url;
     310    }
     311      else
     312    {
     313      // error, no URL
     314      logout << "Error: documentaction::get_cgihead_info failed on get_info" << endl;
     315    }
     316    }
     317  else
     318    {
     319      response = content;
     320      response_data = "text/html";
     321    }
    277322}
    278323
  • trunk/gsdl/src/recpt/infodbclass.cpp

    r533 r722  
    2828/*
    2929   $Log$
     30   Revision 1.5  1999/10/19 03:23:42  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.4  1999/09/07 04:56:56  sjboddie
    3135   added GPL notice
     
    137141// returns true if opened
    138142bool gdbmclass::opendatabase (const text_t &filename, int mode, int num_retrys,
    139                   bool need_filelock) {
     143#ifdef __WIN32__
     144                  bool need_filelock
     145#else
     146                              bool
     147#endif
     148                  ) {
    140149  text_t data_location;
    141150  int block_size = 512;
  • trunk/gsdl/src/recpt/librarymain.cpp

    r713 r722  
    2828/*
    2929   $Log$
     30   Revision 1.17  1999/10/19 03:23:43  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.16  1999/10/18 20:07:33  sjboddie
    3135   added htmlbrowserclass
     
    105109#include "usersaction.h"
    106110#include "authenaction.h"
     111#include "extlinkaction.h"
     112#include "buildaction.h"
    107113
    108114#include "browserclass.h"
     
    206212
    207213  documentaction adocumentaction;
    208   adocumentaction.set_receptionist(&recpt);
     214  adocumentaction.set_receptionist (&recpt);
    209215  recpt.add_action (&adocumentaction);
    210216
    211217  usersaction ausersaction;
    212218  recpt.add_action (&ausersaction);
     219
     220  extlinkaction anextlinkaction;
     221  recpt.add_action (&anextlinkaction);
     222
     223  buildaction abuildaction;
     224  abuildaction.set_receptionist (&recpt);
     225  recpt.add_action (&abuildaction);
    213226
    214227  authenaction aauthenaction;
  • trunk/gsdl/src/recpt/nullproto.cpp

    r533 r722  
    2828/*
    2929   $Log$
     30   Revision 1.10  1999/10/19 03:23:43  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.9  1999/09/07 04:56:56  sjboddie
    3135   added GPL notice
     
    109113    outconvertclass text_t2ascii;
    110114    logout << text_t2ascii
    111            << "Error: couldn't read build.cfg file for collection \""
     115           << "Warning: couldn't read build.cfg file for collection \"" //****
    112116           << configinfo.collection << "\", gsdlhome=\""
    113117           << configinfo.gsdlhome << "\"\n";
    114     return false;
     118    //  return false; //****
    115119      }
    116120
  • trunk/gsdl/src/recpt/pageaction.cpp

    r673 r722  
    2828/*
    2929   $Log$
     30   Revision 1.18  1999/10/19 03:23:44  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.17  1999/10/14 23:04:44  sjboddie
    3135   some hacks to make nzdl home page look right
     
    208212        ColInfoResponse_t cinfo;
    209213        (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout);
     214
    210215        if (err == noError) {
    211           if (cinfo.isPublic) {
     216          if (cinfo.isPublic && (cinfo.buildDate > 0)) {
    212217
    213218        FilterResponse_t response;
  • trunk/gsdl/src/recpt/receptionist.cpp

    r712 r722  
    2828/*
    2929   $Log$
     30   Revision 1.36  1999/10/19 03:23:44  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.35  1999/10/18 20:07:05  sjboddie
    3135   tidied up a few things - moved processing of "hp" argument
     
    11091113  text_t &collection = args["c"];
    11101114
     1115  disp.setmacro ("gsdlhome", "Global", configinfo.gsdlhome);
    11111116  disp.setmacro ("gwcgi", "Global", configinfo.gwcgi);
    11121117  disp.setmacro ("httpimg", "Global", configinfo.httpimg);
  • trunk/gsdl/src/recpt/recptproto.h

    r533 r722  
    170170  void addrecptproto (recptproto *therecptproto);
    171171
    172   // getrecptproto will return NULL if a recptproto for the given colelction
     172  // getrecptproto will return NULL if a recptproto for the given collection
    173173  // could not be found
    174174  recptproto *getrecptproto (const text_t &collection, ostream &logout);
  • trunk/gsdl/src/recpt/statusaction.cpp

    r716 r722  
    2828/*
    2929   $Log$
     30   Revision 1.21  1999/10/19 03:23:46  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.20  1999/10/18 20:10:41  sjboddie
    3135   don't want to use authentication to reach status page (usersaction still
     
    121125}
    122126
     127void statusaction::output_welcome (cgiargsclass &/*args*/, displayclass &disp,
     128                  outconvertclass &outconvert,
     129                  ostream &textout, ostream &/*logout*/) {
     130  textout << outconvert << disp << "_status:infoheader_(_titlewelcome_)\n"
     131    "_status:welcome_\n"
     132    "_status:infofooter_\n";
     133}
     134
    123135void statusaction::output_generalinfo (cgiargsclass &/*args*/, displayclass &disp,
    124136                       outconvertclass &outconvert,
     
    127139  const recptconf &rcinfo = recpt->get_configinfo ();
    128140 
    129   textout << outconvert << disp << "_status:header_(General Information)\n";
     141  textout << outconvert << disp << "_status:infoheader_(General Information)\n";
    130142  textout << outconvert
    131143      << "<h2>General information</h2>\n"
     
    269281  }
    270282 
    271   textout << outconvert << disp << "</table>\n_status:footer_\n";
     283  textout << outconvert << disp << "</table>\n_status:infofooter_\n";
    272284}
    273285
     
    279291  if (rcargsinfo == NULL) return;
    280292
    281   textout << outconvert << disp << "_status:header_(Argument Information)\n";
     293  textout << outconvert << disp << "_status:infoheader_(Argument Information)\n";
    282294  textout << outconvert
    283295      << "<h2>Argument information</h2>\n"
     
    323335  }
    324336 
    325   textout << outconvert << disp << "</table>\n_status:footer_\n";
     337  textout << outconvert << disp << "</table>\n_status:infofooter_\n";
    326338}
    327339
     
    332344  actionmapclass *actions = recpt->get_actionmap_ptr();
    333345
    334   textout << outconvert << disp << "_status:header_(Action Information)\n";
     346  textout << outconvert << disp << "_status:infoheader_(Action Information)\n";
    335347  textout << outconvert
    336348      << "<h2>Action information</h2>\n"
     
    368380  }
    369381 
    370   textout << outconvert << disp << "</table>\n_status:footer_\n";
     382  textout << outconvert << disp << "</table>\n_status:infofooter_\n";
    371383}
    372384
     
    382394  if (rprotolist == NULL) return;
    383395
    384   textout << outconvert << disp << "_status:header_(Protocol Information)\n";
     396  textout << outconvert << disp << "_status:infoheader_(Protocol Information)\n";
    385397  textout << outconvert
    386398      << "<h2>Protocol information</h2>\n"
     
    445457        << "mode making some of the collections unreachable.\n";
    446458  }
    447   textout << outconvert << disp << "_status:footer_\n";
     459  textout << outconvert << disp << "_status:infofooter_\n";
    448460}
    449461
     
    453465  if (recpt == NULL) return;
    454466
    455   textout << outconvert << disp << "_status:header_(Collection info)\n";
     467  textout << outconvert << disp << "_status:infoheader_(Collection info)\n";
    456468  textout << outconvert << "<h2>Collection info</h2>\n";
    457469
     
    643655  }
    644656 
    645   textout << outconvert << disp << "_status:footer_\n";
     657  textout << outconvert << disp << "_status:infofooter_\n";
    646658}
    647659
     
    655667  if (cinitfilename == NULL) return;
    656668
    657   textout << outconvert << disp << "_status:header_(Init log)\n";
     669  textout << outconvert << disp << "_status:infoheader_(Init log)\n";
    658670  textout << outconvert << "<h2>Init log</h2>\n";
    659671
     
    682694  }
    683695
    684   textout << outconvert << disp << "_status:footer_\n";
     696  textout << outconvert << disp << "_status:infofooter_\n";
    685697}
    686698
     
    694706  if (cerrfilename == NULL) return;
    695707
    696   textout << outconvert << disp << "_status:header_(Error log)\n";
     708  textout << outconvert << disp << "_status:infoheader_(Error log)\n";
    697709  textout << outconvert << "<h2>Error log</h2>\n";
    698710  logout << flush;
     
    722734  }
    723735
    724   textout << outconvert << disp << "_status:footer_\n";
     736  textout << outconvert << disp << "_status:infofooter_\n";
    725737}
    726738
     
    780792}
    781793
    782 bool statusaction::check_cgiargs (cgiargsinfoclass &/*argsinfo*/, cgiargsclass &args,
     794bool statusaction::check_cgiargs (cgiargsinfoclass &/*argsinfo*/, cgiargsclass &/*args*/,
    783795                  ostream &/*logout*/) {
    784   // authenticate the user if authentication is avaiable
    785   //  args["uan"] = 1;
    786   //  args["ug"] = "administrator";
    787  
    788796  return true;
    789797}
     
    837845  if (arg_sp == "frameset") output_frameset (args, disp, outconvert, textout, logout);
    838846  else if (arg_sp == "select") output_select (args, disp, outconvert, textout, logout);
     847  else if (arg_sp == "welcome") output_welcome (args, disp, outconvert, textout, logout);
    839848  else if (arg_sp == "generalinfo") output_generalinfo (args, disp, outconvert, textout, logout);
    840849  else if (arg_sp == "argumentinfo") output_argumentinfo (args, disp, outconvert, textout, logout);
  • trunk/gsdl/src/recpt/statusaction.h

    r533 r722  
    4848              ostream &textout, ostream &logout);
    4949
     50  void output_welcome (cgiargsclass &args, displayclass &disp,
     51               outconvertclass &outconvert,
     52               ostream &textout, ostream &logout);
    5053  void output_generalinfo (cgiargsclass &args, displayclass &disp,
    5154               outconvertclass &outconvert,
Note: See TracChangeset for help on using the changeset viewer.