Changeset 1342 for branches


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...)

Location:
branches/z3950-branch/gsdl/src/recpt
Files:
82 edited

Legend:

Unmodified
Added
Removed
  • branches/z3950-branch/gsdl/src/recpt/Makefile.in

    r1174 r1342  
    2727AR = ar
    2828CC = @CC@
    29 CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual
     29#CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual
     30CCFLAGS = @CFLAGS@
     31
     32# YAZ kit for z39.50
     33YAZDIR=../../packages/yaz
    3034
    3135USE_FASTCGI = @USE_FASTCGI@
     
    3539
    3640INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
    37        -I../../packages/mg/lib -I../../packages/mg/src/text
     41       -I../../packages/mg/lib -I../../packages/mg/src/text \
     42       -I../mgpp/lib -I../mgpp/text -I$(YAZDIR)/include
    3843else
    3944DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DGSDLSERVER \
     
    4247INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
    4348       -I../../packages/mg/lib -I../../packages/mg/src/text \
    44            -I../../packages/fcgi/include
     49           -I../../packages/fcgi/include -I../mgpp/lib \
     50       -I../mgpp/text
    4551endif
    4652
    4753RANLIB = @RANLIB@
    4854LDFLAGS = @LDFLAGS@
    49 #LIBS = -lgdbm -lstdc++ -lm #-lcrypt
    5055LIBS = @LIBS@
    5156
     
    95100RECPTSOURCES = recptmain.cpp
    96101
    97 LIBRARYSOURCES = nullproto.cpp z3950proto.cpp z3950server.cpp librarymain.cpp
     102LIBRARYSOURCES = nullproto.cpp z3950proto.cpp z3950server.cpp librarymain.cpp \
     103        zparse.tab.c parse.yy.c $(YAZDIR)/client/yaz_zclient.c
    98104
    99105SOURCES = $(COMMONSOURCES) $(RECPTSOURCES) $(LIBRARYSOURCES)
     
    113119RECPTOBJECTS = recptmain.o
    114120
    115 LIBRARYOBJECTS = nullproto.o z3950proto.o z3950server.o \
    116          librarymain.o zparse.tab.o parse.yy.o
     121LIBRARYOBJECTS = nullproto.o z3950proto.o z3950server.o librarymain.o \
     122        zparse.tab.o $(YAZDIR)/client/yaz_zclient.o
    117123
    118124OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(LIBRARYOBJECTS)
     
    120126
    121127COLSERVROBJECTS = ../colservr/mgq.o \
     128          ../colservr/search.o \
    122129                  ../colservr/mgsearch.o \
    123130                  ../colservr/querycache.o \
     
    132139                  ../colservr/mggdbmsource.o \
    133140                  ../colservr/phrasesearch.o \
    134                   ../colservr/phrasequeryfilter.o
    135 
    136 # bison and flex temp files
     141                  ../colservr/phrasequeryfilter.o \
     142          ../colservr/mgqueryfilter.o \
     143          ../colservr/mgppsearch.o \
     144          ../colservr/mgppqueryfilter.o
     145
     146#EXEC = recpt library
     147EXEC = library
     148
     149all: $(EXEC)
     150
     151## z39.50 stuff
     152$(YAZDIR)/client/yaz_zclient.o: $(YAZDIR)/client/yaz_zclient.h $(YAZDIR)/client/yaz_zclient.c $(YAZDIR)/lib/libyaz.a
     153    cd $(YAZDIR)/client &&  make yaz_zclient.o
     154
     155$(YAZDIR)/lib/libyaz.a:
     156    cd $(YAZDIR) && ./configure && make all
     157
     158z3950server.o: $(YAZDIR)/client/yaz_zclient.h
     159
    137160zparse.tab.c: zparse.y
    138     bison -d zparse.y
     161    @YACC@ -d zparse.y
     162
    139163parse.yy.c: parse.fl
    140164    flex -oparse.yy.c parse.fl
     165
    141166PARSE_TMPFILES= zparse.tab.o zparse.tab.c zparse.tab.h parse.yy.o parse.yy.c
    142 EXEC = recpt library
    143 
    144 all: $(EXEC)
    145167
    146168distclean:
     
    162184    ../../lib/gsdllib.a  \
    163185    ../../packages/mg/src/text/libtextin.a \
    164     ../../packages/mg/lib/libmg.a
     186    ../../packages/mg/lib/libmg.a \
     187    ../mgpp/text/libtextin.a \
     188    ../mgpp/lib/libmg.a
    165189else
    166190RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \
     
    168192    ../../packages/mg/src/text/libtextin.a \
    169193    ../../packages/mg/lib/libmg.a \
    170     ../../packages/fcgi/libfcgi/libfcgi.a
     194    ../../packages/fcgi/libfcgi/libfcgi.a \
     195    ../mgpp/text/libtextin.a \
     196    ../mgpp/lib/libmg.a
    171197endif
    172198
     
    180206    ../../lib/gsdllib.a  \
    181207    ../../packages/mg/src/text/libtextin.a \
    182     ../../packages/mg/lib/libmg.a
     208    ../../packages/mg/lib/libmg.a \
     209    $(YAZDIR)/lib/libyaz.a \
     210    ../mgpp/text/libtextin.a \
     211    ../mgpp/lib/libmg.a
    183212else
    184213LIBRARY_OBJS = $(COMMONOBJECTS) $(LIBRARYOBJECTS) $(COLSERVROBJECTS) \
     
    186215    ../../packages/mg/src/text/libtextin.a \
    187216    ../../packages/mg/lib/libmg.a \
    188     ../../packages/fcgi/libfcgi/libfcgi.a
     217    ../../packages/fcgi/libfcgi/libfcgi.a \
     218    ../mgpp/text/libtextin.a \
     219    ../mgpp/lib/libmg.a
    189220endif
    190221
    191222library: $(LIBRARY_OBJS)
    192223    $(LINK) $(LIBRARY_OBJS) $(LIBS)
     224
     225
     226
     227
     228
  • branches/z3950-branch/gsdl/src/recpt/OIDtools.cpp

    r739 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.18  1999/10/24 07:24:34  sjboddie
    31    small change to allow FullTOC option
    32 
    33    Revision 1.17  1999/10/10 08:14:02  sjboddie
    34    - metadata now returns mp rather than array
    35    - redesigned browsing support (although it's not finished so
    36    won't currently work ;-)
    37 
    38    Revision 1.16  1999/09/07 04:56:51  sjboddie
    39    added GPL notice
    40 
    41    Revision 1.15  1999/09/02 00:22:04  rjmcnab
    42    added extra check in get_info
    43 
    44    Revision 1.14  1999/08/25 04:45:25  sjboddie
    45    changed FilterRequest_t::docSet into an array
    46 
    47    Revision 1.13  1999/08/10 22:44:06  sjboddie
    48    altered the get_contents function so it's now passed metadata
    49    rather than having it hard-coded
    50 
    51    Revision 1.12  1999/07/30 02:26:44  sjboddie
    52    added overloaded get_info function for getting info on multiple OIDs
    53 
    54    Revision 1.11  1999/07/20 02:59:03  sjboddie
    55    get_children now takes a getParents argument
    56 
    57    Revision 1.10  1999/07/07 05:47:41  sjboddie
    58    changed around the way browsetools works
    59 
    60    Revision 1.9  1999/06/16 23:51:53  sjboddie
    61    added a strip_suffix function
    62 
    63    Revision 1.8  1999/06/16 03:11:25  sjboddie
    64    get_info() now takes a getParents argument
    65 
    66    Revision 1.7  1999/06/16 02:05:23  sjboddie
    67    just changed a comment that was confusing me
    68 
    69    Revision 1.6  1999/05/10 03:40:25  sjboddie
    70    lots of changes - slowly getting document action sorted out
    71 
    72    Revision 1.5  1999/04/30 01:59:37  sjboddie
    73    lots of stuff - getting documentaction working (documentaction replaces
    74    old browseaction)
    75 
    76    Revision 1.4  1999/03/29 02:14:25  sjboddie
    77 
    78    More changes to browseaction
    79 
    80    Revision 1.3  1999/03/25 03:13:42  sjboddie
    81 
    82    More library functions for dealing with OIDs. Many of them just
    83    return dummy data at present
    84 
    85    Revision 1.2  1999/03/05 03:53:53  sjboddie
    86 
    87    fixed some bugs
    88 
    89    Revision 1.1  1999/03/04 22:38:20  sjboddie
    90 
    91    Added subjectbrowseaction. - Doesn't do anything yet.
    92 
    93  */
    9425
    9526#include "OIDtools.h"
     
    173104}
    174105
     106// overloaded, to allow "custom" filter options.
     107bool get_info (const text_t &OID, const text_t &collection,
     108           const text_tset &metadata, const OptionValue_tarray &options,
     109           bool getParents,
     110           recptproto *collectproto, FilterResponse_t &response,
     111           ostream &logout) {
     112
     113  response.clear();
     114
     115  comerror_t err;
     116  FilterRequest_t request;
     117
     118  request.filterName = "NullFilter";
     119  request.filterResultOptions = FRmetadata;
     120  request.getParents = getParents;
     121  request.filterOptions = options;
     122  request.fields = metadata;
     123  request.docSet.push_back (OID);
     124 
     125  collectproto->filter (collection, request, response, err, logout);
     126  if (err != noError) {
     127    outconvertclass text_t2ascii;
     128    logout << text_t2ascii
     129       << "Error: call to filter failed for " << OID
     130       << " in OIDtools::get_info ("
     131       << get_comerror_string (err) << ")\n";
     132    return false;
     133  }
     134 
     135  return true;
     136}
     137
    175138bool get_info (const text_tarray &OIDs, const text_t &collection,
    176139           const text_tset &metadata, bool getParents,
     
    202165  return true;
    203166}
     167
     168
    204169
    205170// has_children returns true if OID has children
  • branches/z3950-branch/gsdl/src/recpt/OIDtools.h

    r649 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
     
    4947bool get_info (const text_t &OID, const text_t &collection,
    5048           const text_tset &metadata, bool getParents,
     49           recptproto *collectproto, FilterResponse_t &response,
     50           ostream &logout);
     51bool get_info (const text_t &OID, const text_t &collection,
     52           const text_tset &metadata, const OptionValue_tarray &options,
     53           bool getParents,
    5154           recptproto *collectproto, FilterResponse_t &response,
    5255           ostream &logout);
  • branches/z3950-branch/gsdl/src/recpt/action.cpp

    r962 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.19  2000/02/21 21:57:49  sjboddie
    31    actions are now configured with gsdlhome
    32 
    33    Revision 1.18  1999/11/01 21:10:57  sjboddie
    34    chnaged arguments passed to many functions
    35 
    36    Revision 1.17  1999/09/07 23:04:03  rjmcnab
    37    got rid of some compiler warnings
    38 
    39    Revision 1.16  1999/09/07 04:56:51  sjboddie
    40    added GPL notice
    41 
    42    Revision 1.15  1999/09/03 09:51:47  rjmcnab
    43    removed the argdefault configuration option (it should now be
    44    done with cgiarg)
    45 
    46    Revision 1.14  1999/09/02 00:22:42  rjmcnab
    47    Changes to get it compiling on AIX
    48 
    49    Revision 1.13  1999/07/30 02:24:43  sjboddie
    50    added collectinfo argument to some functions
    51 
    52    Revision 1.12  1999/07/10 22:15:30  rjmcnab
    53    Added function check_external_cgiargs so that actions that
    54    are not being called can override cgi arguments.
    55 
    56    Revision 1.11  1999/06/08 04:29:41  sjboddie
    57    added argsinfo to the call to check_cgiargs to make it easy to set
    58    args to their default if they're found to be screwed up
    59 
    60    Revision 1.10  1999/03/25 03:06:44  sjboddie
    61 
    62    altered receptionist slightly so it now passes *collectproto to
    63    define_internal_macros and define_external_macros - need it
    64    for browseaction
    65 
    66    Revision 1.9  1999/02/28 23:16:00  rjmcnab
    67 
    68    Fixed a compiler warning.
    69 
    70    Revision 1.8  1999/02/28 20:00:11  rjmcnab
    71 
    72 
    73    Fixed a few things.
    74 
    75    Revision 1.7  1999/02/25 21:58:58  rjmcnab
    76 
    77    Merged sources.
    78 
    79    Revision 1.6  1999/02/21 22:33:52  rjmcnab
    80 
    81    Lots of stuff :-)
    82 
    83    Revision 1.5  1999/02/11 01:24:04  rjmcnab
    84 
    85    Fixed a few compiler warnings.
    86 
    87    Revision 1.4  1999/02/08 01:27:59  rjmcnab
    88 
    89    Got the receptionist producing something using the statusaction.
    90 
    91    Revision 1.3  1999/02/05 10:42:41  rjmcnab
    92 
    93    Continued working on receptionist
    94 
    95    Revision 1.2  1999/02/04 10:00:53  rjmcnab
    96 
    97    Developed the idea of an "action" and having them define the cgi arguments
    98    which they need and how those cgi arguments function.
    99 
    100    Revision 1.1  1999/01/08 08:40:52  rjmcnab
    101 
    102    Moved from lib directory.
    103 
    104    Revision 1.1  1999/01/08 03:57:44  rjmcnab
    105 
    106    Initial revision
    107 
    108  */
    109 
    11025
    11126#include "action.h"
     
    237152  return (*here).second.a;
    238153}
    239 
  • branches/z3950-branch/gsdl/src/recpt/action.h

    r962 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/authenaction.cpp

    r1129 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.10  2000/04/19 22:30:23  sjboddie
    31    tidied up status pages and end-user collection building
    32 
    33    Revision 1.9  1999/11/01 21:11:35  sjboddie
    34    changed arguments passed to many functions
    35 
    36    Revision 1.8  1999/10/19 03:23:41  davidb
    37    Collection building support through web pages
    38    and internal and external link handling for collection documents
    39 
    40    Revision 1.7  1999/09/07 23:04:29  rjmcnab
    41    removed some compiler warnings
    42 
    43    Revision 1.6  1999/09/07 04:56:52  sjboddie
    44    added GPL notice
    45 
    46    Revision 1.5  1999/09/02 00:23:24  rjmcnab
    47    a couple of minor things
    48 
    49    Revision 1.4  1999/07/30 02:24:43  sjboddie
    50    added collectinfo argument to some functions
    51 
    52    Revision 1.3  1999/07/13 23:23:26  rjmcnab
    53    Put users in their own gdbm database. Moved a lot of functionality to usersdb
    54 
    55    Revision 1.2  1999/07/11 10:47:32  rjmcnab
    56    Got something basic working.
    57 
    58    Revision 1.1  1999/07/10 22:19:29  rjmcnab
    59    Initial revision.
    60 
    61 
    62  */
    63 
    6425
    6526#include "authenaction.h"
  • branches/z3950-branch/gsdl/src/recpt/authenaction.h

    r755 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/browserclass.cpp

    r765 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.5  1999/11/01 22:04:11  sjboddie
    31    just a few small changes (that means I can't remember ;)
    32 
    33    Revision 1.4  1999/10/30 23:02:46  sjboddie
    34    tidied things up slightly
    35 
    36    Revision 1.3  1999/10/30 22:40:00  sjboddie
    37    added collection argument
    38 
    39    Revision 1.2  1999/10/14 22:59:33  sjboddie
    40    finished off browser classes
    41 
    42    Revision 1.1  1999/10/10 08:14:03  sjboddie
    43    - metadata now returns mp rather than array
    44    - redesigned browsing support (although it's not finished so
    45    won't currently work ;-)
    46 
    47  */
    48 
    4925
    5026#include "browserclass.h"
     
    8157
    8258text_t browserclass::get_default_formatstring () {
    83   return "<td>[link][icon][/link]</td><td>[highlight]{Or}{[Title],Untitled}[/highlight]</td>";
     59  return "";
    8460}
    8561
  • branches/z3950-branch/gsdl/src/recpt/browserclass.h

    r765 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/browsetools.cpp

    r1079 r1342  
    2323 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2424 *
    25  * $Id$
    26  *
    2725 *********************************************************************/
    28 
    29 /*
    30    $Log$
    31    Revision 1.42  2000/04/07 04:40:43  sjboddie
    32    Reverted back to old DocumentHeader, DocumentTitles, DocumentImages etc.
    33    from DocumentColumns stuff. I'll move the DocumentColumns stuff to a
    34    separate development branch (New_Config_Format-branch) for now. The plan
    35    is to redesign the configuration file format a bit and limit the number of
    36    distributions floating around that take different configuration formats).
    37 
    38    Revision 1.39  2000/02/25 02:28:43  sjboddie
    39    caught up with assoc directory changes for displaying cover images
    40 
    41    Revision 1.38  2000/02/17 02:42:24  sjboddie
    42    minor stuff - fixed some cvs conflicts
    43 
    44    Revision 1.37  2000/02/15 22:53:47  kjm18
    45    search history stuff added.
    46 
    47    Revision 1.36  2000/02/06 21:31:36  sjboddie
    48    made some formerly static functions accessible from elsewhere (for
    49    cstr receptionist)
    50 
    51    Revision 1.35  2000/01/26 23:46:16  sjboddie
    52    wrap every second button now (was every third)
    53 
    54    Revision 1.34  1999/11/09 02:28:47  sjboddie
    55    fixed minor bug in expanded contents
    56 
    57    Revision 1.33  1999/10/30 22:22:26  sjboddie
    58    added collection argument to browserclass output_section_group
    59    functions -- moved table functions to formattools
    60 
    61    Revision 1.32  1999/10/24 07:22:37  sjboddie
    62    added a FullTOC option
    63 
    64    Revision 1.31  1999/10/20 03:54:20  sjboddie
    65    problem with expanded contents
    66 
    67    Revision 1.30  1999/10/19 21:36:59  sjboddie
    68    fixed bug in DocumentContents
    69 
    70    Revision 1.29  1999/10/19 08:40:12  sjboddie
    71    fixed some stupid compiler warnings on windows
    72 
    73    Revision 1.28  1999/10/18 20:08:36  sjboddie
    74    tidied up a few things
    75 
    76    Revision 1.27  1999/10/15 03:31:42  sjboddie
    77    oops, left out an '&'
    78 
    79    Revision 1.26  1999/10/14 22:58:05  sjboddie
    80    finished up on changes to browseing support - may still need some
    81    tidying up
    82 
    83    Revision 1.25  1999/10/10 08:14:04  sjboddie
    84    - metadata now returns mp rather than array
    85    - redesigned browsing support (although it's not finished so
    86    won't currently work ;-)
    87 
    88    Revision 1.24  1999/09/28 01:46:55  rjmcnab
    89    removed some unused stuff
    90 
    91    Revision 1.23  1999/09/23 10:09:17  sjboddie
    92    made some changes so AZLists within other classifications are
    93    handled properly
    94 
    95    Revision 1.22  1999/09/07 23:06:58  rjmcnab
    96    removed some compiler warnings.
    97 
    98    Revision 1.21  1999/09/07 04:56:52  sjboddie
    99    added GPL notice
    100 
    101    Revision 1.20  1999/08/25 04:46:58  sjboddie
    102    fixed bug
    103 
    104    Revision 1.19  1999/08/13 04:18:04  sjboddie
    105    fixed some typos
    106 
    107    Revision 1.18  1999/08/10 22:42:21  sjboddie
    108    added more format options to document tocs - there are now just two
    109    types of toc - standard (Hierarchical) and document (as in books)
    110 
    111    Revision 1.17  1999/08/09 02:12:07  sjboddie
    112    made it so dates may be only 4 digits (i.e. year only)
    113 
    114    Revision 1.16  1999/07/30 02:16:10  sjboddie
    115    -added ability to display nested classifications (expanded versions
    116    of nested classifications has yet to be done).
    117    -changed set_arrow_macros slightly to fit in with new showtoppage
    118    format option
    119 
    120    Revision 1.15  1999/07/21 05:01:56  sjboddie
    121    wrote handler for DateList classification
    122 
    123    Revision 1.14  1999/07/20 02:58:15  sjboddie
    124    got List and AZList classifications using format strings - tidied
    125    up a bit
    126 
    127    Revision 1.13  1999/07/07 05:44:25  sjboddie
    128    Made some changes to allow for new way classifiers work (i.e. you can
    129    now have classifiers containing other classifiers). At present there's
    130    only a special case for dealing with the hdl 'magazine' section. A bit
    131    of a redesign is needed to get it completely flexible
    132 
    133    Revision 1.12  1999/07/01 03:47:49  rjmcnab
    134    Fixed a small warning.
    135 
    136    Revision 1.11  1999/06/27 21:49:01  sjboddie
    137    fixed a couple of version conflicts - tidied up some small things
    138 
    139    Revision 1.10  1999/06/26 01:07:21  rjmcnab
    140    Fixed a small "bug" -- well I probably just covered another one...
    141 
    142    Revision 1.9  1999/06/24 05:12:15  sjboddie
    143    lots of small changes
    144 
    145    Revision 1.8  1999/06/17 03:06:53  sjboddie
    146    got detach button working properly - the close book icon is now disabled
    147    when page is detached as the javascript close() function I was using is
    148    too unreliable over different browsers
    149    note that in my last comment I meant the "cl" arg (not the "c" arg).
    150 
    151    Revision 1.7  1999/06/16 23:53:14  sjboddie
    152    tidied a few things up. documentaction::define_external_macros now
    153    resets the "c" arg if it's set to something stupid by the .xx suffixes
    154 
    155    Revision 1.6  1999/06/16 04:03:47  sjboddie
    156    Now sets "cl" arg to "search" when going to a document from a search
    157    results page. This allows the close book icon (in hierarchy toc) to
    158    take you back to the results page if that's where you came from.
    159    If you got to the document page somehow other than from a
    160    classification or a search (i.e. if "cl" isn't set) then the close
    161    book icon is disabled
    162 
    163    Revision 1.5  1999/06/16 03:11:25  sjboddie
    164    get_info() now takes a getParents argument
    165 
    166    Revision 1.4  1999/05/10 03:40:26  sjboddie
    167    lots of changes - slowly getting document action sorted out
    168 
    169    Revision 1.3  1999/04/30 01:59:39  sjboddie
    170    lots of stuff - getting documentaction working (documentaction replaces
    171    old browseaction)
    172 
    173    Revision 1.2  1999/03/29 02:14:29  sjboddie
    174 
    175    More changes to browseaction
    176 
    177    Revision 1.1  1999/03/25 03:10:15  sjboddie
    178 
    179    new library for browse stuff
    180 
    181  */
    18226
    18327#include "browsetools.h"
     
    702546  if (havecontrols) textout << "</td></tr></table>\n";
    703547}
    704 
    705 
    706 
  • branches/z3950-branch/gsdl/src/recpt/browsetools.h

    r1079 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/buildaction.cpp

    r1149 r1342  
    22 *
    33 * buildaction.cpp -- building collections
    4  * Copyright (C) 1999  DigiLib Systems Limited, New Zealand
     4 * Copyright (C) 1999  The New Zealand Digital Library Project
    55 *
    66 * A component of the Greenstone digital library software
     
    2424 *********************************************************************/
    2525
    26 #if !defined(__WIN32__) || defined(__GNUC__)
    27 #include <unistd.h>
    28 #endif
    29 
    3026#include "OIDtools.h"
    3127#include "fileutil.h"
    3228#include "htmlutils.h"
     29#include "gsdltools.h"
    3330#include "buildaction.h"
    3431
     
    105102  // make sure we know about a receptionist
    106103  if (recpt == NULL) {
    107     logout << "The page action does not contain information\n"
     104    logout << "The build action does not contain information\n"
    108105           << "about any receptionists. The method set_receptionist\n"
    109106           << "was probably not called from the module which instantiated\n"
    110            << "this page action.\n";
     107           << "this build action.\n";
    111108    return;
    112109  }
     
    119116  text_t fullnamelist = "var fullnamelist = new Array(";
    120117  text_t dirnamelist  = "var dirnamelist = new Array(";
    121   text_t fullnamemenu = (text_t)"<input type=hidden name=\"bc1fullnameindex\""
    122                         +" value=\"_bcargfullnameindex_\">\n"
    123                         +"<select name=\"bc1fullnamemenu\" onChange=fullnameindex_changed()>\n";
     118  text_t fullnamemenu = "<input type=hidden name=\"bc1fullnameindex\"";
     119  fullnamemenu += " value=\"_bcargfullnameindex_\">\n";
     120  fullnamemenu += "<select name=\"bc1fullnamemenu\" onChange=fullnameindex_changed()>\n";
    124121  int rcount = 1;
    125122  int fcount = 1;
     
    149146    while (collist_here != collist_end) {
    150147
    151       ColInfoResponse_t cinfo;
    152       (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout);
    153       if (err == noError) {
     148      ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout);
     149      if (cinfo != NULL) {
    154150        text_t collectionname = *collist_here;
    155         if (!cinfo.collectionmeta["collectionname"].empty())
     151        if (!cinfo->collectionmeta["collectionname"].empty())
    156152          {
    157153        // get collection name from the collection cfg file
    158         collectionname = cinfo.collectionmeta["collectionname"];
     154        collectionname = cinfo->collectionmeta["collectionname"];
    159155          }
    160156        else
     
    172168        dirnamelist += (text_t)"\"" + *collist_here + "\"";
    173169
    174         fullnamemenu += (text_t)"<option value=\"" + collectionname + "\"";
    175         if (args["bc1dirname"] == "")
     170        fullnamemenu += "<option value=\"" + collectionname;
     171        fullnamemenu.push_back ('"');
     172        if (args["bc1dirname"].empty())
    176173          {
    177174        if ((rcount==1) && (ccount==1))
     
    205202        if (args["bca"]=="buildcol")
    206203          {
    207         if (((args["bc1dirname"]=="") && (rcount==1) && (ccount==1))
     204        if (((args["bc1dirname"].empty()) && (rcount==1) && (ccount==1))
    208205            || (args["bc1dirname"]==*collist_here))
    209206          {
    210             disp.setmacro("bcargingsdlarea","build",cinfo.building["ingsdlarea"]);
    211             disp.setmacro("bcargcopydir","build",cinfo.building["copydir"]);
     207            disp.setmacro("bcargingsdlarea","build",cinfo->building["ingsdlarea"]);
     208            disp.setmacro("bcargcopydir","build",cinfo->building["copydir"]);
    212209           
    213             if (cinfo.buildDate==0) // not built
     210            if (cinfo->buildDate==0) // not built
    214211              {
    215212            // assume that's because this is the first build ever for the collection
     
    243240    }
    244241
    245   if ((args["bca"]=="delcol") || (args["bca"]=="editcol") || (args["bca"]=="buildcol") || (args["bca"]=="collog"))
     242  if ((args["bca"]=="delcol") || (args["bca"]=="editcol") ||
     243      (args["bca"]=="buildcol") || (args["bca"]=="collog"))
    246244    {
    247245      disp.setmacro ("dirnamelist", "build", dirnamelist);
     
    271269    text_t bc1name = substr(args_entry.begin()+3,args_entry.end());
    272270    text_t cached_cgiarg = "bcarg" + bc1name;
    273     disp.setmacro(cached_cgiarg,"build",args[args_entry]);
     271    disp.setmacro(cached_cgiarg, "build", dm_safe(args[args_entry]));
    274272      }
    275273    args_here++;
     
    291289      text_t cfg_fname
    292290    = filename_cat(gsdlhome, "collect", dirname, "etc", "collect.cfg");
     291
     292#ifdef GSDL_USE_IOS_H
    293293      ifstream cfg_ifs (cfg_fname.getcstr(), ios::in | ios::nocreate);
     294#else
     295      ifstream cfg_ifs (cfg_fname.getcstr(), ios::in);
     296#endif
     297
    294298      if (cfg_ifs)
    295299    { 
     
    325329
    326330      // read in collect.bld
    327       text_t bld_fname = filename_cat(gsdlhome, "log", dirname+ ".bld");
     331      text_t bld_fname = filename_cat(gsdlhome, "etc", dirname+ ".bld");
     332
     333#ifdef GSDL_USE_IOS_H
    328334      ifstream bld_ifs (bld_fname.getcstr(), ios::in | ios::nocreate);
     335#else
     336      ifstream bld_ifs (bld_fname.getcstr(), ios::in);
     337#endif
     338
    329339      if (bld_ifs)
    330340    {
     
    430440                   ostream &logout) {
    431441
    432 
    433 
    434 
    435442  text_tarray wizard_split;
    436443  const text_t wizard = (args["wizard"].empty()) ? "buildcol" : args["wizard"];
     
    447454  else
    448455    {
    449       text_t dirname = (args["bc1dirname"] == "") ? (text_t)"unknown" : args["bc1dirname"];
     456      text_t dirname = (args["bc1dirname"] == "") ?
     457    "unknown" : args["bc1dirname"];
     458
    450459      text_t tmpname = dirname+"_XXXXXX";
    451460      char *cstr_tmpname = tmpname.getcstr();
    452       if (mktemp(cstr_tmpname)==NULL)
     461
     462      if (GSDL_MKTEMP (cstr_tmpname)==NULL)
    453463    logout << "Failed to create temporary filename" << endl;
    454464
     
    462472 
    463473      textout << outconvert << disp << headmess << content << "_build:framefooter_\n";
    464       text_t cmd = filename_cat(gsdlhome, "cgi-bin", "webpage_buildcol.pl");
    465       cmd += " gsdlhome=\""+gsdlhome+"\" httpbuild=\""+args["httpbuild"]+"\"";
    466       cmd += " bc1copydata=\""+args["bc1copydata"]+"\"";
    467       cmd += " bc1doimport=\""+args["bc1doimport"]+"\"";
    468       cmd += " bc1dobuild=\""+args["bc1dobuild"]+"\"";
    469       cmd += " bc1dirname=\""+args["bc1dirname"]+"\" bc1tmpname=\""+tmpname+"\" &";
    470      
    471       system(cmd.getcstr());
     474      text_t cmd = "perl \"" +
     475    filename_cat(gsdlhome, "cgi-bin", "webpage_buildcol.pl") + "\"";
     476      cmd += " \"httpbuild="+args["httpbuild"]+"\"";
     477      cmd += " \"bc1copydata="+args["bc1copydata"]+"\"";
     478      cmd += " \"bc1doimport="+args["bc1doimport"]+"\"";
     479      cmd += " \"bc1dobuild="+args["bc1dobuild"]+"\"";
     480      cmd += " \"bc1dirname="+args["bc1dirname"]+"\" \"bc1tmpname="+tmpname+"\"";
     481      // run webpage_buildcol.pl in background on unix systems
     482#if !defined (__WIN32__)
     483      cmd += " &";
     484#endif
     485
     486      char *cstr_cmd = cmd.getcstr();
     487
     488#if defined (__WIN32__)
     489      gsdl_system (cstr_cmd, logout);
     490#else
     491      system (cstr_cmd);
     492#endif
     493
     494      delete cstr_cmd;
    472495    }
    473496
  • branches/z3950-branch/gsdl/src/recpt/buildaction.h

    r822 r1342  
    22 *
    33 * buildaction.h -- building collections
    4  * Copyright (C) 1999  DigiLib Systems Limited, New Zealand
     4 * Copyright (C) 1999  The New Zealand Digital Library Project
    55 *
    66 * A component of the Greenstone digital library software
  • branches/z3950-branch/gsdl/src/recpt/cgiargs.cpp

    r802 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.11  1999/12/05 21:25:20  sjboddie
    31    can't remember why I did this - must have been a reason ;-)
    32 
    33    Revision 1.10  1999/11/08 20:26:38  sjboddie
    34    added multiplevalue option to cgiarginfo
    35 
    36    Revision 1.9  1999/09/07 04:56:53  sjboddie
    37    added GPL notice
    38 
    39    Revision 1.8  1999/09/03 09:52:45  rjmcnab
    40    Fixed a couple of small things
    41 
    42    Revision 1.7  1999/09/02 00:23:55  rjmcnab
    43    changes to get compiling on AIX
    44 
    45    Revision 1.6  1999/07/11 01:02:13  rjmcnab
    46    Stored information relating to the cgi argument's origin with the cgi argument.
    47 
    48    Revision 1.5  1999/02/08 01:28:00  rjmcnab
    49 
    50    Got the receptionist producing something using the statusaction.
    51 
    52    Revision 1.4  1999/02/05 10:42:41  rjmcnab
    53 
    54    Continued working on receptionist
    55 
    56    Revision 1.3  1999/02/04 10:00:54  rjmcnab
    57 
    58    Developed the idea of an "action" and having them define the cgi arguments
    59    which they need and how those cgi arguments function.
    60 
    61    Revision 1.2  1999/01/12 01:51:06  rjmcnab
    62 
    63    Standard header.
    64 
    65    Revision 1.1  1999/01/08 08:40:54  rjmcnab
    66 
    67    Moved from lib directory.
    68 
    69    Revision 1.1  1999/01/08 07:50:30  rjmcnab
    70 
    71    Moved from src/library directory to lib directory.
    72 
    73  */
    74 
    7525
    7626#include "cgiargs.h"
     
    323273  return &((*here).second);
    324274}
    325 
    326 
    327 
  • branches/z3950-branch/gsdl/src/recpt/cgiargs.h

    r928 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
     
    234232
    235233#endif
    236 
    237 
    238 
  • branches/z3950-branch/gsdl/src/recpt/cgiutils.cpp

    r873 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.13  2000/01/25 22:46:54  sjboddie
    31    changes to get fastcgi working properly
    32 
    33    Revision 1.12  1999/11/08 20:26:38  sjboddie
    34    added multiplevalue option to cgiarginfo
    35 
    36    Revision 1.11  1999/11/01 22:03:35  sjboddie
    37    Added ability to handle multiple arguments with the same name (as
    38    is the case with multiple checkboxes using the same name). I'm not
    39    sure this is the best way to do it but it does the trick for what
    40    I currently need.
    41 
    42    Revision 1.10  1999/09/21 21:41:17  sjboddie
    43    fixed a couple of problems in what I committed last
    44 
    45    Revision 1.9  1999/09/21 11:30:39  sjboddie
    46    added ability to escape out '-' in saved args (currently
    47    with a 'Z' ???)
    48 
    49    Revision 1.8  1999/09/07 04:56:53  sjboddie
    50    added GPL notice
    51 
    52    Revision 1.7  1999/08/25 22:27:13  sjboddie
    53    prevented cgi_safe from converting '+' and '-'. It was causing problems
    54    with query strings containing spaces. The space was being converted
    55    to '+', then %2b, then %xx2b over time when saved in compressed args.
    56    I hope this won't cause problems elsewhere...
    57 
    58    Revision 1.6  1999/07/11 01:05:19  rjmcnab
    59    Stored origin of cgiarg with argument.
    60 
    61    Revision 1.5  1999/06/26 01:08:36  rjmcnab
    62    Added encoding and decoding of multibyte compresesd arguments.
    63 
    64    Revision 1.4  1999/06/08 22:03:43  sjboddie
    65    query string is now made cgi safe before being added to compressed args
    66 
    67    Revision 1.3  1999/02/08 01:28:00  rjmcnab
    68 
    69    Got the receptionist producing something using the statusaction.
    70 
    71    Revision 1.2  1999/02/05 10:42:43  rjmcnab
    72 
    73    Continued working on receptionist
    74 
    75    Revision 1.1  1999/01/08 08:40:56  rjmcnab
    76 
    77    Moved from lib directory.
    78 
    79    Revision 1.1  1999/01/08 03:57:45  rjmcnab
    80 
    81    Initial revision
    82 
    83  */
    84 
    8525
    8626#include "cgiutils.h"
  • branches/z3950-branch/gsdl/src/recpt/cgiutils.h

    r873 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/cgiwrapper.cpp

    r1168 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.25.2.1  2000/05/11 01:56:27  johnmcp
    31 
    32    added proper config file parsing for z39.50 servers, and minor changes
    33    to pageaction (minor bug when display collections from >1 proto) and
    34    cgiwrapper (announces which collections are z39.50 servers).
    35 
    36    Revision 1.25  2000/04/14 04:45:19  sjboddie
    37    Modified the English of the debug output slightly
    38 
    39    Revision 1.24  2000/04/14 03:10:35  sjboddie
    40    tidied up a few issues concerning the new debug info which showed
    41    up on windows
    42 
    43    Revision 1.23  2000/04/14 02:52:05  sjboddie
    44    tidied up error messaging and set up some debugging info to be output
    45    when running library from command line
    46 
    47    Revision 1.22  2000/02/21 21:56:46  sjboddie
    48    gsdlhome now comes from gsdlsite.cfg
    49 
    50    Revision 1.21  2000/01/25 22:45:59  sjboddie
    51    few changes to get fastcgi to work properly
    52 
    53    Revision 1.20  1999/09/07 04:56:53  sjboddie
    54    added GPL notice
    55 
    56    Revision 1.19  1999/09/02 00:24:36  rjmcnab
    57    fixed bug in getting POST arguments
    58 
    59    Revision 1.18  1999/08/20 01:02:07  sjboddie
    60    added some usage logging
    61 
    62    Revision 1.17  1999/07/15 06:03:15  rjmcnab
    63    Moved the adding of the actions to librarymain so that they can be
    64    overriden easily.
    65 
    66    Revision 1.16  1999/07/14 08:31:05  rjmcnab
    67    Fixed a small bug in the POST implementation.
    68 
    69    Revision 1.15  1999/07/13 23:32:17  rjmcnab
    70    Added authenaction and usersaction
    71 
    72    Revision 1.14  1999/07/11 01:03:37  rjmcnab
    73    Added ability to receive POST cgi form data.
    74 
    75    Revision 1.13  1999/06/24 05:12:18  sjboddie
    76    lots of small changes
    77 
    78    Revision 1.12  1999/04/30 01:59:40  sjboddie
    79    lots of stuff - getting documentaction working (documentaction replaces
    80    old browseaction)
    81 
    82    Revision 1.11  1999/03/25 03:12:01  sjboddie
    83 
    84    subjectbrowseaction was replaced with browseaction
    85 
    86    Revision 1.10  1999/03/05 03:53:54  sjboddie
    87 
    88    fixed some bugs
    89 
    90    Revision 1.9  1999/03/04 22:38:21  sjboddie
    91 
    92    Added subjectbrowseaction. - Doesn't do anything yet.
    93 
    94    Revision 1.8  1999/02/28 20:00:13  rjmcnab
    95 
    96 
    97    Fixed a few things.
    98 
    99    Revision 1.7  1999/02/21 22:33:53  rjmcnab
    100 
    101    Lots of stuff :-)
    102 
    103    Revision 1.6  1999/02/12 02:40:17  sjboddie
    104 
    105    Added page action
    106 
    107    Revision 1.5  1999/02/11 01:24:04  rjmcnab
    108 
    109    Fixed a few compiler warnings.
    110 
    111    Revision 1.4  1999/02/08 01:28:01  rjmcnab
    112 
    113    Got the receptionist producing something using the statusaction.
    114 
    115    Revision 1.3  1999/02/05 10:42:44  rjmcnab
    116 
    117    Continued working on receptionist
    118 
    119    Revision 1.2  1999/02/04 10:00:56  rjmcnab
    120 
    121    Developed the idea of an "action" and having them define the cgi arguments
    122    which they need and how those cgi arguments function.
    123 
    124    Revision 1.1  1999/02/04 01:16:17  rjmcnab
    125 
    126    Initial revision.
    127 
    128    Revision 1.5  1999/01/19 01:38:18  rjmcnab
    129 
    130    Made the source more portable.
    131 
    132    Revision 1.4  1999/01/12 01:51:04  rjmcnab
    133 
    134    Standard header.
    135 
    136  */
    137 
    13825
    13926#include "gsdlconf.h"
     
    491378
    492379  bool is_z3950 = false;
     380  bool found_valid_col = false;
     381
    493382  while (rprotolist_here != rprotolist_end) {
    494383    if ((*rprotolist_here).p == NULL) continue;
     
    525414      if (cinfo.buildDate > 0) cout << "   running    ";
    526415      else cout << "   not running";
     416      cout << text_t2ascii << *collist_here;
     417
     418      int spaces = (22 - (*collist_here).size());
     419      if (spaces < 2) spaces = 2;
     420      text_t outspaces;
     421      for (int i = 0; i < spaces; i++) outspaces.push_back (' ');
     422      cout << text_t2ascii << outspaces;
     423
     424      ColInfoResponse_t *cinfo = recpt.get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, cerr);
     425      if (cinfo != NULL) {
     426        if (cinfo->isPublic) cout << "public ";
     427        else cout << "private";
     428
     429        if (cinfo->buildDate > 0) {
     430          cout << "   running    ";
     431          found_valid_col = true;
     432        } else {
     433          cout << "   not running";
     434        }
     435      }
     436
     437      cout << "\n";
     438
     439      collist_here ++;
    527440    }
    528441   
     
    536449  } // end of while loop
    537450 
    538   cout << "------------------------------------------------------------\n";
     451  if (!found_valid_col) {
     452    cout << "WARNING: No \"running\" collections were found. You need to\n";
     453    cout << "         build one of the above collections\n";
     454  }
     455
     456  cout << "\n------------------------------------------------------------\n";
    539457  cout << "------------------------------------------------------------\n\n";
    540458  cout << "receptionist running in command line debug mode\n";
     
    671589    if (isfastcgi) {
    672590      if (FCGX_Accept(&fcgiin, &fcgiout, &fcgierr, &fcgienvp) < 0) break;
    673       aURIStr = FCGX_GetParam("QUERY_STRING", fcgienvp);
    674       if (aURIStr != NULL) argstr = aURIStr;
    675       else argstr = "";
     591
     592      char *request_method_str = FCGX_GetParam ("REQUEST_METHOD", fcgienvp);
     593      char *content_length_str = FCGX_GetParam ("CONTENT_LENGTH", fcgienvp);
     594
     595      if (request_method_str != NULL && strcmp(request_method_str, "POST") == 0 &&
     596      content_length_str != NULL)  {
     597    // POST form data
     598    int content_length = text_t(content_length_str).getint();
     599    if (content_length > 0) {
     600      argstr.clear();
     601      int c;
     602      do {
     603        c = FCGX_GetChar (fcgiin);
     604        if (c < 0) break;
     605        argstr.push_back (c);
     606        content_length--;
     607      } while (content_length > 0);
     608    }
     609
     610      } else {
     611    // GET form data
     612    aURIStr = FCGX_GetParam("QUERY_STRING", fcgienvp);
     613    if (aURIStr != NULL) argstr = aURIStr;
     614    else argstr = "";
     615      }
    676616    }
    677617#endif
     
    725665      text_t error_file = filename_cat (gsdlhome, "etc", "errout.txt");
    726666      char *eout = error_file.getcstr();
    727       ofstream errout (eout);
     667      ofstream errout (eout, ios::app);
    728668      delete eout;
     669      // note that the following line appears to cause a runtime
     670      // error using debug versions of VC++ 6.0 (on windows)
    729671      cerr = errout;
    730672   
     
    761703  return;
    762704}
    763 
  • branches/z3950-branch/gsdl/src/recpt/cgiwrapper.h

    r533 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    2725
  • branches/z3950-branch/gsdl/src/recpt/comtypes.cpp

    r823 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.22  1999/12/13 02:24:33  davidb
    31    Data fields for cross collection searching (CCS)
    32 
    33    Support for multiple meta-data entries for same document/section.
    34 
    35    Revision 1.21  1999/11/01 22:00:50  sjboddie
    36    added assignment operator for FilterResponse_t
    37 
    38    Revision 1.20  1999/10/14 23:02:34  sjboddie
    39    fixed bug in new parent metadata stuff
    40 
    41    Revision 1.19  1999/10/10 07:49:35  sjboddie
    42    - metadata now returns map rather than array
    43    - redesigned browsing support (although it's not finished
    44    so won't currently work ;-)
    45 
    46    Revision 1.18  1999/09/07 04:56:54  sjboddie
    47    added GPL notice
    48 
    49    Revision 1.17  1999/09/02 00:25:26  rjmcnab
    50    changes to get compiling on AIX
    51 
    52    Revision 1.16  1999/08/13 04:19:05  sjboddie
    53    added name attribute to metadata
    54 
    55    Revision 1.15  1999/08/03 03:31:43  sjboddie
    56    added ability to set receptionist from configuration files
    57 
    58    Revision 1.14  1999/07/16 03:41:29  sjboddie
    59    changed isApprox
    60 
    61    Revision 1.13  1999/07/08 20:46:45  rjmcnab
    62    Added the result number to the ResultDocInfo_t
    63 
    64    Revision 1.12  1999/07/07 06:11:33  rjmcnab
    65    Slight change for multiple phrase matching.
    66 
    67    Revision 1.11  1999/07/01 22:47:49  sjboddie
    68    added format option to collection info
    69 
    70    Revision 1.10  1999/06/29 22:05:01  rjmcnab
    71    Added a couple of fields to ResultDocInfo_t to handle a special
    72    version of mg.
    73 
    74    Revision 1.9  1999/06/16 02:01:22  sjboddie
    75    Few changes to get getParents filter option to return metadata of parents
    76    as well as current OID
    77 
    78    Revision 1.8  1999/05/10 03:40:33  sjboddie
    79    lots of changes - slowly getting document action sorted out
    80 
    81    Revision 1.7  1999/04/21 05:23:14  sjboddie
    82 
    83    Changed the way metadata is returned
    84 
    85    Revision 1.6  1999/04/06 22:20:34  rjmcnab
    86    Got browsefilter working.
    87 
    88    Revision 1.5  1999/03/31 23:44:47  rjmcnab
    89    Altered the protocol so that the metadata is part of the filter.
    90 
    91    Revision 1.4  1999/03/11 00:11:19  rjmcnab
    92    Added a function to get a string version of comerror_t
    93 
    94    Revision 1.3  1999/03/09 21:00:47  rjmcnab
    95    Reorganised the statusaction, added more functions to comtypes.
    96 
    97    Revision 1.2  1999/03/04 21:19:15  rjmcnab
    98 
    99    Added clear() functions to all the data types.
    100 
    101    Revision 1.1  1999/02/21 22:35:25  rjmcnab
    102 
    103    Initial revision.
    104 
    105  */
    106 
    10725
    10826#include "comtypes.h"
     
    13351  ccsCols.erase(ccsCols.begin(), ccsCols.end());
    13452  buildDate=0;
     53  buildType.clear();
    13554  numDocs=0;
     55  numSections=0;
    13656  numWords=0;
    13757  numBytes=0;
     
    338258  doc.clear();
    339259}
    340 
    341 
    342 
  • branches/z3950-branch/gsdl/src/recpt/comtypes.h

    r871 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
     
    7573//   languages      [6]  IMPLICIT StringSet,  -- languages in the collection
    7674//   numDocs        [7]  IMPLICIT INTEGER,
    77 //   numWords       [8]  IMPLICIT INTEGER OPTIONAL,
    78 //   numBytes       [9]  IMPLICIT INTEGER OPTIONAL
    79 //   collectionmeta [10]  IMPLICIT StringSet
    80 //   format         [11] IMPLICIT StringSet
    81 //   building       [12] IMPLICIT StringSet
    82 //   receptionist   [13] IMPLICIT GeneralString
     75//   numSections    [8]  IMPLICIT INTEGER OPTIONAL,
     76//   numWords       [9]  IMPLICIT INTEGER OPTIONAL,
     77//   numBytes       [10] IMPLICIT INTEGER OPTIONAL
     78//   collectionmeta [11] IMPLICIT StringSet
     79//   format         [12] IMPLICIT StringSet
     80//   building       [13] IMPLICIT StringSet
     81//   receptionist   [14] IMPLICIT GeneralString
     82//   buildType      [15] IMPLICIT GeneralString
    8383// }
    8484struct ColInfoResponse_t {
     
    9292  text_tarray ccsCols;    // empty if collection does not use cross-collection searching
    9393  text_tarray languages;
    94   unsigned long numDocs;  // 0 if not known
    95   unsigned long numWords; // 0 if not known
    96   unsigned long numBytes; // 0 if not known
     94  unsigned long numDocs;     // 0 if not known
     95  unsigned long numSections; // 0 if not known
     96  unsigned long numWords;    // 0 if not known
     97  unsigned long numBytes;    // 0 if not known
    9798  text_tmap collectionmeta;
    9899  text_tmap format;
    99100  text_tmap building;
    100101  text_t receptionist;
     102  text_t  buildType;  // MG or MGPP
    101103};
    102104
     
    227229#define FRdocFreq    32
    228230#define FRmetadata   64
     231// used to indicate a full text browse query for mgpp
     232#define FRfullTextBrowse  128
    229233
    230234struct FilterRequest_t {
     
    359363
    360364#endif
     365
  • branches/z3950-branch/gsdl/src/recpt/converter.cpp

    r533 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.4  1999/09/07 04:56:54  sjboddie
    31    added GPL notice
    32 
    33    Revision 1.3  1999/09/02 00:25:27  rjmcnab
    34    changes to get compiling on AIX
    35 
    36    Revision 1.2  1999/02/21 22:33:54  rjmcnab
    37    Lots of stuff :-)
    38 
    39    Revision 1.1  1999/02/05 10:42:45  rjmcnab
    40 
    41    Continued working on receptionist
    42 
    43  */
    44 
    4525
    4626#include "converter.h"
     
    9676  return (*here).second.outconverter;
    9777}
    98 
  • branches/z3950-branch/gsdl/src/recpt/converter.h

    r533 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/datelistbrowserclass.cpp

    r995 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.5  2000/02/29 21:00:27  sjboddie
    31    fixed some compiler warnings
    32 
    33    Revision 1.4  1999/11/01 22:04:11  sjboddie
    34    just a few small changes (that means I can't remember ;)
    35 
    36    Revision 1.3  1999/10/19 08:40:11  sjboddie
    37    fixed some stupid compiler warnings on windows
    38 
    39    Revision 1.2  1999/10/14 22:59:33  sjboddie
    40    finished off browser classes
    41 
    42    Revision 1.1  1999/10/10 08:14:05  sjboddie
    43    - metadata now returns mp rather than array
    44    - redesigned browsing support (although it's not finished so
    45    won't currently work ;-)
    46 
    47  */
    48 
    4925
    5026#include "datelistbrowserclass.h"
  • branches/z3950-branch/gsdl/src/recpt/datelistbrowserclass.h

    r995 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/delhistoryaction.cpp

    r1000 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
     
    208206  return result;
    209207}
    210 
    211 
    212 
    213 
    214 
  • branches/z3950-branch/gsdl/src/recpt/delhistoryaction.h

    r928 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
     
    7674
    7775#endif
    78 
  • 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 
  • branches/z3950-branch/gsdl/src/recpt/documentaction.h

    r1079 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
     
    7977  virtual ~documentaction ();
    8078
     79  void set_receptionist (receptionist *therecpt) {recpt=therecpt;}
     80
    8181  text_t get_action_name () {return "d";}
    8282
     
    104104
    105105#endif
    106 
    107 
  • branches/z3950-branch/gsdl/src/recpt/extlinkaction.cpp

    r869 r1342  
    248248  return true;
    249249}
    250 
    251 
  • branches/z3950-branch/gsdl/src/recpt/extlinkaction.h

    r869 r1342  
    6161
    6262#endif
    63 
    64 
  • branches/z3950-branch/gsdl/src/recpt/formattools.cpp

    r1079 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.20  2000/04/07 04:40:44  sjboddie
    31    Reverted back to old DocumentHeader, DocumentTitles, DocumentImages etc.
    32    from DocumentColumns stuff. I'll move the DocumentColumns stuff to a
    33    separate development branch (New_Config_Format-branch) for now. The plan
    34    is to redesign the configuration file format a bit and limit the number of
    35    distributions floating around that take different configuration formats).
    36 
    37    Revision 1.17  2000/01/26 20:10:31  sjboddie
    38    changed the default order of detach/expand/highlight buttons
    39 
    40    Revision 1.16  2000/01/25 22:33:31  sjboddie
    41    added DocumentUseHTML
    42 
    43    Revision 1.15  1999/12/13 02:45:16  davidb
    44    Support for more than one metavalue for the same metadata name
    45 
    46    Revision 1.14  1999/10/30 22:23:11  sjboddie
    47    moved table functions from browsetools
    48 
    49    Revision 1.13  1999/10/14 23:01:24  sjboddie
    50    changes for new browsing support
    51 
    52    Revision 1.12  1999/10/10 08:14:07  sjboddie
    53    - metadata now returns mp rather than array
    54    - redesigned browsing support (although it's not finished so
    55    won't currently work ;-)
    56 
    57    Revision 1.11  1999/09/28 20:38:19  rjmcnab
    58    fixed a couple of bugs
    59 
    60    Revision 1.10  1999/09/07 04:56:55  sjboddie
    61    added GPL notice
    62 
    63    Revision 1.9  1999/09/02 00:31:25  rjmcnab
    64    fixed small error.
    65 
    66    Revision 1.8  1999/08/20 00:56:38  sjboddie
    67    added cgisafe option - you can now do something like [cgisafe:Title] if
    68    you want Title to be entered safely into a url
    69 
    70    Revision 1.7  1999/08/10 22:38:08  sjboddie
    71    added some more format options
    72 
    73    Revision 1.6  1999/07/30 02:25:42  sjboddie
    74    made format_date function global
    75 
    76    Revision 1.5  1999/07/21 05:00:00  sjboddie
    77    added some date formatting
    78 
    79    Revision 1.4  1999/07/20 03:02:15  sjboddie
    80    added an [icon] option, added ability to call get_formatted_string
    81    with icon and link arguments set
    82 
    83    Revision 1.3  1999/07/09 02:44:35  sjboddie
    84    fixed parent(All) function so it only outputs parents and not current
    85    level meta
    86 
    87    Revision 1.2  1999/07/08 20:48:33  rjmcnab
    88    Added ability to print the result number
    89 
    90    Revision 1.1  1999/07/07 05:49:34  sjboddie
    91    had another crack at the format string code - created a new formattools
    92    module. It can now handle {If} and {Or} statements although there's a
    93    bug preventing nested if's and or's.
    94 
    95  */
    96 
    9725
    9826#include "formattools.h"
    9927#include "cgiutils.h"
     28#include <assert.h>
    10029
    10130// a few function prototypes
     
    15382  while (here != end) {
    15483    if (*here != ' ') {
    155       if (*here == '<') {
     84      if ((*here == '<') && ((here+3) < end)) {
    15685    if ((*(here+1) == 't' || *(here+1) == 'T') &&
    15786        (*(here+2) == 'd' || *(here+2) == 'D') &&
     
    239168
    240169static void get_parent_options (text_t &instring, metadata_t &metaoption) {
     170
     171  assert (instring.size() > 7);
     172  if (instring.size() <= 7) return;
    241173
    242174  text_t meta, com, op;
     
    323255  while (here != end) {
    324256
    325     if (*here == '\\')
    326       text.push_back (*(++here));
    327 
    328     else if (*here == '{') {
     257    if (*here == '\\') {
     258      here ++;
     259      if (here != end) text.push_back (*here);
     260
     261    } else if (*here == '{') {
    329262      if (!text.empty()) {
    330263    formatlistptr->command = comText;
     
    433366
    434367    } else {
    435       // assume it's plain text
    436       or_ptr->command = comText;
    437       or_ptr->text = text;
     368      parse_string (text, or_ptr, metadata, getParents);
    438369    }
    439370    text.clear();
     
    710641  return ft;
    711642}
    712 
    713 
  • branches/z3950-branch/gsdl/src/recpt/formattools.h

    r1079 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/historydb.cpp

    r995 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29   $Log$
    30   Revision 1.4  2000/02/29 21:00:28  sjboddie
    31   fixed some compiler warnings
    32 
    33   Revision 1.3  2000/02/21 22:01:02  sjboddie
    34   gsdlhome now comes from gsdlsite.cfg
    35 
    36   Revision 1.2  2000/02/17 02:40:21  sjboddie
    37   tidied up a bit - fixed a bug (gdbm file wasn't always being closed properly)
    38 
    39 
    40   */
    4125
    4226#include "historydb.h"
     
    622606  logout << "in format user info - end";
    623607}
    624 
    625 
    626 
    627 
    628 
    629 
    630 
    631 
    632 
  • branches/z3950-branch/gsdl/src/recpt/historydb.h

    r1000 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
     
    9492
    9593#endif
    96 
    97 
  • branches/z3950-branch/gsdl/src/recpt/hlistbrowserclass.cpp

    r995 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.7  2000/02/29 21:00:29  sjboddie
    31    fixed some compiler warnings
    32 
    33    Revision 1.6  1999/11/01 22:04:12  sjboddie
    34    just a few small changes (that means I can't remember ;)
    35 
    36    Revision 1.5  1999/10/30 23:02:01  sjboddie
    37    tidied up, fixed a small bug
    38 
    39    Revision 1.4  1999/10/30 22:15:23  sjboddie
    40    added a collection argument
    41 
    42    Revision 1.3  1999/10/20 03:54:21  sjboddie
    43    problem with expanded contents
    44 
    45    Revision 1.2  1999/10/14 22:59:34  sjboddie
    46    finished off browser classes
    47 
    48    Revision 1.1  1999/10/10 08:14:08  sjboddie
    49    - metadata now returns mp rather than array
    50    - redesigned browsing support (although it's not finished so
    51    won't currently work ;-)
    52 
    53  */
    54 
    5525
    5626#include "hlistbrowserclass.h"
  • branches/z3950-branch/gsdl/src/recpt/hlistbrowserclass.h

    r995 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
     
    6462
    6563#endif
    66 
  • branches/z3950-branch/gsdl/src/recpt/htmlbrowserclass.cpp

    r715 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.1  1999/10/18 20:09:17  sjboddie
    31    new browserclass
    32 
    33 
    34  */
    35 
    3625
    3726#include "htmlbrowserclass.h"
  • branches/z3950-branch/gsdl/src/recpt/htmlbrowserclass.h

    r715 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/htmlgen.cpp

    r533 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.4  1999/09/07 04:56:55  sjboddie
    31    added GPL notice
    32 
    33    Revision 1.3  1999/02/11 01:24:04  rjmcnab
    34 
    35    Fixed a few compiler warnings.
    36 
    37    Revision 1.2  1999/02/08 01:28:02  rjmcnab
    38 
    39    Got the receptionist producing something using the statusaction.
    40 
    41    Revision 1.1  1999/01/08 08:40:56  rjmcnab
    42 
    43    Moved from lib directory.
    44 
    45    Revision 1.1  1999/01/08 03:57:46  rjmcnab
    46 
    47    Initial revision
    48 
    49  */
    5025
    5126#include "htmlgen.h"
     
    12196  textout << outconvert << buffer;
    12297}
    123 
    124 
  • branches/z3950-branch/gsdl/src/recpt/htmlgen.h

    r533 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/htmlutils.cpp

    r1147 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.6  2000/05/04 05:17:46  sjboddie
    31    moved dm_safe from htmlutils to gsdltools
    32 
    33    Revision 1.5  2000/02/13 20:38:59  sjboddie
    34    added dm_safe function
    35 
    36    Revision 1.4  1999/09/07 04:56:56  sjboddie
    37    added GPL notice
    38 
    39    Revision 1.3  1999/06/09 00:09:30  sjboddie
    40    Added a fairly minimal html_safe function
    41 
    42    Revision 1.2  1999/02/08 01:28:02  rjmcnab
    43 
    44    Got the receptionist producing something using the statusaction.
    45 
    46    Revision 1.1  1999/01/08 08:40:58  rjmcnab
    47 
    48    Moved from lib directory.
    49 
    50    Revision 1.1  1999/01/08 03:57:47  rjmcnab
    51 
    52    Initial revision
    53 
    54  */
    55 
    5625
    5726#include "htmlutils.h"
  • branches/z3950-branch/gsdl/src/recpt/htmlutils.h

    r1147 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    2725
  • branches/z3950-branch/gsdl/src/recpt/infodbclass.cpp

    r1149 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.7  2000/05/04 08:21:30  sjboddie
    31    modifications for windows port of GCC
    32 
    33    Revision 1.6  2000/02/15 22:53:50  kjm18
    34    search history stuff added.
    35 
    36    Revision 1.5  1999/10/19 03:23:42  davidb
    37    Collection building support through web pages
    38    and internal and external link handling for collection documents
    39 
    40    Revision 1.4  1999/09/07 04:56:56  sjboddie
    41    added GPL notice
    42 
    43    Revision 1.3  1999/09/02 00:26:10  rjmcnab
    44    now there can be multiple values for a single key
    45 
    46    Revision 1.2  1999/07/13 23:24:05  rjmcnab
    47    Added functionality to modify a gdbm database.
    48 
    49    Revision 1.1  1999/07/11 08:27:52  rjmcnab
    50    Moved from src/colservr and added capability to write out data.
    51 
    52    Revision 1.4  1999/05/10 03:43:48  sjboddie
    53    lots of changes to lots of files - getting document action going
    54 
    55    Revision 1.3  1999/04/30 02:00:46  sjboddie
    56    lots of stuff to do with getting documentaction working
    57 
    58    Revision 1.2  1999/04/06 22:20:31  rjmcnab
    59    Got browsefilter working.
    60 
    61    Revision 1.1  1999/03/30 05:10:07  rjmcnab
    62    Initial revision.
    63 
    64  */
    65 
    6625
    6726#include "infodbclass.h"
     
    586545  return true;
    587546}
    588 
    589 
  • branches/z3950-branch/gsdl/src/recpt/infodbclass.h

    r928 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    2725
     
    3331#include "gsdlconf.h"
    3432#include "text_t.h"
     33
     34#if defined(GSDL_USE_OBJECTSPACE)
     35#  include <ospace\std\iostream>
     36#  include <ospace\std\fstream>
     37#elif defined(GSDL_USE_IOS_H)
     38#  include <iostream.h>
     39#  include <fstream.h>
     40#else
     41#  include <iostream>
     42#  include <fstream>
     43#endif
    3544
    3645#ifdef __WIN32__
     
    175184
    176185#endif
    177 
    178 
    179 
    180 
    181 
  • branches/z3950-branch/gsdl/src/recpt/invbrowserclass.cpp

    r668 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.2  1999/10/14 22:59:34  sjboddie
    31    finished off browser classes
    32 
    33    Revision 1.1  1999/10/10 08:28:06  sjboddie
    34    - metadata now returns map rather than array
    35    - redesigned browsing support
    36 
    37  */
    38 
    3925
    4026#include "invbrowserclass.h"
  • branches/z3950-branch/gsdl/src/recpt/invbrowserclass.h

    r752 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/librarymain.cpp

    r1168 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.25.2.1  2000/05/11 01:56:29  johnmcp
    31 
    32    added proper config file parsing for z39.50 servers, and minor changes
    33    to pageaction (minor bug when display collections from >1 proto) and
    34    cgiwrapper (announces which collections are z39.50 servers).
    35 
    36    Revision 1.25  2000/04/14 02:52:05  sjboddie
    37    tidied up error messaging and set up some debugging info to be output
    38    when running library from command line
    39 
    40    Revision 1.24  2000/02/29 20:59:02  sjboddie
    41    added error message when unable to read from collect directory - should
    42    probably write this out to a web page too
    43 
    44    Revision 1.23  2000/02/21 21:59:37  sjboddie
    45    gsdlhome now comes from gsdlsite.cfg
    46 
    47    Revision 1.22  2000/02/17 02:35:48  sjboddie
    48    tidied up a bit
    49 
    50    Revision 1.21  2000/02/15 22:53:51  kjm18
    51    search history stuff added.
    52 
    53    Revision 1.20  1999/12/13 02:46:56  davidb
    54    Teach buildaction about recptionist
    55 
    56    Revision 1.19  1999/11/01 21:58:49  sjboddie
    57    no longer set receptionist for some actions that used to
    58 
    59    Revision 1.18  1999/10/25 22:29:31  sjboddie
    60    receptionist now checks collect diectory for collections
    61    rather than collections.txt file
    62 
    63    Revision 1.17  1999/10/19 03:23:43  davidb
    64    Collection building support through web pages
    65    and internal and external link handling for collection documents
    66 
    67    Revision 1.16  1999/10/18 20:07:33  sjboddie
    68    added htmlbrowserclass
    69 
    70    Revision 1.15  1999/10/14 23:03:10  sjboddie
    71    another browser
    72 
    73    Revision 1.14  1999/10/10 08:14:09  sjboddie
    74    - metadata now returns mp rather than array
    75    - redesigned browsing support (although it's not finished so
    76    won't currently work ;-)
    77 
    78    Revision 1.13  1999/09/16 21:39:35  sjboddie
    79    added gb converters
    80 
    81    Revision 1.12  1999/09/14 22:42:06  sjboddie
    82    included utf8 converter
    83 
    84    Revision 1.11  1999/09/14 22:03:27  sjboddie
    85    now reads in collections from a file to avoid recompiling
    86 
    87    Revision 1.10  1999/09/08 00:51:11  sjboddie
    88    removed old interface stuff
    89 
    90    Revision 1.9  1999/09/07 04:56:56  sjboddie
    91    added GPL notice
    92 
    93    Revision 1.8  1999/07/15 06:08:55  rjmcnab
    94    Moved the adding of the actions to librarymain so that they can
    95    be overriden easier.
    96 
    97    Revision 1.7  1999/06/15 01:56:12  sjboddie
    98    Got multiple collections working
    99 
    100    Revision 1.6  1999/05/10 03:40:39  sjboddie
    101    lots of changes - slowly getting document action sorted out
    102 
    103    Revision 1.5  1999/04/19 23:56:10  rjmcnab
    104    Finished the gdbm metadata stuff
    105 
    106    Revision 1.4  1999/04/12 03:45:05  rjmcnab
    107    Finished the query filter.
    108 
    109    Revision 1.3  1999/04/06 22:20:35  rjmcnab
    110    Got browsefilter working.
    111 
    112    Revision 1.2  1999/03/05 03:53:54  sjboddie
    113 
    114    fixed some bugs
    115 
    116    Revision 1.1  1999/02/21 22:35:22  rjmcnab
    117 
    118    Initial revision.
    119 
    120  */
    121 
    12225
    12326#include "receptionist.h"
     
    12932#include "filter.h"
    13033#include "browsefilter.h"
    131 #include "queryfilter.h"
     34#include "mgqueryfilter.h"
     35#include "mgppqueryfilter.h"
    13236#include "infodbclass.h"
     37#include "mggdbmsource.h"
    13338#include "mgsearch.h"
    134 #include "mggdbmsource.h"
     39#include "mgppsearch.h"
    13540#include "fileutil.h"
    13641#include <assert.h>
     
    16267  nullproto nproto;
    16368  z3950proto zproto;
     69
    16470  text_tarray collections;
    165 
    16671
    16772  // get gsdlhome
     
    17075  text_t collectdir = filename_cat (gsdlhome, "collect");
    17176  read_dir (collectdir, collections);
    172 
     77 
    17378  text_tarray::const_iterator thiscol = collections.begin();
    17479  text_tarray::const_iterator endcol = collections.end();
     
    17782   
    17883    // ignore the modelcol
    179     if (*thiscol == "modelcol") {thiscol ++; continue;}
    180    
     84
     85    if (*thiscol == "modelcol") {
     86      thiscol ++;
     87      continue;
     88    }
     89   
     90    // read config file to see if built with mg or mgpp
     91    text_t buildtype = "mg"; // mg is default
     92    text_tarray cfgline;
     93    text_t key;
     94    text_t filename = filename_cat(collectdir, *thiscol, "index/build.cfg");
     95    ifstream confin(filename.getcstr());
     96
     97    if (confin) {
     98      while (read_cfg_line(confin, cfgline) >= 0) {
     99    if (cfgline.size() ==2 ) {
     100      key = cfgline[0];
     101      cfgline.erase(cfgline.begin());
     102      if (key =="buildtype") {
     103        buildtype = cfgline[0];
     104        break;
     105      }
     106    }
     107      }
     108    }
     109   
     110    confin.close();
     111
    181112    // this memory is created but never destroyed
    182113    // we're also not doing any error checking to make sure we didn't
     
    184115    collectserver *cserver = new collectserver();
    185116    gdbmclass *gdbmhandler = new gdbmclass();
    186     mgsearchclass *mgsearch = new mgsearchclass();
    187    
     117
    188118    // add a null filter
    189119    filterclass *filter = new filterclass ();
     
    193123    browsefilterclass *browsefilter = new browsefilterclass();
    194124    browsefilter->set_gdbmptr (gdbmhandler);
    195     cserver->add_filter (browsefilter);
    196    
    197     // add a query filter
    198     queryfilterclass *queryfilter = new queryfilterclass();
    199     queryfilter->set_gdbmptr (gdbmhandler);
    200     queryfilter->set_mgsearchptr (mgsearch);
    201     cserver->add_filter (queryfilter);
    202    
    203     // add a mg and gdbm source
    204     mggdbmsourceclass *mggdbmsource = new mggdbmsourceclass ();
    205     mggdbmsource->set_gdbmptr (gdbmhandler);
    206     mggdbmsource->set_mgsearchptr (mgsearch);
    207     cserver->add_source (mggdbmsource);
     125    cserver->add_filter (browsefilter); 
     126 
     127    if (buildtype == "mg") {
     128       mgsearchclass *mgsearch = new mgsearchclass();
     129 
     130       // add a query filter
     131       mgqueryfilterclass *queryfilter = new mgqueryfilterclass();
     132       queryfilter->set_gdbmptr (gdbmhandler);
     133       queryfilter->set_mgsearchptr (mgsearch);
     134       cserver->add_filter (queryfilter);
     135       
     136       // add a mg and gdbm source
     137       mggdbmsourceclass *mggdbmsource = new mggdbmsourceclass ();
     138       mggdbmsource->set_gdbmptr (gdbmhandler);
     139       mggdbmsource->set_mgsearchptr (mgsearch);
     140       cserver->add_source (mggdbmsource);
     141    }
     142    else if (buildtype == "mgpp") {
     143     
     144      mgppsearchclass *mgsearch = new mgppsearchclass();
     145
     146      // add a query filter
     147      mgppqueryfilterclass *queryfilter = new mgppqueryfilterclass();
     148      queryfilter->set_gdbmptr (gdbmhandler);
     149      queryfilter->set_mgsearchptr (mgsearch);
     150      cserver->add_filter (queryfilter);
     151     
     152      // add a mg and gdbm source
     153      mggdbmsourceclass *mggdbmsource = new mggdbmsourceclass ();
     154      mggdbmsource->set_gdbmptr (gdbmhandler);
     155      mggdbmsource->set_mgsearchptr (mgsearch);
     156      cserver->add_source (mggdbmsource);
     157   
     158    }
    208159   
    209160    // inform collection server and everything it contains about its
     
    247198  recpt.add_converter ("u", &utf8inconvert, &utf8outconvert);
    248199
    249   if (!gsdlhome.empty()) {
    250     mapinconvertclass gbinconvert;
    251     gbinconvert.setmapfile (gsdlhome, "gbku", 0x25a1);
    252     mapoutconvertclass gboutconvert;
    253     gboutconvert.setmapfile (gsdlhome, "ugbk", 0xa1f5);
    254     recpt.add_converter ("g", &gbinconvert, &gboutconvert);
    255   }
     200  mapinconvertclass gbinconvert;
     201  gbinconvert.setmapfile (gsdlhome, "gbku", 0x25a1);
     202  mapoutconvertclass gboutconvert;
     203  gboutconvert.setmapfile (gsdlhome, "ugbk", 0xa1f5);
     204  recpt.add_converter ("g", &gbinconvert, &gboutconvert);
     205
     206  text_t armapfile = filename_cat (gsdlhome, "unicode", "MAPPINGS");
     207  armapfile = filename_cat (armapfile, "WINDOWS", "1256.TXT");
     208  simplemapinconvertclass arinconvert;
     209  arinconvert.setmapfile (armapfile);
     210  simplemapoutconvertclass aroutconvert;
     211  aroutconvert.setmapfile (armapfile);
     212  recpt.add_converter ("a", &arinconvert, &aroutconvert); 
     213
    256214
    257215  // the list of actions. Note: these actions will become invalid
     
    262220
    263221  pageaction apageaction;
     222  apageaction.set_receptionist (&recpt);
    264223  recpt.add_action (&apageaction);
    265224
     
    268227
    269228  queryaction aqueryaction;
     229  aqueryaction.set_receptionist (&recpt);
    270230  recpt.add_action (&aqueryaction);
    271231
    272232  documentaction adocumentaction;
     233  adocumentaction.set_receptionist (&recpt);
    273234  recpt.add_action (&adocumentaction);
    274235
     
    313274  return 0;
    314275}
    315 
    316 
    317 
    318 
    319 
  • branches/z3950-branch/gsdl/src/recpt/nullproto.cpp

    r801 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.12  1999/12/05 21:23:39  sjboddie
    31    support for multiple gsdlhomes and gdbmhomes
    32 
    33    Revision 1.11  1999/10/25 22:29:32  sjboddie
    34    receptionist now checks collect diectory for collections
    35    rather than collections.txt file
    36 
    37    Revision 1.10  1999/10/19 03:23:43  davidb
    38    Collection building support through web pages
    39    and internal and external link handling for collection documents
    40 
    41    Revision 1.9  1999/09/07 04:56:56  sjboddie
    42    added GPL notice
    43 
    44    Revision 1.8  1999/06/27 22:04:47  sjboddie
    45    now read in build.cfg before collect.cfg so that the indexmaps
    46    are available if required to decode defaultindex, defaultsubcollection,
    47    and defaultlanguage
    48 
    49    Revision 1.7  1999/06/15 02:16:45  sjboddie
    50    small change to prevent collectdir configuration string from being passed
    51    to everything
    52 
    53    Revision 1.6  1999/05/10 03:40:41  sjboddie
    54    lots of changes - slowly getting document action sorted out
    55 
    56    Revision 1.5  1999/04/30 01:59:41  sjboddie
    57    lots of stuff - getting documentaction working (documentaction replaces
    58    old browseaction)
    59 
    60    Revision 1.4  1999/03/31 23:44:48  rjmcnab
    61    Altered the protocol so that the metadata is part of the filter.
    62 
    63    Revision 1.3  1999/03/03 23:26:35  sjboddie
    64 
    65    Implemented more of the protocol
    66 
    67    Revision 1.2  1999/02/25 21:58:58  rjmcnab
    68 
    69    Merged sources.
    70 
    71    Revision 1.1  1999/02/21 22:35:22  rjmcnab
    72 
    73    Initial revision.
    74 
    75  */
    76 
    7725
    7826#include "nullproto.h"
     
    11765    if ((*here).second.c != NULL) {
    11866      const colservrconf &configinfo = (*here).second.c->get_configinfo ();
     67      bool failed = false;
    11968
    12069      // configure this collection server
     
    13079           << configinfo.collection << "\", gsdlhome=\""
    13180           << configinfo.gsdlhome << "\"\n";
    132     //  return false; //****
    133     here ++;
    134     continue;
     81    failed = true;
    13582      }
    13683
     
    14289           << configinfo.collection << "\", gsdlhome=\""
    14390           << configinfo.gsdlhome << "\"\n";
    144     //  return false; //****
    145     here ++;
    146     continue;
     91    failed = true;
    14792      }
    14893
    149       if (!(*here).second.c->init (logout)) return false;
     94      // don't bother initializing if one of the config files
     95      // wasn't read correctly
     96      if (!failed) {
     97    if (!(*here).second.c->init (logout)) return false;
     98      }
    15099    }
    151100    here++;
  • branches/z3950-branch/gsdl/src/recpt/nullproto.h

    r533 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/pageaction.cpp

    r1168 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.29.6.1  2000/05/11 01:56:30  johnmcp
    31 
    32    added proper config file parsing for z39.50 servers, and minor changes
    33    to pageaction (minor bug when display collections from >1 proto) and
    34    cgiwrapper (announces which collections are z39.50 servers).
    35 
    36    Revision 1.29  2000/03/19 21:16:46  nzdl
    37    added german language interface
    38 
    39    Revision 1.28  2000/02/24 01:19:01  sjboddie
    40    fixed up messy hack for meldex
    41 
    42    Revision 1.27  2000/02/15 22:53:51  kjm18
    43    search history stuff added.
    44 
    45    Revision 1.26  2000/02/03 01:49:35  sjboddie
    46    fixed up some of the preferences stuff
    47 
    48    Revision 1.25  2000/01/26 20:11:04  sjboddie
    49    added some collection specific help text
    50 
    51    Revision 1.24  2000/01/25 22:31:09  sjboddie
    52    more hacky changes to get preferences to be a bit smarter
    53 
    54    Revision 1.23  2000/01/24 22:59:57  sjboddie
    55    changes to set macros differently for preferences page depending
    56    on type of collection - pageaction is getting kind of hacky - should
    57    tidy it up some day
    58 
    59    Revision 1.22  1999/11/25 23:01:09  sjboddie
    60    now need to be able to handle it if no collection is selected
    61 
    62    Revision 1.21  1999/11/03 22:50:13  sjboddie
    63    now defaults to home page
    64 
    65    Revision 1.20  1999/11/01 21:58:02  sjboddie
    66    changes to arguments of many functions, now pass list of protocols
    67    instead of just that for this collection
    68 
    69    Revision 1.19  1999/10/19 21:59:09  sjboddie
    70    bug in generating "how to find information" text for about pages
    71 
    72    Revision 1.18  1999/10/19 03:23:44  davidb
    73    Collection building support through web pages
    74    and internal and external link handling for collection documents
    75 
    76    Revision 1.17  1999/10/14 23:04:44  sjboddie
    77    some hacks to make nzdl home page look right
    78 
    79    Revision 1.16  1999/10/10 08:14:09  sjboddie
    80    - metadata now returns mp rather than array
    81    - redesigned browsing support (although it's not finished so
    82    won't currently work ;-)
    83 
    84    Revision 1.15  1999/09/17 04:46:05  sjboddie
    85    fixed a couple of problems with 'unknown' classifier
    86 
    87    Revision 1.14  1999/09/07 23:08:09  rjmcnab
    88    Removed some compiler warnings
    89 
    90    Revision 1.13  1999/09/07 04:56:57  sjboddie
    91    added GPL notice
    92 
    93    Revision 1.12  1999/09/02 00:26:43  rjmcnab
    94    made the p cgi argument always saved in the compressed arguments
    95 
    96    Revision 1.11  1999/08/25 04:48:43  sjboddie
    97    changes to the home and about pages
    98 
    99    Revision 1.10  1999/08/11 23:29:43  sjboddie
    100    added support for html classifier (i.e. the hp argument)
    101 
    102    Revision 1.9  1999/08/03 03:29:47  sjboddie
    103    added ability to set receptionist from collect.cfg
    104 
    105    Revision 1.8  1999/07/30 02:24:44  sjboddie
    106    added collectinfo argument to some functions
    107 
    108    Revision 1.7  1999/06/24 05:12:24  sjboddie
    109    lots of small changes
    110 
    111    Revision 1.6  1999/06/10 00:39:16  sjboddie
    112    navigation bar is no longer written out for every page (it should
    113    be included in the _content_ macro of pages wanting to display it).
    114 
    115    Revision 1.5  1999/06/08 04:29:35  sjboddie
    116    added argsinfo to the call to check_cgiargs to make it easy to set
    117    args to their default if they're found to be screwed up
    118 
    119    Revision 1.4  1999/02/28 20:00:14  rjmcnab
    120 
    121 
    122    Fixed a few things.
    123 
    124    Revision 1.3  1999/02/25 21:58:58  rjmcnab
    125 
    126    Merged sources.
    127 
    128    Revision 1.2  1999/02/21 22:33:54  rjmcnab
    129 
    130    Lots of stuff :-)
    131 
    132    Revision 1.1  1999/02/12 02:40:17  sjboddie
    133 
    134    Added page action
    135 
    136  */
    13725
    13826#include "OIDtools.h"
     
    19280
    19381  text_t homeextra = "<center><table width=_pagewidth_><tr valign=top>\n";
     82  bool found_valid_col = false;
    19483 
    19584  recptprotolistclass::iterator rprotolist_here = protos->begin();
     
    20493    text_tarray::iterator collist_here = collist.begin();
    20594    text_tarray::iterator collist_end = collist.end();
    206    
    207     int row1 = 9;
    208     int row2 = 8;
    209     int count = 1;
     95
     96    int count = 0;
     97    bool first = true;
    21098    while (collist_here != collist_end) {
    21199     
    212       ColInfoResponse_t cinfo;
    213       (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout);
     100      ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout);
    214101     
    215       if (err == noError) {
    216         if (cinfo.isPublic && (cinfo.buildDate > 0)) {
     102      if (cinfo != NULL) {
     103        if (cinfo->isPublic && (cinfo->buildDate > 0)) {
    217104         
     105          found_valid_col = true;
    218106          FilterResponse_t response;
    219107          text_tset metadata;
     
    239127          }
    240128       
    241           if ((count == 1) || (count == (row1+1)) || (count == ((row1+row2)+1)))
    242         homeextra += "<td align=center>";
    243           else homeextra += "<p>";
    244 
    245           if (*collist_here == "niupepa") {
    246         homeextra += "<a href=\"_httpmusiclibrary_\">_iconmusiclibrary_</a>\n";
    247         if ((count == row1) || (count == (row1+row2))) homeextra += "</td>";
    248         count ++;
    249         if ((count == 1) || (count == (row1+1)) || (count == ((row1+row2)+1)))
    250           homeextra += "<td align=center>";
    251         else homeextra += "<p>";
    252           }
     129          if ((count%3 == 0) && (!first))
     130        homeextra += "</tr><tr valign=top>\n";
    253131         
    254132          text_t link = "<a href=\"_gwcgi_?a=p&p=about&c=" + *collist_here + "\">";
     
    256134        link = "<a href=\"_gwcgi_?a=p&p=about&l=zh&nw=u&c=" + *collist_here + "\">";
    257135          if (*collist_here == "arabic")
    258         link = "<a href=\"_gwcgi_?a=p&p=about&w=a&c=" + *collist_here + "\">";
    259 
    260           if (!cinfo.receptionist.empty())
    261         link = "<a href=\"" + cinfo.receptionist + "\">";
     136        link = "<a href=\"_gwcgi_?a=p&p=about&l=ar&nw=u&c=" + *collist_here + "\">";
     137
     138          if (!cinfo->receptionist.empty())
     139        link = "<a href=\"" + cinfo->receptionist + "\">";
    262140         
    263           homeextra += link + collectionname + "</a>\n";
    264          
    265           if ((count == row1) || (count == (row1+row2)))
    266         homeextra += "</td>";
     141          homeextra += "<td>" + link + collectionname + "</a></td>\n";
    267142         
    268143          count ++;
     144          first = false;
    269145        }
    270146      }
     
    272148      collist_here ++;
    273149    }
     150
    274151    // disp.setmacro ("homeextra", "home", homeextra);
     152    for (; count%3 != 0; count ++) homeextra += "<td></td>\n";
    275153      }
    276154    }
     
    278156    rprotolist_here ++;
    279157  }
     158
    280159  homeextra += "</tr></table></center>\n";
    281160  disp.setmacro ("homeextra", "home", homeextra);
     161
     162  if (!found_valid_col) {
     163    homeextra += "<td>No valid (i.e. built and public) collections are available</td>\n";
     164  }
     165  homeextra += "</tr></table></center>\n";
     166  disp.setmacro ("homeextra", "home", homeextra);
     167
    282168}
    283169
     
    327213
    328214 
     215  if (recpt == NULL) {
     216    logout << "ERROR (pageaction::define_internal_macros): This action does not contain\n"
     217       << "      information about any receptionists. The method set_receptionist was\n"
     218       << "      probably not called from the module which instantiated this action.\n";
     219    return;
     220  }
     221
    329222  text_t &arg_p = args["p"];
    330223  text_t &arg_c = args["c"];
    331   ColInfoResponse_t cinfo;
    332   comerror_t err;
     224  ColInfoResponse_t *cinfo = NULL;
    333225
    334226  recptproto* collectproto = protos->getrecptproto (arg_c, logout);
    335227  if (collectproto != NULL) {
    336     collectproto->get_collectinfo (arg_c, cinfo, err, logout);
    337 
    338     disp.setmacro ("numdocs", "Global", cinfo.numDocs);
     228    cinfo = recpt->get_collectinfo_ptr (collectproto, arg_c, logout);
     229
     230    disp.setmacro ("numdocs", "Global", cinfo->numDocs);
    339231    unsigned long current_time = time(NULL);
    340     unsigned long builddate = (current_time - cinfo.buildDate) / 86400;
     232    unsigned long builddate = (current_time - cinfo->buildDate) / 86400;
    341233    disp.setmacro ("builddate", "Global", builddate);
    342234  }
     
    348240    // _collectionoption_
    349241
    350     if (args["ccs"] == "1" && collectproto != NULL && (cinfo.ccsCols.size() > 1)) {
     242    if (args["ccs"] == "1" && collectproto != NULL && (cinfo->ccsCols.size() > 1)) {
    351243      text_t collectionoption = "_textcollectionoption_";
    352       text_tarray::const_iterator col_here = cinfo.ccsCols.begin();
    353       text_tarray::const_iterator col_end = cinfo.ccsCols.end();
     244      text_tarray::const_iterator col_here = cinfo->ccsCols.begin();
     245      text_tarray::const_iterator col_end = cinfo->ccsCols.end();
    354246      int count = 0;
    355247      while (col_here != col_end) {
    356248    text_t colname;
    357249    if (*col_here == arg_c) {
    358         colname = cinfo.collectionmeta["collectionname"];
     250        colname = cinfo->collectionmeta["collectionname"];
    359251    } else {
    360       ColInfoResponse_t this_cinfo;
    361       collectproto->get_collectinfo (*col_here, this_cinfo, err, logout);
    362       if (err != noError) {col_here ++; continue;}
    363       colname = this_cinfo.collectionmeta["collectionname"];
     252      ColInfoResponse_t *this_cinfo = recpt->get_collectinfo_ptr (collectproto, *col_here, logout);
     253      if (this_cinfo == NULL) {col_here ++; continue;}
     254      colname = this_cinfo->collectionmeta["collectionname"];
    364255    }
    365256
     
    377268    // _htmloptions_
    378269   
    379     text_tmap::const_iterator it = cinfo.format.find ("DocumentUseHTML");
    380     if ((it != cinfo.format.end()) && ((*it).second == "true")) {
     270    text_tmap::const_iterator it = cinfo->format.find ("DocumentUseHTML");
     271    if ((it != cinfo->format.end()) && ((*it).second == "true")) {
    381272      disp.setmacro ("htmloptions", "preferences", "_htmloptionson_");
    382273
     
    384275      // _PreferenceDocsFromWeb_
    385276
    386       it = cinfo.format.find ("PreferenceDocsFromWeb");
    387       if ((it == cinfo.format.end()) || ((*it).second == "true"))
     277      it = cinfo->format.find ("PreferenceDocsFromWeb");
     278      if ((it == cinfo->format.end()) || ((*it).second == "true"))
    388279    disp.setmacro ("PreferenceDocsFromWeb", "preferences", "1");
    389280    }
     
    400291    text_tarray languages;
    401292    languages.push_back ("en");
     293    languages.push_back ("fr");
    402294    languages.push_back ("de");
     295    languages.push_back ("es");
    403296    languages.push_back ("mi");
    404297    languages.push_back ("zh");
     298    languages.push_back ("ar");
    405299    text_tarray::const_iterator this_lang = languages.begin();
    406300    text_tarray::const_iterator end_lang = languages.end();
    407301
    408302    text_t languageoption = "_textlanguage_\n<select name=\"l\" onChange=\"updatel();\">\n";
    409     it = cinfo.format.find ("PreferenceLanguages");
    410     if ((it != cinfo.format.end()) && (!(*it).second.empty())) {
     303    it = cinfo->format.find ("PreferenceLanguages");
     304    if ((it != cinfo->format.end()) && (!(*it).second.empty())) {
    411305      text_tset pref_langs;
    412306      splitchar ((*it).second.begin(), (*it).second.end(), '|', pref_langs);
     
    479373         
    480374      // if HTML collection there's no how to read document text
    481       text_tmap::const_iterator it = cinfo.format.find ("HelpNoDocs");
    482       if ((it != cinfo.format.end()) && ((*it).second == "true")) {
     375      text_tmap::const_iterator it = cinfo->format.find ("HelpNoDocs");
     376      if ((it != cinfo->format.end()) && ((*it).second == "true")) {
    483377    disp.setmacro ("topicreadingdocs", "help", "");
    484378    disp.setmacro ("texthelpreadingdocs", "help", "");
    485379      }
    486       it = cinfo.format.find ("HelpBibDocs");
    487       if ((it != cinfo.format.end()) && ((*it).second == "true")) {
     380      it = cinfo->format.find ("HelpBibDocs");
     381      if ((it != cinfo->format.end()) && ((*it).second == "true")) {
    488382    disp.setmacro ("texthelpreadingdocs", "help", "_bibtexthelpreadingdocs_");
    489383    disp.setmacro ("textreadingdocs", "help", "_bibtextreadingdocs_");
    490384      }
    491       it = cinfo.format.find ("HelpBookDocs");
    492       if ((it != cinfo.format.end()) && ((*it).second == "true")) {
     385      it = cinfo->format.find ("HelpBookDocs");
     386      if ((it != cinfo->format.end()) && ((*it).second == "true")) {
    493387    disp.setmacro ("texthelpreadingdocs", "help", "_booktexthelpreadingdocs_");
    494388    disp.setmacro ("textreadingdocs", "help", "_booktextreadingdocs_");
     
    499393
    500394      // _textsubcollections_
    501       if (args["ccs"] == "1" && (cinfo.ccsCols.size() > 1)) {
    502     text_t textsubcollections = "_textsubcols1_(" + text_t(cinfo.ccsCols.size()) + ")";
    503     text_tarray::const_iterator here = cinfo.ccsCols.begin();
    504     text_tarray::const_iterator end = cinfo.ccsCols.end();
     395      if (args["ccs"] == "1" && (cinfo->ccsCols.size() > 1)) {
     396    text_t textsubcollections = "_textsubcols1_(" + text_t(cinfo->ccsCols.size()) + ")";
     397    text_tarray::const_iterator here = cinfo->ccsCols.begin();
     398    text_tarray::const_iterator end = cinfo->ccsCols.end();
    505399    bool first = true;
    506400    int count = 0;
     
    508402      if (*here == arg_c) {
    509403        if (!first) textsubcollections += "<br>";
    510         textsubcollections += "\n" + cinfo.collectionmeta["collectionname"] + "\n";
     404        textsubcollections += "\n" + cinfo->collectionmeta["collectionname"] + "\n";
    511405      } else {
    512         ColInfoResponse_t this_cinfo;
    513         collectproto->get_collectinfo (*here, this_cinfo, err, logout);
    514         if (err != noError) {here ++; continue;}
     406        ColInfoResponse_t *this_cinfo = recpt->get_collectinfo_ptr (collectproto, *here, logout);
     407        if (this_cinfo == NULL) {here ++; continue;}
    515408        if (!first) textsubcollections += "<br>";
    516         textsubcollections += "\n" + this_cinfo.collectionmeta["collectionname"] + "\n";
     409        textsubcollections += "\n" + this_cinfo->collectionmeta["collectionname"] + "\n";
    517410      }
    518411      count ++;
     
    541434  return true;
    542435}
    543 
    544 
    545 
    546 
    547 
  • branches/z3950-branch/gsdl/src/recpt/pageaction.h

    r761 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    2725
     
    4644  pageaction ();
    4745  virtual ~pageaction ();
     46
     47  void set_receptionist (receptionist *therecpt) {recpt=therecpt;}
    4848
    4949  text_t get_action_name () {return "p";}
  • branches/z3950-branch/gsdl/src/recpt/pagedbrowserclass.cpp

    r1048 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.9  2000/03/31 03:04:32  nzdl
    31    tidied up some of the browsing code - replaced DocumentImages,
    32    DocumentTitles and DocumentHeading with DocumentIcon
    33 
    34    Revision 1.8  2000/02/17 20:54:00  sjboddie
    35    minor change to macro name
    36 
    37    Revision 1.7  2000/02/17 02:35:48  sjboddie
    38    tidied up a bit
    39 
    40    Revision 1.6  2000/02/15 22:53:51  kjm18
    41    search history stuff added.
    42 
    43    Revision 1.5  2000/02/06 21:29:11  sjboddie
    44    fixed a bug - made some functions virtual for use with cstr collection
    45 
    46    Revision 1.4  1999/10/30 23:06:25  sjboddie
    47    tidied up a bit
    48 
    49    Revision 1.3  1999/10/30 22:16:37  sjboddie
    50    added a collection argument
    51 
    52    Revision 1.2  1999/10/19 08:40:11  sjboddie
    53    fixed some stupid compiler warnings on windows
    54 
    55    Revision 1.1  1999/10/14 22:59:35  sjboddie
    56    finished off browser classes
    57 
    58  */
    59 
    6025
    6126#include "pagedbrowserclass.h"
     
    7742void pagedbrowserclass::load_metadata_defaults (text_tset &metadata) {
    7843  metadata.insert ("Title");
    79 }
    80 
    81 text_t pagedbrowserclass::get_default_formatstring () {
    82   return "";
    8344}
    8445
     
    12081    }
    12182  }
    122        
    123 
    124    
    12583}
    12684
     
    13795
    13896  if (section.OID != args["d"]) {
    139     // set the _parentarrow_ macro
    140     text_t parentarrow = "<a href=\"_httpdocument_&cl=" + args["cl"] +
    141       "&d=" + section.OID + "\">_iconprev_</a>\n";
     97    text_t httpprevarrow = "_httpdocument_&cl=" + args["cl"] + "&d=" + section.OID;
     98    text_t parentarrow = "<a href=\"" + httpprevarrow + "\">_iconprev_</a>\n";
     99    disp.setmacro ("httpprevarrow", "document", httpprevarrow);
    142100    disp.setmacro ("parentarrow", "document", parentarrow);
    143101    return 0;
     
    165123
    166124  text_t previousOID, previoustitle, nextOID, nexttitle;
    167   text_t previousarrow, nextarrow;
     125  text_t previousarrow, nextarrow, httpprevarrow, httpnextarrow;
    168126  bool found = false;
    169127
     
    182140    previousOID = (*(thissection-1)).OID;
    183141    previoustitle = (*(thissection-1)).metadata["Title"].values[0];
    184       } else
     142      } else {
    185143    previousarrow = "_document:parentarrow_";
     144      }
    186145
    187146      if ((thissection+1) != endsection) {
     
    202161      << ("_document:textnumpages_(" + text_t(numpages) + ")</center></td></tr>\n");
    203162
    204   if (!found)
    205     nextarrow = "<a href=\"_httpdocument_&cl=" + args["cl"] + "&d=" + sections.docInfo[0].OID +
    206       "\">" + sections.docInfo[0].metadata["Title"].values[0] + "_iconnext_</a>\n";
    207   else {
    208     if (!previousOID.empty())
    209       previousarrow = "<a href=\"_httpdocument_&cl=" + args["cl"] + "&d=" +
    210     previousOID + "\">_iconprev_" + previoustitle + "</a>\n";
    211     if (!nextOID.empty())
    212       nextarrow = "<a href=\"_httpdocument_&cl=" + args["cl"] + "&d=" +
    213     nextOID + "\">" + nexttitle + "_iconnext_</a>\n";
     163  if (!found) {
     164    httpnextarrow = "_httpdocument_&cl=" + args["cl"] + "&d=" + sections.docInfo[0].OID;
     165    nextarrow = "<a href=\"" + httpnextarrow + "\">" +
     166      sections.docInfo[0].metadata["Title"].values[0] + "_iconnext_</a>\n";
     167
     168  } else {
     169    if (!previousOID.empty()) {
     170      httpprevarrow = "_httpdocument_&cl=" + args["cl"] + "&d=" + previousOID;
     171      previousarrow = "<a href=\"" + httpprevarrow + "\">_iconprev_" + previoustitle + "</a>\n";
     172    }
     173    if (!nextOID.empty()) {
     174      httpnextarrow = "_httpdocument_&cl=" + args["cl"] + "&d=" + nextOID;
     175      nextarrow = "<a href=\"" + httpnextarrow + "\">" + nexttitle + "_iconnext_</a>\n";
     176    }
    214177  }
     178
     179  if (!httpprevarrow.empty()) disp.setmacro ("httpprevarrow", "document", httpprevarrow);
     180  if (!httpnextarrow.empty()) disp.setmacro ("httpnextarrow", "document", httpnextarrow);
    215181
    216182  textout << outconvert << disp << "<tr valign=middle>\n"
     
    222188  return 0;
    223189}
    224 
    225 
    226 
    227 
    228 
    229 
  • branches/z3950-branch/gsdl/src/recpt/pagedbrowserclass.h

    r928 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    2725
     
    4543  void load_metadata_defaults (text_tset &metadata);
    4644
    47   text_t get_default_formatstring ();
    48 
    4945  virtual void processOID (cgiargsclass &args, recptproto *collectproto,
    5046               ostream &logout);
     
    6662
    6763#endif
    68 
  • branches/z3950-branch/gsdl/src/recpt/pingaction.cpp

    r760 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.5  1999/11/01 21:56:32  sjboddie
    31    changes to arguments of many functions
    32 
    33    Revision 1.4  1999/09/07 04:56:57  sjboddie
    34    added GPL notice
    35 
    36    Revision 1.3  1999/07/30 02:24:45  sjboddie
    37    added collectinfo argument to some functions
    38 
    39    Revision 1.2  1999/02/25 21:58:59  rjmcnab
    40 
    41    Merged sources.
    42 
    43    Revision 1.1  1999/02/21 22:35:20  rjmcnab
    44 
    45    Initial revision.
    46 
    47  */
    48 
    4925
    5026#include "pingaction.h"
  • branches/z3950-branch/gsdl/src/recpt/pingaction.h

    r760 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/queryaction.cpp

    r1174 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.36.6.1  2000/05/17 02:57:00  johnmcp
    31    checkpoint - can now connect and get status information from a z39.50 server.
    32    Still need to get queries and data retrieval working.
    33 
    34    Revision 1.36  2000/02/21 21:57:48  sjboddie
    35    actions are now configured with gsdlhome
    36 
    37    Revision 1.35  2000/02/17 02:35:04  sjboddie
    38    tidied up search history stuff a bit - replaced strings with macros
    39 
    40    Revision 1.34  2000/02/15 22:53:52  kjm18
    41    search history stuff added.
    42 
    43    Revision 1.33  2000/01/24 22:57:59  sjboddie
    44    fixed bug in cross-collection searching, tidied up a bit
    45 
    46    Revision 1.32  1999/12/13 02:54:11  davidb
    47    Support for cross collection searching (CCS)
    48 
    49    Revision 1.31  1999/12/05 21:22:33  sjboddie
    50    tidied up cross-collection searching a bit
    51 
    52    Revision 1.30  1999/11/08 20:26:37  sjboddie
    53    added multiplevalue option to cgiarginfo
    54 
    55    Revision 1.29  1999/11/04 20:29:53  sjboddie
    56    small change to cross-collection searching
    57 
    58    Revision 1.28  1999/11/03 22:49:50  sjboddie
    59    A few changes to cross-collection searching for fao
    60 
    61    Revision 1.27  1999/11/01 21:53:27  sjboddie
    62    added cross-collection searching capability - still needs lots of
    63    work but the basic functionality is there
    64 
    65    Revision 1.26  1999/10/10 08:14:10  sjboddie
    66    - metadata now returns mp rather than array
    67    - redesigned browsing support (although it's not finished so
    68    won't currently work ;-)
    69 
    70    Revision 1.25  1999/09/24 04:49:39  sjboddie
    71    fixed up the query selection boxes to display properly if there's only
    72    a single index/sub-collection
    73 
    74    Revision 1.24  1999/09/22 03:44:31  sjboddie
    75    EndResults query filter option may now take '-1' for 'all'
    76 
    77    Revision 1.23  1999/09/21 11:34:42  sjboddie
    78    added Maxdocs queryfilter option which may be -1 for 'all'
    79 
    80    Revision 1.22  1999/09/07 23:08:51  rjmcnab
    81    removed some compiler warnings
    82 
    83    Revision 1.21  1999/09/07 04:56:57  sjboddie
    84    added GPL notice
    85 
    86    Revision 1.20  1999/08/25 04:47:55  sjboddie
    87    added advanced search option - other minor changes
    88 
    89    Revision 1.19  1999/08/13 04:17:24  sjboddie
    90    small change to do with new collection-level metadata
    91 
    92    Revision 1.18  1999/08/10 22:46:33  sjboddie
    93    changed format option result to QueryResults and added QueryLinks option
    94 
    95    Revision 1.17  1999/07/30 02:24:42  sjboddie
    96    added collectinfo argument to some functions
    97 
    98    Revision 1.16  1999/07/19 00:16:58  sjboddie
    99    no longer display documents that don't match all phrases in query string
    100 
    101    Revision 1.15  1999/07/16 08:33:36  rjmcnab
    102    Changed the logic for getting the results string slightly
    103 
    104    Revision 1.14  1999/07/16 03:41:29  sjboddie
    105    changed isApprox
    106 
    107    Revision 1.13  1999/07/16 00:19:01  sjboddie
    108    some changes to the way quoted queries are handled
    109 
    110    Revision 1.12  1999/07/09 02:17:55  rjmcnab
    111    Setting macros needed for a second query.
    112 
    113    Revision 1.11  1999/07/07 06:13:10  rjmcnab
    114    Added ability to combine two independant queries.
    115 
    116    Revision 1.10  1999/07/07 05:49:35  sjboddie
    117    had another crack at the format string code - created a new formattools
    118    module. It can now handle {If} and {Or} statements although there's a
    119    bug preventing nested if's and or's.
    120 
    121    Revision 1.9  1999/07/01 22:48:46  sjboddie
    122    had a go at getting a query result format string working
    123 
    124    Revision 1.8  1999/06/27 22:02:11  sjboddie
    125    author is added  to queryresults if there is one
    126 
    127    Revision 1.7  1999/06/26 01:10:18  rjmcnab
    128    Made h, i, and n arguments saved in the compressed arguments.
    129 
    130    Revision 1.6  1999/06/24 05:12:25  sjboddie
    131    lots of small changes
    132 
    133    Revision 1.5  1999/06/16 04:03:48  sjboddie
    134    Now sets "cl" arg to "search" when going to a document from a search
    135    results page. This allows the close book icon (in hierarchy toc) to
    136    take you back to the results page if that's where you came from.
    137    If you got to the document page somehow other than from a
    138    classification or a search (i.e. if "cl" isn't set) then the close
    139    book icon is disabled
    140 
    141    Revision 1.4  1999/06/16 02:08:38  sjboddie
    142    got queryaction working
    143 
    144    Revision 1.3  1999/03/25 03:06:45  sjboddie
    145 
    146    altered receptionist slightly so it now passes *collectproto to
    147    define_internal_macros and define_external_macros - need it
    148    for browseaction
    149 
    150    Revision 1.2  1999/03/03 20:26:50  rjmcnab
    151 
    152    Modified stuff.
    153 
    154    Revision 1.1  1999/02/28 22:45:21  rjmcnab
    155 
    156    Initial revision.
    157 
    158  */
    159 
    16025
    16126#include "queryaction.h"
     
    18146queryaction::queryaction () {
    18247
     48  recpt = NULL;
    18349  num_phrases = 0;
    18450
     
    397263  arg_ainfo.defaultstatus = cgiarginfo::weak;
    398264  arg_ainfo.argdefault = "1";
     265  arg_ainfo.savedarginfo = cgiarginfo::must;
     266  argsinfo.addarginfo (NULL, arg_ainfo);
     267
     268
     269  // new arg for granularity, for mgpp collections
     270  arg_ainfo.shortname = "g";
     271  arg_ainfo.longname = "granularity";
     272  arg_ainfo.multiplechar = true;
     273  arg_ainfo.defaultstatus = cgiarginfo::weak;
     274  arg_ainfo.argdefault = "Document";
    399275  arg_ainfo.savedarginfo = cgiarginfo::must;
    400276  argsinfo.addarginfo (NULL, arg_ainfo);
     
    615491    it = response.filterOptions.find ("CombineQuery");
    616492    if (it != end) set_option_macro ("cq2", args["cq2"], (*it).second, disp);
     493
     494    // _gselection_ (Level) // for mgpp collections
     495    it = response.filterOptions.find("Level");
     496    if (it!=end) set_option_macro("g", args["g"], (*it).second, disp);
    617497
    618498    // define_history_macros(disp, args, protos, logout);
     
    699579                  ostream &textout, ostream &logout) {
    700580
    701   ColInfoResponse_t cinfo;
     581  ColInfoResponse_t *cinfo = NULL;
    702582  comerror_t err;
    703583  InfoFilterOptionsResponse_t fresponse;
     
    741621    while (collist_here != collist_end) {
    742622     
    743       (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout);
     623      cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout);
    744624      //      if (err == noError && cinfo.isPublic && (cinfo.buildDate > 0)) {
    745       if (err == noError && (cinfo.buildDate > 0)) {
     625      if (cinfo != NULL && (cinfo->buildDate > 0)) {
    746626       
    747627        (*rprotolist_here).p->get_filteroptions (*collist_here, frequest, fresponse, err, logout);
     
    793673              << " name=cc value=\"" << *collist_here << "\">";
    794674         
    795           if (!cinfo.collectionmeta["collectionname"].empty())
    796         textout << outconvert << disp << cinfo.collectionmeta["collectionname"];
     675          if (!cinfo->collectionmeta["collectionname"].empty())
     676        textout << outconvert << disp << cinfo->collectionmeta["collectionname"];
    797677          else
    798678        textout << outconvert << *collist_here;
     
    820700                 ostream &logout) {
    821701 
     702  if (recpt == NULL) {
     703    logout << "ERROR (queryaction::do_action): This action does not contain information\n"
     704       << "      about any receptionists. The method set_receptionist was probably\n"
     705       << "      not called from the module which instantiated this action.\n";
     706    return true;
     707  }
     708
     709
    822710  if (args["ccs"] == "1") {
    823711    if (!args["cc"].empty()) {
     
    870758  map<text_t, colinfo_t, lttext_t> colinfomap;
    871759
    872   ColInfoResponse_t cinfo;
     760  ColInfoResponse_t *cinfo = NULL;
    873761  comerror_t err;
    874762  FilterRequest_t request;
     
    910798      continue;
    911799    }
    912     collectproto->get_collectinfo (*col_here, cinfo, err, logout);
     800    cinfo = recpt->get_collectinfo_ptr (collectproto, *col_here, logout);
     801    if (cinfo == NULL) {
     802      logout << "ERROR (query_action::search_multiple_collections): get_collectinfo_ptr returned NULL\n";
     803      col_here ++;
     804      continue;
     805    }
    913806   
    914807    browserclass *bptr = browsers->getbrowser (browsertype);
     
    917810    text_t formatstring;
    918811    if (!get_formatstring (classification, browsertype,
    919                cinfo.format, formatstring))
     812               cinfo->format, formatstring))
    920813      formatstring = bptr->get_default_formatstring();
    921814
     
    1073966  text_t classification = "Search";
    1074967
    1075   ColInfoResponse_t cinfo;
    1076968  comerror_t err;
    1077   collectproto->get_collectinfo (collection, cinfo, err, logout);
     969  ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr (collectproto, collection, logout);
     970
     971  if (cinfo == NULL) {
     972    logout << "ERROR (query_action::search_single_collection): get_collectinfo_ptr returned NULL\n";
     973    return false;
     974  }
    1078975   
    1079976  browserclass *bptr = browsers->getbrowser (browsertype);
     
    1082979  text_t formatstring;
    1083980  if (!get_formatstring (classification, browsertype,
    1084              cinfo.format, formatstring))
     981             cinfo->format, formatstring))
    1085982    formatstring = bptr->get_default_formatstring();
    1086983
     
    1097994  text_t formattedstring = args["q"];
    1098995  if (!combine_query (args["z"], formattedstring, gsdlhome)) {
    1099     args["q"]=formattedstring;
     996    args["q"]=formattedstring; 
    1100997  }
    1101998
     
    11431040void queryaction::define_query_macros (cgiargsclass &args, displayclass &disp,
    11441041                       const FilterResponse_t &response) {
    1145 
    11461042  // set up _freqmsg_ and _quotedquery_ macros
    11471043  text_t freqmsg = "_textfreqmsg1_";
     
    11541050    this_term ++;
    11551051  }
    1156  
    11571052  disp.setmacro ("freqmsg", "query", freqmsg);
    11581053
     
    12071102bool queryaction::save_search_history (cgiargsclass &args, const FilterResponse_t &response)
    12081103{
     1104
    12091105  if (args["q"]=="") return true; // null query, dont save
    12101106  if (args["hs"]=="0") return true; // only save when submit query
     
    12381134
    12391135}
    1240 
    1241 
    1242 
    1243 
    1244 
  • branches/z3950-branch/gsdl/src/recpt/queryaction.h

    r928 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    2725
     
    3230#include "gsdlconf.h"
    3331#include "action.h"
     32#include "receptionist.h"
    3433
    3534struct colinfo_t {
     
    6160
    6261protected:
     62
     63  receptionist *recpt;
     64
    6365  text_t formatstring;
    6466  int num_phrases;
     
    9799  queryaction ();
    98100  virtual ~queryaction () {}
     101
     102  void set_receptionist (receptionist *therecpt) {recpt=therecpt;}
    99103 
    100104  void configure (const text_t &key, const text_tarray &cfgline);
     
    123127
    124128#endif
    125 
    126 
  • branches/z3950-branch/gsdl/src/recpt/querytools.cpp

    r759 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.8  1999/11/01 21:56:12  sjboddie
    31    changes for cross-collection searching - still needs work
    32 
    33    Revision 1.7  1999/09/21 11:32:42  sjboddie
    34    added Maxdocs queryfilter option which may be -1 for 'all'
    35 
    36    Revision 1.6  1999/09/07 04:56:58  sjboddie
    37    added GPL notice
    38 
    39    Revision 1.5  1999/08/25 04:47:55  sjboddie
    40    added advanced search option - other minor changes
    41 
    42    Revision 1.4  1999/07/19 00:16:58  sjboddie
    43    no longer display documents that don't match all phrases in query string
    44 
    45    Revision 1.3  1999/07/16 00:19:02  sjboddie
    46    some changes to the way quoted queries are handled
    47 
    48    Revision 1.2  1999/07/07 06:12:21  rjmcnab
    49    Added ability to combine two independant queries.
    50 
    51    Revision 1.1  1999/06/15 02:24:06  sjboddie
    52    moved do_query from queryaction to new querytools module (as do_action
    53    is also called from documentaction when highlighting text)
    54 
    55  */
    56 
    5725
    5826#include "querytools.h"
     
    9967    option.name = "Language";
    10068    option.value = args["n"];
     69    request.filterOptions.push_back (option);
     70  }
     71 
     72  if (!args["g"].empty()) { // granularity for mgpp
     73    option.name = "Level";
     74    option.value = args["g"];
    10175    request.filterOptions.push_back (option);
    10276  }
     
    163137  option.value = arg_m;
    164138  request.filterOptions.push_back (option);
    165  
     139
    166140  //  option.name = "StartResults";
    167141  //  option.value = args["r"];
     
    238212  }
    239213}
    240 
  • branches/z3950-branch/gsdl/src/recpt/querytools.h

    r759 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/receptionist.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.49  2000/05/04 05:18:46  sjboddie
    31    attempting to get end-user collection building to work under windows
    32 
    33    Revision 1.48  2000/04/14 02:52:06  sjboddie
    34    tidied up error messaging and set up some debugging info to be output
    35    when running library from command line
    36 
    37    Revision 1.47  2000/02/17 22:26:17  sjboddie
    38    set macros for displaying macrons in utf8
    39 
    40    Revision 1.46  2000/02/17 02:34:09  sjboddie
    41    made compressedoptions macro dm_safe - added SCRIPT_NAME to log string
    42 
    43    Revision 1.45  2000/02/03 01:48:52  sjboddie
    44    fixed potential bug in ccscols stuff
    45 
    46    Revision 1.44  2000/01/24 22:53:09  sjboddie
    47    a few small changes to get fastcgi working properly here at Waikato -
    48    hopefully changes will work everywhere ...
    49 
    50    Revision 1.43  1999/12/06 01:14:16  sjboddie
    51    added arabic encoding
    52 
    53    Revision 1.42  1999/12/05 21:21:04  sjboddie
    54    added support for multiple gsdlhomes and gdbmhomes
    55 
    56    Revision 1.41  1999/11/25 21:44:16  sjboddie
    57    fixed bug in logout
    58 
    59    Revision 1.40  1999/11/08 20:26:37  sjboddie
    60    added multiplevalue option to cgiarginfo
    61 
    62    Revision 1.39  1999/11/03 22:49:10  sjboddie
    63    A location url may now contain macros
    64 
    65    Revision 1.38  1999/11/01 21:49:34  sjboddie
    66    changes to arguments of many functions
    67 
    68    Revision 1.37  1999/10/20 03:55:03  sjboddie
    69    yet another problem with calling browserclass
    70    processOID functions correctly
    71 
    72    Revision 1.36  1999/10/19 03:23:44  davidb
    73    Collection building support through web pages
    74    and internal and external link handling for collection documents
    75 
    76    Revision 1.35  1999/10/18 20:07:05  sjboddie
    77    tidied up a few things - moved processing of "hp" argument
    78    to htmlbrowserclass
    79 
    80    Revision 1.34  1999/10/14 23:00:52  sjboddie
    81    finished changes to browsing support
    82 
    83    Revision 1.33  1999/10/10 08:14:10  sjboddie
    84    - metadata now returns mp rather than array
    85    - redesigned browsing support (although it's not finished so
    86    won't currently work ;-)
    87 
    88    Revision 1.32  1999/09/21 11:28:45  sjboddie
    89    tidied up file locking
    90 
    91    Revision 1.31  1999/09/16 21:38:17  sjboddie
    92    added some file locking stuff for logging. Windows still needs to
    93    be done.
    94 
    95    Revision 1.30  1999/09/07 04:56:58  sjboddie
    96    added GPL notice
    97 
    98    Revision 1.29  1999/09/03 10:02:30  rjmcnab
    99    Made the page parameters configurable. Now the page parameters must
    100    correspond to cgi arguments in name and value (ie language=zh should now
    101    be l=zh) which makes things more consistent anyway. Removed a couple of
    102    specialised NZDL page parameters.
    103 
    104    Moved the combining of the cgi arguments so that the receptionist does
    105    all the configuration now.
    106 
    107    Made the macro precedence configurable.
    108 
    109    Made cgi arguments totally configurable. Now any piece of information about
    110    a cgi argument can be configured meaning that cgi arguments can be declared
    111    from the configuration file.
    112 
    113    Removed the argdefault configuration argument. This should now be done
    114    using cgiarg.
    115 
    116    Revision 1.28  1999/09/03 04:39:46  rjmcnab
    117    Made cookies and logs optional (they are turned off by default). To
    118    turn them on put
    119 
    120    usecookies true
    121    logcgiargs true
    122 
    123    in your configuration file.
    124 
    125    Revision 1.27  1999/09/02 00:27:21  rjmcnab
    126    A few small things.
    127 
    128    Revision 1.26  1999/08/25 04:43:06  sjboddie
    129    made FilterRequest_t::docSet an array rather than a set
    130 
    131    Revision 1.25  1999/08/20 00:59:01  sjboddie
    132    -fixed up location redirection
    133    -added some usage logging, also now set a GSDL_UID cookie. Logging
    134    does NOT presently lock the log file while it's in use. That has yet
    135    to be done.
    136 
    137    Revision 1.24  1999/08/13 04:16:42  sjboddie
    138    added some collection-level metadata stuff
    139 
    140    Revision 1.23  1999/08/11 23:28:59  sjboddie
    141    added support for html classifier (i.e. the hp argumant now must be
    142    translated too).
    143 
    144    Revision 1.22  1999/08/10 22:45:21  sjboddie
    145    format option ShowTopPages is now called DocumentTopPages
    146 
    147    Revision 1.21  1999/08/09 04:25:17  sjboddie
    148    moved OID translation stuff from documentaction::define_external_macros
    149    to receptionist
    150 
    151    Revision 1.20  1999/07/30 02:13:09  sjboddie
    152    -added collectinfo argument to some functions
    153    -made some function prototypes virtual
    154 
    155    Revision 1.19  1999/07/15 06:02:05  rjmcnab
    156    Moved the setting of argsinfo into the constructor. Added the configuration
    157    command argdefault (as used by the actions). Added code to output the
    158    correct charset based on the page encoding so that the user does not need
    159    to specify the encoding used for a particular page.
    160 
    161    Revision 1.18  1999/07/11 01:05:20  rjmcnab
    162    Stored origin of cgiarg with argument.
    163 
    164    Revision 1.17  1999/07/10 22:18:26  rjmcnab
    165    Added calls to define_external_cgiargs.
    166 
    167    Revision 1.16  1999/06/27 21:49:03  sjboddie
    168    fixed a couple of version conflicts - tidied up some small things
    169 
    170    Revision 1.15  1999/06/26 01:14:32  rjmcnab
    171    Made a couple of changes to handle different encodings.
    172 
    173    Revision 1.14  1999/06/09 00:08:36  sjboddie
    174    query string macro (_cgiargq_) is now made html safe before being set
    175 
    176    Revision 1.13  1999/06/08 04:29:31  sjboddie
    177    added argsinfo to the call to check_cgiargs to make it easy to set
    178    args to their default if they're found to be screwed up
    179 
    180    Revision 1.12  1999/04/30 01:59:42  sjboddie
    181    lots of stuff - getting documentaction working (documentaction replaces
    182    old browseaction)
    183 
    184    Revision 1.11  1999/03/25 03:06:43  sjboddie
    185 
    186    altered receptionist slightly so it now passes *collectproto to
    187    define_internal_macros and define_external_macros - need it
    188    for browseaction
    189 
    190    Revision 1.10  1999/03/05 03:53:54  sjboddie
    191 
    192    fixed some bugs
    193 
    194    Revision 1.9  1999/02/28 20:00:16  rjmcnab
    195 
    196 
    197    Fixed a few things.
    198 
    199    Revision 1.8  1999/02/25 21:58:59  rjmcnab
    200 
    201    Merged sources.
    202 
    203    Revision 1.7  1999/02/21 22:33:55  rjmcnab
    204 
    205    Lots of stuff :-)
    206 
    207    Revision 1.6  1999/02/11 01:24:05  rjmcnab
    208 
    209    Fixed a few compiler warnings.
    210 
    211    Revision 1.5  1999/02/08 01:28:02  rjmcnab
    212 
    213    Got the receptionist producing something using the statusaction.
    214 
    215    Revision 1.4  1999/02/05 10:42:46  rjmcnab
    216 
    217    Continued working on receptionist
    218 
    219    Revision 1.3  1999/02/04 10:00:56  rjmcnab
    220 
    221    Developed the idea of an "action" and having them define the cgi arguments
    222    which they need and how those cgi arguments function.
    223 
    224    Revision 1.2  1999/02/04 01:17:27  rjmcnab
    225 
    226    Got it outputing something.
    227 
    228 
    229  */
    230 
    23125
    23226#include "receptionist.h"
     
    23933#include <time.h>
    24034#include <stdio.h>
     35#if defined (GSDL_USE_IOS_H)
    24136#include <fstream.h>
     37#else
     38#include <fstream>
     39#endif
    24240
    24341#if defined (__WIN32_)
     
    25250  collectdir.clear();
    25351  httpprefix.clear();
    254   httpimg.clear();
     52  httpimg = "/images";
    25553  gwcgi.clear();
    25654  macrofiles.erase(macrofiles.begin(), macrofiles.end());
     
    27270}
    27371
    274 
     72void collectioninfo_t::clear () {
     73  gsdl_gsdlhome.clear();
     74  gsdl_gdbmhome.clear();
     75
     76  info_loaded = false;
     77  info.clear();
     78}
    27579
    27680receptionist::receptionist () {
     
    789593  utf8outconvertclass text_t2utf8;
    790594  char *lfile = filename.getcstr();
     595
    791596  ofstream log (lfile, ios::app);
    792597 
     
    912717bool receptionist::produce_content (cgiargsclass &args, ostream &contentout,
    913718                    ostream &logout) {
    914  
     719
    915720  // decide on the output conversion class
    916721  text_t &arg_w = args["w"];
     
    1019824  colinfo_tmap::iterator colend = configinfo.collectinfo.end();
    1020825  while (colhere != colend) {
    1021     gsdlmacrodir = filename_cat ((*colhere).second.gsdl_gsdlhome, "macros");
    1022     maindirs.insert (gsdlmacrodir);
     826    if (!((*colhere).second.gsdl_gsdlhome).empty()) {
     827      gsdlmacrodir = filename_cat ((*colhere).second.gsdl_gsdlhome, "macros");
     828      maindirs.insert (gsdlmacrodir);
     829    }
    1023830    colhere ++;
    1024831  }
     
    1103910
    1104911    text_t &arg_c = args["c"];
    1105     ColInfoResponse_t cinfo;
    1106     comerror_t err;
    1107912    recptproto *collectproto = protocols.getrecptproto (arg_c, logout);
    1108     collectproto->get_collectinfo (arg_c, cinfo, err, logout);
    1109 
    1110     if (!cinfo.ccsCols.empty()) {
    1111       args["ccs"] = 1;
    1112       if (args["cc"].empty()) {
    1113     text_tarray::const_iterator col_here = cinfo.ccsCols.begin();
    1114     text_tarray::const_iterator col_end = cinfo.ccsCols.end();
    1115     bool first = true;
    1116     while (col_here != col_end) {
    1117       // make sure it's a valid collection
    1118       if (protocols.getrecptproto (*col_here, logout) != NULL) {
    1119         if (!first) args["cc"].push_back (',');
    1120         args["cc"] += *col_here;
    1121         first = false;
     913    if (collectproto == NULL) {
     914      // oops, this collection isn't valid
     915      outconvertclass text_t2ascii;
     916      logout << text_t2ascii << "ERROR: Invalid collection: " << arg_c << "\n";
     917      args["c"].clear();
     918
     919    } else {
     920
     921      ColInfoResponse_t *cinfo = get_collectinfo_ptr (collectproto, arg_c, logout);
     922
     923      if (cinfo != NULL) {
     924    if (!cinfo->ccsCols.empty()) {
     925      args["ccs"] = 1;
     926      if (args["cc"].empty()) {
     927        text_tarray::const_iterator col_here = cinfo->ccsCols.begin();
     928        text_tarray::const_iterator col_end = cinfo->ccsCols.end();
     929        bool first = true;
     930        while (col_here != col_end) {
     931          // make sure it's a valid collection
     932          if (protocols.getrecptproto (*col_here, logout) != NULL) {
     933        if (!first) args["cc"].push_back (',');
     934        args["cc"] += *col_here;
     935        first = false;
     936          }
     937          col_here ++;
     938        }
    1122939      }
    1123       col_here ++;
    1124940    }
     941      } else {
     942    logout << "ERROR (receptionist::check_mainargs): get_collectinfo_ptr returned NULL\n";
    1125943      }
    1126944    }
     
    12451063  decode_cgi_arg (compressedoptions);
    12461064  disp.setmacro ("decodedcompressedoptions", "Global", dm_safe(compressedoptions));
     1065
     1066#if defined (__WIN32__)
     1067  disp.setmacro ("win32", "Global", "1");
     1068#endif
    12471069
    12481070  // set macron macros if encoding is utf8
     
    13071129  }
    13081130}
     1131
     1132// gets collection info from cache if found or
     1133// calls collection server (and updates cache)
     1134// returns NULL if there's an error
     1135ColInfoResponse_t *receptionist::get_collectinfo_ptr (recptproto *collectproto,
     1136                              const text_t &collection,
     1137                              ostream &logout) {
     1138 
     1139  // check the cache
     1140  colinfo_tmap::iterator it = configinfo.collectinfo.find (collection);
     1141  if ((it != configinfo.collectinfo.end()) && ((*it).second.info_loaded)) {
     1142    // found it
     1143    return &((*it).second.info);
     1144  }
     1145
     1146  // not cached, get info from collection server
     1147  if (collectproto == NULL) {
     1148    logout << "ERROR: receptionist::get_collectinfo_ptr passed null collectproto\n";
     1149    return NULL;
     1150  }
     1151   
     1152  comerror_t err;
     1153  if (it == configinfo.collectinfo.end()) {
     1154    collectioninfo_t cinfo;
     1155    collectproto->get_collectinfo (collection, cinfo.info, err, logout);
     1156    if (err != noError) {
     1157      outconvertclass text_t2ascii;
     1158      logout << text_t2ascii << "ERROR (receptionist::getcollectinfo_ptr): \""
     1159         << get_comerror_string (err) << "\"while getting collectinfo\n";
     1160      return NULL;
     1161    }
     1162    cinfo.info_loaded = true;
     1163    configinfo.collectinfo[collection] = cinfo;
     1164    return &(configinfo.collectinfo[collection].info);
     1165  } else {
     1166    collectproto->get_collectinfo (collection, (*it).second.info, err, logout);
     1167    if (err != noError) {
     1168      outconvertclass text_t2ascii;
     1169      logout << text_t2ascii << "ERROR (receptionist::getcollectinfo_ptr): \""
     1170         << get_comerror_string (err) << "\"while getting collectinfo\n";
     1171      return NULL;
     1172    }
     1173    (*it).second.info_loaded = true;
     1174    return &((*it).second.info);
     1175  }
     1176}
  • branches/z3950-branch/gsdl/src/recpt/receptionist.h

    r864 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    2725
     
    3432#include "cgiargs.h"
    3533#include "display.h"
    36 #include "action.h"
    3734#include "browserclass.h"
    3835#include "recptproto.h"
    3936#include "converter.h"
    4037#include "cfgread.h"
     38#include "action.h"
    4139
    4240// the MACROPRECEDENCE macro is used as a default. override
     
    5149
    5250
     51struct collectioninfo_t {
     52  void clear ();
     53  collectioninfo_t () {clear();}
     54
     55  text_t gsdl_gsdlhome;
     56  text_t gsdl_gdbmhome;
     57
     58  bool info_loaded;
     59  ColInfoResponse_t info;
     60};
     61
     62typedef map<text_t, collectioninfo_t, lttext_t> colinfo_tmap;
     63
     64
    5365struct recptconf {
    5466  text_t gsdlhome;
     
    5870  colinfo_tmap collectinfo;
    5971  text_t httpprefix;
    60   text_t httpimg;
     72  text_t httpimg;    // will equal /images if not set
    6173  text_t gwcgi;
    6274  text_tset macrofiles;
     
    7183  recptconf () {clear();}
    7284};
    73 
    7485
    7586class receptionist {
     
    196207  // list. This can be used to save preferences between sessions.
    197208  text_t get_compressed_arg (cgiargsclass &args, ostream &logout);
     209
     210  // gets collection info from cache if found or
     211  // calls collection server (and updates cache)
     212  // returns NULL if there's an error
     213  ColInfoResponse_t *get_collectinfo_ptr (recptproto *collectproto,
     214                      const text_t &collection,
     215                      ostream &logout);
     216
    198217 
    199218protected:
  • branches/z3950-branch/gsdl/src/recpt/recptconfig.cpp

    r1090 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.8  2000/04/14 03:10:35  sjboddie
    31    tidied up a few issues concerning the new debug info which showed
    32    up on windows
    33 
    34    Revision 1.7  2000/04/14 02:52:06  sjboddie
    35    tidied up error messaging and set up some debugging info to be output
    36    when running library from command line
    37 
    38    Revision 1.6  2000/02/21 21:55:33  sjboddie
    39    gsdlhome now comes from gsdlsite.cfg
    40 
    41    Revision 1.5  1999/09/07 04:56:59  sjboddie
    42    added GPL notice
    43 
    44    Revision 1.4  1999/09/07 00:09:31  sjboddie
    45    now reads in both main.cfg and collect.cfg always
    46 
    47    Revision 1.3  1999/02/21 22:33:57  rjmcnab
    48 
    49    Lots of stuff :-)
    50 
    51    Revision 1.2  1999/02/08 01:28:04  rjmcnab
    52 
    53    Got the receptionist producing something using the statusaction.
    54 
    55    Revision 1.1  1999/02/05 06:50:32  rjmcnab
    56 
    57    Initial revision.
    58 
    59  */
    60 
    6125
    6226#include "recptconfig.h"
     
    8751  text_tarray cfgline;
    8852  text_t key;
     53
     54#ifdef GSDL_USE_IOS_H
    8955  ifstream confin ("gsdlsite.cfg", ios::in | ios::nocreate);
     56#else
     57  ifstream confin ("gsdlsite.cfg", ios::in);
     58#endif
    9059
    9160  if (confin) {
     
    12291  text_tarray cfgline;
    12392  text_t key;
     93
     94#ifdef GSDL_USE_IOS_H
    12495  ifstream confin ("gsdlsite.cfg", ios::in | ios::nocreate);
     96#else
     97  ifstream confin ("gsdlsite.cfg", ios::in);
     98#endif
    12599
    126100  if (confin) {
     
    153127  if (file_exists (filename)) {
    154128    char *cstr = filename.getcstr();
     129   
     130#ifdef GSDL_USE_IOS_H
    155131    ifstream confin (cstr, ios::in | ios::nocreate);
     132#else
     133    ifstream confin (cstr, ios::in);
     134#endif
     135
    156136    delete cstr;
    157137 
     
    186166    if (!filename.empty()) {
    187167      char *cstr = filename.getcstr();
     168
     169#ifdef GSDL_USE_IOS_H
    188170      ifstream confin (cstr, ios::in | ios::nocreate);
     171#else
     172      ifstream confin (cstr, ios::in);
     173#endif
     174     
    189175      delete cstr;
    190176     
  • branches/z3950-branch/gsdl/src/recpt/recptconfig.h

    r963 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/recptmain.cpp

    r533 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.3  1999/09/07 04:56:59  sjboddie
    31    added GPL notice
    32 
    33    Revision 1.2  1999/02/21 22:33:58  rjmcnab
    34 
    35    Lots of stuff :-)
    36 
    37    Revision 1.1  1999/02/04 01:16:18  rjmcnab
    38 
    39    Initial revision.
    40 
    41  */
    42 
    4325
    4426#include "receptionist.h"
     
    5133  return 0;
    5234}
    53 
  • branches/z3950-branch/gsdl/src/recpt/recptproto.cpp

    r533 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.7  1999/09/07 04:56:59  sjboddie
    31    added GPL notice
    32 
    33    Revision 1.6  1999/05/10 03:40:43  sjboddie
    34    lots of changes - slowly getting document action sorted out
    35 
    36    Revision 1.5  1999/04/30 01:59:43  sjboddie
    37    lots of stuff - getting documentaction working (documentaction replaces
    38    old browseaction)
    39 
    40    Revision 1.4  1999/03/31 23:44:48  rjmcnab
    41    Altered the protocol so that the metadata is part of the filter.
    42 
    43    Revision 1.3  1999/03/03 23:26:35  sjboddie
    44 
    45    Implemented more of the protocol
    46 
    47    Revision 1.2  1999/02/25 21:59:01  rjmcnab
    48 
    49    Merged sources.
    50 
    51    Revision 1.1  1999/02/21 22:35:24  rjmcnab
    52 
    53    Initial revision.
    54 
    55  */
    56 
    5725
    5826#include "recptproto.h"
     
    182150  return NULL;
    183151}
    184 
  • branches/z3950-branch/gsdl/src/recpt/recptproto.h

    r722 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/statusaction.cpp

    r1129 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.26  2000/04/19 22:30:23  sjboddie
    31    tidied up status pages and end-user collection building
    32 
    33    Revision 1.25  2000/02/29 21:00:31  sjboddie
    34    fixed some compiler warnings
    35 
    36    Revision 1.24  1999/12/06 01:13:02  sjboddie
    37    macrofiles is now a set to allow for multiple gsdlhomes
    38 
    39    Revision 1.23  1999/11/09 02:26:20  sjboddie
    40    added some new(ish) options
    41 
    42    Revision 1.22  1999/11/01 21:55:27  sjboddie
    43    changes to arguments of many functions
    44 
    45    Revision 1.21  1999/10/19 03:23:46  davidb
    46    Collection building support through web pages
    47    and internal and external link handling for collection documents
    48 
    49    Revision 1.20  1999/10/18 20:10:41  sjboddie
    50    don't want to use authentication to reach status page (usersaction still
    51    uses authentication)
    52 
    53    Revision 1.19  1999/09/07 23:09:40  rjmcnab
    54    removed some compiler warnings
    55 
    56    Revision 1.18  1999/09/07 04:57:00  sjboddie
    57    added GPL notice
    58 
    59    Revision 1.17  1999/09/03 09:53:46  rjmcnab
    60    Output more configuration options for the receptionist.
    61 
    62    Revision 1.16  1999/09/02 00:28:42  rjmcnab
    63    removed dependancy on GSDL_GSDLHOME
    64 
    65    Revision 1.15  1999/07/30 02:24:42  sjboddie
    66    added collectinfo argument to some functions
    67 
    68    Revision 1.14  1999/07/13 23:26:07  rjmcnab
    69    Added support for authenaction and usersaction
    70 
    71    Revision 1.13  1999/06/08 04:29:39  sjboddie
    72    added argsinfo to the call to check_cgiargs to make it easy to set
    73    args to their default if they're found to be screwed up
    74 
    75    Revision 1.12  1999/04/06 22:20:35  rjmcnab
    76    Got browsefilter working.
    77 
    78    Revision 1.11  1999/03/31 23:44:49  rjmcnab
    79    Altered the protocol so that the metadata is part of the filter.
    80 
    81    Revision 1.10  1999/03/16 04:47:03  rjmcnab
    82    Changed the list of arguments on the argument page to be the info list
    83    not the current args list (there are some arguments which don't have
    84    a default so they never make it onto the args list).
    85 
    86    Revision 1.9  1999/03/11 01:26:02  rjmcnab
    87    Fixed a few small formatting things.
    88 
    89    Revision 1.8  1999/03/11 00:12:30  rjmcnab
    90    Started using status.dm to handle the bulky text. Made the status
    91    action use frames and added some more information.
    92 
    93    Revision 1.7  1999/03/09 21:00:47  rjmcnab
    94    Reorganised the statusaction, added more functions to comtypes.
    95 
    96    Revision 1.6  1999/02/25 21:59:02  rjmcnab
    97 
    98    Merged sources.
    99 
    100    Revision 1.5  1999/02/21 22:33:58  rjmcnab
    101 
    102    Lots of stuff :-)
    103 
    104    Revision 1.4  1999/02/12 02:40:18  sjboddie
    105 
    106    Added page action
    107 
    108    Revision 1.3  1999/02/11 23:07:00  sjboddie
    109 
    110    extended the status action
    111 
    112    Revision 1.2  1999/02/11 01:24:06  rjmcnab
    113 
    114    Fixed a few compiler warnings.
    115 
    116    Revision 1.1  1999/02/11 01:01:27  rjmcnab
    117 
    118    Initial revision.
    119 
    120  */
    121 
    12225
    12326#include "statusaction.h"
     
    14447                   displayclass &disp, outconvertclass &outconvert,
    14548                   ostream &textout, ostream &logout) {
     49
     50  if (recpt == NULL) return;
    14651
    14752  textout << outconvert << disp
     
    17580            << "</a></td>";
    17681
    177       ColInfoResponse_t cinfo;
    178       (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout);
    179       if (err == noError) {
     82      ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout);
     83      if (cinfo != NULL) {
    18084        text_t collname = *collist_here;
    181         text_tmap::iterator it = cinfo.collectionmeta.find("collectionname");
    182         if (it != cinfo.collectionmeta.end()) collname = (*it).second;
     85        text_tmap::iterator it = cinfo->collectionmeta.find("collectionname");
     86        if (it != cinfo->collectionmeta.end()) collname = (*it).second;
    18387
    18488        textout << "<td>";
    185         if (cinfo.buildDate > 0)
     89        if (cinfo->buildDate > 0)
    18690          textout << outconvert << disp
    18791              << "<a href=\"_httppagex_(about)&c=" << *collist_here
    188               << "\" target=_top>";
     92              << "\" target=\\_top>";
    18993
    19094        textout << outconvert << disp << collname;
    19195
    192         if (cinfo.buildDate > 0) textout << "</a>";
     96        if (cinfo->buildDate > 0) textout << "</a>";
    19397
    19498        textout << "</td>";
    19599
    196         if (cinfo.isPublic) textout << "<td>yes</td>";
     100        if (cinfo->isPublic) textout << "<td>yes</td>";
    197101        else textout << "<td>no</td>";
    198102       
    199         if (cinfo.buildDate > 0)
     103        if (cinfo->buildDate > 0)
    200104          textout << outconvert << "<td>yes</td>";
    201105        else
     
    328232  }
    329233 
     234  // browsers
     235  browsermapclass *browsers = recpt->get_browsermap_ptr();
     236  if (browsers != NULL) {
     237    textout << outconvert << "<tr valign=top><th>browsers</th><td>";
     238   
     239    browserptrmap::iterator browsershere = browsers->begin ();
     240    browserptrmap::iterator browsersend = browsers->end ();
     241    bool browsersfirst = true;
     242    while (browsershere != browsersend) {
     243      if (!browsersfirst) textout << outconvert << ", ";
     244      browsersfirst = false;
     245      assert ((*browsershere).second.b != NULL);
     246      if ((*browsershere).second.b != NULL) {
     247    textout << outconvert << "\"" << (*browsershere).second.b->get_browser_name() << "\"";
     248      }
     249      browsershere++;
     250    }
     251   
     252    textout << outconvert << "</td></tr>\n";
     253  }
     254
    330255  // protocols
    331256  recptprotolistclass *protocols = recpt->get_recptprotolist_ptr ();
     
    471396}
    472397
     398void statusaction::output_browserinfo (cgiargsclass &/*args*/, displayclass &disp,
     399                       outconvertclass &outconvert,
     400                       ostream &textout, ostream &/*logout*/) {
     401  if (recpt == NULL) return;
     402  browsermapclass *browsers = recpt->get_browsermap_ptr();
     403
     404  textout << outconvert << disp << "_status:infoheader_(Browser Information)\n";
     405  textout << outconvert
     406      << "<h2>Browser information</h2>\n"
     407      << "<table>";
     408
     409  // browser information
     410  if (browsers != NULL) {
     411    textout << outconvert
     412        << "<tr><th>browser name</th><th>default formatstring</th></tr>\n";
     413   
     414    browserptrmap::iterator browsershere = browsers->begin ();
     415    browserptrmap::iterator browsersend = browsers->end ();
     416    while (browsershere != browsersend) {
     417      assert ((*browsershere).second.b != NULL);
     418      if ((*browsershere).second.b != NULL) {
     419    textout << outconvert
     420        << "<tr><td>" << (*browsershere).second.b->get_browser_name()
     421        << "</td><td>" << html_safe ((*browsershere).second.b->get_default_formatstring())
     422        << "</td></tr>\n";
     423      }
     424      browsershere++;
     425    }
     426  }
     427 
     428  textout << outconvert << disp << "</table>\n_status:infofooter_\n";
     429}
     430
    473431void statusaction::output_protocolinfo (cgiargsclass &/*args*/, displayclass &disp,
    474432                    outconvertclass &outconvert,
     
    584542  } else {
    585543    // rproto can't be NULL to get here
    586     ColInfoResponse_t collectinfo;
    587     comerror_t err;
    588 
    589     rproto->get_collectinfo (arg_c, collectinfo, err, logout);
    590     if (err == noError) {
     544    ColInfoResponse_t *collectinfo = recpt->get_collectinfo_ptr (rproto, arg_c, logout);
     545    if (collectinfo != NULL) {
    591546      textout << outconvert << "<table>\n"
    592547          << "<tr><th>collection name</th><td>\""
    593           << collectinfo.shortInfo.name
     548          << collectinfo->shortInfo.name
    594549          << "\"</td></tr>\n"
    595550
    596551          << "<tr><th>host</th><td>\""
    597           << collectinfo.shortInfo.host
     552          << collectinfo->shortInfo.host
    598553          << "\"</td></tr>\n"
    599554
    600555          << "<tr><th>port</th><td>\""
    601           << collectinfo.shortInfo.port
     556          << collectinfo->shortInfo.port
    602557          << "\"</td></tr>\n"
    603558
    604559          << "<tr><th>is public?</th><td>";
    605       if (collectinfo.isPublic) textout << outconvert << "true";
     560      if (collectinfo->isPublic) textout << outconvert << "true";
    606561      else textout << outconvert << "false";
    607562      textout << outconvert
     
    609564
    610565          << "<tr><th>is beta?</th><td>";
    611       if (collectinfo.isBeta) textout << outconvert << "true";
     566      if (collectinfo->isBeta) textout << outconvert << "true";
    612567      else textout << outconvert << "false";
    613568      textout << outconvert
     
    615570
    616571          << "<tr><th>build date</th><td>\""
    617           << collectinfo.buildDate
     572          << collectinfo->buildDate
    618573          << "\"</td></tr>\n"
    619574
    620575          << "<tr><th>interface languages</th><td>";
    621       text_tarray::iterator languages_here = collectinfo.languages.begin();
    622       text_tarray::iterator languages_end = collectinfo.languages.end();
     576      text_tarray::iterator languages_here = collectinfo->languages.begin();
     577      text_tarray::iterator languages_end = collectinfo->languages.end();
    623578      bool languages_first = true;
    624579      while (languages_here != languages_end) {
     
    630585
    631586      textout << "<tr><th valign=top>collection metadata</th><td><table>\n";
    632       text_tmap::iterator meta_here = collectinfo.collectionmeta.begin();
    633       text_tmap::iterator meta_end = collectinfo.collectionmeta.end();
     587      text_tmap::iterator meta_here = collectinfo->collectionmeta.begin();
     588      text_tmap::iterator meta_end = collectinfo->collectionmeta.end();
    634589      while (meta_here != meta_end) {
    635590    textout << outconvert << "<tr><td>" << (*meta_here).first
     
    640595
    641596      textout << "<tr><th valign=top>format info</th><td><table>\n";
    642       text_tmap::iterator format_here = collectinfo.format.begin();
    643       text_tmap::iterator format_end = collectinfo.format.end();
     597      text_tmap::iterator format_here = collectinfo->format.begin();
     598      text_tmap::iterator format_end = collectinfo->format.end();
    644599      while (format_here != format_end) {
    645600    textout << outconvert << "<tr><td>" << (*format_here).first
     
    650605
    651606      textout << "<tr><th valign=top>building info</th><td><table>\n";
    652       text_tmap::iterator building_here = collectinfo.building.begin();
    653       text_tmap::iterator building_end = collectinfo.building.end();
     607      text_tmap::iterator building_here = collectinfo->building.begin();
     608      text_tmap::iterator building_end = collectinfo->building.end();
    654609      while (building_here != building_end) {
    655610    textout << outconvert << "<tr><td>" << (*building_here).first
     
    663618
    664619          << "<tr><th>number of documents</th><td>\""
    665           << collectinfo.numDocs
     620          << collectinfo->numDocs
    666621          << "\"</td></tr>\n"
    667622
     623          << "<tr><th>number of sections</th><td>\""
     624          << collectinfo->numSections
     625          << "\"</td></tr>\n"
     626
    668627          << "<tr><th>number of words</th><td>\""
    669           << collectinfo.numWords
     628          << collectinfo->numWords
    670629          << "\"</td></tr>\n"
    671630
    672631          << "<tr><th>number of bytes</th><td>\""
    673           << collectinfo.numBytes
     632          << collectinfo->numBytes
    674633          << "\"</td></tr>\n"
    675634
    676635          << "<tr><th>preferred receptionist</th><td>\""
    677           << collectinfo.receptionist
     636          << collectinfo->receptionist
    678637          << "\"</td></tr>\n"
    679638
     
    681640     
    682641    } else {
    683       textout << outconvert << "Error (" << get_comerror_string (err)
    684           << ") while getting collect information\n";
     642      textout << "ERROR (statusaction::output_collectioninfo): while getting collect information\n";
    685643    }
    686644
     
    689647    InfoFilterOptionsRequest_t filteroptions_request;
    690648    InfoFilterOptionsResponse_t filteroptions;
     649    comerror_t err;
    691650    rproto->get_filterinfo (arg_c, filterinfo, err, logout);
    692651    if (err == noError) {
     
    794753  textout << outconvert << "<h2>Init log</h2>\n";
    795754
     755#ifdef GSDL_USE_IOS_H
    796756  ifstream initin (cinitfilename, ios::in | ios::nocreate);
     757#else
     758  ifstream initin (cinitfilename, ios::in);
     759#endif
     760
    797761  delete cinitfilename;
    798762  if (initin) {
     
    834798  logout << flush;
    835799
     800#ifdef GSDL_USE_IOS_H
    836801  ifstream errin (cerrfilename, ios::in | ios::nocreate);
     802#else
     803  ifstream errin (cerrfilename, ios::in);
     804#endif
     805
    837806  delete cerrfilename;
    838807  if (errin) {
     
    974943  else if (arg_sp == "argumentinfo") output_argumentinfo (args, disp, outconvert, textout, logout);
    975944  else if (arg_sp == "actioninfo") output_actioninfo (args, disp, outconvert, textout, logout);
     945  else if (arg_sp == "browserinfo") output_browserinfo (args, disp, outconvert, textout, logout);
    976946  else if (arg_sp == "protocolinfo") output_protocolinfo (args, disp, outconvert, textout, logout);
    977947  else if (arg_sp == "collectioninfo") output_collectioninfo (args, disp, outconvert, textout, logout);
     
    996966  }
    997967}
    998 
  • branches/z3950-branch/gsdl/src/recpt/statusaction.h

    r1129 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
     
    6462              outconvertclass &outconvert,
    6563              ostream &textout, ostream &logout);
     64
     65  void output_browserinfo (cgiargsclass &args, displayclass &disp,
     66               outconvertclass &outconvert,
     67               ostream &textout, ostream &logout);
    6668
    6769  void output_protocolinfo (cgiargsclass &args, displayclass &disp,
  • branches/z3950-branch/gsdl/src/recpt/tipaction.cpp

    r760 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.6  1999/11/01 21:54:57  sjboddie
    31    changes to arguments of many functions
    32 
    33    Revision 1.5  1999/09/07 23:10:18  rjmcnab
    34    removed some compiler warnings
    35 
    36    Revision 1.4  1999/09/07 04:57:00  sjboddie
    37    added GPL notice
    38 
    39    Revision 1.3  1999/09/02 00:29:27  rjmcnab
    40    added cgi argument "st" - show tips
    41 
    42    Revision 1.2  1999/07/30 02:24:45  sjboddie
    43    added collectinfo argument to some functions
    44 
    45    Revision 1.1  1999/07/09 02:18:27  rjmcnab
    46    Initial revision.
    47 
    48 
    49  */
    50 
    5125
    5226#include "tipaction.h"
     
    9165  }
    9266}
    93 
  • branches/z3950-branch/gsdl/src/recpt/tipaction.h

    r760 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/userdb.cpp

    r1000 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.6  2000/03/01 22:23:09  sjboddie
    31    tidied up windows installation
    32 
    33    Revision 1.5  2000/02/29 21:53:09  sjboddie
    34    tidied up crypt includes
    35 
    36    Revision 1.4  1999/09/07 04:57:00  sjboddie
    37    added GPL notice
    38 
    39    Revision 1.3  1999/09/02 00:30:04  rjmcnab
    40    added option for specifying whether the gdbm database should be locked
    41 
    42    Revision 1.2  1999/07/14 08:30:01  rjmcnab
    43    fixed an error to do with the way time is dealt with on different machines.
    44    It seems that there is no direct corresponding function to mktime and
    45    localtime or gmtime might not get you back to where you started.
    46 
    47    Revision 1.1  1999/07/13 23:22:04  rjmcnab
    48    Initial revision.
    49 
    50  */
    5125
    5226#include "gsdlconf.h"
     
    187161      userinfo.password = crypt_text("admin");
    188162      userinfo.enabled = true;
    189       userinfo.groups = "administrator";
     163      userinfo.groups = "administrator,colbuilder";
    190164      userinfo.comment = "change the password for this account as soon as possible";
    191165      return set_user_info (userdbfile, username, userinfo);
  • branches/z3950-branch/gsdl/src/recpt/userdb.h

    r533 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/usersaction.cpp

    r760 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.7  1999/11/01 21:48:27  sjboddie
    31    changes to arguments of many functions
    32 
    33    Revision 1.6  1999/09/08 03:44:24  cs025
    34    Added a cast to (char *) of (..:..?..) on output to avoid type
    35    error at compile time.
    36 
    37    Revision 1.5  1999/09/07 23:12:34  rjmcnab
    38    removed some compiler warnings
    39 
    40    Revision 1.4  1999/09/07 04:57:01  sjboddie
    41    added GPL notice
    42 
    43    Revision 1.3  1999/09/02 00:30:56  rjmcnab
    44    added option for specifying whether the gdbm database should be locked
    45 
    46    Revision 1.2  1999/07/30 02:24:44  sjboddie
    47    added collectinfo argument to some functions
    48 
    49    Revision 1.1  1999/07/13 23:22:05  rjmcnab
    50    Initial revision.
    51 
    52 
    53  */
    54 
    5525
    5626#include "usersaction.h"
     
    442412  return true;
    443413}
    444 
  • branches/z3950-branch/gsdl/src/recpt/usersaction.h

    r760 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/vlistbrowserclass.cpp

    r1048 r1342  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    2323 *
    24  * $Id$
    25  *
    2624 *********************************************************************/
    27 
    28 /*
    29    $Log$
    30    Revision 1.8  2000/03/31 03:04:32  nzdl
    31    tidied up some of the browsing code - replaced DocumentImages,
    32    DocumentTitles and DocumentHeading with DocumentIcon
    33 
    34    Revision 1.7  2000/02/17 02:33:09  sjboddie
    35    minor tidy up - made some function definitions virtual
    36 
    37    Revision 1.6  1999/12/13 02:44:23  davidb
    38    Better protection when accessing "haschildren"
    39 
    40    Revision 1.5  1999/10/30 23:01:24  sjboddie
    41    tidied things up slightly
    42 
    43    Revision 1.4  1999/10/30 22:14:44  sjboddie
    44    added a collection argument
    45 
    46    Revision 1.3  1999/10/19 08:40:13  sjboddie
    47    fixed some stupid compiler warnings on windows
    48 
    49    Revision 1.2  1999/10/14 22:59:34  sjboddie
    50    finished off browser classes
    51 
    52    Revision 1.1  1999/10/10 08:14:11  sjboddie
    53    - metadata now returns mp rather than array
    54    - redesigned browsing support (although it's not finished so
    55    won't currently work ;-)
    56 
    57  */
    58 
    5925
    6026#include "vlistbrowserclass.h"
  • branches/z3950-branch/gsdl/src/recpt/vlistbrowserclass.h

    r934 r1342  
    2121 * along with this program; if not, write to the Free Software
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    23  *
    24  * $Id$
    2523 *
    2624 *********************************************************************/
  • branches/z3950-branch/gsdl/src/recpt/z3950proto.cpp

    r1191 r1342  
    1 
    2 #ifndef Z3950PROTO_H
    3 #define Z3050PROTO_H
     1/**********************************************************************
     2 *
     3 * z3950proto.cpp --
     4 * Copyright (C) 2000  The New Zealand Digital Library Project
     5 *
     6 * A component of the Greenstone digital library software
     7 * from the New Zealand Digital Library Project at the
     8 * University of Waikato, New Zealand.
     9 *
     10 * This program is free software; you can redistribute it and/or modify
     11 * it under the terms of the GNU General Public License as published by
     12 * the Free Software Foundation; either version 2 of the License, or
     13 * (at your option) any later version.
     14 *
     15 * This program is distributed in the hope that it will be useful,
     16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18 * GNU General Public License for more details.
     19 *
     20 * You should have received a copy of the GNU General Public License
     21 * along with this program; if not, write to the Free Software
     22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     23 *
     24 *********************************************************************/
    425
    526#include "z3950proto.h"
     
    200221  }
    201222
    202   // is this right? ie does end refer to the last element, or AFTER the
    203   // last element?
    204223  if (here==end) {
    205224    err=protocolError;
     
    230249  //  collectinfo.collectionmeta; // text_tmap
    231250  collectinfo.collectionmeta=*((*here)->getMeta());
    232   /* collectinfo.format; //text_tmap
    233     collectinfo.building; //text_tmap
    234   */
     251  collectinfo.format=*((*here)->getFormat()); //text_tmap
     252  /*    collectinfo.building; //text_tmap  */
    235253
    236254  ////collectinfo.receptionist="z3950";
     
    299317  // now have collection in zserver.
    300318 
    301   //  ColInfoResponse_t *info = new ColInfoResponse_t;
    302319  ColInfoResponse_t info;
    303320  ResultDocInfo_t *docInfo;
     
    307324
    308325  // See if this is for a query action
    309   /*** johnmcp **** - could check filterName??????? ********/
    310   /*    if (!request.requestParams.empty())
    311     cout << "RequestParams: " << request.requestParams.getcstr() << "\n";
    312     if (!request.refParams.empty())
    313     cout << "RefParams: " << request.refParams.getcstr() << "\n";
    314   */   
    315   /* cout << "filterOptions:\n";
    316      OptionValue_tarray::iterator ov_here=request.filterOptions.begin();
    317      OptionValue_tarray::iterator ov_end=request.filterOptions.end();
    318      while (ov_here != ov_end) {
    319      cout << "OV pair: `" << ov_here->name.getcstr() << "'=`"
    320      << ov_here->value.getcstr() << "'\n";
    321      ov_here++;
    322      }*/
    323  
    324   // fields is type text_tset;
    325   /* cout << "Fields:\n";
    326      text_tset::iterator fields_h=request.fields.begin();
    327      text_tset::iterator fields_e=request.fields.end();
    328      while (fields_h != fields_e) {
    329      cout << "Field: " << fields_h->getcstr() << "\n";
    330      fields_h++;
    331      }*/
    332  
    333 
    334   // if this is true, we assume query action.
    335   //  if (request.filterResultOptions & /*FROID*/FRtermFreq) {
    336326  if (request.filterName=="QueryFilter") {
    337327    /* Sample OptionValue pairs
     
    346336     */
    347337    // go through options
    348     text_t opt_term;
     338    text_t opt_term;            // the term(s) that the user entered
     339    text_t opt_fields;          // which fields to search on
    349340    int opt_start=1, opt_end=20; // default values
    350341    int nummatches=0, maxdocs=50; // default values
     
    354345      //      cout << "OV pair: `" << ov_here->name.getcstr() << "'=`"
    355346      //   << ov_here->value.getcstr() << "'\n";
    356       if (ov_here->name=="Term") {
    357     opt_term=ov_here->value;
    358       } else if (ov_here->name=="StartResults") {
    359     opt_start=ov_here->value.getint();
    360       } else if (ov_here->name=="EndResults") {
    361     opt_end=ov_here->value.getint();
    362       } else if (ov_here->name=="Maxdocs") {
    363     maxdocs=ov_here->value.getint();
    364       }
     347      if (ov_here->name=="Term")
     348    {
     349      opt_term=ov_here->value;
     350    } else if (ov_here->name=="Index")
     351      {
     352        opt_fields=ov_here->value;
     353      } else if (ov_here->name=="StartResults")
     354        {
     355          opt_start=ov_here->value.getint();
     356        } else if (ov_here->name=="EndResults")
     357          {
     358        opt_end=ov_here->value.getint();
     359          } else if (ov_here->name=="Maxdocs")
     360        {
     361          maxdocs=ov_here->value.getint();
     362        }
    365363      ov_here++;
    366364    }
    367365    err=noError;
    368     text_tarray *titles=(*zserver)->getbriefrecords(opt_term,
    369                             opt_start,
     366    text_tarray *titles=(*zserver)->getrecordTitles(opt_term,
     367                            opt_fields,
     368                            opt_start, // first to get
    370369                            opt_end-opt_start, //count
    371370                            &nummatches,err);
     
    375374      docInfo=new ResultDocInfo_t;
    376375      response.docInfo.push_back(*docInfo);
    377       logout << "z3950 filter query: error connecting to server\n";
     376      docInfo->metadata["Title"].values.push_back("Error - query err?");
     377      logout << "\nz3950 filter query: error connecting to server\n";
     378      // for now, DON'T use GSDL protocol err.
     379      err=noError;
    378380      return;
    379381    }
    380382    // check if (titles==NULL) - only happens on error?
    381 
    382     text_tarray::iterator titles_here=titles->begin();
    383     text_tarray::iterator titles_end=titles->end();
    384     int counter=1;
    385     while (titles_here!=titles_end) {
    386      docInfo=new ResultDocInfo_t;
    387       docInfo->metadata["Title"].values.push_back(*titles_here);
    388       docInfo->result_num=counter;
    389       // we need to give some OID, so we'll just use counter for now...
    390       // make it the number into the whole possible retrieved set.
    391       docInfo->OID=counter+opt_start-1;
    392       response.docInfo.push_back(*docInfo);
    393       counter++;
    394       titles_here++;
     383    if (nummatches>0) {
     384      text_tarray::iterator titles_here=titles->begin();
     385      text_tarray::iterator titles_end=titles->end();
     386      int counter=1;
     387      while (titles_here!=titles_end) {
     388    docInfo=new ResultDocInfo_t;
     389    docInfo->metadata["Title"].values.push_back(*titles_here);
     390    docInfo->result_num=counter;
     391    // we need to give some OID, so we'll just use counter for now...
     392    // make it the number into the whole possible retrieved set.
     393    docInfo->OID=counter+opt_start-1;
     394    response.docInfo.push_back(*docInfo);
     395    counter++;
     396    titles_here++;
     397      }
    395398    }
    396399
     
    432435    get_collectinfo (collection, info, err, logout);
    433436    // should check err returned here....
    434     /* In the absence of any other information, (eg commented code),
    435        assuming that if the request.fields is empty, then we should return
    436        all metadata, otherwise return only the requested fields */
    437     /**** comtypes.h has: "text_tset fields;   // empty if not used" ****/
     437
     438    // get the Query out of the filterOptions.
     439    text_t query="";
     440    text_t field="";
     441    OptionValue_tarray::iterator opt_here=request.filterOptions.begin();
     442    OptionValue_tarray::iterator opt_end=request.filterOptions.end();
     443    while (opt_here!=opt_end) {
     444      if (opt_here->name=="Query") {
     445    query=opt_here->value;
     446    if (field!="") break; // break from loop if we've got both
     447      } else if (opt_here->name=="Index") {
     448    field=opt_here->value;
     449    if (query!="") break; // break from loop if we've got both
     450      }
     451      opt_here++;
     452    }
    438453
    439454    if (!request.fields.empty()) {
     
    452467      if (it!=info.collectionmeta.end())
    453468        docs_here->metadata[*fields_here].values.push_back((*it).second);
    454       else if (*fields_here=="Title") {
    455         text_t title;
     469      else if (*fields_here=="Title" && !request.docSet.empty()) {
     470        // We only do this for a document action.
     471        // (This comes through as a NullQuery).
     472        // hopefully docSet is only not empty for documentaction...
     473        text_t doctitle;
    456474        int i;
    457         // check that docSet isn't empty!!!@!!!
     475        // check that docSet isn't empty first!!!!!!
    458476        i=request.docSet[0].getint();
    459477        text_t doctext="unneeded";
    460         (*zserver)->getfullrecord(i, title, doctext,err);
     478        (*zserver)->getfullrecord(query, field, i, doctitle, doctext, err);
    461479        // check err value!
    462         docInfo->metadata["Title"].values.push_back(title);     
     480        docs_here->metadata["Title"].values.push_back(doctitle);       
    463481      } else {
    464482        docs_here->metadata[*fields_here].values.push_back("");
     
    503521
    504522    // do indices' names, regardless of whether asked for or not...
    505     response.docInfo[0].metadata[".author"].values.push_back("author fields");
    506     response.docInfo[0].metadata[".title"].values.push_back("title fields");
    507     response.docInfo[0].metadata[".any"].values.push_back("any fields");
     523    if (!response.docInfo.empty()) {
     524     response.docInfo[0].metadata[".author"].values.push_back("author fields");
     525      response.docInfo[0].metadata[".title"].values.push_back("title fields");
     526      response.docInfo[0].metadata[".any"].values.push_back("any fields");
     527    }
    508528  } //end of  if (... & FRmetadata) ...
    509529}
     
    538558  text_t title="unneeded";
    539559  text_t doctext;
    540   (*zserver)->getfullrecord(request.OID.getint(),title,doctext,err);
     560  text_t query; // this should not be needed, as we have already connected to
     561  // get the  title....
     562  text_t field; // ditto...
     563  (*zserver)->getfullrecord(query,field,request.OID.getint(),
     564                title,doctext,err);
    541565  // check return value of above? (false=>not connected)
    542566  if (err==noError)
     
    554578  }
    555579}
    556 
    557 
    558 #endif
  • branches/z3950-branch/gsdl/src/recpt/z3950proto.h

    r1191 r1342  
     1/**********************************************************************
     2 *
     3 * z3950proto.h --
     4 * Copyright (C) 2000  The New Zealand Digital Library Project
     5 *
     6 * A component of the Greenstone digital library software
     7 * from the New Zealand Digital Library Project at the
     8 * University of Waikato, New Zealand.
     9 *
     10 * This program is free software; you can redistribute it and/or modify
     11 * it under the terms of the GNU General Public License as published by
     12 * the Free Software Foundation; either version 2 of the License, or
     13 * (at your option) any later version.
     14 *
     15 * This program is distributed in the hope that it will be useful,
     16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     18 * GNU General Public License for more details.
     19 *
     20 * You should have received a copy of the GNU General Public License
     21 * along with this program; if not, write to the Free Software
     22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     23 *
     24 *********************************************************************/
    125
    226#ifndef Z3950PROTO_H
    3 #define Z3050PROTO_H
     27#define Z3950PROTO_H
    428
    529#include "recptproto.h"
  • branches/z3950-branch/gsdl/src/recpt/z3950server.cpp

    r1191 r1342  
    1818  // for now, assume that all records will have text associated with them.
    1919  meta["hastxt"]="1";
     20  // for now, assume we don't want ANY DocumentButtons.
     21  format["DocumentButtons"]="";
    2022}
    2123
     
    7476}
    7577
    76 text_tarray *z3950_server::getbriefrecords(const text_t &query,
     78void z3950_server::parseQuery(const text_t &query,
     79                  const text_t &fields,
     80                  text_t &parsed_query) {
     81  /****** FIXME *****/
     82  // We need to format the query string into RPN -
     83  // by just passing it like this, it will only work for simple queries.
     84  // This will require us to actually come up with a query syntax and
     85  // a parser. For now, we'll just do an "AND" query for all terms
     86
     87  // we need to count number of terms separated by a space
     88  char *ptr=query.getcstr();
     89  int strlength=strlen(ptr);
     90  bool inword=false;
     91  int num_terms=0;
     92  for (int i=0;i<strlength;i++) {
     93    if (*(ptr+i)!=' ') {
     94      if (inword==false) {
     95    inword=true;
     96    num_terms++;
     97      }
     98    }
     99    else { // ptr+i is a space
     100      inword=false;
     101      }
     102  }
     103 
     104  // set the field(s) to search on - main ones (that I've found) include:
     105  //  1016  => Any
     106  //  1     => (Personal) Name
     107  //  4     => Title
     108  //  21    => Subject Heading
     109  //  45    => Subject precis
     110  // Note I have no idea how these actually work - I think some servers
     111  // only have limited fields, and map all subject-type requests into that
     112  // subject field, etc.
     113
     114  parsed_query="@attr 1=";
     115  if (fields==".author")
     116    parsed_query+="1 ";
     117  else if (fields==".title")
     118    parsed_query+="4 ";
     119  else // fields==".any"
     120    parsed_query+="1016 ";
     121
     122  // append "@and" for each term after the first
     123  for (int i=1;i<num_terms;i++)
     124    parsed_query+="@and ";
     125  // append the actual query
     126  parsed_query+=query;
     127
     128}
     129
     130text_tarray *z3950_server::getrecordTitles(const text_t &query,
     131                       const text_t &fields,
    77132                       int first, int count,
    78133                       int *nummatches, comerror_t &err) {
     
    83138  titles=new text_tarray;
    84139
     140  /* check if connected */
    85141  if (connected==false)
    86142    if (connect()==false) {
     
    91147 
    92148
    93   // We need to format the query string into RPN -
    94   // by just passing it like this, it will only work for simple queries.
    95   /* check if connected */
    96   /*  titles->push_back("first dummy title");
    97       titles->push_back("Second dummy title");
    98       return titles;
    99   */
     149  text_t expanded_query="";
     150  parseQuery(query,fields,expanded_query);
     151
    100152  // following functions defined in yaz_zclient.c
    101   *nummatches=z_cmd_dosearch(query.getcstr()); // returns # found, -1 on err.
    102   // could just check if (*nummatches)==0.
    103 
     153  *nummatches=z_cmd_dosearch(expanded_query.getcstr()); // returns # found, -1 on err.
     154  if (*nummatches<=0) {
     155    if (*nummatches==0) {
     156      // no matches
     157      return (NULL);
     158    } else  if (*nummatches==-1) {
     159      // prefix query error
     160      err=protocolError;
     161      return (NULL);
     162    }  else if (*nummatches==-2) {
     163      // sendsearchRequest not answered by searchResponse
     164      err=protocolError;
     165      return (NULL);
     166    }
     167  }
    104168  // could do a sort eventually, eg on date, title, etc.
    105169  // (non-existent function)    z_sort(field, asc|desc);
    106170  /* min of (count, first + (*nummatches) ) */
    107   c_str_titles=z_getbriefrecords(first,count);
     171  // z_getrecordTitles ( first, howmany )
     172  c_str_titles=z_getrecordTitles(first,min(count,*nummatches-first+1));
    108173  if (c_str_titles==NULL) {
    109174    // an error occurred. we need a logout/err as an arg
     
    124189}
    125190
    126 bool z3950_server::getfullrecord(const int ID, text_t &rettitle,
    127                 text_t &rettext, comerror_t &err) {
     191bool z3950_server::getfullrecord(const text_t &query, const text_t &fields,
     192                 const int ID,
     193                 text_t &rettitle,
     194                 text_t &rettext, comerror_t &err) {
    128195  if (connected==false) {
    129196    if (connect()==false) {
     
    134201    // since we have just re-connected, we need to do the
    135202    // query again.
     203
     204    text_t expanded_query="";
     205    parseQuery(query,fields,expanded_query);
     206
     207    int returned=z_cmd_dosearch(expanded_query.getcstr());
     208    if (returned<=0) {
     209      // 0 => none.
     210      // <0 => error
     211      err=protocolError;
     212      return (false);
     213    }
    136214  }
    137215
    138216  if (rettitle!="unneeded") {
    139     /*char **c_str_titles;
    140       int dummy;
    141       c_str_titles=z_getbriefrecords("the",ID,1,&dummy); // check this return value.
    142       if (c_str_titles!=NULL && (int)c_str_titles[0]==1) {
     217    char **c_str_titles;
     218    //int dummy;
     219    c_str_titles=z_getrecordTitles(ID,1); // check this return value.
     220    if (c_str_titles!=NULL && (int)c_str_titles[0]==1) {
    143221      rettitle.setcstr(c_str_titles[1]); // and check this
    144222      free (c_str_titles);
    145     */
    146     //    rettitle=(*titles)[ID]; // this isn't quite right, as ID isn't the offset
    147     rettitle="Dummy Title";
    148   }
    149  
     223      // rettitle="Dummy Title";
     224    } else {
     225      // we didn't get something....
     226      rettitle="Nothing Returned...";
     227    }
     228  }
     229
    150230  if (rettext!="unneeded") {
    151231    // get the text
    152     rettext="Dummy Text. This is here as a placeholder until I work out";
    153     rettext+=" a way to get the query again when running in simple cgi\n";
    154     rettext+="as after each page is completed, the connection is lost to the";
    155     rettext+=" server, and we forget what the query was\n";
     232    rettext.setcstr(z_getfullRecord(ID));
    156233  }
    157234  return (true);
    158 }
     235  }
    159236
    160237text_t &z3950_server::getzAbout() {
  • branches/z3950-branch/gsdl/src/recpt/z3950server.h

    r1191 r1342  
    1010  text_t z_initstr; // a string returned when the connection is initialised.
    1111  text_tmap meta;  // metadata for this collection (ie server/database pair)
     12  text_tmap format;
    1213  text_tmap about; // langauge/abouttext pair for collection.
    1314  ShortColInfo_t *info; // has  (database) name, host and port
     
    2324  void setMeta(const text_t &key, const text_t &value);
    2425  const text_tmap *getMeta() {return &meta;}
     26  const text_tmap *getFormat() {return &format;}
    2527  void setInfo(ShortColInfo_t *newinfo) {info=newinfo;}
    2628  const ShortColInfo_t *getInfo() {return info;}
     
    2931  // now the functions that actually talk to the target (ie zserver) over tcp
    3032  text_t &getzAbout(); // gets any name, id, MOTD, etc from server.
    31   text_tarray *getbriefrecords(const text_t &query,
     33  text_tarray *getrecordTitles(const text_t &query,
     34                   const text_t &fields,
    3235                   const int first, const int count,
    3336                   int *nummatches, comerror_t &err);
    3437  /* only get one record at a time? (Eventually we could buffer them, but
    3538     for now... */
    36   bool getfullrecord(const int ID, text_t &rettitle,
     39  bool getfullrecord(const text_t &query, const text_t &fields,
     40             const int ID, text_t &rettitle,
    3741             text_t &rettext,comerror_t &err);
     42 private:
     43  void parseQuery(const text_t &query, const text_t &fields,
     44          text_t &parsed_query);
    3845};
    3946
  • branches/z3950-branch/gsdl/src/recpt/zparse.y

    r1191 r1342  
    132132              | {$$=NULL;}
    133133
    134 about         : aboutList {;}
     134about         : aboutList {defLanguage=0;}
    135135              | {$$=NULL;}
    136136
Note: See TracChangeset for help on using the changeset viewer.