Changeset 2485
- Timestamp:
- 2001-05-30T13:39:18+12:00 (23 years ago)
- Location:
- trunk/cstr
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cstr/macros/cstr.dm
r1964 r2485 30 30 _imagefigures_ [c=cstr] {_gsimage_(_httpcurrentdocument_&gg=figures,_document:httpiconefigof_,_document:httpiconefigon_,fig,_document:texticonfigures_)} 31 31 32 _httpiconepsof_ [c=cstr] {_http collection_/images/epsof.gif}33 _httpiconepson_ [c=cstr] {_http collection_/images/epson.gif}32 _httpiconepsof_ [c=cstr] {_httpprefix_/collect/cstr/images/epsof.gif} 33 _httpiconepson_ [c=cstr] {_httpprefix_/collect/cstr/images/epson.gif} 34 34 _widthepsx_ [c=cstr] {64} 35 35 _heightepsx_ [c=cstr] {30} 36 36 37 _httpiconetextof_ [c=cstr] {_http collection_/images/etextof.gif}38 _httpiconetexton_ [c=cstr] {_http collection_/images/etexton.gif}37 _httpiconetextof_ [c=cstr] {_httpprefix_/collect/cstr/images/etextof.gif} 38 _httpiconetexton_ [c=cstr] {_httpprefix_/collect/cstr/images/etexton.gif} 39 39 _widthetextx_ [c=cstr] {65} 40 40 _heightetextx_ [c=cstr] {30} 41 41 42 _httpiconeabstrof_ [c=cstr] {_http collection_/images/eabstrof.gif}43 _httpiconeabstron_ [c=cstr] {_http collection_/images/eabstron.gif}42 _httpiconeabstrof_ [c=cstr] {_httpprefix_/collect/cstr/images/eabstrof.gif} 43 _httpiconeabstron_ [c=cstr] {_httpprefix_/collect/cstr/images/eabstron.gif} 44 44 _widtheabstrx_ [c=cstr] {65} 45 45 _heighteabstrx_ [c=cstr] {30} 46 46 47 _httpiconefigof_ [c=cstr] {_http collection_/images/efigof.gif}48 _httpiconefigon_ [c=cstr] {_http collection_/images/efigon.gif}47 _httpiconefigof_ [c=cstr] {_httpprefix_/collect/cstr/images/efigof.gif} 48 _httpiconefigon_ [c=cstr] {_httpprefix_/collect/cstr/images/efigon.gif} 49 49 _widthefigx_ [c=cstr] {47} 50 50 _heightefigx_ [c=cstr] {30} -
trunk/cstr/src/recpt/Makefile.in
r1065 r2485 46 46 RANLIB = @RANLIB@ 47 47 LDFLAGS = @LDFLAGS@ 48 #LIBS = -lgdbm -lstdc++ -lm -lcrypt 48 49 LIBS = @LIBS@ 49 50 … … 64 65 65 66 66 HEADERS = cstrdocaction.h 67 HEADERS = cstrdocaction.h cstrbrowsetools.h cstrpagedbrowserclass.h 67 68 68 SOURCES = cstrlibrarymain.cpp cstrdocaction.cpp 69 SOURCES = cstrlibrarymain.cpp cstrdocaction.cpp cstrbrowsetools.cpp \ 70 cstrpagedbrowserclass.cpp 69 71 70 72 71 OBJECTS = cstrlibrarymain.o cstrdocaction.o 73 OBJECTS = cstrlibrarymain.o cstrdocaction.o cstrbrowsetools.o \ 74 cstrpagedbrowserclass.o 72 75 73 76 … … 123 126 $(MAINRECPTDIR)/usersaction.o \ 124 127 $(MAINRECPTDIR)/userdb.o \ 125 $(MAINRECPTDIR)/delhistoryaction.o \126 128 $(MAINRECPTDIR)/historydb.o \ 127 129 $(MAINCOLSERVRDIR)/mgq.o \ … … 135 137 $(MAINCOLSERVRDIR)/browsefilter.o \ 136 138 $(MAINCOLSERVRDIR)/queryfilter.o \ 137 $(MAINCOLSERVRDIR)/phrasequeryfilter.o \ 139 $(MAINCOLSERVRDIR)/mgqueryfilter.o \ 140 $(MAINCOLSERVRDIR)/mgppqueryfilter.o \ 138 141 $(MAINCOLSERVRDIR)/phrasesearch.o \ 139 142 $(MAINCOLSERVRDIR)/mggdbmsource.o \ 143 $(MAINCOLSERVRDIR)/search.o \ 140 144 $(MAINCOLSERVRDIR)/mgsearch.o \ 145 $(MAINCOLSERVRDIR)/mgppsearch.o \ 146 $(MAINCOLSERVRDIR)/collectset.o \ 141 147 $(GD)/lib/gsdllib.a \ 142 148 $(GD)/packages/mg/src/text/libtextin.a \ 143 $(GD)/packages/mg/lib/libmg.a 149 $(GD)/packages/mg/lib/libmg.a \ 150 $(GD)/src/mgpp/text/libtextin.a \ 151 $(GD)/src/mgpp/lib/libmg.a 152 144 153 145 154 ifneq ($(USE_FASTCGI), 1) -
trunk/cstr/src/recpt/cstrdocaction.cpp
r1065 r2485 28 28 /* 29 29 $Log$ 30 Revision 1.3 2000/04/04 04:43:07 nzdl 31 caught cstr collection up with DocumentColumn stuff 30 Revision 1.4 2001/05/30 01:39:18 sjboddie 31 Rewound cstr to use the old browsetools etc approach rather than the 32 LeftColumn etc methods 32 33 33 34 Revision 1.2 2000/02/06 21:25:21 sjboddie … … 42 43 #include <string.h> 43 44 #include "cstrdocaction.h" 45 #include "cstrbrowsetools.h" 46 #include "browsetools.h" 44 47 #include "OIDtools.h" 45 48 #include "querytools.h" 46 #include " cgiutils.h"49 #include "unitool.h" 47 50 48 51 cstrdocaction::cstrdocaction () { … … 77 80 } 78 81 79 void cstrdocaction::output_controls (cgiargsclass &args, const text_tarray &ibuttons,80 recptproto *collectproto, displayclass &disp,81 outconvertclass &outconvert, ostream &textout,82 ostream &logout) {83 84 85 if (args["u"] != "1") {86 87 text_tarray buttons;88 text_t &arg_gg = args["gg"];89 90 text_tarray::const_iterator here = ibuttons.begin();91 text_tarray::const_iterator end = ibuttons.end();92 93 while (here != end) {94 95 if (*here == "Detach")96 buttons.push_back ("_document:imagedetach_");97 else if ((*here == "Highlight") && (arg_gg == "text")) {98 if (args["hl"] == "1")99 buttons.push_back ("_document:imagenohighlight_");100 else101 buttons.push_back ("_document:imagehighlight_");102 } else if ((*here == "Expand Text") && arg_gg == "text") {103 if (args.getintarg("gt"))104 buttons.push_back ("_document:imagecontracttext_");105 else106 buttons.push_back ("_document:imageexpandtext_");107 }108 here ++;109 }110 111 FilterResponse_t response;112 text_tset metadata;113 text_t top;114 get_top (args["d"], top);115 metadata.insert ("figures");116 metadata.insert ("Description");117 metadata.insert ("Source");118 if (get_info (top, args["c"], metadata, false, collectproto, response, logout)) {119 text_t &figures = response.docInfo[0].metadata["figures"].values[0];120 text_t &description = response.docInfo[0].metadata["Description"].values[0];121 text_t &source = response.docInfo[0].metadata["Source"].values[0];122 123 if (!source.empty())124 buttons.push_back ("_document:imagepostscript_(" + cgi_safe(source) + ")");125 126 if ((!description.empty()) && (arg_gg != "abstract"))127 buttons.push_back ("_document:imageabstract_");128 129 if ((!figures.empty()) && (arg_gg != "figures"))130 buttons.push_back ("_document:imagefigures_");131 132 if (arg_gg != "text")133 buttons.push_back ("_document:imageviewtext_");134 }135 136 here = buttons.begin();137 end = buttons.end();138 int count = 0;139 while (here != end) {140 if ((count != 0) && ((count % 2) == 0)) textout << "<br>\n";141 textout << outconvert << disp << *here;142 count ++;143 here ++;144 }145 }146 }147 148 149 82 150 83 void cstrdocaction::get_cgihead_info (cgiargsclass &args, recptprotolistclass * /*protos*/, … … 177 110 178 111 int arg_gt = args.getintarg("gt"); 112 // int arg_gc = args.getintarg("gc"); 179 113 int arg_hl = args.getintarg("hl"); 180 114 … … 192 126 else 193 127 javaimagescontent += "_javaexpandtext_"; 128 // } else if (*button_here == "Expand Contents") { 129 // if (arg_gc == 1) 130 // javaimagescontent += "_javacontractcontents_"; 131 // else 132 // javaimagescontent += "_javaexpandcontents_"; 194 133 } else if (*button_here == "Highlight" && arg_gg == "text") { 195 134 if (arg_hl == 1) … … 203 142 disp.setmacro ("javaimagescontent", "document", javaimagescontent); 204 143 } 144 145 146 147 /* 148 // define all the macros which are related to pages generated 149 // by this action. we also load up the formatinfo structure 150 // here (it's used in do_action as well as here) 151 void cstrdocaction::define_internal_macros (const ColInfoResponse_t &collectinfo, displayclass &disp, 152 cgiargsclass &args, recptproto *collectproto, 153 ostream &logout) { 154 155 // define_internal_macros sets the following macros: 156 157 // _pagetitle_ the title to be displayed at the top of the browser window 158 159 // _imagethispage_ the title image to be displayed at top right of page 160 161 // _classificationlinks_ the links between classifications to be displayed 162 // at top of list or datelist classifications 163 164 // _httpprevarrow_ these are set if next or previous arrows 165 // _httpnextarrow_ are to be used - (i.e. if it's an AZList or a DateList 166 // classifytype at a top level or if it's a Book or a 167 // Hierarchy classifytype at document level 168 169 // _navarrows_ this may be overridden to "" when format option 170 // DocumentArrowsBottom is false 171 172 // _header_ the header macro is overridden if we're not at a top level 173 // classification to remove the title block 174 175 // _javaimagescontent_ this is the javascript code to shove in to make the 176 // flashy buttons work 177 178 // _thisOID_ the OID (directory) of the current document - this corresponds 179 // to the archivedir metadata element 180 181 // can't do anything if collectproto is null (i.e. no collection was specified) 182 if (collectproto == NULL) return; 183 184 text_tarray metadata; 185 FilterResponse_t response; 186 text_t &arg_d = args["d"]; 187 text_t &arg_cl = args["cl"]; 188 text_t &collection = args["c"]; 189 int gt = args.getintarg("gt"); 190 load_formatinfo (collectinfo.format, gt); 191 192 // don't want arrows or goto if we're in figures or facsimiles 193 if (args["gg"] != "text") { 194 formatinfo.DocumentArrowsBottom = false; 195 formatinfo.DocumentArrowsTop = false; 196 formatinfo.DocumentGoTo = false; 197 } 198 199 if (!formatinfo.DocumentArrowsBottom) 200 disp.setmacro("navarrows", "document", ""); 201 202 metadata.push_back ("Title"); 203 metadata.push_back ("classifytype"); 204 metadata.push_back ("archivedir"); 205 206 if (!arg_d.empty()) { 207 // we're at document level 208 209 // get metadata for this document and it's parents 210 if (get_info (arg_d, collection, metadata, true, collectproto, response, logout)) { 211 disp.setmacro ("header", "document", "_textheader_"); 212 213 disp.setmacro ("thisOID", "Global", response.docInfo[0].metadata["archivedir"].values[0]); 214 215 text_t &classifytype = response.docInfo[0].metadata["classifytype"].values[0]; 216 if (classifytype.empty()) classifytype = "Book"; // defaults to Book 217 218 // set arrow macros if required 219 if (((classifytype == "Book") && (formatinfo.DocumentArrowsTop || formatinfo.DocumentArrowsBottom)) || 220 ((classifytype == "Hierarchy") && formatinfo.DocumentArrowsBottom)) 221 set_arrow_macros (arg_d, classifytype, formatinfo.DocumentTopPages, 222 disp, collectproto, collection, logout); 223 224 if (args["u"] != "1") 225 set_java_macros (args, disp); 226 227 } 228 } else { 229 if (!arg_cl.empty()) { 230 231 // get metadata for top level classification 232 text_t classtop; 233 get_top (arg_cl, classtop); 234 if (get_info (classtop, collection, metadata, false, collectproto, response, logout)) { 235 236 text_t &title = response.docInfo[0].metadata["Title"].values[0]; 237 text_t &classifytype = response.docInfo[0].metadata["classifytype"].values[0]; 238 239 disp.setmacro ("pagetitle", "document", "_text" + title + "page_"); 240 disp.setmacro ("imagethispage", "document", "_icon" + title + "page_"); 241 242 // now get the metadata for each child of top level 243 // so we can generate the _classificationlinks_ and arrow macros 244 // (if they're required by the current classification type) 245 246 if ((classifytype == "AZList") || (classifytype == "DateList")) 247 get_classificationlinks (arg_cl, collection, collectproto, disp, logout); 248 249 } 250 } 251 } 252 } 253 254 */ 205 255 206 256 void cstrdocaction::output_document (const text_t &OID, cgiargsclass &args, … … 226 276 textout << outconvert << disp << "_textnoabstract_"; 227 277 } 228 229 278 } else if (arg_gg == "figures") { 230 279 metadata.insert ("figures"); … … 241 290 while (this_figure != end_figure) { 242 291 textout << outconvert << disp 243 << "<p><center><img border=1 src=\"_http collimg_/_thisOID_/"292 << "<p><center><img border=1 src=\"_httpprefix_/collect/cstr/index/assoc/_thisOID_/" 244 293 << *this_figure << "\"></center>\n"; 245 294 this_figure ++; … … 249 298 } 250 299 } 251 252 300 } else if (arg_gg == "facsimiles") { 253 301 metadata.insert ("facsimiles"); … … 255 303 get_top (OID, top); 256 304 if (get_info (top, collection, metadata, false, collectproto, inforesponse, logout)) { 257 258 text_tarray::const_iterator this_facs = inforesponse.docInfo[0].metadata["facsimiles"].values.begin(); 259 text_tarray::const_iterator end_facs = inforesponse.docInfo[0].metadata["facsimiles"].values.end(); 260 while (this_facs != end_facs) { 261 textout << outconvert << disp 262 << "<p><center><img border=1 src=\"_httpcollimg_/_thisOID_/" 263 << *this_facs << "\"></center>\n"; 264 this_facs ++; 305 text_t &facsimiles = inforesponse.docInfo[0].metadata["facsimiles"].values[0]; 306 307 if (!facsimiles.empty()) { 308 text_tarray facs_array; 309 splitchar (facsimiles.begin(), facsimiles.end(), ',', facs_array); 310 text_tarray::const_iterator this_facs = facs_array.begin(); 311 text_tarray::const_iterator end_facs = facs_array.end(); 312 while (this_facs != end_facs) { 313 textout << outconvert << disp 314 << "<p><center><img border=1 src=\"_httpprefix_/collect/cstr/index/assoc/_thisOID_/" 315 << *this_facs << "\"></center>\n"; 316 this_facs ++; 317 } 318 } else { 319 textout << outconvert << disp << "_textnofacsimiles_"; 265 320 } 266 } else { 267 textout << outconvert << disp << "_textnofacsimiles_"; 268 } 321 } 269 322 270 323 } else { … … 274 327 int wanttext = 0; 275 328 int arg_gt = args.getintarg("gt"); 276 329 277 330 // if we have a query string and highlighting is turned on we need 278 331 // to redo the query to get the terms for highlighting … … 391 444 392 445 393 394 395 396 397 398 399 400 401 402 446 bool cstrdocaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 447 browsermapclass *browsers, displayclass &disp, 448 outconvertclass &outconvert, ostream &textout, 449 ostream &logout) { 450 451 452 // must have a valid collection server 453 recptproto *collectproto = protos->getrecptproto (args["c"], logout); 454 if (collectproto == NULL) { 455 logout << "cstrdocaction::do_action called with NULL collectproto\n"; 456 textout << outconvert << disp << "_document:header_\n" 457 << "Error: Attempt to get document without setting collection\n" 458 << "_document:footer_\n"; 459 } else { 460 461 text_t OID = args["d"]; 462 if (OID.empty()) OID = args["cl"]; 463 if (OID.empty()) { 464 textout << outconvert << disp << "Document contains no data_document:footer_\n"; 465 return true; 466 } 467 468 textout << outconvert << disp << "_document:header_\n" 469 << "_document:content_\n"; 470 471 if (args["d"].empty()) { 472 output_toc (args, browsers, formatinfo, collectproto, 473 disp, outconvert, textout, logout); 474 } else { 475 output_cstr_toc (args, browsers, formatinfo, collectproto, 476 disp, outconvert, textout, logout); 477 478 textout << "<p>\n"; 479 output_document (OID, args, collectproto, disp, outconvert, textout, logout); 480 } 481 482 textout << outconvert << disp << "_document:footer_\n"; 483 } 484 return true; 485 } 486 487 488 489 490 491 492 493 494 495 496 497 -
trunk/cstr/src/recpt/cstrdocaction.h
r1065 r2485 36 36 protected: 37 37 38 void output_controls (cgiargsclass &args, const text_tarray &ibuttons,39 recptproto *collectproto, displayclass &disp,40 outconvertclass &outconvert, ostream &textout,41 ostream &logout);42 43 38 void set_java_macros (cgiargsclass &args, displayclass &disp); 44 39 … … 53 48 virtual ~cstrdocaction (); 54 49 50 55 51 void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos, 56 52 response_t &response,text_t &response_data, 57 53 ostream &logout); 54 55 // void define_internal_macros (const ColInfoResponse_t &collectinfo, displayclass &disp, 56 // cgiargsclass &args, recptproto *collectproto, 57 // ostream &logout); 58 59 bool do_action (cgiargsclass &args, recptprotolistclass *protos, 60 browsermapclass *browsers, displayclass &disp, 61 outconvertclass &outconvert, ostream &textout, 62 ostream &logout); 63 58 64 }; 59 65 -
trunk/cstr/src/recpt/cstrlibrarymain.cpp
r1964 r2485 26 26 27 27 #include "receptionist.h" 28 #include "collectset.h"29 28 #include "cgiwrapper.h" 30 29 #include "nullproto.h" 30 #include "collectserver.h" 31 #include "filter.h" 32 #include "browsefilter.h" 33 #include "queryfilter.h" 34 #include "infodbclass.h" 35 #include "mgsearch.h" 36 #include "mggdbmsource.h" 31 37 #include "fileutil.h" 38 #include "collectset.h" 32 39 #include <assert.h> 33 40 … … 40 47 #include "authenaction.h" 41 48 #include "usersaction.h" 49 #include "authenaction.h" 42 50 43 51 #include "browserclass.h" … … 46 54 #include "datelistbrowserclass.h" 47 55 #include "invbrowserclass.h" 48 #include " pagedbrowserclass.h"56 #include "cstrpagedbrowserclass.h" 49 57 #include "htmlbrowserclass.h" 50 58 … … 112 120 recpt.add_browser (&ainvbrowserclass); 113 121 114 pagedbrowserclass apagedbrowserclass;122 cstrpagedbrowserclass apagedbrowserclass; 115 123 recpt.add_browser (&apagedbrowserclass); 116 124 … … 121 129 return 0; 122 130 } 131 132 133 134
Note:
See TracChangeset
for help on using the changeset viewer.