Changeset 1065
- Timestamp:
- 2000-04-04T16:43:08+12:00 (24 years ago)
- Location:
- trunk/cstr/src/recpt
- Files:
-
- 4 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cstr/src/recpt/Makefile.in
r1022 r1065 46 46 RANLIB = @RANLIB@ 47 47 LDFLAGS = @LDFLAGS@ 48 #LIBS = -lgdbm -lstdc++ -lm -lcrypt49 48 LIBS = @LIBS@ 50 49 … … 65 64 66 65 67 HEADERS = cstrdocaction.h cstrbrowsetools.h cstrpagedbrowserclass.h66 HEADERS = cstrdocaction.h 68 67 69 SOURCES = cstrlibrarymain.cpp cstrdocaction.cpp cstrbrowsetools.cpp \ 70 cstrpagedbrowserclass.cpp 68 SOURCES = cstrlibrarymain.cpp cstrdocaction.cpp 71 69 72 70 73 OBJECTS = cstrlibrarymain.o cstrdocaction.o cstrbrowsetools.o \ 74 cstrpagedbrowserclass.o 71 OBJECTS = cstrlibrarymain.o cstrdocaction.o 75 72 76 73 -
trunk/cstr/src/recpt/cstrdocaction.cpp
r911 r1065 28 28 /* 29 29 $Log$ 30 Revision 1.3 2000/04/04 04:43:07 nzdl 31 caught cstr collection up with DocumentColumn stuff 32 30 33 Revision 1.2 2000/02/06 21:25:21 sjboddie 31 34 updated cstr … … 39 42 #include <string.h> 40 43 #include "cstrdocaction.h" 41 #include "cstrbrowsetools.h"42 #include "browsetools.h"43 44 #include "OIDtools.h" 44 45 #include "querytools.h" 45 #include " unitool.h"46 #include "cgiutils.h" 46 47 47 48 cstrdocaction::cstrdocaction () { … … 76 77 } 77 78 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 else 101 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 else 106 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 78 149 79 150 void cstrdocaction::get_cgihead_info (cgiargsclass &args, recptprotolistclass * /*protos*/, … … 106 177 107 178 int arg_gt = args.getintarg("gt"); 108 // int arg_gc = args.getintarg("gc");109 179 int arg_hl = args.getintarg("hl"); 110 180 … … 122 192 else 123 193 javaimagescontent += "_javaexpandtext_"; 124 // } else if (*button_here == "Expand Contents") {125 // if (arg_gc == 1)126 // javaimagescontent += "_javacontractcontents_";127 // else128 // javaimagescontent += "_javaexpandcontents_";129 194 } else if (*button_here == "Highlight" && arg_gg == "text") { 130 195 if (arg_hl == 1) … … 138 203 disp.setmacro ("javaimagescontent", "document", javaimagescontent); 139 204 } 140 141 142 143 /*144 // define all the macros which are related to pages generated145 // by this action. we also load up the formatinfo structure146 // here (it's used in do_action as well as here)147 void cstrdocaction::define_internal_macros (const ColInfoResponse_t &collectinfo, displayclass &disp,148 cgiargsclass &args, recptproto *collectproto,149 ostream &logout) {150 151 // define_internal_macros sets the following macros:152 153 // _pagetitle_ the title to be displayed at the top of the browser window154 155 // _imagethispage_ the title image to be displayed at top right of page156 157 // _classificationlinks_ the links between classifications to be displayed158 // at top of list or datelist classifications159 160 // _httpprevarrow_ these are set if next or previous arrows161 // _httpnextarrow_ are to be used - (i.e. if it's an AZList or a DateList162 // classifytype at a top level or if it's a Book or a163 // Hierarchy classifytype at document level164 165 // _navarrows_ this may be overridden to "" when format option166 // DocumentArrowsBottom is false167 168 // _header_ the header macro is overridden if we're not at a top level169 // classification to remove the title block170 171 // _javaimagescontent_ this is the javascript code to shove in to make the172 // flashy buttons work173 174 // _thisOID_ the OID (directory) of the current document - this corresponds175 // to the archivedir metadata element176 177 // can't do anything if collectproto is null (i.e. no collection was specified)178 if (collectproto == NULL) return;179 180 text_tarray metadata;181 FilterResponse_t response;182 text_t &arg_d = args["d"];183 text_t &arg_cl = args["cl"];184 text_t &collection = args["c"];185 int gt = args.getintarg("gt");186 load_formatinfo (collectinfo.format, gt);187 188 // don't want arrows or goto if we're in figures or facsimiles189 if (args["gg"] != "text") {190 formatinfo.DocumentArrowsBottom = false;191 formatinfo.DocumentArrowsTop = false;192 formatinfo.DocumentGoTo = false;193 }194 195 if (!formatinfo.DocumentArrowsBottom)196 disp.setmacro("navarrows", "document", "");197 198 metadata.push_back ("Title");199 metadata.push_back ("classifytype");200 metadata.push_back ("archivedir");201 202 if (!arg_d.empty()) {203 // we're at document level204 205 // get metadata for this document and it's parents206 if (get_info (arg_d, collection, metadata, true, collectproto, response, logout)) {207 disp.setmacro ("header", "document", "_textheader_");208 209 disp.setmacro ("thisOID", "Global", response.docInfo[0].metadata["archivedir"].values[0]);210 211 text_t &classifytype = response.docInfo[0].metadata["classifytype"].values[0];212 if (classifytype.empty()) classifytype = "Book"; // defaults to Book213 214 // set arrow macros if required215 if (((classifytype == "Book") && (formatinfo.DocumentArrowsTop || formatinfo.DocumentArrowsBottom)) ||216 ((classifytype == "Hierarchy") && formatinfo.DocumentArrowsBottom))217 set_arrow_macros (arg_d, classifytype, formatinfo.DocumentTopPages,218 disp, collectproto, collection, logout);219 220 if (args["u"] != "1")221 set_java_macros (args, disp);222 223 }224 } else {225 if (!arg_cl.empty()) {226 227 // get metadata for top level classification228 text_t classtop;229 get_top (arg_cl, classtop);230 if (get_info (classtop, collection, metadata, false, collectproto, response, logout)) {231 232 text_t &title = response.docInfo[0].metadata["Title"].values[0];233 text_t &classifytype = response.docInfo[0].metadata["classifytype"].values[0];234 235 disp.setmacro ("pagetitle", "document", "_text" + title + "page_");236 disp.setmacro ("imagethispage", "document", "_icon" + title + "page_");237 238 // now get the metadata for each child of top level239 // so we can generate the _classificationlinks_ and arrow macros240 // (if they're required by the current classification type)241 242 if ((classifytype == "AZList") || (classifytype == "DateList"))243 get_classificationlinks (arg_cl, collection, collectproto, disp, logout);244 245 }246 }247 }248 }249 250 */251 205 252 206 void cstrdocaction::output_document (const text_t &OID, cgiargsclass &args, … … 272 226 textout << outconvert << disp << "_textnoabstract_"; 273 227 } 228 274 229 } else if (arg_gg == "figures") { 275 230 metadata.insert ("figures"); … … 294 249 } 295 250 } 251 296 252 } else if (arg_gg == "facsimiles") { 297 253 metadata.insert ("facsimiles"); … … 299 255 get_top (OID, top); 300 256 if (get_info (top, collection, metadata, false, collectproto, inforesponse, logout)) { 301 text_t &facsimiles = inforesponse.docInfo[0].metadata["facsimiles"].values[0]; 302 303 if (!facsimiles.empty()) { 304 text_tarray facs_array; 305 splitchar (facsimiles.begin(), facsimiles.end(), ',', facs_array); 306 text_tarray::const_iterator this_facs = facs_array.begin(); 307 text_tarray::const_iterator end_facs = facs_array.end(); 308 while (this_facs != end_facs) { 309 textout << outconvert << disp 310 << "<p><center><img border=1 src=\"_httpcollimg_/_thisOID_/" 311 << *this_facs << "\"></center>\n"; 312 this_facs ++; 313 } 314 } else { 315 textout << outconvert << disp << "_textnofacsimiles_"; 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 ++; 316 265 } 317 } 266 } else { 267 textout << outconvert << disp << "_textnofacsimiles_"; 268 } 318 269 319 270 } else { … … 323 274 int wanttext = 0; 324 275 int arg_gt = args.getintarg("gt"); 325 276 326 277 // if we have a query string and highlighting is turned on we need 327 278 // to redo the query to get the terms for highlighting … … 440 391 441 392 442 bool cstrdocaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 443 browsermapclass *browsers, displayclass &disp, 444 outconvertclass &outconvert, ostream &textout, 445 ostream &logout) { 446 447 448 // must have a valid collection server 449 recptproto *collectproto = protos->getrecptproto (args["c"], logout); 450 if (collectproto == NULL) { 451 logout << "cstrdocaction::do_action called with NULL collectproto\n"; 452 textout << outconvert << disp << "_document:header_\n" 453 << "Error: Attempt to get document without setting collection\n" 454 << "_document:footer_\n"; 455 } else { 456 457 text_t OID = args["d"]; 458 if (OID.empty()) OID = args["cl"]; 459 if (OID.empty()) { 460 textout << outconvert << disp << "Document contains no data_document:footer_\n"; 461 return true; 462 } 463 464 textout << outconvert << disp << "_document:header_\n" 465 << "_document:content_\n"; 466 467 if (args["d"].empty()) { 468 output_toc (args, browsers, formatinfo, collectproto, 469 disp, outconvert, textout, logout); 470 } else { 471 output_cstr_toc (args, browsers, formatinfo, collectproto, 472 disp, outconvert, textout, logout); 473 474 textout << "<p>\n"; 475 output_document (OID, args, collectproto, disp, outconvert, textout, logout); 476 } 477 478 textout << outconvert << disp << "_document:footer_\n"; 479 } 480 return true; 481 } 482 483 484 485 486 487 488 489 490 491 492 493 393 394 395 396 397 398 399 400 401 402 -
trunk/cstr/src/recpt/cstrdocaction.h
r911 r1065 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 38 43 void set_java_macros (cgiargsclass &args, displayclass &disp); 39 44 … … 48 53 virtual ~cstrdocaction (); 49 54 50 51 55 void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos, 52 56 response_t &response,text_t &response_data, 53 57 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 64 58 }; 65 59 -
trunk/cstr/src/recpt/cstrlibrarymain.cpp
r957 r1065 28 28 /* 29 29 $Log$ 30 Revision 1.4 2000/04/04 04:43:07 nzdl 31 caught cstr collection up with DocumentColumn stuff 32 30 33 Revision 1.3 2000/02/21 21:45:08 sjboddie 31 34 gsdlhome now set from gsdlsite.cfg … … 67 70 #include "datelistbrowserclass.h" 68 71 #include "invbrowserclass.h" 69 #include " cstrpagedbrowserclass.h"72 #include "pagedbrowserclass.h" 70 73 #include "htmlbrowserclass.h" 71 74 … … 181 184 recpt.add_browser (&ainvbrowserclass); 182 185 183 cstrpagedbrowserclass apagedbrowserclass;186 pagedbrowserclass apagedbrowserclass; 184 187 recpt.add_browser (&apagedbrowserclass); 185 188
Note:
See TracChangeset
for help on using the changeset viewer.