Changeset 58 for trunk/gsdl/src/library


Ignore:
Timestamp:
1998-12-07T11:50:25+13:00 (26 years ago)
Author:
sjboddie
Message:

added niupepa collection and made allowances in libinterface for 'auxiliary' actions for those things that don't fit into 'document' action

Location:
trunk/gsdl/src/library
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/library/browse.cpp

    r36 r58  
    434434      } else {
    435435    if (!info.c.empty()) {
    436       (info.c, firstcontent);
     436      get_first_section(info.c, firstcontent);
    437437      return_text += link + *here + "." + firstcontent + "\">";
    438438      return_text += info.t + "</a>&nbsp;&nbsp;&nbsp;";
     
    735735
    736736// sorts an array of sections alphabetically (i.e. by title, author depending
    737 // on what classification is)
     737// on what classification is) or by date
    738738void browseclass::sort_array (vector<text_t> &array, gdbmclass &gdbm,
    739739                  const text_t &collection, const text_t classification) {
     740
     741  if ((classification[0] != 'T') && (classification[0] != 'A') &&
     742      (classification[0] != 'D')) return;
    740743
    741744  gdbm_info info;
     
    759762      tmparray = string_add(tmparray, &len, info.t.getcstr());
    760763
    761     } else {
     764    } else if (classification[0] == 'A') {
    762765      alphabetize_string_name(info.a);
    763766      info.a += ":#:" + *here;
    764767      tmparray = string_add(tmparray, &len, info.a.getcstr());
     768   
     769    } else {
     770      info.i += ":#:" + *here;
     771      tmparray = string_add(tmparray, &len, info.i.getcstr());
    765772    }
    766773    here ++;
  • trunk/gsdl/src/library/gdbmclass.cpp

    r54 r58  
    711711
    712712static int compare_str (const void *e1, const void *e2) {
    713   return my_stricmp(*((char**)e1), *((char**)e2));
     713  return _stricmp(*((char**)e1), *((char**)e2));
    714714}
    715715
  • trunk/gsdl/src/library/libinterface.cpp

    r4 r58  
    240240  else if (arg_a == "t") document_action (args, textout, logout);
    241241  else if (arg_a == "p") page_action (args, textout, logout);
     242  else if ((arg_a.size() == 2) && (arg_a[0] == 'a')) auxiliary_action (args, textout, logout);
    242243  else
    243244    {
     
    256257{
    257258  argconfigstr =
    258     "a[p]"     // action: q=query, b=browse, t=targetdoc, p=page
     259    "+a[p]"    // action: q=query, b=browse, t=targetdoc, p=page, a1=auxiliary
    259260    "t[1]"     // query type: 0=boolean, 1=ranked
    260261    "i[c]"     // index: c=chapter, p=paragraph, t=title, b=book
     
    262263    "s[0]"     // stemming: 0=off, 1=on
    263264    "+p[home]" // page
    264     "+c[unu2]" // collection
     265    "+c[unu]" // collection
    265266    "+r[1]"    // results from
    266267    "+d[C.1]"  // the target document
     
    865866
    866867/////////////////////////////////////////////////////////////////////////////////////////
     868// auxiliary_action is called to retrieve and display collection documents
     869// in formats other than those handled by document_action (i.e. those other
     870// than text). This should be overridden for collections needing to return
     871// images, postscript etc. You can have as many auxiliary actions as needed
     872// by setting arg_a to a1, a2, a3 etc. and testing arg["a"][1] within the
     873// auxiliary_action function.
     874// auxiliary_action defaults to calling document_action
     875
     876void libinterface::auxiliary_action (cgiargsclass &args, ostream &textout, ostream &logout) {
     877  document_action (args, textout, logout);
     878}
     879
     880/////////////////////////////////////////////////////////////////////////////////////////
    867881// page is called when a standard html page is to be displayed
    868882void libinterface::page_action (cgiargsclass &args, ostream &textout, ostream &logout)
  • trunk/gsdl/src/library/libinterface.h

    r4 r58  
    119119  virtual void document_action (cgiargsclass &args, ostream &textout, ostream &logout);
    120120  virtual void page_action (cgiargsclass &args, ostream &textout, ostream &logout);
     121  virtual void auxiliary_action (cgiargsclass &args, ostream &textout, ostream &logout);
    121122 
    122123  virtual void displayresults (cgiargsclass &args, ostream &textout, ostream &logout,
Note: See TracChangeset for help on using the changeset viewer.