Ignore:
Timestamp:
1999-08-13T16:16:43+12:00 (25 years ago)
Author:
sjboddie
Message:

added some collection-level metadata stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/receptionist.cpp

    r451 r456  
    1212/*
    1313   $Log$
     14   Revision 1.24  1999/08/13 04:16:42  sjboddie
     15   added some collection-level metadata stuff
     16
    1417   Revision 1.23  1999/08/11 23:28:59  sjboddie
    1518   added support for html classifier (i.e. the hp argumant now must be
     
    520523  }
    521524
     525  // get collection information
     526  collectinfo.clear();
     527  if (!collection.empty()) {
     528    comerror_t err;
     529    collectproto->get_collectinfo (collection, collectinfo, err, logout);
     530    if (err != noError) collectinfo.clear();
     531  }
     532
    522533  // translate "d", "cl", and "hp" arguments if required
    523534  translate_OIDs (args, collectproto, logout);
     
    740751}
    741752
    742 // prepare_page sets up page parameters, sets display macros,
    743 // gets format information and opens the page ready for output
     753// prepare_page sets up page parameters, sets display macros
     754// and opens the page ready for output
    744755void receptionist::prepare_page (action *a, cgiargsclass &args, recptproto *collectproto,
    745756                 outconvertclass &outconvert, ostream &logout) {
     
    763774    if (first) pageparams += ",language=" + args["l"];
    764775    else pageparams += ",language=" + args["l"];
    765  
    766   // get collection information
    767   collectinfo.clear();
    768   if (!collection.empty()) {
    769     comerror_t err;
    770     collectproto->get_collectinfo (collection, collectinfo, err, logout);
    771     if (err != noError) collectinfo.clear();
    772   }
    773776
    774777  // open the page
     
    777780
    778781  // define general macros
    779   define_general_macros (args, outconvert, logout);
     782  define_general_macros (args, collectproto, outconvert, logout);
    780783
    781784 
     
    795798}
    796799
    797 void receptionist::define_general_macros (cgiargsclass &args, outconvertclass &/*outconvert*/,
    798                       ostream &logout) {
     800void receptionist::define_general_macros (cgiargsclass &args, recptproto *collectproto,
     801                      outconvertclass &/*outconvert*/, ostream &logout) {
     802
     803  text_t &collection = args["c"];
     804
    799805  disp.setmacro ("gwcgi", "Global", configinfo.gwcgi);
    800806  disp.setmacro ("httpimg", "Global", configinfo.httpimg);
     
    813819    argshere ++;
    814820  }
    815 }
     821
     822  // set collection specific macros
     823  if ((!collection.empty()) && (collectproto != NULL)) {
     824    FilterResponse_t response;
     825    text_tarray metadata;
     826    //    metadata.push_back (".collectionimage");
     827   
     828    get_info ("collection", collection, metadata, false,
     829          collectproto, response, logout);
     830
     831    if (!response.docInfo[0].metadata.empty()) {
     832      MetadataInfo_tarray::const_iterator here = response.docInfo[0].metadata.begin();
     833      MetadataInfo_tarray::const_iterator end = response.docInfo[0].metadata.end();
     834      while (here != end) {
     835    if (((*here).name != "haschildren") && ((*here).name != "hasnext") &&
     836        ((*here).name != "hasprevious")) {
     837      disp.setmacro ((*here).name, "Global", (*here).values[0]);
     838    }
     839    here ++;
     840      }
     841    }
     842  }
     843}
Note: See TracChangeset for help on using the changeset viewer.