Ignore:
Timestamp:
2000-08-03T14:49:41+12:00 (24 years ago)
Author:
johnmcp
Message:

Relatively stable z39.50 implementation now, merged with the mgpp source.
(Still needs a decent interface and query language though...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/z3950-branch/gsdl/src/recpt/documentaction.cpp

    r1148 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.38  2000/05/04 05:18:46  sjboddie
    31    attempting to get end-user collection building to work under windows
    32 
    33    Revision 1.37  2000/04/07 04:40:44  sjboddie
    34    Reverted back to old DocumentHeader, DocumentTitles, DocumentImages etc.
    35    from DocumentColumns stuff. I'll move the DocumentColumns stuff to a
    36    separate development branch (New_Config_Format-branch) for now. The plan
    37    is to redesign the configuration file format a bit and limit the number of
    38    distributions floating around that take different configuration formats).
    39 
    40    Revision 1.34  2000/02/15 22:53:49  kjm18
    41    search history stuff added.
    42 
    43    Revision 1.33  2000/02/13 20:40:05  sjboddie
    44    now dm_safe _thisOID_ macro
    45 
    46    Revision 1.32  2000/01/25 22:39:15  sjboddie
    47    added DocumentUseHTML - tidied some things up (and messed up some others)
    48 
    49    Revision 1.31  1999/11/13 08:57:00  sjboddie
    50    fixed bug in last changes
    51 
    52    Revision 1.30  1999/11/01 21:54:27  sjboddie
    53    changes for cross-collection searching - changes to arguments
    54    of many functions
    55 
    56    Revision 1.29  1999/10/24 07:23:40  sjboddie
    57    added FullTOC option
    58 
    59    Revision 1.28  1999/10/19 03:23:42  davidb
    60    Collection building support through web pages
    61    and internal and external link handling for collection documents
    62 
    63    Revision 1.27  1999/10/14 23:00:53  sjboddie
    64    finished changes to browsing support
    65 
    66    Revision 1.26  1999/10/10 08:14:06  sjboddie
    67    - metadata now returns mp rather than array
    68    - redesigned browsing support (although it's not finished so
    69    won't currently work ;-)
    70 
    71    Revision 1.25  1999/09/17 04:46:05  sjboddie
    72    fixed a couple of problems with 'unknown' classifier
    73 
    74    Revision 1.24  1999/09/17 04:00:26  sjboddie
    75    tidied up navigation bar to produce a default "unknown" button if
    76    it comes across metadata it can't display
    77 
    78    Revision 1.23  1999/09/07 04:56:54  sjboddie
    79    added GPL notice
    80 
    81    Revision 1.22  1999/08/20 01:00:22  sjboddie
    82    split some of the larger functions up to simplify the creation of
    83    collection specific receptionists
    84 
    85    Revision 1.21  1999/08/11 23:28:03  sjboddie
    86    -added support for html classifier
    87    - removed _random_ macro - now use _blank for detach page
    88 
    89    Revision 1.20  1999/08/10 23:16:39  sjboddie
    90    a couple of small changes to get format options DocumentArrowsBottom
    91    and DocumentArrowsTop working correctly
    92 
    93    Revision 1.19  1999/08/10 22:40:01  sjboddie
    94    added some more format options including the ability to format the
    95    document text
    96 
    97    Revision 1.18  1999/08/09 04:25:18  sjboddie
    98    moved OID translation stuff from documentaction::define_external_macros
    99    to receptionist
    100 
    101    Revision 1.17  1999/08/09 02:13:53  sjboddie
    102    fixed small bug in ShowSectionTitles
    103 
    104    Revision 1.16  1999/08/03 03:30:47  sjboddie
    105    a few small changes related to new format options
    106 
    107    Revision 1.15  1999/07/30 02:18:49  sjboddie
    108    -added collectinfo argument to some functions
    109    -caught up with changes to browsetools (allowing nested classifications)
    110    -added showtoppage format option
    111 
    112    Revision 1.14  1999/07/21 05:01:09  sjboddie
    113    fixed up wrapping of classificationlinks
    114 
    115    Revision 1.13  1999/07/20 02:59:54  sjboddie
    116    List and AZList classifications now use format strings
    117 
    118    Revision 1.12  1999/07/16 00:19:01  sjboddie
    119    some changes to the way quoted queries are handled
    120 
    121    Revision 1.11  1999/07/07 05:47:41  sjboddie
    122    changed around the way browsetools works
    123 
    124    Revision 1.10  1999/06/29 01:46:44  sjboddie
    125    now sets a _navigationbar_ macro even if there aren't any
    126    classifications (it will just have the 'search' button
    127 
    128    Revision 1.9  1999/06/27 22:05:58  sjboddie
    129    now set a _thisOID_ macro for use in displaying images
    130 
    131    Revision 1.8  1999/06/24 05:12:20  sjboddie
    132    lots of small changes
    133 
    134    Revision 1.7  1999/06/17 03:06:58  sjboddie
    135    got detach button working properly - the close book icon is now disabled
    136    when page is detached as the javascript close() function I was using is
    137    too unreliable over different browsers
    138    note that in my last comment I meant the "cl" arg (not the "c" arg).
    139 
    140    Revision 1.6  1999/06/16 23:53:15  sjboddie
    141    tidied a few things up. documentaction::define_external_macros now
    142    resets the "c" arg if it's set to something stupid by the .xx suffixes
    143 
    144    Revision 1.5  1999/06/16 03:10:49  sjboddie
    145    define_internal_macros() now sets _pagetitle_ macro to document's title
    146    (including parents of current document)
    147 
    148    Revision 1.4  1999/06/15 01:55:29  sjboddie
    149    - got text highlighting working
    150    - got multiple collections working (now outputs error message if an
    151      attempt is made to get a document when the "c" arg isn't set.
    152 
    153    Revision 1.3  1999/06/08 04:29:37  sjboddie
    154    added argsinfo to the call to check_cgiargs to make it easy to set
    155    args to their default if they're found to be screwed up
    156 
    157    Revision 1.2  1999/05/10 03:40:35  sjboddie
    158    lots of changes - slowly getting document action sorted out
    159 
    160    Revision 1.1  1999/04/30 01:59:40  sjboddie
    161    lots of stuff - getting documentaction working (documentaction replaces
    162    old browseaction)
    163 
    164    Revision 1.2  1999/03/29 02:14:27  sjboddie
    165 
    166    More changes to browseaction
    167 
    168    Revision 1.1  1999/03/25 03:09:40  sjboddie
    169 
    170    subjectbrowseaction became browseaction
    171 
    172 
    173  */
    174 
    17525
    17626#include <string.h>
     
    18333
    18434documentaction::documentaction () {
     35  recpt = NULL;
     36
    18537
    18638  // this action uses cgi variables "a", "d", "cl",
     
    500352  if (collectproto == NULL) return;
    501353 
     354  if (recpt == NULL) {
     355    logout << "ERROR (documentaction::define_external_macros): This action does not contain\n"
     356       << "      information about any receptionists. The method set_receptionist was\n"
     357       << "      probably not called from the module which instantiated this action.\n";
     358    return;
     359  }
     360
    502361  outconvertclass text_t2ascii;
    503362  comerror_t err;
     
    505364  FilterResponse_t response;
    506365  text_tset metadata;
    507 
    508366
    509367  // get info on current collection and load up formatinfo
     
    513371  // fix it ... maybe - Stefan.
    514372  ColInfoResponse_t cinfo;
     373
    515374  collectproto->get_collectinfo (collection, cinfo, err, logout);
    516375  load_formatinfo (cinfo.format, args.getintarg("gt"));
     376  //  ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr (collectproto, collection, logout);
     377  //  if (cinfo == NULL) {
     378  //    logout << "ERROR (documentaction::define_external_macros): get_collectinfo_ptr returned NULL\n";
     379  //    return;
     380  //  }
     381  //load_formatinfo (cinfo->format, args.getintarg("gt"));
    517382
    518383  if (formatinfo.DocumentUseHTML) {
     
    738603
    739604    metadata.insert ("archivedir");
    740    
     605
     606    OptionValue_tarray options;
     607    // we need to know what the query was for the z3950proto
     608    if (collectproto->get_protocol_name()=="z3950proto") {
     609      OptionValue_t opt;
     610      opt.name="Query";
     611      opt.value=args["q"];
     612      options.push_back(opt);
     613    }
     614
    741615    // get metadata for this document and it's parents
    742     if (get_info (arg_d, collection, metadata, true, collectproto, response, logout)) {
     616    if (get_info (arg_d, collection, metadata, options,
     617          true, collectproto, response, logout)) {
    743618      disp.setmacro ("header", "document", "_textheader_");
    744619
     
    1101976  textout << outconvert << disp << buffer;
    1102977}
    1103 
    1104 
    1105 
    1106 
    1107 
    1108 
    1109 
    1110 
    1111 
    1112 
    1113 
Note: See TracChangeset for help on using the changeset viewer.