Ignore:
Timestamp:
2000-02-07T10:27:04+13:00 (24 years ago)
Author:
sjboddie
Message:

updated cstr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cstr/src/recpt/cstrdocaction.cpp

    r891 r911  
    2828/*
    2929   $Log$
    30    Revision 1.1  2000/02/01 22:32:37  sjboddie
    31    Initial revision
     30   Revision 1.2  2000/02/06 21:25:21  sjboddie
     31   updated cstr
    3232
    3333   Revision 1.1  1999/09/07 21:49:42  sjboddie
     
    4040#include "cstrdocaction.h"
    4141#include "cstrbrowsetools.h"
     42#include "browsetools.h"
    4243#include "OIDtools.h"
    4344#include "querytools.h"
     
    9293void cstrdocaction::set_java_macros (cgiargsclass &args, displayclass &disp) {
    9394
    94   text_t javaimagescontent = "_javaextras__javapostscript_";
     95  text_t javaimagescontent = "<!----java images content------->\n_javaextras__javapostscript_";
    9596
    9697  text_t &arg_gg = args["gg"];
     
    134135    button_here ++;
    135136  }
     137  javaimagescontent += "<!--end java img content--->\n";
    136138  disp.setmacro ("javaimagescontent", "document", javaimagescontent);
    137139}
     
    205207      disp.setmacro ("header", "document", "_textheader_");
    206208
    207       disp.setmacro ("thisOID", "Global", response.docInfo[0].metadata[2].values[0]);
    208 
    209       text_t &classifytype = response.docInfo[0].metadata[1].values[0];
     209      disp.setmacro ("thisOID", "Global", response.docInfo[0].metadata["archivedir"].values[0]);
     210
     211      text_t &classifytype = response.docInfo[0].metadata["classifytype"].values[0];
    210212      if (classifytype.empty()) classifytype = "Book"; // defaults to Book
    211213
     
    228230      if (get_info (classtop, collection, metadata, false, collectproto, response, logout)) {
    229231     
    230     text_t &title = response.docInfo[0].metadata[0].values[0];
    231     text_t &classifytype = response.docInfo[0].metadata[1].values[0];
     232    text_t &title = response.docInfo[0].metadata["Title"].values[0];
     233    text_t &classifytype = response.docInfo[0].metadata["classifytype"].values[0];
    232234
    233235    disp.setmacro ("pagetitle", "document", "_text" + title + "page_");
     
    284286    while (this_figure != end_figure) {
    285287      textout << outconvert << disp
    286           << "<p><center><img border=1 src=\"_httpcollection_/archives/_thisOID_/"
     288          << "<p><center><img border=1 src=\"_httpcollimg_/_thisOID_/"
    287289          << *this_figure << "\"></center>\n";
    288290      this_figure ++;
     
    306308    while (this_facs != end_facs) {
    307309      textout << outconvert << disp
    308             << "<p><center><img border=1 src=\"_httpcollection_/archives/_thisOID_/"
     310            << "<p><center><img border=1 src=\"_httpcollimg_/_thisOID_/"
    309311          << *this_facs << "\"></center>\n";
    310312      this_facs ++;
     
    359361    }
    360362   
    361     int metasize = metadata.size();
    362    
    363363    if (get_info (OID, collection, metadata, getParents, collectproto, inforesponse, logout)) {
    364364      int hastxt = inforesponse.docInfo[0].metadata["hastxt"].values[0].getint();
     
    438438  }
    439439}
     440
     441
     442bool 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
Note: See TracChangeset for help on using the changeset viewer.