- Timestamp:
- 2000-08-03T14:49:41+12:00 (24 years ago)
- Location:
- branches/z3950-branch/gsdl/src/recpt
- Files:
-
- 82 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/z3950-branch/gsdl/src/recpt/Makefile.in
r1174 r1342 27 27 AR = ar 28 28 CC = @CC@ 29 CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual 29 #CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual 30 CCFLAGS = @CFLAGS@ 31 32 # YAZ kit for z39.50 33 YAZDIR=../../packages/yaz 30 34 31 35 USE_FASTCGI = @USE_FASTCGI@ … … 35 39 36 40 INCLUDES = -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 38 43 else 39 44 DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DGSDLSERVER \ … … 42 47 INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \ 43 48 -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 45 51 endif 46 52 47 53 RANLIB = @RANLIB@ 48 54 LDFLAGS = @LDFLAGS@ 49 #LIBS = -lgdbm -lstdc++ -lm #-lcrypt50 55 LIBS = @LIBS@ 51 56 … … 95 100 RECPTSOURCES = recptmain.cpp 96 101 97 LIBRARYSOURCES = nullproto.cpp z3950proto.cpp z3950server.cpp librarymain.cpp 102 LIBRARYSOURCES = nullproto.cpp z3950proto.cpp z3950server.cpp librarymain.cpp \ 103 zparse.tab.c parse.yy.c $(YAZDIR)/client/yaz_zclient.c 98 104 99 105 SOURCES = $(COMMONSOURCES) $(RECPTSOURCES) $(LIBRARYSOURCES) … … 113 119 RECPTOBJECTS = recptmain.o 114 120 115 LIBRARYOBJECTS = nullproto.o z3950proto.o z3950server.o \116 librarymain.o zparse.tab.o parse.yy.o121 LIBRARYOBJECTS = nullproto.o z3950proto.o z3950server.o librarymain.o \ 122 zparse.tab.o $(YAZDIR)/client/yaz_zclient.o 117 123 118 124 OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(LIBRARYOBJECTS) … … 120 126 121 127 COLSERVROBJECTS = ../colservr/mgq.o \ 128 ../colservr/search.o \ 122 129 ../colservr/mgsearch.o \ 123 130 ../colservr/querycache.o \ … … 132 139 ../colservr/mggdbmsource.o \ 133 140 ../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 147 EXEC = library 148 149 all: $(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 158 z3950server.o: $(YAZDIR)/client/yaz_zclient.h 159 137 160 zparse.tab.c: zparse.y 138 bison -d zparse.y 161 @YACC@ -d zparse.y 162 139 163 parse.yy.c: parse.fl 140 164 flex -oparse.yy.c parse.fl 165 141 166 PARSE_TMPFILES= zparse.tab.o zparse.tab.c zparse.tab.h parse.yy.o parse.yy.c 142 EXEC = recpt library143 144 all: $(EXEC)145 167 146 168 distclean: … … 162 184 ../../lib/gsdllib.a \ 163 185 ../../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 165 189 else 166 190 RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \ … … 168 192 ../../packages/mg/src/text/libtextin.a \ 169 193 ../../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 171 197 endif 172 198 … … 180 206 ../../lib/gsdllib.a \ 181 207 ../../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 183 212 else 184 213 LIBRARY_OBJS = $(COMMONOBJECTS) $(LIBRARYOBJECTS) $(COLSERVROBJECTS) \ … … 186 215 ../../packages/mg/src/text/libtextin.a \ 187 216 ../../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 189 220 endif 190 221 191 222 library: $(LIBRARY_OBJS) 192 223 $(LINK) $(LIBRARY_OBJS) $(LIBS) 224 225 226 227 228 -
branches/z3950-branch/gsdl/src/recpt/OIDtools.cpp
r739 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.18 1999/10/24 07:24:34 sjboddie31 small change to allow FullTOC option32 33 Revision 1.17 1999/10/10 08:14:02 sjboddie34 - metadata now returns mp rather than array35 - redesigned browsing support (although it's not finished so36 won't currently work ;-)37 38 Revision 1.16 1999/09/07 04:56:51 sjboddie39 added GPL notice40 41 Revision 1.15 1999/09/02 00:22:04 rjmcnab42 added extra check in get_info43 44 Revision 1.14 1999/08/25 04:45:25 sjboddie45 changed FilterRequest_t::docSet into an array46 47 Revision 1.13 1999/08/10 22:44:06 sjboddie48 altered the get_contents function so it's now passed metadata49 rather than having it hard-coded50 51 Revision 1.12 1999/07/30 02:26:44 sjboddie52 added overloaded get_info function for getting info on multiple OIDs53 54 Revision 1.11 1999/07/20 02:59:03 sjboddie55 get_children now takes a getParents argument56 57 Revision 1.10 1999/07/07 05:47:41 sjboddie58 changed around the way browsetools works59 60 Revision 1.9 1999/06/16 23:51:53 sjboddie61 added a strip_suffix function62 63 Revision 1.8 1999/06/16 03:11:25 sjboddie64 get_info() now takes a getParents argument65 66 Revision 1.7 1999/06/16 02:05:23 sjboddie67 just changed a comment that was confusing me68 69 Revision 1.6 1999/05/10 03:40:25 sjboddie70 lots of changes - slowly getting document action sorted out71 72 Revision 1.5 1999/04/30 01:59:37 sjboddie73 lots of stuff - getting documentaction working (documentaction replaces74 old browseaction)75 76 Revision 1.4 1999/03/29 02:14:25 sjboddie77 78 More changes to browseaction79 80 Revision 1.3 1999/03/25 03:13:42 sjboddie81 82 More library functions for dealing with OIDs. Many of them just83 return dummy data at present84 85 Revision 1.2 1999/03/05 03:53:53 sjboddie86 87 fixed some bugs88 89 Revision 1.1 1999/03/04 22:38:20 sjboddie90 91 Added subjectbrowseaction. - Doesn't do anything yet.92 93 */94 25 95 26 #include "OIDtools.h" … … 173 104 } 174 105 106 // overloaded, to allow "custom" filter options. 107 bool 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 175 138 bool get_info (const text_tarray &OIDs, const text_t &collection, 176 139 const text_tset &metadata, bool getParents, … … 202 165 return true; 203 166 } 167 168 204 169 205 170 // has_children returns true if OID has children -
branches/z3950-branch/gsdl/src/recpt/OIDtools.h
r649 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ … … 49 47 bool get_info (const text_t &OID, const text_t &collection, 50 48 const text_tset &metadata, bool getParents, 49 recptproto *collectproto, FilterResponse_t &response, 50 ostream &logout); 51 bool get_info (const text_t &OID, const text_t &collection, 52 const text_tset &metadata, const OptionValue_tarray &options, 53 bool getParents, 51 54 recptproto *collectproto, FilterResponse_t &response, 52 55 ostream &logout); -
branches/z3950-branch/gsdl/src/recpt/action.cpp
r962 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.19 2000/02/21 21:57:49 sjboddie31 actions are now configured with gsdlhome32 33 Revision 1.18 1999/11/01 21:10:57 sjboddie34 chnaged arguments passed to many functions35 36 Revision 1.17 1999/09/07 23:04:03 rjmcnab37 got rid of some compiler warnings38 39 Revision 1.16 1999/09/07 04:56:51 sjboddie40 added GPL notice41 42 Revision 1.15 1999/09/03 09:51:47 rjmcnab43 removed the argdefault configuration option (it should now be44 done with cgiarg)45 46 Revision 1.14 1999/09/02 00:22:42 rjmcnab47 Changes to get it compiling on AIX48 49 Revision 1.13 1999/07/30 02:24:43 sjboddie50 added collectinfo argument to some functions51 52 Revision 1.12 1999/07/10 22:15:30 rjmcnab53 Added function check_external_cgiargs so that actions that54 are not being called can override cgi arguments.55 56 Revision 1.11 1999/06/08 04:29:41 sjboddie57 added argsinfo to the call to check_cgiargs to make it easy to set58 args to their default if they're found to be screwed up59 60 Revision 1.10 1999/03/25 03:06:44 sjboddie61 62 altered receptionist slightly so it now passes *collectproto to63 define_internal_macros and define_external_macros - need it64 for browseaction65 66 Revision 1.9 1999/02/28 23:16:00 rjmcnab67 68 Fixed a compiler warning.69 70 Revision 1.8 1999/02/28 20:00:11 rjmcnab71 72 73 Fixed a few things.74 75 Revision 1.7 1999/02/25 21:58:58 rjmcnab76 77 Merged sources.78 79 Revision 1.6 1999/02/21 22:33:52 rjmcnab80 81 Lots of stuff :-)82 83 Revision 1.5 1999/02/11 01:24:04 rjmcnab84 85 Fixed a few compiler warnings.86 87 Revision 1.4 1999/02/08 01:27:59 rjmcnab88 89 Got the receptionist producing something using the statusaction.90 91 Revision 1.3 1999/02/05 10:42:41 rjmcnab92 93 Continued working on receptionist94 95 Revision 1.2 1999/02/04 10:00:53 rjmcnab96 97 Developed the idea of an "action" and having them define the cgi arguments98 which they need and how those cgi arguments function.99 100 Revision 1.1 1999/01/08 08:40:52 rjmcnab101 102 Moved from lib directory.103 104 Revision 1.1 1999/01/08 03:57:44 rjmcnab105 106 Initial revision107 108 */109 110 25 111 26 #include "action.h" … … 237 152 return (*here).second.a; 238 153 } 239 -
branches/z3950-branch/gsdl/src/recpt/action.h
r962 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/authenaction.cpp
r1129 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.10 2000/04/19 22:30:23 sjboddie31 tidied up status pages and end-user collection building32 33 Revision 1.9 1999/11/01 21:11:35 sjboddie34 changed arguments passed to many functions35 36 Revision 1.8 1999/10/19 03:23:41 davidb37 Collection building support through web pages38 and internal and external link handling for collection documents39 40 Revision 1.7 1999/09/07 23:04:29 rjmcnab41 removed some compiler warnings42 43 Revision 1.6 1999/09/07 04:56:52 sjboddie44 added GPL notice45 46 Revision 1.5 1999/09/02 00:23:24 rjmcnab47 a couple of minor things48 49 Revision 1.4 1999/07/30 02:24:43 sjboddie50 added collectinfo argument to some functions51 52 Revision 1.3 1999/07/13 23:23:26 rjmcnab53 Put users in their own gdbm database. Moved a lot of functionality to usersdb54 55 Revision 1.2 1999/07/11 10:47:32 rjmcnab56 Got something basic working.57 58 Revision 1.1 1999/07/10 22:19:29 rjmcnab59 Initial revision.60 61 62 */63 64 25 65 26 #include "authenaction.h" -
branches/z3950-branch/gsdl/src/recpt/authenaction.h
r755 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/browserclass.cpp
r765 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.5 1999/11/01 22:04:11 sjboddie31 just a few small changes (that means I can't remember ;)32 33 Revision 1.4 1999/10/30 23:02:46 sjboddie34 tidied things up slightly35 36 Revision 1.3 1999/10/30 22:40:00 sjboddie37 added collection argument38 39 Revision 1.2 1999/10/14 22:59:33 sjboddie40 finished off browser classes41 42 Revision 1.1 1999/10/10 08:14:03 sjboddie43 - metadata now returns mp rather than array44 - redesigned browsing support (although it's not finished so45 won't currently work ;-)46 47 */48 49 25 50 26 #include "browserclass.h" … … 81 57 82 58 text_t browserclass::get_default_formatstring () { 83 return " <td>[link][icon][/link]</td><td>[highlight]{Or}{[Title],Untitled}[/highlight]</td>";59 return ""; 84 60 } 85 61 -
branches/z3950-branch/gsdl/src/recpt/browserclass.h
r765 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/browsetools.cpp
r1079 r1342 23 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 24 * 25 * $Id$26 *27 25 *********************************************************************/ 28 29 /*30 $Log$31 Revision 1.42 2000/04/07 04:40:43 sjboddie32 Reverted back to old DocumentHeader, DocumentTitles, DocumentImages etc.33 from DocumentColumns stuff. I'll move the DocumentColumns stuff to a34 separate development branch (New_Config_Format-branch) for now. The plan35 is to redesign the configuration file format a bit and limit the number of36 distributions floating around that take different configuration formats).37 38 Revision 1.39 2000/02/25 02:28:43 sjboddie39 caught up with assoc directory changes for displaying cover images40 41 Revision 1.38 2000/02/17 02:42:24 sjboddie42 minor stuff - fixed some cvs conflicts43 44 Revision 1.37 2000/02/15 22:53:47 kjm1845 search history stuff added.46 47 Revision 1.36 2000/02/06 21:31:36 sjboddie48 made some formerly static functions accessible from elsewhere (for49 cstr receptionist)50 51 Revision 1.35 2000/01/26 23:46:16 sjboddie52 wrap every second button now (was every third)53 54 Revision 1.34 1999/11/09 02:28:47 sjboddie55 fixed minor bug in expanded contents56 57 Revision 1.33 1999/10/30 22:22:26 sjboddie58 added collection argument to browserclass output_section_group59 functions -- moved table functions to formattools60 61 Revision 1.32 1999/10/24 07:22:37 sjboddie62 added a FullTOC option63 64 Revision 1.31 1999/10/20 03:54:20 sjboddie65 problem with expanded contents66 67 Revision 1.30 1999/10/19 21:36:59 sjboddie68 fixed bug in DocumentContents69 70 Revision 1.29 1999/10/19 08:40:12 sjboddie71 fixed some stupid compiler warnings on windows72 73 Revision 1.28 1999/10/18 20:08:36 sjboddie74 tidied up a few things75 76 Revision 1.27 1999/10/15 03:31:42 sjboddie77 oops, left out an '&'78 79 Revision 1.26 1999/10/14 22:58:05 sjboddie80 finished up on changes to browseing support - may still need some81 tidying up82 83 Revision 1.25 1999/10/10 08:14:04 sjboddie84 - metadata now returns mp rather than array85 - redesigned browsing support (although it's not finished so86 won't currently work ;-)87 88 Revision 1.24 1999/09/28 01:46:55 rjmcnab89 removed some unused stuff90 91 Revision 1.23 1999/09/23 10:09:17 sjboddie92 made some changes so AZLists within other classifications are93 handled properly94 95 Revision 1.22 1999/09/07 23:06:58 rjmcnab96 removed some compiler warnings.97 98 Revision 1.21 1999/09/07 04:56:52 sjboddie99 added GPL notice100 101 Revision 1.20 1999/08/25 04:46:58 sjboddie102 fixed bug103 104 Revision 1.19 1999/08/13 04:18:04 sjboddie105 fixed some typos106 107 Revision 1.18 1999/08/10 22:42:21 sjboddie108 added more format options to document tocs - there are now just two109 types of toc - standard (Hierarchical) and document (as in books)110 111 Revision 1.17 1999/08/09 02:12:07 sjboddie112 made it so dates may be only 4 digits (i.e. year only)113 114 Revision 1.16 1999/07/30 02:16:10 sjboddie115 -added ability to display nested classifications (expanded versions116 of nested classifications has yet to be done).117 -changed set_arrow_macros slightly to fit in with new showtoppage118 format option119 120 Revision 1.15 1999/07/21 05:01:56 sjboddie121 wrote handler for DateList classification122 123 Revision 1.14 1999/07/20 02:58:15 sjboddie124 got List and AZList classifications using format strings - tidied125 up a bit126 127 Revision 1.13 1999/07/07 05:44:25 sjboddie128 Made some changes to allow for new way classifiers work (i.e. you can129 now have classifiers containing other classifiers). At present there's130 only a special case for dealing with the hdl 'magazine' section. A bit131 of a redesign is needed to get it completely flexible132 133 Revision 1.12 1999/07/01 03:47:49 rjmcnab134 Fixed a small warning.135 136 Revision 1.11 1999/06/27 21:49:01 sjboddie137 fixed a couple of version conflicts - tidied up some small things138 139 Revision 1.10 1999/06/26 01:07:21 rjmcnab140 Fixed a small "bug" -- well I probably just covered another one...141 142 Revision 1.9 1999/06/24 05:12:15 sjboddie143 lots of small changes144 145 Revision 1.8 1999/06/17 03:06:53 sjboddie146 got detach button working properly - the close book icon is now disabled147 when page is detached as the javascript close() function I was using is148 too unreliable over different browsers149 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 sjboddie152 tidied a few things up. documentaction::define_external_macros now153 resets the "c" arg if it's set to something stupid by the .xx suffixes154 155 Revision 1.6 1999/06/16 04:03:47 sjboddie156 Now sets "cl" arg to "search" when going to a document from a search157 results page. This allows the close book icon (in hierarchy toc) to158 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 a160 classification or a search (i.e. if "cl" isn't set) then the close161 book icon is disabled162 163 Revision 1.5 1999/06/16 03:11:25 sjboddie164 get_info() now takes a getParents argument165 166 Revision 1.4 1999/05/10 03:40:26 sjboddie167 lots of changes - slowly getting document action sorted out168 169 Revision 1.3 1999/04/30 01:59:39 sjboddie170 lots of stuff - getting documentaction working (documentaction replaces171 old browseaction)172 173 Revision 1.2 1999/03/29 02:14:29 sjboddie174 175 More changes to browseaction176 177 Revision 1.1 1999/03/25 03:10:15 sjboddie178 179 new library for browse stuff180 181 */182 26 183 27 #include "browsetools.h" … … 702 546 if (havecontrols) textout << "</td></tr></table>\n"; 703 547 } 704 705 706 -
branches/z3950-branch/gsdl/src/recpt/browsetools.h
r1079 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/buildaction.cpp
r1149 r1342 2 2 * 3 3 * buildaction.cpp -- building collections 4 * Copyright (C) 1999 DigiLib Systems Limited, New Zealand4 * Copyright (C) 1999 The New Zealand Digital Library Project 5 5 * 6 6 * A component of the Greenstone digital library software … … 24 24 *********************************************************************/ 25 25 26 #if !defined(__WIN32__) || defined(__GNUC__)27 #include <unistd.h>28 #endif29 30 26 #include "OIDtools.h" 31 27 #include "fileutil.h" 32 28 #include "htmlutils.h" 29 #include "gsdltools.h" 33 30 #include "buildaction.h" 34 31 … … 105 102 // make sure we know about a receptionist 106 103 if (recpt == NULL) { 107 logout << "The pageaction does not contain information\n"104 logout << "The build action does not contain information\n" 108 105 << "about any receptionists. The method set_receptionist\n" 109 106 << "was probably not called from the module which instantiated\n" 110 << "this pageaction.\n";107 << "this build action.\n"; 111 108 return; 112 109 } … … 119 116 text_t fullnamelist = "var fullnamelist = new Array("; 120 117 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"; 124 121 int rcount = 1; 125 122 int fcount = 1; … … 149 146 while (collist_here != collist_end) { 150 147 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) { 154 150 text_t collectionname = *collist_here; 155 if (!cinfo .collectionmeta["collectionname"].empty())151 if (!cinfo->collectionmeta["collectionname"].empty()) 156 152 { 157 153 // get collection name from the collection cfg file 158 collectionname = cinfo .collectionmeta["collectionname"];154 collectionname = cinfo->collectionmeta["collectionname"]; 159 155 } 160 156 else … … 172 168 dirnamelist += (text_t)"\"" + *collist_here + "\""; 173 169 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()) 176 173 { 177 174 if ((rcount==1) && (ccount==1)) … … 205 202 if (args["bca"]=="buildcol") 206 203 { 207 if (((args["bc1dirname"] =="") && (rcount==1) && (ccount==1))204 if (((args["bc1dirname"].empty()) && (rcount==1) && (ccount==1)) 208 205 || (args["bc1dirname"]==*collist_here)) 209 206 { 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"]); 212 209 213 if (cinfo .buildDate==0) // not built210 if (cinfo->buildDate==0) // not built 214 211 { 215 212 // assume that's because this is the first build ever for the collection … … 243 240 } 244 241 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")) 246 244 { 247 245 disp.setmacro ("dirnamelist", "build", dirnamelist); … … 271 269 text_t bc1name = substr(args_entry.begin()+3,args_entry.end()); 272 270 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])); 274 272 } 275 273 args_here++; … … 291 289 text_t cfg_fname 292 290 = filename_cat(gsdlhome, "collect", dirname, "etc", "collect.cfg"); 291 292 #ifdef GSDL_USE_IOS_H 293 293 ifstream cfg_ifs (cfg_fname.getcstr(), ios::in | ios::nocreate); 294 #else 295 ifstream cfg_ifs (cfg_fname.getcstr(), ios::in); 296 #endif 297 294 298 if (cfg_ifs) 295 299 { … … 325 329 326 330 // 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 328 334 ifstream bld_ifs (bld_fname.getcstr(), ios::in | ios::nocreate); 335 #else 336 ifstream bld_ifs (bld_fname.getcstr(), ios::in); 337 #endif 338 329 339 if (bld_ifs) 330 340 { … … 430 440 ostream &logout) { 431 441 432 433 434 435 442 text_tarray wizard_split; 436 443 const text_t wizard = (args["wizard"].empty()) ? "buildcol" : args["wizard"]; … … 447 454 else 448 455 { 449 text_t dirname = (args["bc1dirname"] == "") ? (text_t)"unknown" : args["bc1dirname"]; 456 text_t dirname = (args["bc1dirname"] == "") ? 457 "unknown" : args["bc1dirname"]; 458 450 459 text_t tmpname = dirname+"_XXXXXX"; 451 460 char *cstr_tmpname = tmpname.getcstr(); 452 if (mktemp(cstr_tmpname)==NULL) 461 462 if (GSDL_MKTEMP (cstr_tmpname)==NULL) 453 463 logout << "Failed to create temporary filename" << endl; 454 464 … … 462 472 463 473 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; 472 495 } 473 496 -
branches/z3950-branch/gsdl/src/recpt/buildaction.h
r822 r1342 2 2 * 3 3 * buildaction.h -- building collections 4 * Copyright (C) 1999 DigiLib Systems Limited, New Zealand4 * Copyright (C) 1999 The New Zealand Digital Library Project 5 5 * 6 6 * A component of the Greenstone digital library software -
branches/z3950-branch/gsdl/src/recpt/cgiargs.cpp
r802 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.11 1999/12/05 21:25:20 sjboddie31 can't remember why I did this - must have been a reason ;-)32 33 Revision 1.10 1999/11/08 20:26:38 sjboddie34 added multiplevalue option to cgiarginfo35 36 Revision 1.9 1999/09/07 04:56:53 sjboddie37 added GPL notice38 39 Revision 1.8 1999/09/03 09:52:45 rjmcnab40 Fixed a couple of small things41 42 Revision 1.7 1999/09/02 00:23:55 rjmcnab43 changes to get compiling on AIX44 45 Revision 1.6 1999/07/11 01:02:13 rjmcnab46 Stored information relating to the cgi argument's origin with the cgi argument.47 48 Revision 1.5 1999/02/08 01:28:00 rjmcnab49 50 Got the receptionist producing something using the statusaction.51 52 Revision 1.4 1999/02/05 10:42:41 rjmcnab53 54 Continued working on receptionist55 56 Revision 1.3 1999/02/04 10:00:54 rjmcnab57 58 Developed the idea of an "action" and having them define the cgi arguments59 which they need and how those cgi arguments function.60 61 Revision 1.2 1999/01/12 01:51:06 rjmcnab62 63 Standard header.64 65 Revision 1.1 1999/01/08 08:40:54 rjmcnab66 67 Moved from lib directory.68 69 Revision 1.1 1999/01/08 07:50:30 rjmcnab70 71 Moved from src/library directory to lib directory.72 73 */74 75 25 76 26 #include "cgiargs.h" … … 323 273 return &((*here).second); 324 274 } 325 326 327 -
branches/z3950-branch/gsdl/src/recpt/cgiargs.h
r928 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ … … 234 232 235 233 #endif 236 237 238 -
branches/z3950-branch/gsdl/src/recpt/cgiutils.cpp
r873 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.13 2000/01/25 22:46:54 sjboddie31 changes to get fastcgi working properly32 33 Revision 1.12 1999/11/08 20:26:38 sjboddie34 added multiplevalue option to cgiarginfo35 36 Revision 1.11 1999/11/01 22:03:35 sjboddie37 Added ability to handle multiple arguments with the same name (as38 is the case with multiple checkboxes using the same name). I'm not39 sure this is the best way to do it but it does the trick for what40 I currently need.41 42 Revision 1.10 1999/09/21 21:41:17 sjboddie43 fixed a couple of problems in what I committed last44 45 Revision 1.9 1999/09/21 11:30:39 sjboddie46 added ability to escape out '-' in saved args (currently47 with a 'Z' ???)48 49 Revision 1.8 1999/09/07 04:56:53 sjboddie50 added GPL notice51 52 Revision 1.7 1999/08/25 22:27:13 sjboddie53 prevented cgi_safe from converting '+' and '-'. It was causing problems54 with query strings containing spaces. The space was being converted55 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 rjmcnab59 Stored origin of cgiarg with argument.60 61 Revision 1.5 1999/06/26 01:08:36 rjmcnab62 Added encoding and decoding of multibyte compresesd arguments.63 64 Revision 1.4 1999/06/08 22:03:43 sjboddie65 query string is now made cgi safe before being added to compressed args66 67 Revision 1.3 1999/02/08 01:28:00 rjmcnab68 69 Got the receptionist producing something using the statusaction.70 71 Revision 1.2 1999/02/05 10:42:43 rjmcnab72 73 Continued working on receptionist74 75 Revision 1.1 1999/01/08 08:40:56 rjmcnab76 77 Moved from lib directory.78 79 Revision 1.1 1999/01/08 03:57:45 rjmcnab80 81 Initial revision82 83 */84 85 25 86 26 #include "cgiutils.h" -
branches/z3950-branch/gsdl/src/recpt/cgiutils.h
r873 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/cgiwrapper.cpp
r1168 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.25.2.1 2000/05/11 01:56:27 johnmcp31 32 added proper config file parsing for z39.50 servers, and minor changes33 to pageaction (minor bug when display collections from >1 proto) and34 cgiwrapper (announces which collections are z39.50 servers).35 36 Revision 1.25 2000/04/14 04:45:19 sjboddie37 Modified the English of the debug output slightly38 39 Revision 1.24 2000/04/14 03:10:35 sjboddie40 tidied up a few issues concerning the new debug info which showed41 up on windows42 43 Revision 1.23 2000/04/14 02:52:05 sjboddie44 tidied up error messaging and set up some debugging info to be output45 when running library from command line46 47 Revision 1.22 2000/02/21 21:56:46 sjboddie48 gsdlhome now comes from gsdlsite.cfg49 50 Revision 1.21 2000/01/25 22:45:59 sjboddie51 few changes to get fastcgi to work properly52 53 Revision 1.20 1999/09/07 04:56:53 sjboddie54 added GPL notice55 56 Revision 1.19 1999/09/02 00:24:36 rjmcnab57 fixed bug in getting POST arguments58 59 Revision 1.18 1999/08/20 01:02:07 sjboddie60 added some usage logging61 62 Revision 1.17 1999/07/15 06:03:15 rjmcnab63 Moved the adding of the actions to librarymain so that they can be64 overriden easily.65 66 Revision 1.16 1999/07/14 08:31:05 rjmcnab67 Fixed a small bug in the POST implementation.68 69 Revision 1.15 1999/07/13 23:32:17 rjmcnab70 Added authenaction and usersaction71 72 Revision 1.14 1999/07/11 01:03:37 rjmcnab73 Added ability to receive POST cgi form data.74 75 Revision 1.13 1999/06/24 05:12:18 sjboddie76 lots of small changes77 78 Revision 1.12 1999/04/30 01:59:40 sjboddie79 lots of stuff - getting documentaction working (documentaction replaces80 old browseaction)81 82 Revision 1.11 1999/03/25 03:12:01 sjboddie83 84 subjectbrowseaction was replaced with browseaction85 86 Revision 1.10 1999/03/05 03:53:54 sjboddie87 88 fixed some bugs89 90 Revision 1.9 1999/03/04 22:38:21 sjboddie91 92 Added subjectbrowseaction. - Doesn't do anything yet.93 94 Revision 1.8 1999/02/28 20:00:13 rjmcnab95 96 97 Fixed a few things.98 99 Revision 1.7 1999/02/21 22:33:53 rjmcnab100 101 Lots of stuff :-)102 103 Revision 1.6 1999/02/12 02:40:17 sjboddie104 105 Added page action106 107 Revision 1.5 1999/02/11 01:24:04 rjmcnab108 109 Fixed a few compiler warnings.110 111 Revision 1.4 1999/02/08 01:28:01 rjmcnab112 113 Got the receptionist producing something using the statusaction.114 115 Revision 1.3 1999/02/05 10:42:44 rjmcnab116 117 Continued working on receptionist118 119 Revision 1.2 1999/02/04 10:00:56 rjmcnab120 121 Developed the idea of an "action" and having them define the cgi arguments122 which they need and how those cgi arguments function.123 124 Revision 1.1 1999/02/04 01:16:17 rjmcnab125 126 Initial revision.127 128 Revision 1.5 1999/01/19 01:38:18 rjmcnab129 130 Made the source more portable.131 132 Revision 1.4 1999/01/12 01:51:04 rjmcnab133 134 Standard header.135 136 */137 138 25 139 26 #include "gsdlconf.h" … … 491 378 492 379 bool is_z3950 = false; 380 bool found_valid_col = false; 381 493 382 while (rprotolist_here != rprotolist_end) { 494 383 if ((*rprotolist_here).p == NULL) continue; … … 525 414 if (cinfo.buildDate > 0) cout << " running "; 526 415 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 ++; 527 440 } 528 441 … … 536 449 } // end of while loop 537 450 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"; 539 457 cout << "------------------------------------------------------------\n\n"; 540 458 cout << "receptionist running in command line debug mode\n"; … … 671 589 if (isfastcgi) { 672 590 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 } 676 616 } 677 617 #endif … … 725 665 text_t error_file = filename_cat (gsdlhome, "etc", "errout.txt"); 726 666 char *eout = error_file.getcstr(); 727 ofstream errout (eout );667 ofstream errout (eout, ios::app); 728 668 delete eout; 669 // note that the following line appears to cause a runtime 670 // error using debug versions of VC++ 6.0 (on windows) 729 671 cerr = errout; 730 672 … … 761 703 return; 762 704 } 763 -
branches/z3950-branch/gsdl/src/recpt/cgiwrapper.h
r533 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 25 -
branches/z3950-branch/gsdl/src/recpt/comtypes.cpp
r823 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.22 1999/12/13 02:24:33 davidb31 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 sjboddie36 added assignment operator for FilterResponse_t37 38 Revision 1.20 1999/10/14 23:02:34 sjboddie39 fixed bug in new parent metadata stuff40 41 Revision 1.19 1999/10/10 07:49:35 sjboddie42 - metadata now returns map rather than array43 - redesigned browsing support (although it's not finished44 so won't currently work ;-)45 46 Revision 1.18 1999/09/07 04:56:54 sjboddie47 added GPL notice48 49 Revision 1.17 1999/09/02 00:25:26 rjmcnab50 changes to get compiling on AIX51 52 Revision 1.16 1999/08/13 04:19:05 sjboddie53 added name attribute to metadata54 55 Revision 1.15 1999/08/03 03:31:43 sjboddie56 added ability to set receptionist from configuration files57 58 Revision 1.14 1999/07/16 03:41:29 sjboddie59 changed isApprox60 61 Revision 1.13 1999/07/08 20:46:45 rjmcnab62 Added the result number to the ResultDocInfo_t63 64 Revision 1.12 1999/07/07 06:11:33 rjmcnab65 Slight change for multiple phrase matching.66 67 Revision 1.11 1999/07/01 22:47:49 sjboddie68 added format option to collection info69 70 Revision 1.10 1999/06/29 22:05:01 rjmcnab71 Added a couple of fields to ResultDocInfo_t to handle a special72 version of mg.73 74 Revision 1.9 1999/06/16 02:01:22 sjboddie75 Few changes to get getParents filter option to return metadata of parents76 as well as current OID77 78 Revision 1.8 1999/05/10 03:40:33 sjboddie79 lots of changes - slowly getting document action sorted out80 81 Revision 1.7 1999/04/21 05:23:14 sjboddie82 83 Changed the way metadata is returned84 85 Revision 1.6 1999/04/06 22:20:34 rjmcnab86 Got browsefilter working.87 88 Revision 1.5 1999/03/31 23:44:47 rjmcnab89 Altered the protocol so that the metadata is part of the filter.90 91 Revision 1.4 1999/03/11 00:11:19 rjmcnab92 Added a function to get a string version of comerror_t93 94 Revision 1.3 1999/03/09 21:00:47 rjmcnab95 Reorganised the statusaction, added more functions to comtypes.96 97 Revision 1.2 1999/03/04 21:19:15 rjmcnab98 99 Added clear() functions to all the data types.100 101 Revision 1.1 1999/02/21 22:35:25 rjmcnab102 103 Initial revision.104 105 */106 107 25 108 26 #include "comtypes.h" … … 133 51 ccsCols.erase(ccsCols.begin(), ccsCols.end()); 134 52 buildDate=0; 53 buildType.clear(); 135 54 numDocs=0; 55 numSections=0; 136 56 numWords=0; 137 57 numBytes=0; … … 338 258 doc.clear(); 339 259 } 340 341 342 -
branches/z3950-branch/gsdl/src/recpt/comtypes.h
r871 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ … … 75 73 // languages [6] IMPLICIT StringSet, -- languages in the collection 76 74 // 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 83 83 // } 84 84 struct ColInfoResponse_t { … … 92 92 text_tarray ccsCols; // empty if collection does not use cross-collection searching 93 93 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 97 98 text_tmap collectionmeta; 98 99 text_tmap format; 99 100 text_tmap building; 100 101 text_t receptionist; 102 text_t buildType; // MG or MGPP 101 103 }; 102 104 … … 227 229 #define FRdocFreq 32 228 230 #define FRmetadata 64 231 // used to indicate a full text browse query for mgpp 232 #define FRfullTextBrowse 128 229 233 230 234 struct FilterRequest_t { … … 359 363 360 364 #endif 365 -
branches/z3950-branch/gsdl/src/recpt/converter.cpp
r533 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.4 1999/09/07 04:56:54 sjboddie31 added GPL notice32 33 Revision 1.3 1999/09/02 00:25:27 rjmcnab34 changes to get compiling on AIX35 36 Revision 1.2 1999/02/21 22:33:54 rjmcnab37 Lots of stuff :-)38 39 Revision 1.1 1999/02/05 10:42:45 rjmcnab40 41 Continued working on receptionist42 43 */44 45 25 46 26 #include "converter.h" … … 96 76 return (*here).second.outconverter; 97 77 } 98 -
branches/z3950-branch/gsdl/src/recpt/converter.h
r533 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/datelistbrowserclass.cpp
r995 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.5 2000/02/29 21:00:27 sjboddie31 fixed some compiler warnings32 33 Revision 1.4 1999/11/01 22:04:11 sjboddie34 just a few small changes (that means I can't remember ;)35 36 Revision 1.3 1999/10/19 08:40:11 sjboddie37 fixed some stupid compiler warnings on windows38 39 Revision 1.2 1999/10/14 22:59:33 sjboddie40 finished off browser classes41 42 Revision 1.1 1999/10/10 08:14:05 sjboddie43 - metadata now returns mp rather than array44 - redesigned browsing support (although it's not finished so45 won't currently work ;-)46 47 */48 49 25 50 26 #include "datelistbrowserclass.h" -
branches/z3950-branch/gsdl/src/recpt/datelistbrowserclass.h
r995 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/delhistoryaction.cpp
r1000 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ … … 208 206 return result; 209 207 } 210 211 212 213 214 -
branches/z3950-branch/gsdl/src/recpt/delhistoryaction.h
r928 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ … … 76 74 77 75 #endif 78 -
branches/z3950-branch/gsdl/src/recpt/documentaction.cpp
r1148 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.38 2000/05/04 05:18:46 sjboddie31 attempting to get end-user collection building to work under windows32 33 Revision 1.37 2000/04/07 04:40:44 sjboddie34 Reverted back to old DocumentHeader, DocumentTitles, DocumentImages etc.35 from DocumentColumns stuff. I'll move the DocumentColumns stuff to a36 separate development branch (New_Config_Format-branch) for now. The plan37 is to redesign the configuration file format a bit and limit the number of38 distributions floating around that take different configuration formats).39 40 Revision 1.34 2000/02/15 22:53:49 kjm1841 search history stuff added.42 43 Revision 1.33 2000/02/13 20:40:05 sjboddie44 now dm_safe _thisOID_ macro45 46 Revision 1.32 2000/01/25 22:39:15 sjboddie47 added DocumentUseHTML - tidied some things up (and messed up some others)48 49 Revision 1.31 1999/11/13 08:57:00 sjboddie50 fixed bug in last changes51 52 Revision 1.30 1999/11/01 21:54:27 sjboddie53 changes for cross-collection searching - changes to arguments54 of many functions55 56 Revision 1.29 1999/10/24 07:23:40 sjboddie57 added FullTOC option58 59 Revision 1.28 1999/10/19 03:23:42 davidb60 Collection building support through web pages61 and internal and external link handling for collection documents62 63 Revision 1.27 1999/10/14 23:00:53 sjboddie64 finished changes to browsing support65 66 Revision 1.26 1999/10/10 08:14:06 sjboddie67 - metadata now returns mp rather than array68 - redesigned browsing support (although it's not finished so69 won't currently work ;-)70 71 Revision 1.25 1999/09/17 04:46:05 sjboddie72 fixed a couple of problems with 'unknown' classifier73 74 Revision 1.24 1999/09/17 04:00:26 sjboddie75 tidied up navigation bar to produce a default "unknown" button if76 it comes across metadata it can't display77 78 Revision 1.23 1999/09/07 04:56:54 sjboddie79 added GPL notice80 81 Revision 1.22 1999/08/20 01:00:22 sjboddie82 split some of the larger functions up to simplify the creation of83 collection specific receptionists84 85 Revision 1.21 1999/08/11 23:28:03 sjboddie86 -added support for html classifier87 - removed _random_ macro - now use _blank for detach page88 89 Revision 1.20 1999/08/10 23:16:39 sjboddie90 a couple of small changes to get format options DocumentArrowsBottom91 and DocumentArrowsTop working correctly92 93 Revision 1.19 1999/08/10 22:40:01 sjboddie94 added some more format options including the ability to format the95 document text96 97 Revision 1.18 1999/08/09 04:25:18 sjboddie98 moved OID translation stuff from documentaction::define_external_macros99 to receptionist100 101 Revision 1.17 1999/08/09 02:13:53 sjboddie102 fixed small bug in ShowSectionTitles103 104 Revision 1.16 1999/08/03 03:30:47 sjboddie105 a few small changes related to new format options106 107 Revision 1.15 1999/07/30 02:18:49 sjboddie108 -added collectinfo argument to some functions109 -caught up with changes to browsetools (allowing nested classifications)110 -added showtoppage format option111 112 Revision 1.14 1999/07/21 05:01:09 sjboddie113 fixed up wrapping of classificationlinks114 115 Revision 1.13 1999/07/20 02:59:54 sjboddie116 List and AZList classifications now use format strings117 118 Revision 1.12 1999/07/16 00:19:01 sjboddie119 some changes to the way quoted queries are handled120 121 Revision 1.11 1999/07/07 05:47:41 sjboddie122 changed around the way browsetools works123 124 Revision 1.10 1999/06/29 01:46:44 sjboddie125 now sets a _navigationbar_ macro even if there aren't any126 classifications (it will just have the 'search' button127 128 Revision 1.9 1999/06/27 22:05:58 sjboddie129 now set a _thisOID_ macro for use in displaying images130 131 Revision 1.8 1999/06/24 05:12:20 sjboddie132 lots of small changes133 134 Revision 1.7 1999/06/17 03:06:58 sjboddie135 got detach button working properly - the close book icon is now disabled136 when page is detached as the javascript close() function I was using is137 too unreliable over different browsers138 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 sjboddie141 tidied a few things up. documentaction::define_external_macros now142 resets the "c" arg if it's set to something stupid by the .xx suffixes143 144 Revision 1.5 1999/06/16 03:10:49 sjboddie145 define_internal_macros() now sets _pagetitle_ macro to document's title146 (including parents of current document)147 148 Revision 1.4 1999/06/15 01:55:29 sjboddie149 - got text highlighting working150 - got multiple collections working (now outputs error message if an151 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 sjboddie154 added argsinfo to the call to check_cgiargs to make it easy to set155 args to their default if they're found to be screwed up156 157 Revision 1.2 1999/05/10 03:40:35 sjboddie158 lots of changes - slowly getting document action sorted out159 160 Revision 1.1 1999/04/30 01:59:40 sjboddie161 lots of stuff - getting documentaction working (documentaction replaces162 old browseaction)163 164 Revision 1.2 1999/03/29 02:14:27 sjboddie165 166 More changes to browseaction167 168 Revision 1.1 1999/03/25 03:09:40 sjboddie169 170 subjectbrowseaction became browseaction171 172 173 */174 175 25 176 26 #include <string.h> … … 183 33 184 34 documentaction::documentaction () { 35 recpt = NULL; 36 185 37 186 38 // this action uses cgi variables "a", "d", "cl", … … 500 352 if (collectproto == NULL) return; 501 353 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 502 361 outconvertclass text_t2ascii; 503 362 comerror_t err; … … 505 364 FilterResponse_t response; 506 365 text_tset metadata; 507 508 366 509 367 // get info on current collection and load up formatinfo … … 513 371 // fix it ... maybe - Stefan. 514 372 ColInfoResponse_t cinfo; 373 515 374 collectproto->get_collectinfo (collection, cinfo, err, logout); 516 375 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")); 517 382 518 383 if (formatinfo.DocumentUseHTML) { … … 738 603 739 604 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 741 615 // 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)) { 743 618 disp.setmacro ("header", "document", "_textheader_"); 744 619 … … 1101 976 textout << outconvert << disp << buffer; 1102 977 } 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 -
branches/z3950-branch/gsdl/src/recpt/documentaction.h
r1079 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ … … 79 77 virtual ~documentaction (); 80 78 79 void set_receptionist (receptionist *therecpt) {recpt=therecpt;} 80 81 81 text_t get_action_name () {return "d";} 82 82 … … 104 104 105 105 #endif 106 107 -
branches/z3950-branch/gsdl/src/recpt/extlinkaction.cpp
r869 r1342 248 248 return true; 249 249 } 250 251 -
branches/z3950-branch/gsdl/src/recpt/extlinkaction.h
r869 r1342 61 61 62 62 #endif 63 64 -
branches/z3950-branch/gsdl/src/recpt/formattools.cpp
r1079 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.20 2000/04/07 04:40:44 sjboddie31 Reverted back to old DocumentHeader, DocumentTitles, DocumentImages etc.32 from DocumentColumns stuff. I'll move the DocumentColumns stuff to a33 separate development branch (New_Config_Format-branch) for now. The plan34 is to redesign the configuration file format a bit and limit the number of35 distributions floating around that take different configuration formats).36 37 Revision 1.17 2000/01/26 20:10:31 sjboddie38 changed the default order of detach/expand/highlight buttons39 40 Revision 1.16 2000/01/25 22:33:31 sjboddie41 added DocumentUseHTML42 43 Revision 1.15 1999/12/13 02:45:16 davidb44 Support for more than one metavalue for the same metadata name45 46 Revision 1.14 1999/10/30 22:23:11 sjboddie47 moved table functions from browsetools48 49 Revision 1.13 1999/10/14 23:01:24 sjboddie50 changes for new browsing support51 52 Revision 1.12 1999/10/10 08:14:07 sjboddie53 - metadata now returns mp rather than array54 - redesigned browsing support (although it's not finished so55 won't currently work ;-)56 57 Revision 1.11 1999/09/28 20:38:19 rjmcnab58 fixed a couple of bugs59 60 Revision 1.10 1999/09/07 04:56:55 sjboddie61 added GPL notice62 63 Revision 1.9 1999/09/02 00:31:25 rjmcnab64 fixed small error.65 66 Revision 1.8 1999/08/20 00:56:38 sjboddie67 added cgisafe option - you can now do something like [cgisafe:Title] if68 you want Title to be entered safely into a url69 70 Revision 1.7 1999/08/10 22:38:08 sjboddie71 added some more format options72 73 Revision 1.6 1999/07/30 02:25:42 sjboddie74 made format_date function global75 76 Revision 1.5 1999/07/21 05:00:00 sjboddie77 added some date formatting78 79 Revision 1.4 1999/07/20 03:02:15 sjboddie80 added an [icon] option, added ability to call get_formatted_string81 with icon and link arguments set82 83 Revision 1.3 1999/07/09 02:44:35 sjboddie84 fixed parent(All) function so it only outputs parents and not current85 level meta86 87 Revision 1.2 1999/07/08 20:48:33 rjmcnab88 Added ability to print the result number89 90 Revision 1.1 1999/07/07 05:49:34 sjboddie91 had another crack at the format string code - created a new formattools92 module. It can now handle {If} and {Or} statements although there's a93 bug preventing nested if's and or's.94 95 */96 97 25 98 26 #include "formattools.h" 99 27 #include "cgiutils.h" 28 #include <assert.h> 100 29 101 30 // a few function prototypes … … 153 82 while (here != end) { 154 83 if (*here != ' ') { 155 if ( *here == '<') {84 if ((*here == '<') && ((here+3) < end)) { 156 85 if ((*(here+1) == 't' || *(here+1) == 'T') && 157 86 (*(here+2) == 'd' || *(here+2) == 'D') && … … 239 168 240 169 static void get_parent_options (text_t &instring, metadata_t &metaoption) { 170 171 assert (instring.size() > 7); 172 if (instring.size() <= 7) return; 241 173 242 174 text_t meta, com, op; … … 323 255 while (here != end) { 324 256 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 == '{') { 329 262 if (!text.empty()) { 330 263 formatlistptr->command = comText; … … 433 366 434 367 } 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); 438 369 } 439 370 text.clear(); … … 710 641 return ft; 711 642 } 712 713 -
branches/z3950-branch/gsdl/src/recpt/formattools.h
r1079 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/historydb.cpp
r995 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.4 2000/02/29 21:00:28 sjboddie31 fixed some compiler warnings32 33 Revision 1.3 2000/02/21 22:01:02 sjboddie34 gsdlhome now comes from gsdlsite.cfg35 36 Revision 1.2 2000/02/17 02:40:21 sjboddie37 tidied up a bit - fixed a bug (gdbm file wasn't always being closed properly)38 39 40 */41 25 42 26 #include "historydb.h" … … 622 606 logout << "in format user info - end"; 623 607 } 624 625 626 627 628 629 630 631 632 -
branches/z3950-branch/gsdl/src/recpt/historydb.h
r1000 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ … … 94 92 95 93 #endif 96 97 -
branches/z3950-branch/gsdl/src/recpt/hlistbrowserclass.cpp
r995 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.7 2000/02/29 21:00:29 sjboddie31 fixed some compiler warnings32 33 Revision 1.6 1999/11/01 22:04:12 sjboddie34 just a few small changes (that means I can't remember ;)35 36 Revision 1.5 1999/10/30 23:02:01 sjboddie37 tidied up, fixed a small bug38 39 Revision 1.4 1999/10/30 22:15:23 sjboddie40 added a collection argument41 42 Revision 1.3 1999/10/20 03:54:21 sjboddie43 problem with expanded contents44 45 Revision 1.2 1999/10/14 22:59:34 sjboddie46 finished off browser classes47 48 Revision 1.1 1999/10/10 08:14:08 sjboddie49 - metadata now returns mp rather than array50 - redesigned browsing support (although it's not finished so51 won't currently work ;-)52 53 */54 55 25 56 26 #include "hlistbrowserclass.h" -
branches/z3950-branch/gsdl/src/recpt/hlistbrowserclass.h
r995 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ … … 64 62 65 63 #endif 66 -
branches/z3950-branch/gsdl/src/recpt/htmlbrowserclass.cpp
r715 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.1 1999/10/18 20:09:17 sjboddie31 new browserclass32 33 34 */35 36 25 37 26 #include "htmlbrowserclass.h" -
branches/z3950-branch/gsdl/src/recpt/htmlbrowserclass.h
r715 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/htmlgen.cpp
r533 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.4 1999/09/07 04:56:55 sjboddie31 added GPL notice32 33 Revision 1.3 1999/02/11 01:24:04 rjmcnab34 35 Fixed a few compiler warnings.36 37 Revision 1.2 1999/02/08 01:28:02 rjmcnab38 39 Got the receptionist producing something using the statusaction.40 41 Revision 1.1 1999/01/08 08:40:56 rjmcnab42 43 Moved from lib directory.44 45 Revision 1.1 1999/01/08 03:57:46 rjmcnab46 47 Initial revision48 49 */50 25 51 26 #include "htmlgen.h" … … 121 96 textout << outconvert << buffer; 122 97 } 123 124 -
branches/z3950-branch/gsdl/src/recpt/htmlgen.h
r533 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/htmlutils.cpp
r1147 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.6 2000/05/04 05:17:46 sjboddie31 moved dm_safe from htmlutils to gsdltools32 33 Revision 1.5 2000/02/13 20:38:59 sjboddie34 added dm_safe function35 36 Revision 1.4 1999/09/07 04:56:56 sjboddie37 added GPL notice38 39 Revision 1.3 1999/06/09 00:09:30 sjboddie40 Added a fairly minimal html_safe function41 42 Revision 1.2 1999/02/08 01:28:02 rjmcnab43 44 Got the receptionist producing something using the statusaction.45 46 Revision 1.1 1999/01/08 08:40:58 rjmcnab47 48 Moved from lib directory.49 50 Revision 1.1 1999/01/08 03:57:47 rjmcnab51 52 Initial revision53 54 */55 56 25 57 26 #include "htmlutils.h" -
branches/z3950-branch/gsdl/src/recpt/htmlutils.h
r1147 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 25 -
branches/z3950-branch/gsdl/src/recpt/infodbclass.cpp
r1149 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.7 2000/05/04 08:21:30 sjboddie31 modifications for windows port of GCC32 33 Revision 1.6 2000/02/15 22:53:50 kjm1834 search history stuff added.35 36 Revision 1.5 1999/10/19 03:23:42 davidb37 Collection building support through web pages38 and internal and external link handling for collection documents39 40 Revision 1.4 1999/09/07 04:56:56 sjboddie41 added GPL notice42 43 Revision 1.3 1999/09/02 00:26:10 rjmcnab44 now there can be multiple values for a single key45 46 Revision 1.2 1999/07/13 23:24:05 rjmcnab47 Added functionality to modify a gdbm database.48 49 Revision 1.1 1999/07/11 08:27:52 rjmcnab50 Moved from src/colservr and added capability to write out data.51 52 Revision 1.4 1999/05/10 03:43:48 sjboddie53 lots of changes to lots of files - getting document action going54 55 Revision 1.3 1999/04/30 02:00:46 sjboddie56 lots of stuff to do with getting documentaction working57 58 Revision 1.2 1999/04/06 22:20:31 rjmcnab59 Got browsefilter working.60 61 Revision 1.1 1999/03/30 05:10:07 rjmcnab62 Initial revision.63 64 */65 66 25 67 26 #include "infodbclass.h" … … 586 545 return true; 587 546 } 588 589 -
branches/z3950-branch/gsdl/src/recpt/infodbclass.h
r928 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 25 … … 33 31 #include "gsdlconf.h" 34 32 #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 35 44 36 45 #ifdef __WIN32__ … … 175 184 176 185 #endif 177 178 179 180 181 -
branches/z3950-branch/gsdl/src/recpt/invbrowserclass.cpp
r668 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.2 1999/10/14 22:59:34 sjboddie31 finished off browser classes32 33 Revision 1.1 1999/10/10 08:28:06 sjboddie34 - metadata now returns map rather than array35 - redesigned browsing support36 37 */38 39 25 40 26 #include "invbrowserclass.h" -
branches/z3950-branch/gsdl/src/recpt/invbrowserclass.h
r752 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/librarymain.cpp
r1168 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.25.2.1 2000/05/11 01:56:29 johnmcp31 32 added proper config file parsing for z39.50 servers, and minor changes33 to pageaction (minor bug when display collections from >1 proto) and34 cgiwrapper (announces which collections are z39.50 servers).35 36 Revision 1.25 2000/04/14 02:52:05 sjboddie37 tidied up error messaging and set up some debugging info to be output38 when running library from command line39 40 Revision 1.24 2000/02/29 20:59:02 sjboddie41 added error message when unable to read from collect directory - should42 probably write this out to a web page too43 44 Revision 1.23 2000/02/21 21:59:37 sjboddie45 gsdlhome now comes from gsdlsite.cfg46 47 Revision 1.22 2000/02/17 02:35:48 sjboddie48 tidied up a bit49 50 Revision 1.21 2000/02/15 22:53:51 kjm1851 search history stuff added.52 53 Revision 1.20 1999/12/13 02:46:56 davidb54 Teach buildaction about recptionist55 56 Revision 1.19 1999/11/01 21:58:49 sjboddie57 no longer set receptionist for some actions that used to58 59 Revision 1.18 1999/10/25 22:29:31 sjboddie60 receptionist now checks collect diectory for collections61 rather than collections.txt file62 63 Revision 1.17 1999/10/19 03:23:43 davidb64 Collection building support through web pages65 and internal and external link handling for collection documents66 67 Revision 1.16 1999/10/18 20:07:33 sjboddie68 added htmlbrowserclass69 70 Revision 1.15 1999/10/14 23:03:10 sjboddie71 another browser72 73 Revision 1.14 1999/10/10 08:14:09 sjboddie74 - metadata now returns mp rather than array75 - redesigned browsing support (although it's not finished so76 won't currently work ;-)77 78 Revision 1.13 1999/09/16 21:39:35 sjboddie79 added gb converters80 81 Revision 1.12 1999/09/14 22:42:06 sjboddie82 included utf8 converter83 84 Revision 1.11 1999/09/14 22:03:27 sjboddie85 now reads in collections from a file to avoid recompiling86 87 Revision 1.10 1999/09/08 00:51:11 sjboddie88 removed old interface stuff89 90 Revision 1.9 1999/09/07 04:56:56 sjboddie91 added GPL notice92 93 Revision 1.8 1999/07/15 06:08:55 rjmcnab94 Moved the adding of the actions to librarymain so that they can95 be overriden easier.96 97 Revision 1.7 1999/06/15 01:56:12 sjboddie98 Got multiple collections working99 100 Revision 1.6 1999/05/10 03:40:39 sjboddie101 lots of changes - slowly getting document action sorted out102 103 Revision 1.5 1999/04/19 23:56:10 rjmcnab104 Finished the gdbm metadata stuff105 106 Revision 1.4 1999/04/12 03:45:05 rjmcnab107 Finished the query filter.108 109 Revision 1.3 1999/04/06 22:20:35 rjmcnab110 Got browsefilter working.111 112 Revision 1.2 1999/03/05 03:53:54 sjboddie113 114 fixed some bugs115 116 Revision 1.1 1999/02/21 22:35:22 rjmcnab117 118 Initial revision.119 120 */121 122 25 123 26 #include "receptionist.h" … … 129 32 #include "filter.h" 130 33 #include "browsefilter.h" 131 #include "queryfilter.h" 34 #include "mgqueryfilter.h" 35 #include "mgppqueryfilter.h" 132 36 #include "infodbclass.h" 37 #include "mggdbmsource.h" 133 38 #include "mgsearch.h" 134 #include "mg gdbmsource.h"39 #include "mgppsearch.h" 135 40 #include "fileutil.h" 136 41 #include <assert.h> … … 162 67 nullproto nproto; 163 68 z3950proto zproto; 69 164 70 text_tarray collections; 165 166 71 167 72 // get gsdlhome … … 170 75 text_t collectdir = filename_cat (gsdlhome, "collect"); 171 76 read_dir (collectdir, collections); 172 77 173 78 text_tarray::const_iterator thiscol = collections.begin(); 174 79 text_tarray::const_iterator endcol = collections.end(); … … 177 82 178 83 // 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 181 112 // this memory is created but never destroyed 182 113 // we're also not doing any error checking to make sure we didn't … … 184 115 collectserver *cserver = new collectserver(); 185 116 gdbmclass *gdbmhandler = new gdbmclass(); 186 mgsearchclass *mgsearch = new mgsearchclass(); 187 117 188 118 // add a null filter 189 119 filterclass *filter = new filterclass (); … … 193 123 browsefilterclass *browsefilter = new browsefilterclass(); 194 124 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 } 208 159 209 160 // inform collection server and everything it contains about its … … 247 198 recpt.add_converter ("u", &utf8inconvert, &utf8outconvert); 248 199 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 256 214 257 215 // the list of actions. Note: these actions will become invalid … … 262 220 263 221 pageaction apageaction; 222 apageaction.set_receptionist (&recpt); 264 223 recpt.add_action (&apageaction); 265 224 … … 268 227 269 228 queryaction aqueryaction; 229 aqueryaction.set_receptionist (&recpt); 270 230 recpt.add_action (&aqueryaction); 271 231 272 232 documentaction adocumentaction; 233 adocumentaction.set_receptionist (&recpt); 273 234 recpt.add_action (&adocumentaction); 274 235 … … 313 274 return 0; 314 275 } 315 316 317 318 319 -
branches/z3950-branch/gsdl/src/recpt/nullproto.cpp
r801 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.12 1999/12/05 21:23:39 sjboddie31 support for multiple gsdlhomes and gdbmhomes32 33 Revision 1.11 1999/10/25 22:29:32 sjboddie34 receptionist now checks collect diectory for collections35 rather than collections.txt file36 37 Revision 1.10 1999/10/19 03:23:43 davidb38 Collection building support through web pages39 and internal and external link handling for collection documents40 41 Revision 1.9 1999/09/07 04:56:56 sjboddie42 added GPL notice43 44 Revision 1.8 1999/06/27 22:04:47 sjboddie45 now read in build.cfg before collect.cfg so that the indexmaps46 are available if required to decode defaultindex, defaultsubcollection,47 and defaultlanguage48 49 Revision 1.7 1999/06/15 02:16:45 sjboddie50 small change to prevent collectdir configuration string from being passed51 to everything52 53 Revision 1.6 1999/05/10 03:40:41 sjboddie54 lots of changes - slowly getting document action sorted out55 56 Revision 1.5 1999/04/30 01:59:41 sjboddie57 lots of stuff - getting documentaction working (documentaction replaces58 old browseaction)59 60 Revision 1.4 1999/03/31 23:44:48 rjmcnab61 Altered the protocol so that the metadata is part of the filter.62 63 Revision 1.3 1999/03/03 23:26:35 sjboddie64 65 Implemented more of the protocol66 67 Revision 1.2 1999/02/25 21:58:58 rjmcnab68 69 Merged sources.70 71 Revision 1.1 1999/02/21 22:35:22 rjmcnab72 73 Initial revision.74 75 */76 77 25 78 26 #include "nullproto.h" … … 117 65 if ((*here).second.c != NULL) { 118 66 const colservrconf &configinfo = (*here).second.c->get_configinfo (); 67 bool failed = false; 119 68 120 69 // configure this collection server … … 130 79 << configinfo.collection << "\", gsdlhome=\"" 131 80 << configinfo.gsdlhome << "\"\n"; 132 // return false; //**** 133 here ++; 134 continue; 81 failed = true; 135 82 } 136 83 … … 142 89 << configinfo.collection << "\", gsdlhome=\"" 143 90 << configinfo.gsdlhome << "\"\n"; 144 // return false; //**** 145 here ++; 146 continue; 91 failed = true; 147 92 } 148 93 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 } 150 99 } 151 100 here++; -
branches/z3950-branch/gsdl/src/recpt/nullproto.h
r533 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/pageaction.cpp
r1168 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.29.6.1 2000/05/11 01:56:30 johnmcp31 32 added proper config file parsing for z39.50 servers, and minor changes33 to pageaction (minor bug when display collections from >1 proto) and34 cgiwrapper (announces which collections are z39.50 servers).35 36 Revision 1.29 2000/03/19 21:16:46 nzdl37 added german language interface38 39 Revision 1.28 2000/02/24 01:19:01 sjboddie40 fixed up messy hack for meldex41 42 Revision 1.27 2000/02/15 22:53:51 kjm1843 search history stuff added.44 45 Revision 1.26 2000/02/03 01:49:35 sjboddie46 fixed up some of the preferences stuff47 48 Revision 1.25 2000/01/26 20:11:04 sjboddie49 added some collection specific help text50 51 Revision 1.24 2000/01/25 22:31:09 sjboddie52 more hacky changes to get preferences to be a bit smarter53 54 Revision 1.23 2000/01/24 22:59:57 sjboddie55 changes to set macros differently for preferences page depending56 on type of collection - pageaction is getting kind of hacky - should57 tidy it up some day58 59 Revision 1.22 1999/11/25 23:01:09 sjboddie60 now need to be able to handle it if no collection is selected61 62 Revision 1.21 1999/11/03 22:50:13 sjboddie63 now defaults to home page64 65 Revision 1.20 1999/11/01 21:58:02 sjboddie66 changes to arguments of many functions, now pass list of protocols67 instead of just that for this collection68 69 Revision 1.19 1999/10/19 21:59:09 sjboddie70 bug in generating "how to find information" text for about pages71 72 Revision 1.18 1999/10/19 03:23:44 davidb73 Collection building support through web pages74 and internal and external link handling for collection documents75 76 Revision 1.17 1999/10/14 23:04:44 sjboddie77 some hacks to make nzdl home page look right78 79 Revision 1.16 1999/10/10 08:14:09 sjboddie80 - metadata now returns mp rather than array81 - redesigned browsing support (although it's not finished so82 won't currently work ;-)83 84 Revision 1.15 1999/09/17 04:46:05 sjboddie85 fixed a couple of problems with 'unknown' classifier86 87 Revision 1.14 1999/09/07 23:08:09 rjmcnab88 Removed some compiler warnings89 90 Revision 1.13 1999/09/07 04:56:57 sjboddie91 added GPL notice92 93 Revision 1.12 1999/09/02 00:26:43 rjmcnab94 made the p cgi argument always saved in the compressed arguments95 96 Revision 1.11 1999/08/25 04:48:43 sjboddie97 changes to the home and about pages98 99 Revision 1.10 1999/08/11 23:29:43 sjboddie100 added support for html classifier (i.e. the hp argument)101 102 Revision 1.9 1999/08/03 03:29:47 sjboddie103 added ability to set receptionist from collect.cfg104 105 Revision 1.8 1999/07/30 02:24:44 sjboddie106 added collectinfo argument to some functions107 108 Revision 1.7 1999/06/24 05:12:24 sjboddie109 lots of small changes110 111 Revision 1.6 1999/06/10 00:39:16 sjboddie112 navigation bar is no longer written out for every page (it should113 be included in the _content_ macro of pages wanting to display it).114 115 Revision 1.5 1999/06/08 04:29:35 sjboddie116 added argsinfo to the call to check_cgiargs to make it easy to set117 args to their default if they're found to be screwed up118 119 Revision 1.4 1999/02/28 20:00:14 rjmcnab120 121 122 Fixed a few things.123 124 Revision 1.3 1999/02/25 21:58:58 rjmcnab125 126 Merged sources.127 128 Revision 1.2 1999/02/21 22:33:54 rjmcnab129 130 Lots of stuff :-)131 132 Revision 1.1 1999/02/12 02:40:17 sjboddie133 134 Added page action135 136 */137 25 138 26 #include "OIDtools.h" … … 192 80 193 81 text_t homeextra = "<center><table width=_pagewidth_><tr valign=top>\n"; 82 bool found_valid_col = false; 194 83 195 84 recptprotolistclass::iterator rprotolist_here = protos->begin(); … … 204 93 text_tarray::iterator collist_here = collist.begin(); 205 94 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; 210 98 while (collist_here != collist_end) { 211 99 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); 214 101 215 if ( err == noError) {216 if (cinfo .isPublic && (cinfo.buildDate > 0)) {102 if (cinfo != NULL) { 103 if (cinfo->isPublic && (cinfo->buildDate > 0)) { 217 104 105 found_valid_col = true; 218 106 FilterResponse_t response; 219 107 text_tset metadata; … … 239 127 } 240 128 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"; 253 131 254 132 text_t link = "<a href=\"_gwcgi_?a=p&p=about&c=" + *collist_here + "\">"; … … 256 134 link = "<a href=\"_gwcgi_?a=p&p=about&l=zh&nw=u&c=" + *collist_here + "\">"; 257 135 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 + "\">"; 262 140 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"; 267 142 268 143 count ++; 144 first = false; 269 145 } 270 146 } … … 272 148 collist_here ++; 273 149 } 150 274 151 // disp.setmacro ("homeextra", "home", homeextra); 152 for (; count%3 != 0; count ++) homeextra += "<td></td>\n"; 275 153 } 276 154 } … … 278 156 rprotolist_here ++; 279 157 } 158 280 159 homeextra += "</tr></table></center>\n"; 281 160 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 282 168 } 283 169 … … 327 213 328 214 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 329 222 text_t &arg_p = args["p"]; 330 223 text_t &arg_c = args["c"]; 331 ColInfoResponse_t cinfo; 332 comerror_t err; 224 ColInfoResponse_t *cinfo = NULL; 333 225 334 226 recptproto* collectproto = protos->getrecptproto (arg_c, logout); 335 227 if (collectproto != NULL) { 336 c ollectproto->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); 339 231 unsigned long current_time = time(NULL); 340 unsigned long builddate = (current_time - cinfo .buildDate) / 86400;232 unsigned long builddate = (current_time - cinfo->buildDate) / 86400; 341 233 disp.setmacro ("builddate", "Global", builddate); 342 234 } … … 348 240 // _collectionoption_ 349 241 350 if (args["ccs"] == "1" && collectproto != NULL && (cinfo .ccsCols.size() > 1)) {242 if (args["ccs"] == "1" && collectproto != NULL && (cinfo->ccsCols.size() > 1)) { 351 243 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(); 354 246 int count = 0; 355 247 while (col_here != col_end) { 356 248 text_t colname; 357 249 if (*col_here == arg_c) { 358 colname = cinfo .collectionmeta["collectionname"];250 colname = cinfo->collectionmeta["collectionname"]; 359 251 } 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"]; 364 255 } 365 256 … … 377 268 // _htmloptions_ 378 269 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")) { 381 272 disp.setmacro ("htmloptions", "preferences", "_htmloptionson_"); 382 273 … … 384 275 // _PreferenceDocsFromWeb_ 385 276 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")) 388 279 disp.setmacro ("PreferenceDocsFromWeb", "preferences", "1"); 389 280 } … … 400 291 text_tarray languages; 401 292 languages.push_back ("en"); 293 languages.push_back ("fr"); 402 294 languages.push_back ("de"); 295 languages.push_back ("es"); 403 296 languages.push_back ("mi"); 404 297 languages.push_back ("zh"); 298 languages.push_back ("ar"); 405 299 text_tarray::const_iterator this_lang = languages.begin(); 406 300 text_tarray::const_iterator end_lang = languages.end(); 407 301 408 302 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())) { 411 305 text_tset pref_langs; 412 306 splitchar ((*it).second.begin(), (*it).second.end(), '|', pref_langs); … … 479 373 480 374 // 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")) { 483 377 disp.setmacro ("topicreadingdocs", "help", ""); 484 378 disp.setmacro ("texthelpreadingdocs", "help", ""); 485 379 } 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")) { 488 382 disp.setmacro ("texthelpreadingdocs", "help", "_bibtexthelpreadingdocs_"); 489 383 disp.setmacro ("textreadingdocs", "help", "_bibtextreadingdocs_"); 490 384 } 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")) { 493 387 disp.setmacro ("texthelpreadingdocs", "help", "_booktexthelpreadingdocs_"); 494 388 disp.setmacro ("textreadingdocs", "help", "_booktextreadingdocs_"); … … 499 393 500 394 // _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(); 505 399 bool first = true; 506 400 int count = 0; … … 508 402 if (*here == arg_c) { 509 403 if (!first) textsubcollections += "<br>"; 510 textsubcollections += "\n" + cinfo .collectionmeta["collectionname"] + "\n";404 textsubcollections += "\n" + cinfo->collectionmeta["collectionname"] + "\n"; 511 405 } 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;} 515 408 if (!first) textsubcollections += "<br>"; 516 textsubcollections += "\n" + this_cinfo .collectionmeta["collectionname"] + "\n";409 textsubcollections += "\n" + this_cinfo->collectionmeta["collectionname"] + "\n"; 517 410 } 518 411 count ++; … … 541 434 return true; 542 435 } 543 544 545 546 547 -
branches/z3950-branch/gsdl/src/recpt/pageaction.h
r761 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 25 … … 46 44 pageaction (); 47 45 virtual ~pageaction (); 46 47 void set_receptionist (receptionist *therecpt) {recpt=therecpt;} 48 48 49 49 text_t get_action_name () {return "p";} -
branches/z3950-branch/gsdl/src/recpt/pagedbrowserclass.cpp
r1048 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.9 2000/03/31 03:04:32 nzdl31 tidied up some of the browsing code - replaced DocumentImages,32 DocumentTitles and DocumentHeading with DocumentIcon33 34 Revision 1.8 2000/02/17 20:54:00 sjboddie35 minor change to macro name36 37 Revision 1.7 2000/02/17 02:35:48 sjboddie38 tidied up a bit39 40 Revision 1.6 2000/02/15 22:53:51 kjm1841 search history stuff added.42 43 Revision 1.5 2000/02/06 21:29:11 sjboddie44 fixed a bug - made some functions virtual for use with cstr collection45 46 Revision 1.4 1999/10/30 23:06:25 sjboddie47 tidied up a bit48 49 Revision 1.3 1999/10/30 22:16:37 sjboddie50 added a collection argument51 52 Revision 1.2 1999/10/19 08:40:11 sjboddie53 fixed some stupid compiler warnings on windows54 55 Revision 1.1 1999/10/14 22:59:35 sjboddie56 finished off browser classes57 58 */59 60 25 61 26 #include "pagedbrowserclass.h" … … 77 42 void pagedbrowserclass::load_metadata_defaults (text_tset &metadata) { 78 43 metadata.insert ("Title"); 79 }80 81 text_t pagedbrowserclass::get_default_formatstring () {82 return "";83 44 } 84 45 … … 120 81 } 121 82 } 122 123 124 125 83 } 126 84 … … 137 95 138 96 if (section.OID != args["d"]) { 139 // set the _parentarrow_ macro140 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); 142 100 disp.setmacro ("parentarrow", "document", parentarrow); 143 101 return 0; … … 165 123 166 124 text_t previousOID, previoustitle, nextOID, nexttitle; 167 text_t previousarrow, nextarrow ;125 text_t previousarrow, nextarrow, httpprevarrow, httpnextarrow; 168 126 bool found = false; 169 127 … … 182 140 previousOID = (*(thissection-1)).OID; 183 141 previoustitle = (*(thissection-1)).metadata["Title"].values[0]; 184 } else 142 } else { 185 143 previousarrow = "_document:parentarrow_"; 144 } 186 145 187 146 if ((thissection+1) != endsection) { … … 202 161 << ("_document:textnumpages_(" + text_t(numpages) + ")</center></td></tr>\n"); 203 162 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 } 214 177 } 178 179 if (!httpprevarrow.empty()) disp.setmacro ("httpprevarrow", "document", httpprevarrow); 180 if (!httpnextarrow.empty()) disp.setmacro ("httpnextarrow", "document", httpnextarrow); 215 181 216 182 textout << outconvert << disp << "<tr valign=middle>\n" … … 222 188 return 0; 223 189 } 224 225 226 227 228 229 -
branches/z3950-branch/gsdl/src/recpt/pagedbrowserclass.h
r928 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 25 … … 45 43 void load_metadata_defaults (text_tset &metadata); 46 44 47 text_t get_default_formatstring ();48 49 45 virtual void processOID (cgiargsclass &args, recptproto *collectproto, 50 46 ostream &logout); … … 66 62 67 63 #endif 68 -
branches/z3950-branch/gsdl/src/recpt/pingaction.cpp
r760 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.5 1999/11/01 21:56:32 sjboddie31 changes to arguments of many functions32 33 Revision 1.4 1999/09/07 04:56:57 sjboddie34 added GPL notice35 36 Revision 1.3 1999/07/30 02:24:45 sjboddie37 added collectinfo argument to some functions38 39 Revision 1.2 1999/02/25 21:58:59 rjmcnab40 41 Merged sources.42 43 Revision 1.1 1999/02/21 22:35:20 rjmcnab44 45 Initial revision.46 47 */48 49 25 50 26 #include "pingaction.h" -
branches/z3950-branch/gsdl/src/recpt/pingaction.h
r760 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/queryaction.cpp
r1174 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.36.6.1 2000/05/17 02:57:00 johnmcp31 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 sjboddie35 actions are now configured with gsdlhome36 37 Revision 1.35 2000/02/17 02:35:04 sjboddie38 tidied up search history stuff a bit - replaced strings with macros39 40 Revision 1.34 2000/02/15 22:53:52 kjm1841 search history stuff added.42 43 Revision 1.33 2000/01/24 22:57:59 sjboddie44 fixed bug in cross-collection searching, tidied up a bit45 46 Revision 1.32 1999/12/13 02:54:11 davidb47 Support for cross collection searching (CCS)48 49 Revision 1.31 1999/12/05 21:22:33 sjboddie50 tidied up cross-collection searching a bit51 52 Revision 1.30 1999/11/08 20:26:37 sjboddie53 added multiplevalue option to cgiarginfo54 55 Revision 1.29 1999/11/04 20:29:53 sjboddie56 small change to cross-collection searching57 58 Revision 1.28 1999/11/03 22:49:50 sjboddie59 A few changes to cross-collection searching for fao60 61 Revision 1.27 1999/11/01 21:53:27 sjboddie62 added cross-collection searching capability - still needs lots of63 work but the basic functionality is there64 65 Revision 1.26 1999/10/10 08:14:10 sjboddie66 - metadata now returns mp rather than array67 - redesigned browsing support (although it's not finished so68 won't currently work ;-)69 70 Revision 1.25 1999/09/24 04:49:39 sjboddie71 fixed up the query selection boxes to display properly if there's only72 a single index/sub-collection73 74 Revision 1.24 1999/09/22 03:44:31 sjboddie75 EndResults query filter option may now take '-1' for 'all'76 77 Revision 1.23 1999/09/21 11:34:42 sjboddie78 added Maxdocs queryfilter option which may be -1 for 'all'79 80 Revision 1.22 1999/09/07 23:08:51 rjmcnab81 removed some compiler warnings82 83 Revision 1.21 1999/09/07 04:56:57 sjboddie84 added GPL notice85 86 Revision 1.20 1999/08/25 04:47:55 sjboddie87 added advanced search option - other minor changes88 89 Revision 1.19 1999/08/13 04:17:24 sjboddie90 small change to do with new collection-level metadata91 92 Revision 1.18 1999/08/10 22:46:33 sjboddie93 changed format option result to QueryResults and added QueryLinks option94 95 Revision 1.17 1999/07/30 02:24:42 sjboddie96 added collectinfo argument to some functions97 98 Revision 1.16 1999/07/19 00:16:58 sjboddie99 no longer display documents that don't match all phrases in query string100 101 Revision 1.15 1999/07/16 08:33:36 rjmcnab102 Changed the logic for getting the results string slightly103 104 Revision 1.14 1999/07/16 03:41:29 sjboddie105 changed isApprox106 107 Revision 1.13 1999/07/16 00:19:01 sjboddie108 some changes to the way quoted queries are handled109 110 Revision 1.12 1999/07/09 02:17:55 rjmcnab111 Setting macros needed for a second query.112 113 Revision 1.11 1999/07/07 06:13:10 rjmcnab114 Added ability to combine two independant queries.115 116 Revision 1.10 1999/07/07 05:49:35 sjboddie117 had another crack at the format string code - created a new formattools118 module. It can now handle {If} and {Or} statements although there's a119 bug preventing nested if's and or's.120 121 Revision 1.9 1999/07/01 22:48:46 sjboddie122 had a go at getting a query result format string working123 124 Revision 1.8 1999/06/27 22:02:11 sjboddie125 author is added to queryresults if there is one126 127 Revision 1.7 1999/06/26 01:10:18 rjmcnab128 Made h, i, and n arguments saved in the compressed arguments.129 130 Revision 1.6 1999/06/24 05:12:25 sjboddie131 lots of small changes132 133 Revision 1.5 1999/06/16 04:03:48 sjboddie134 Now sets "cl" arg to "search" when going to a document from a search135 results page. This allows the close book icon (in hierarchy toc) to136 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 a138 classification or a search (i.e. if "cl" isn't set) then the close139 book icon is disabled140 141 Revision 1.4 1999/06/16 02:08:38 sjboddie142 got queryaction working143 144 Revision 1.3 1999/03/25 03:06:45 sjboddie145 146 altered receptionist slightly so it now passes *collectproto to147 define_internal_macros and define_external_macros - need it148 for browseaction149 150 Revision 1.2 1999/03/03 20:26:50 rjmcnab151 152 Modified stuff.153 154 Revision 1.1 1999/02/28 22:45:21 rjmcnab155 156 Initial revision.157 158 */159 160 25 161 26 #include "queryaction.h" … … 181 46 queryaction::queryaction () { 182 47 48 recpt = NULL; 183 49 num_phrases = 0; 184 50 … … 397 263 arg_ainfo.defaultstatus = cgiarginfo::weak; 398 264 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"; 399 275 arg_ainfo.savedarginfo = cgiarginfo::must; 400 276 argsinfo.addarginfo (NULL, arg_ainfo); … … 615 491 it = response.filterOptions.find ("CombineQuery"); 616 492 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); 617 497 618 498 // define_history_macros(disp, args, protos, logout); … … 699 579 ostream &textout, ostream &logout) { 700 580 701 ColInfoResponse_t cinfo;581 ColInfoResponse_t *cinfo = NULL; 702 582 comerror_t err; 703 583 InfoFilterOptionsResponse_t fresponse; … … 741 621 while (collist_here != collist_end) { 742 622 743 (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout);623 cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout); 744 624 // if (err == noError && cinfo.isPublic && (cinfo.buildDate > 0)) { 745 if ( err == noError && (cinfo.buildDate > 0)) {625 if (cinfo != NULL && (cinfo->buildDate > 0)) { 746 626 747 627 (*rprotolist_here).p->get_filteroptions (*collist_here, frequest, fresponse, err, logout); … … 793 673 << " name=cc value=\"" << *collist_here << "\">"; 794 674 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"]; 797 677 else 798 678 textout << outconvert << *collist_here; … … 820 700 ostream &logout) { 821 701 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 822 710 if (args["ccs"] == "1") { 823 711 if (!args["cc"].empty()) { … … 870 758 map<text_t, colinfo_t, lttext_t> colinfomap; 871 759 872 ColInfoResponse_t cinfo;760 ColInfoResponse_t *cinfo = NULL; 873 761 comerror_t err; 874 762 FilterRequest_t request; … … 910 798 continue; 911 799 } 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 } 913 806 914 807 browserclass *bptr = browsers->getbrowser (browsertype); … … 917 810 text_t formatstring; 918 811 if (!get_formatstring (classification, browsertype, 919 cinfo .format, formatstring))812 cinfo->format, formatstring)) 920 813 formatstring = bptr->get_default_formatstring(); 921 814 … … 1073 966 text_t classification = "Search"; 1074 967 1075 ColInfoResponse_t cinfo;1076 968 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 } 1078 975 1079 976 browserclass *bptr = browsers->getbrowser (browsertype); … … 1082 979 text_t formatstring; 1083 980 if (!get_formatstring (classification, browsertype, 1084 cinfo .format, formatstring))981 cinfo->format, formatstring)) 1085 982 formatstring = bptr->get_default_formatstring(); 1086 983 … … 1097 994 text_t formattedstring = args["q"]; 1098 995 if (!combine_query (args["z"], formattedstring, gsdlhome)) { 1099 args["q"]=formattedstring; 996 args["q"]=formattedstring; 1100 997 } 1101 998 … … 1143 1040 void queryaction::define_query_macros (cgiargsclass &args, displayclass &disp, 1144 1041 const FilterResponse_t &response) { 1145 1146 1042 // set up _freqmsg_ and _quotedquery_ macros 1147 1043 text_t freqmsg = "_textfreqmsg1_"; … … 1154 1050 this_term ++; 1155 1051 } 1156 1157 1052 disp.setmacro ("freqmsg", "query", freqmsg); 1158 1053 … … 1207 1102 bool queryaction::save_search_history (cgiargsclass &args, const FilterResponse_t &response) 1208 1103 { 1104 1209 1105 if (args["q"]=="") return true; // null query, dont save 1210 1106 if (args["hs"]=="0") return true; // only save when submit query … … 1238 1134 1239 1135 } 1240 1241 1242 1243 1244 -
branches/z3950-branch/gsdl/src/recpt/queryaction.h
r928 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 25 … … 32 30 #include "gsdlconf.h" 33 31 #include "action.h" 32 #include "receptionist.h" 34 33 35 34 struct colinfo_t { … … 61 60 62 61 protected: 62 63 receptionist *recpt; 64 63 65 text_t formatstring; 64 66 int num_phrases; … … 97 99 queryaction (); 98 100 virtual ~queryaction () {} 101 102 void set_receptionist (receptionist *therecpt) {recpt=therecpt;} 99 103 100 104 void configure (const text_t &key, const text_tarray &cfgline); … … 123 127 124 128 #endif 125 126 -
branches/z3950-branch/gsdl/src/recpt/querytools.cpp
r759 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.8 1999/11/01 21:56:12 sjboddie31 changes for cross-collection searching - still needs work32 33 Revision 1.7 1999/09/21 11:32:42 sjboddie34 added Maxdocs queryfilter option which may be -1 for 'all'35 36 Revision 1.6 1999/09/07 04:56:58 sjboddie37 added GPL notice38 39 Revision 1.5 1999/08/25 04:47:55 sjboddie40 added advanced search option - other minor changes41 42 Revision 1.4 1999/07/19 00:16:58 sjboddie43 no longer display documents that don't match all phrases in query string44 45 Revision 1.3 1999/07/16 00:19:02 sjboddie46 some changes to the way quoted queries are handled47 48 Revision 1.2 1999/07/07 06:12:21 rjmcnab49 Added ability to combine two independant queries.50 51 Revision 1.1 1999/06/15 02:24:06 sjboddie52 moved do_query from queryaction to new querytools module (as do_action53 is also called from documentaction when highlighting text)54 55 */56 57 25 58 26 #include "querytools.h" … … 99 67 option.name = "Language"; 100 68 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"]; 101 75 request.filterOptions.push_back (option); 102 76 } … … 163 137 option.value = arg_m; 164 138 request.filterOptions.push_back (option); 165 139 166 140 // option.name = "StartResults"; 167 141 // option.value = args["r"]; … … 238 212 } 239 213 } 240 -
branches/z3950-branch/gsdl/src/recpt/querytools.h
r759 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/receptionist.cpp
r1148 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.49 2000/05/04 05:18:46 sjboddie31 attempting to get end-user collection building to work under windows32 33 Revision 1.48 2000/04/14 02:52:06 sjboddie34 tidied up error messaging and set up some debugging info to be output35 when running library from command line36 37 Revision 1.47 2000/02/17 22:26:17 sjboddie38 set macros for displaying macrons in utf839 40 Revision 1.46 2000/02/17 02:34:09 sjboddie41 made compressedoptions macro dm_safe - added SCRIPT_NAME to log string42 43 Revision 1.45 2000/02/03 01:48:52 sjboddie44 fixed potential bug in ccscols stuff45 46 Revision 1.44 2000/01/24 22:53:09 sjboddie47 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 sjboddie51 added arabic encoding52 53 Revision 1.42 1999/12/05 21:21:04 sjboddie54 added support for multiple gsdlhomes and gdbmhomes55 56 Revision 1.41 1999/11/25 21:44:16 sjboddie57 fixed bug in logout58 59 Revision 1.40 1999/11/08 20:26:37 sjboddie60 added multiplevalue option to cgiarginfo61 62 Revision 1.39 1999/11/03 22:49:10 sjboddie63 A location url may now contain macros64 65 Revision 1.38 1999/11/01 21:49:34 sjboddie66 changes to arguments of many functions67 68 Revision 1.37 1999/10/20 03:55:03 sjboddie69 yet another problem with calling browserclass70 processOID functions correctly71 72 Revision 1.36 1999/10/19 03:23:44 davidb73 Collection building support through web pages74 and internal and external link handling for collection documents75 76 Revision 1.35 1999/10/18 20:07:05 sjboddie77 tidied up a few things - moved processing of "hp" argument78 to htmlbrowserclass79 80 Revision 1.34 1999/10/14 23:00:52 sjboddie81 finished changes to browsing support82 83 Revision 1.33 1999/10/10 08:14:10 sjboddie84 - metadata now returns mp rather than array85 - redesigned browsing support (although it's not finished so86 won't currently work ;-)87 88 Revision 1.32 1999/09/21 11:28:45 sjboddie89 tidied up file locking90 91 Revision 1.31 1999/09/16 21:38:17 sjboddie92 added some file locking stuff for logging. Windows still needs to93 be done.94 95 Revision 1.30 1999/09/07 04:56:58 sjboddie96 added GPL notice97 98 Revision 1.29 1999/09/03 10:02:30 rjmcnab99 Made the page parameters configurable. Now the page parameters must100 correspond to cgi arguments in name and value (ie language=zh should now101 be l=zh) which makes things more consistent anyway. Removed a couple of102 specialised NZDL page parameters.103 104 Moved the combining of the cgi arguments so that the receptionist does105 all the configuration now.106 107 Made the macro precedence configurable.108 109 Made cgi arguments totally configurable. Now any piece of information about110 a cgi argument can be configured meaning that cgi arguments can be declared111 from the configuration file.112 113 Removed the argdefault configuration argument. This should now be done114 using cgiarg.115 116 Revision 1.28 1999/09/03 04:39:46 rjmcnab117 Made cookies and logs optional (they are turned off by default). To118 turn them on put119 120 usecookies true121 logcgiargs true122 123 in your configuration file.124 125 Revision 1.27 1999/09/02 00:27:21 rjmcnab126 A few small things.127 128 Revision 1.26 1999/08/25 04:43:06 sjboddie129 made FilterRequest_t::docSet an array rather than a set130 131 Revision 1.25 1999/08/20 00:59:01 sjboddie132 -fixed up location redirection133 -added some usage logging, also now set a GSDL_UID cookie. Logging134 does NOT presently lock the log file while it's in use. That has yet135 to be done.136 137 Revision 1.24 1999/08/13 04:16:42 sjboddie138 added some collection-level metadata stuff139 140 Revision 1.23 1999/08/11 23:28:59 sjboddie141 added support for html classifier (i.e. the hp argumant now must be142 translated too).143 144 Revision 1.22 1999/08/10 22:45:21 sjboddie145 format option ShowTopPages is now called DocumentTopPages146 147 Revision 1.21 1999/08/09 04:25:17 sjboddie148 moved OID translation stuff from documentaction::define_external_macros149 to receptionist150 151 Revision 1.20 1999/07/30 02:13:09 sjboddie152 -added collectinfo argument to some functions153 -made some function prototypes virtual154 155 Revision 1.19 1999/07/15 06:02:05 rjmcnab156 Moved the setting of argsinfo into the constructor. Added the configuration157 command argdefault (as used by the actions). Added code to output the158 correct charset based on the page encoding so that the user does not need159 to specify the encoding used for a particular page.160 161 Revision 1.18 1999/07/11 01:05:20 rjmcnab162 Stored origin of cgiarg with argument.163 164 Revision 1.17 1999/07/10 22:18:26 rjmcnab165 Added calls to define_external_cgiargs.166 167 Revision 1.16 1999/06/27 21:49:03 sjboddie168 fixed a couple of version conflicts - tidied up some small things169 170 Revision 1.15 1999/06/26 01:14:32 rjmcnab171 Made a couple of changes to handle different encodings.172 173 Revision 1.14 1999/06/09 00:08:36 sjboddie174 query string macro (_cgiargq_) is now made html safe before being set175 176 Revision 1.13 1999/06/08 04:29:31 sjboddie177 added argsinfo to the call to check_cgiargs to make it easy to set178 args to their default if they're found to be screwed up179 180 Revision 1.12 1999/04/30 01:59:42 sjboddie181 lots of stuff - getting documentaction working (documentaction replaces182 old browseaction)183 184 Revision 1.11 1999/03/25 03:06:43 sjboddie185 186 altered receptionist slightly so it now passes *collectproto to187 define_internal_macros and define_external_macros - need it188 for browseaction189 190 Revision 1.10 1999/03/05 03:53:54 sjboddie191 192 fixed some bugs193 194 Revision 1.9 1999/02/28 20:00:16 rjmcnab195 196 197 Fixed a few things.198 199 Revision 1.8 1999/02/25 21:58:59 rjmcnab200 201 Merged sources.202 203 Revision 1.7 1999/02/21 22:33:55 rjmcnab204 205 Lots of stuff :-)206 207 Revision 1.6 1999/02/11 01:24:05 rjmcnab208 209 Fixed a few compiler warnings.210 211 Revision 1.5 1999/02/08 01:28:02 rjmcnab212 213 Got the receptionist producing something using the statusaction.214 215 Revision 1.4 1999/02/05 10:42:46 rjmcnab216 217 Continued working on receptionist218 219 Revision 1.3 1999/02/04 10:00:56 rjmcnab220 221 Developed the idea of an "action" and having them define the cgi arguments222 which they need and how those cgi arguments function.223 224 Revision 1.2 1999/02/04 01:17:27 rjmcnab225 226 Got it outputing something.227 228 229 */230 231 25 232 26 #include "receptionist.h" … … 239 33 #include <time.h> 240 34 #include <stdio.h> 35 #if defined (GSDL_USE_IOS_H) 241 36 #include <fstream.h> 37 #else 38 #include <fstream> 39 #endif 242 40 243 41 #if defined (__WIN32_) … … 252 50 collectdir.clear(); 253 51 httpprefix.clear(); 254 httpimg .clear();52 httpimg = "/images"; 255 53 gwcgi.clear(); 256 54 macrofiles.erase(macrofiles.begin(), macrofiles.end()); … … 272 70 } 273 71 274 72 void collectioninfo_t::clear () { 73 gsdl_gsdlhome.clear(); 74 gsdl_gdbmhome.clear(); 75 76 info_loaded = false; 77 info.clear(); 78 } 275 79 276 80 receptionist::receptionist () { … … 789 593 utf8outconvertclass text_t2utf8; 790 594 char *lfile = filename.getcstr(); 595 791 596 ofstream log (lfile, ios::app); 792 597 … … 912 717 bool receptionist::produce_content (cgiargsclass &args, ostream &contentout, 913 718 ostream &logout) { 914 719 915 720 // decide on the output conversion class 916 721 text_t &arg_w = args["w"]; … … 1019 824 colinfo_tmap::iterator colend = configinfo.collectinfo.end(); 1020 825 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 } 1023 830 colhere ++; 1024 831 } … … 1103 910 1104 911 text_t &arg_c = args["c"]; 1105 ColInfoResponse_t cinfo;1106 comerror_t err;1107 912 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 } 1122 939 } 1123 col_here ++;1124 940 } 941 } else { 942 logout << "ERROR (receptionist::check_mainargs): get_collectinfo_ptr returned NULL\n"; 1125 943 } 1126 944 } … … 1245 1063 decode_cgi_arg (compressedoptions); 1246 1064 disp.setmacro ("decodedcompressedoptions", "Global", dm_safe(compressedoptions)); 1065 1066 #if defined (__WIN32__) 1067 disp.setmacro ("win32", "Global", "1"); 1068 #endif 1247 1069 1248 1070 // set macron macros if encoding is utf8 … … 1307 1129 } 1308 1130 } 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 1135 ColInfoResponse_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 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 25 … … 34 32 #include "cgiargs.h" 35 33 #include "display.h" 36 #include "action.h"37 34 #include "browserclass.h" 38 35 #include "recptproto.h" 39 36 #include "converter.h" 40 37 #include "cfgread.h" 38 #include "action.h" 41 39 42 40 // the MACROPRECEDENCE macro is used as a default. override … … 51 49 52 50 51 struct 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 62 typedef map<text_t, collectioninfo_t, lttext_t> colinfo_tmap; 63 64 53 65 struct recptconf { 54 66 text_t gsdlhome; … … 58 70 colinfo_tmap collectinfo; 59 71 text_t httpprefix; 60 text_t httpimg; 72 text_t httpimg; // will equal /images if not set 61 73 text_t gwcgi; 62 74 text_tset macrofiles; … … 71 83 recptconf () {clear();} 72 84 }; 73 74 85 75 86 class receptionist { … … 196 207 // list. This can be used to save preferences between sessions. 197 208 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 198 217 199 218 protected: -
branches/z3950-branch/gsdl/src/recpt/recptconfig.cpp
r1090 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.8 2000/04/14 03:10:35 sjboddie31 tidied up a few issues concerning the new debug info which showed32 up on windows33 34 Revision 1.7 2000/04/14 02:52:06 sjboddie35 tidied up error messaging and set up some debugging info to be output36 when running library from command line37 38 Revision 1.6 2000/02/21 21:55:33 sjboddie39 gsdlhome now comes from gsdlsite.cfg40 41 Revision 1.5 1999/09/07 04:56:59 sjboddie42 added GPL notice43 44 Revision 1.4 1999/09/07 00:09:31 sjboddie45 now reads in both main.cfg and collect.cfg always46 47 Revision 1.3 1999/02/21 22:33:57 rjmcnab48 49 Lots of stuff :-)50 51 Revision 1.2 1999/02/08 01:28:04 rjmcnab52 53 Got the receptionist producing something using the statusaction.54 55 Revision 1.1 1999/02/05 06:50:32 rjmcnab56 57 Initial revision.58 59 */60 61 25 62 26 #include "recptconfig.h" … … 87 51 text_tarray cfgline; 88 52 text_t key; 53 54 #ifdef GSDL_USE_IOS_H 89 55 ifstream confin ("gsdlsite.cfg", ios::in | ios::nocreate); 56 #else 57 ifstream confin ("gsdlsite.cfg", ios::in); 58 #endif 90 59 91 60 if (confin) { … … 122 91 text_tarray cfgline; 123 92 text_t key; 93 94 #ifdef GSDL_USE_IOS_H 124 95 ifstream confin ("gsdlsite.cfg", ios::in | ios::nocreate); 96 #else 97 ifstream confin ("gsdlsite.cfg", ios::in); 98 #endif 125 99 126 100 if (confin) { … … 153 127 if (file_exists (filename)) { 154 128 char *cstr = filename.getcstr(); 129 130 #ifdef GSDL_USE_IOS_H 155 131 ifstream confin (cstr, ios::in | ios::nocreate); 132 #else 133 ifstream confin (cstr, ios::in); 134 #endif 135 156 136 delete cstr; 157 137 … … 186 166 if (!filename.empty()) { 187 167 char *cstr = filename.getcstr(); 168 169 #ifdef GSDL_USE_IOS_H 188 170 ifstream confin (cstr, ios::in | ios::nocreate); 171 #else 172 ifstream confin (cstr, ios::in); 173 #endif 174 189 175 delete cstr; 190 176 -
branches/z3950-branch/gsdl/src/recpt/recptconfig.h
r963 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/recptmain.cpp
r533 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.3 1999/09/07 04:56:59 sjboddie31 added GPL notice32 33 Revision 1.2 1999/02/21 22:33:58 rjmcnab34 35 Lots of stuff :-)36 37 Revision 1.1 1999/02/04 01:16:18 rjmcnab38 39 Initial revision.40 41 */42 43 25 44 26 #include "receptionist.h" … … 51 33 return 0; 52 34 } 53 -
branches/z3950-branch/gsdl/src/recpt/recptproto.cpp
r533 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.7 1999/09/07 04:56:59 sjboddie31 added GPL notice32 33 Revision 1.6 1999/05/10 03:40:43 sjboddie34 lots of changes - slowly getting document action sorted out35 36 Revision 1.5 1999/04/30 01:59:43 sjboddie37 lots of stuff - getting documentaction working (documentaction replaces38 old browseaction)39 40 Revision 1.4 1999/03/31 23:44:48 rjmcnab41 Altered the protocol so that the metadata is part of the filter.42 43 Revision 1.3 1999/03/03 23:26:35 sjboddie44 45 Implemented more of the protocol46 47 Revision 1.2 1999/02/25 21:59:01 rjmcnab48 49 Merged sources.50 51 Revision 1.1 1999/02/21 22:35:24 rjmcnab52 53 Initial revision.54 55 */56 57 25 58 26 #include "recptproto.h" … … 182 150 return NULL; 183 151 } 184 -
branches/z3950-branch/gsdl/src/recpt/recptproto.h
r722 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/statusaction.cpp
r1129 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.26 2000/04/19 22:30:23 sjboddie31 tidied up status pages and end-user collection building32 33 Revision 1.25 2000/02/29 21:00:31 sjboddie34 fixed some compiler warnings35 36 Revision 1.24 1999/12/06 01:13:02 sjboddie37 macrofiles is now a set to allow for multiple gsdlhomes38 39 Revision 1.23 1999/11/09 02:26:20 sjboddie40 added some new(ish) options41 42 Revision 1.22 1999/11/01 21:55:27 sjboddie43 changes to arguments of many functions44 45 Revision 1.21 1999/10/19 03:23:46 davidb46 Collection building support through web pages47 and internal and external link handling for collection documents48 49 Revision 1.20 1999/10/18 20:10:41 sjboddie50 don't want to use authentication to reach status page (usersaction still51 uses authentication)52 53 Revision 1.19 1999/09/07 23:09:40 rjmcnab54 removed some compiler warnings55 56 Revision 1.18 1999/09/07 04:57:00 sjboddie57 added GPL notice58 59 Revision 1.17 1999/09/03 09:53:46 rjmcnab60 Output more configuration options for the receptionist.61 62 Revision 1.16 1999/09/02 00:28:42 rjmcnab63 removed dependancy on GSDL_GSDLHOME64 65 Revision 1.15 1999/07/30 02:24:42 sjboddie66 added collectinfo argument to some functions67 68 Revision 1.14 1999/07/13 23:26:07 rjmcnab69 Added support for authenaction and usersaction70 71 Revision 1.13 1999/06/08 04:29:39 sjboddie72 added argsinfo to the call to check_cgiargs to make it easy to set73 args to their default if they're found to be screwed up74 75 Revision 1.12 1999/04/06 22:20:35 rjmcnab76 Got browsefilter working.77 78 Revision 1.11 1999/03/31 23:44:49 rjmcnab79 Altered the protocol so that the metadata is part of the filter.80 81 Revision 1.10 1999/03/16 04:47:03 rjmcnab82 Changed the list of arguments on the argument page to be the info list83 not the current args list (there are some arguments which don't have84 a default so they never make it onto the args list).85 86 Revision 1.9 1999/03/11 01:26:02 rjmcnab87 Fixed a few small formatting things.88 89 Revision 1.8 1999/03/11 00:12:30 rjmcnab90 Started using status.dm to handle the bulky text. Made the status91 action use frames and added some more information.92 93 Revision 1.7 1999/03/09 21:00:47 rjmcnab94 Reorganised the statusaction, added more functions to comtypes.95 96 Revision 1.6 1999/02/25 21:59:02 rjmcnab97 98 Merged sources.99 100 Revision 1.5 1999/02/21 22:33:58 rjmcnab101 102 Lots of stuff :-)103 104 Revision 1.4 1999/02/12 02:40:18 sjboddie105 106 Added page action107 108 Revision 1.3 1999/02/11 23:07:00 sjboddie109 110 extended the status action111 112 Revision 1.2 1999/02/11 01:24:06 rjmcnab113 114 Fixed a few compiler warnings.115 116 Revision 1.1 1999/02/11 01:01:27 rjmcnab117 118 Initial revision.119 120 */121 122 25 123 26 #include "statusaction.h" … … 144 47 displayclass &disp, outconvertclass &outconvert, 145 48 ostream &textout, ostream &logout) { 49 50 if (recpt == NULL) return; 146 51 147 52 textout << outconvert << disp … … 175 80 << "</a></td>"; 176 81 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) { 180 84 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; 183 87 184 88 textout << "<td>"; 185 if (cinfo .buildDate > 0)89 if (cinfo->buildDate > 0) 186 90 textout << outconvert << disp 187 91 << "<a href=\"_httppagex_(about)&c=" << *collist_here 188 << "\" target= _top>";92 << "\" target=\\_top>"; 189 93 190 94 textout << outconvert << disp << collname; 191 95 192 if (cinfo .buildDate > 0) textout << "</a>";96 if (cinfo->buildDate > 0) textout << "</a>"; 193 97 194 98 textout << "</td>"; 195 99 196 if (cinfo .isPublic) textout << "<td>yes</td>";100 if (cinfo->isPublic) textout << "<td>yes</td>"; 197 101 else textout << "<td>no</td>"; 198 102 199 if (cinfo .buildDate > 0)103 if (cinfo->buildDate > 0) 200 104 textout << outconvert << "<td>yes</td>"; 201 105 else … … 328 232 } 329 233 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 330 255 // protocols 331 256 recptprotolistclass *protocols = recpt->get_recptprotolist_ptr (); … … 471 396 } 472 397 398 void 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 473 431 void statusaction::output_protocolinfo (cgiargsclass &/*args*/, displayclass &disp, 474 432 outconvertclass &outconvert, … … 584 542 } else { 585 543 // 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) { 591 546 textout << outconvert << "<table>\n" 592 547 << "<tr><th>collection name</th><td>\"" 593 << collectinfo .shortInfo.name548 << collectinfo->shortInfo.name 594 549 << "\"</td></tr>\n" 595 550 596 551 << "<tr><th>host</th><td>\"" 597 << collectinfo .shortInfo.host552 << collectinfo->shortInfo.host 598 553 << "\"</td></tr>\n" 599 554 600 555 << "<tr><th>port</th><td>\"" 601 << collectinfo .shortInfo.port556 << collectinfo->shortInfo.port 602 557 << "\"</td></tr>\n" 603 558 604 559 << "<tr><th>is public?</th><td>"; 605 if (collectinfo .isPublic) textout << outconvert << "true";560 if (collectinfo->isPublic) textout << outconvert << "true"; 606 561 else textout << outconvert << "false"; 607 562 textout << outconvert … … 609 564 610 565 << "<tr><th>is beta?</th><td>"; 611 if (collectinfo .isBeta) textout << outconvert << "true";566 if (collectinfo->isBeta) textout << outconvert << "true"; 612 567 else textout << outconvert << "false"; 613 568 textout << outconvert … … 615 570 616 571 << "<tr><th>build date</th><td>\"" 617 << collectinfo .buildDate572 << collectinfo->buildDate 618 573 << "\"</td></tr>\n" 619 574 620 575 << "<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(); 623 578 bool languages_first = true; 624 579 while (languages_here != languages_end) { … … 630 585 631 586 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(); 634 589 while (meta_here != meta_end) { 635 590 textout << outconvert << "<tr><td>" << (*meta_here).first … … 640 595 641 596 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(); 644 599 while (format_here != format_end) { 645 600 textout << outconvert << "<tr><td>" << (*format_here).first … … 650 605 651 606 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(); 654 609 while (building_here != building_end) { 655 610 textout << outconvert << "<tr><td>" << (*building_here).first … … 663 618 664 619 << "<tr><th>number of documents</th><td>\"" 665 << collectinfo .numDocs620 << collectinfo->numDocs 666 621 << "\"</td></tr>\n" 667 622 623 << "<tr><th>number of sections</th><td>\"" 624 << collectinfo->numSections 625 << "\"</td></tr>\n" 626 668 627 << "<tr><th>number of words</th><td>\"" 669 << collectinfo .numWords628 << collectinfo->numWords 670 629 << "\"</td></tr>\n" 671 630 672 631 << "<tr><th>number of bytes</th><td>\"" 673 << collectinfo .numBytes632 << collectinfo->numBytes 674 633 << "\"</td></tr>\n" 675 634 676 635 << "<tr><th>preferred receptionist</th><td>\"" 677 << collectinfo .receptionist636 << collectinfo->receptionist 678 637 << "\"</td></tr>\n" 679 638 … … 681 640 682 641 } 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"; 685 643 } 686 644 … … 689 647 InfoFilterOptionsRequest_t filteroptions_request; 690 648 InfoFilterOptionsResponse_t filteroptions; 649 comerror_t err; 691 650 rproto->get_filterinfo (arg_c, filterinfo, err, logout); 692 651 if (err == noError) { … … 794 753 textout << outconvert << "<h2>Init log</h2>\n"; 795 754 755 #ifdef GSDL_USE_IOS_H 796 756 ifstream initin (cinitfilename, ios::in | ios::nocreate); 757 #else 758 ifstream initin (cinitfilename, ios::in); 759 #endif 760 797 761 delete cinitfilename; 798 762 if (initin) { … … 834 798 logout << flush; 835 799 800 #ifdef GSDL_USE_IOS_H 836 801 ifstream errin (cerrfilename, ios::in | ios::nocreate); 802 #else 803 ifstream errin (cerrfilename, ios::in); 804 #endif 805 837 806 delete cerrfilename; 838 807 if (errin) { … … 974 943 else if (arg_sp == "argumentinfo") output_argumentinfo (args, disp, outconvert, textout, logout); 975 944 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); 976 946 else if (arg_sp == "protocolinfo") output_protocolinfo (args, disp, outconvert, textout, logout); 977 947 else if (arg_sp == "collectioninfo") output_collectioninfo (args, disp, outconvert, textout, logout); … … 996 966 } 997 967 } 998 -
branches/z3950-branch/gsdl/src/recpt/statusaction.h
r1129 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ … … 64 62 outconvertclass &outconvert, 65 63 ostream &textout, ostream &logout); 64 65 void output_browserinfo (cgiargsclass &args, displayclass &disp, 66 outconvertclass &outconvert, 67 ostream &textout, ostream &logout); 66 68 67 69 void output_protocolinfo (cgiargsclass &args, displayclass &disp, -
branches/z3950-branch/gsdl/src/recpt/tipaction.cpp
r760 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.6 1999/11/01 21:54:57 sjboddie31 changes to arguments of many functions32 33 Revision 1.5 1999/09/07 23:10:18 rjmcnab34 removed some compiler warnings35 36 Revision 1.4 1999/09/07 04:57:00 sjboddie37 added GPL notice38 39 Revision 1.3 1999/09/02 00:29:27 rjmcnab40 added cgi argument "st" - show tips41 42 Revision 1.2 1999/07/30 02:24:45 sjboddie43 added collectinfo argument to some functions44 45 Revision 1.1 1999/07/09 02:18:27 rjmcnab46 Initial revision.47 48 49 */50 51 25 52 26 #include "tipaction.h" … … 91 65 } 92 66 } 93 -
branches/z3950-branch/gsdl/src/recpt/tipaction.h
r760 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/userdb.cpp
r1000 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.6 2000/03/01 22:23:09 sjboddie31 tidied up windows installation32 33 Revision 1.5 2000/02/29 21:53:09 sjboddie34 tidied up crypt includes35 36 Revision 1.4 1999/09/07 04:57:00 sjboddie37 added GPL notice38 39 Revision 1.3 1999/09/02 00:30:04 rjmcnab40 added option for specifying whether the gdbm database should be locked41 42 Revision 1.2 1999/07/14 08:30:01 rjmcnab43 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 and45 localtime or gmtime might not get you back to where you started.46 47 Revision 1.1 1999/07/13 23:22:04 rjmcnab48 Initial revision.49 50 */51 25 52 26 #include "gsdlconf.h" … … 187 161 userinfo.password = crypt_text("admin"); 188 162 userinfo.enabled = true; 189 userinfo.groups = "administrator ";163 userinfo.groups = "administrator,colbuilder"; 190 164 userinfo.comment = "change the password for this account as soon as possible"; 191 165 return set_user_info (userdbfile, username, userinfo); -
branches/z3950-branch/gsdl/src/recpt/userdb.h
r533 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/usersaction.cpp
r760 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.7 1999/11/01 21:48:27 sjboddie31 changes to arguments of many functions32 33 Revision 1.6 1999/09/08 03:44:24 cs02534 Added a cast to (char *) of (..:..?..) on output to avoid type35 error at compile time.36 37 Revision 1.5 1999/09/07 23:12:34 rjmcnab38 removed some compiler warnings39 40 Revision 1.4 1999/09/07 04:57:01 sjboddie41 added GPL notice42 43 Revision 1.3 1999/09/02 00:30:56 rjmcnab44 added option for specifying whether the gdbm database should be locked45 46 Revision 1.2 1999/07/30 02:24:44 sjboddie47 added collectinfo argument to some functions48 49 Revision 1.1 1999/07/13 23:22:05 rjmcnab50 Initial revision.51 52 53 */54 55 25 56 26 #include "usersaction.h" … … 442 412 return true; 443 413 } 444 -
branches/z3950-branch/gsdl/src/recpt/usersaction.h
r760 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
branches/z3950-branch/gsdl/src/recpt/vlistbrowserclass.cpp
r1048 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.8 2000/03/31 03:04:32 nzdl31 tidied up some of the browsing code - replaced DocumentImages,32 DocumentTitles and DocumentHeading with DocumentIcon33 34 Revision 1.7 2000/02/17 02:33:09 sjboddie35 minor tidy up - made some function definitions virtual36 37 Revision 1.6 1999/12/13 02:44:23 davidb38 Better protection when accessing "haschildren"39 40 Revision 1.5 1999/10/30 23:01:24 sjboddie41 tidied things up slightly42 43 Revision 1.4 1999/10/30 22:14:44 sjboddie44 added a collection argument45 46 Revision 1.3 1999/10/19 08:40:13 sjboddie47 fixed some stupid compiler warnings on windows48 49 Revision 1.2 1999/10/14 22:59:34 sjboddie50 finished off browser classes51 52 Revision 1.1 1999/10/10 08:14:11 sjboddie53 - metadata now returns mp rather than array54 - redesigned browsing support (although it's not finished so55 won't currently work ;-)56 57 */58 59 25 60 26 #include "vlistbrowserclass.h" -
branches/z3950-branch/gsdl/src/recpt/vlistbrowserclass.h
r934 r1342 21 21 * along with this program; if not, write to the Free Software 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 *24 * $Id$25 23 * 26 24 *********************************************************************/ -
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 *********************************************************************/ 4 25 5 26 #include "z3950proto.h" … … 200 221 } 201 222 202 // is this right? ie does end refer to the last element, or AFTER the203 // last element?204 223 if (here==end) { 205 224 err=protocolError; … … 230 249 // collectinfo.collectionmeta; // text_tmap 231 250 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 */ 235 253 236 254 ////collectinfo.receptionist="z3950"; … … 299 317 // now have collection in zserver. 300 318 301 // ColInfoResponse_t *info = new ColInfoResponse_t;302 319 ColInfoResponse_t info; 303 320 ResultDocInfo_t *docInfo; … … 307 324 308 325 // 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) {336 326 if (request.filterName=="QueryFilter") { 337 327 /* Sample OptionValue pairs … … 346 336 */ 347 337 // 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 349 340 int opt_start=1, opt_end=20; // default values 350 341 int nummatches=0, maxdocs=50; // default values … … 354 345 // cout << "OV pair: `" << ov_here->name.getcstr() << "'=`" 355 346 // << 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 } 365 363 ov_here++; 366 364 } 367 365 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 370 369 opt_end-opt_start, //count 371 370 &nummatches,err); … … 375 374 docInfo=new ResultDocInfo_t; 376 375 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; 378 380 return; 379 381 } 380 382 // 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 } 395 398 } 396 399 … … 432 435 get_collectinfo (collection, info, err, logout); 433 436 // 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 } 438 453 439 454 if (!request.fields.empty()) { … … 452 467 if (it!=info.collectionmeta.end()) 453 468 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; 456 474 int i; 457 // check that docSet isn't empty !!!@!!!475 // check that docSet isn't empty first!!!!!! 458 476 i=request.docSet[0].getint(); 459 477 text_t doctext="unneeded"; 460 (*zserver)->getfullrecord( i, title, doctext,err);478 (*zserver)->getfullrecord(query, field, i, doctitle, doctext, err); 461 479 // check err value! 462 doc Info->metadata["Title"].values.push_back(title);480 docs_here->metadata["Title"].values.push_back(doctitle); 463 481 } else { 464 482 docs_here->metadata[*fields_here].values.push_back(""); … … 503 521 504 522 // 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 } 508 528 } //end of if (... & FRmetadata) ... 509 529 } … … 538 558 text_t title="unneeded"; 539 559 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); 541 565 // check return value of above? (false=>not connected) 542 566 if (err==noError) … … 554 578 } 555 579 } 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 *********************************************************************/ 1 25 2 26 #ifndef Z3950PROTO_H 3 #define Z3 050PROTO_H27 #define Z3950PROTO_H 4 28 5 29 #include "recptproto.h" -
branches/z3950-branch/gsdl/src/recpt/z3950server.cpp
r1191 r1342 18 18 // for now, assume that all records will have text associated with them. 19 19 meta["hastxt"]="1"; 20 // for now, assume we don't want ANY DocumentButtons. 21 format["DocumentButtons"]=""; 20 22 } 21 23 … … 74 76 } 75 77 76 text_tarray *z3950_server::getbriefrecords(const text_t &query, 78 void 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 130 text_tarray *z3950_server::getrecordTitles(const text_t &query, 131 const text_t &fields, 77 132 int first, int count, 78 133 int *nummatches, comerror_t &err) { … … 83 138 titles=new text_tarray; 84 139 140 /* check if connected */ 85 141 if (connected==false) 86 142 if (connect()==false) { … … 91 147 92 148 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 100 152 // 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 } 104 168 // could do a sort eventually, eg on date, title, etc. 105 169 // (non-existent function) z_sort(field, asc|desc); 106 170 /* 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)); 108 173 if (c_str_titles==NULL) { 109 174 // an error occurred. we need a logout/err as an arg … … 124 189 } 125 190 126 bool z3950_server::getfullrecord(const int ID, text_t &rettitle, 127 text_t &rettext, comerror_t &err) { 191 bool 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) { 128 195 if (connected==false) { 129 196 if (connect()==false) { … … 134 201 // since we have just re-connected, we need to do the 135 202 // 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 } 136 214 } 137 215 138 216 if (rettitle!="unneeded") { 139 /*char **c_str_titles;140 141 c_str_titles=z_getbriefrecords("the",ID,1,&dummy); // check this return value.142 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) { 143 221 rettitle.setcstr(c_str_titles[1]); // and check this 144 222 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 150 230 if (rettext!="unneeded") { 151 231 // 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)); 156 233 } 157 234 return (true); 158 }235 } 159 236 160 237 text_t &z3950_server::getzAbout() { -
branches/z3950-branch/gsdl/src/recpt/z3950server.h
r1191 r1342 10 10 text_t z_initstr; // a string returned when the connection is initialised. 11 11 text_tmap meta; // metadata for this collection (ie server/database pair) 12 text_tmap format; 12 13 text_tmap about; // langauge/abouttext pair for collection. 13 14 ShortColInfo_t *info; // has (database) name, host and port … … 23 24 void setMeta(const text_t &key, const text_t &value); 24 25 const text_tmap *getMeta() {return &meta;} 26 const text_tmap *getFormat() {return &format;} 25 27 void setInfo(ShortColInfo_t *newinfo) {info=newinfo;} 26 28 const ShortColInfo_t *getInfo() {return info;} … … 29 31 // now the functions that actually talk to the target (ie zserver) over tcp 30 32 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, 32 35 const int first, const int count, 33 36 int *nummatches, comerror_t &err); 34 37 /* only get one record at a time? (Eventually we could buffer them, but 35 38 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, 37 41 text_t &rettext,comerror_t &err); 42 private: 43 void parseQuery(const text_t &query, const text_t &fields, 44 text_t &parsed_query); 38 45 }; 39 46 -
branches/z3950-branch/gsdl/src/recpt/zparse.y
r1191 r1342 132 132 | {$$=NULL;} 133 133 134 about : aboutList { ;}134 about : aboutList {defLanguage=0;} 135 135 | {$$=NULL;} 136 136
Note:
See TracChangeset
for help on using the changeset viewer.