Changeset 259


Ignore:
Timestamp:
1999-05-10T15:43:49+12:00 (25 years ago)
Author:
sjboddie
Message:

lots of changes to lots of files - getting document action going

Location:
trunk/gsdl/src/colservr
Files:
8 edited

Legend:

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

    r249 r259  
    1212/*
    1313   $Log$
     14   Revision 1.4  1999/05/10 03:43:47  sjboddie
     15   lots of changes to lots of files - getting document action going
     16
    1417   Revision 1.3  1999/04/30 02:00:45  sjboddie
    1518   lots of stuff to do with getting documentaction working
     
    136139  }
    137140
     141  infodbclass info;
     142
     143  // translate any ".fc", ".pr" etc. stuff in the parentnode
     144  parentnode = gdbmptr->translate_OID (parentnode, info);
     145
    138146  // adjust topmost browsing node
    139147  if (parentnode.empty()) parentnode = "browse";
    140148
    141149  // get the node
    142   infodbclass info;
    143  
    144150  if ((request.filterResultOptions & FROID) ||
    145151      (request.filterResultOptions & FRmetadata)) {
  • trunk/gsdl/src/colservr/collectserver.cpp

    r249 r259  
    1313/*
    1414   $Log$
     15   Revision 1.8  1999/05/10 03:43:47  sjboddie
     16   lots of changes to lots of files - getting document action going
     17
    1518   Revision 1.7  1999/04/30 02:00:45  sjboddie
    1619   lots of stuff to do with getting documentaction working
     
    246249}
    247250
    248 
    249 
    250 
     251void collectserver::get_document (const DocumentRequest_t &request,
     252                  DocumentResponse_t &response,
     253                  comerror_t &err, ostream &logout) {
     254
     255  sourcelistclass::iterator source_here = sources.begin();
     256  sourcelistclass::iterator source_end = sources.end();
     257  while (source_here != source_end) {
     258    assert ((*source_here).s != NULL);
     259    if (((*source_here).s != NULL) &&
     260    ((*source_here).s->get_document (request.OID, response.doc, err, logout))) {
     261      if (err != noError) return;
     262      break;
     263    }
     264    source_here++;
     265  }
     266}
    251267
    252268// thecollectserver remains the property of the calling code but
  • trunk/gsdl/src/colservr/collectserver.h

    r249 r259  
    9797               FilterResponse_t &response,
    9898               comerror_t &err, ostream &logout);
     99
     100
     101  virtual void get_document (const DocumentRequest_t &request,
     102                 DocumentResponse_t &response,
     103                 comerror_t &err, ostream &logout);
     104
    99105};
    100106
  • trunk/gsdl/src/colservr/infodbclass.cpp

    r249 r259  
    1212/*
    1313   $Log$
     14   Revision 1.4  1999/05/10 03:43:48  sjboddie
     15   lots of changes to lots of files - getting document action going
     16
    1417   Revision 1.3  1999/04/30 02:00:46  sjboddie
    1518   lots of stuff to do with getting documentaction working
     
    102105text_t gdbmclass::translate_OID (const text_t &inOID, infodbclass &info) {
    103106
    104   if (inOID.empty() || inOID.size() < 4) return inOID;
     107  if (inOID.size() < 4) return inOID;
    105108  if (findchar (inOID.begin(), inOID.end(), '.') == inOID.end()) return inOID;
    106109
  • trunk/gsdl/src/colservr/mggdbmsource.cpp

    r249 r259  
    1212/*
    1313   $Log$
     14   Revision 1.8  1999/05/10 03:43:48  sjboddie
     15   lots of changes to lots of files - getting document action going
     16
    1417   Revision 1.7  1999/04/30 02:00:47  sjboddie
    1518   lots of stuff to do with getting documentaction working
     
    231234}
    232235
     236
     237bool mggdbmsourceclass::get_document (const text_t &OID, text_t &doc,
     238                      comerror_t &err, ostream &logout) {
     239
     240  outconvertclass text_t2ascii;
     241
     242  err = noError;
     243  if (gdbmptr == NULL) {
     244    // most likely a configuration problem
     245    logout << text_t2ascii
     246       << "configuration error: mggdbmsource contains a null gdbmclass\n\n";
     247    err = configurationError;
     248    return true;
     249  }
     250
     251  // open the database
     252  gdbmptr->setlogout(&logout);
     253  if (!gdbmptr->opendatabase (gdbm_filename)) {
     254    // most likely a system problem (we have already checked that the
     255    // gdbm database exists)
     256    logout << text_t2ascii
     257       << "system problem: open on gdbm database \""
     258       << gdbm_filename << "\" failed\n\n";
     259    err = systemProblem;
     260    return true;
     261  }
     262
     263  text_t tOID = OID;
     264  if (needs_translating (OID))
     265    translate_OID (OID, tOID, err, logout);
     266  infodbclass info;
     267  if (!gdbmptr->getinfo(tOID, info)) return false;
     268 
     269  if (info["hastxt"].getint() == 1) {
     270    int docnum = info["docnum"].getint();
     271   
     272    // set the collection directory
     273    mgsearchptr->setcollectdir (collectdir);
     274   
     275    // get the text
     276    mgsearchptr->docTargetDocument("stx", collection, docnum, doc);
     277  }
     278  return true;
     279}
  • trunk/gsdl/src/colservr/mggdbmsource.h

    r249 r259  
    5656             MetadataInfo_tarray &metadata,
    5757             comerror_t &err, ostream &logout);
     58  bool get_document (const text_t &OID, text_t &doc,
     59             comerror_t &err, ostream &logout);
    5860};
    5961
  • trunk/gsdl/src/colservr/source.cpp

    r249 r259  
    1212/*
    1313   $Log$
     14   Revision 1.4  1999/05/10 03:43:49  sjboddie
     15   lots of changes to lots of files - getting document action going
     16
    1417   Revision 1.3  1999/04/30 02:00:48  sjboddie
    1518   lots of stuff to do with getting documentaction working
     
    7073}
    7174
     75bool sourceclass::get_document (const text_t &/*OID*/, text_t &/*doc*/,
     76                comerror_t &err, ostream &/*logout*/) {
     77  err = noError;
     78
     79  return false;
     80}
    7281
    7382
  • trunk/gsdl/src/colservr/source.h

    r249 r259  
    4040                 const text_tarray &fields, const text_t &OID,
    4141                 MetadataInfo_tarray &metadata,
     42                 comerror_t &err, ostream &logout);
     43
     44  virtual bool get_document (const text_t &OID, text_t &doc,
    4245                 comerror_t &err, ostream &logout);
    4346};
Note: See TracChangeset for help on using the changeset viewer.