Ignore:
Timestamp:
1999-10-19T16:23:46+13:00 (25 years ago)
Author:
davidb
Message:

Collection building support through web pages
and internal and external link handling for collection documents

File:
1 edited

Legend:

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

    r669 r722  
    2828/*
    2929   $Log$
     30   Revision 1.28  1999/10/19 03:23:42  davidb
     31   Collection building support through web pages
     32   and internal and external link handling for collection documents
     33
    3034   Revision 1.27  1999/10/14 23:00:53  sjboddie
    3135   finished changes to browsing support
     
    167171  arg_ainfo.argdefault = "";
    168172  arg_ainfo.savedarginfo = cgiarginfo::can;
     173  argsinfo.addarginfo (NULL, arg_ainfo);
     174
     175  // whether or not a document should be retrieved from the
     176  // library or the Web.
     177  arg_ainfo.shortname = "il";
     178  arg_ainfo.longname = "internal link preference";
     179  arg_ainfo.multiplechar = false;
     180  arg_ainfo.defaultstatus = cgiarginfo::weak;
     181  arg_ainfo.argdefault = "l";
     182  arg_ainfo.savedarginfo = cgiarginfo::must;
    169183  argsinfo.addarginfo (NULL, arg_ainfo);
    170184
     
    271285}
    272286
    273 void documentaction::get_cgihead_info (cgiargsclass &/*args*/, response_t &response,
    274                        text_t &response_data, ostream &/*logout*/) {
    275   response = content;
    276   response_data = "text/html";
     287void documentaction::get_cgihead_info (cgiargsclass &args, response_t &response,
     288                       text_t &response_data, ostream &logout) {
     289
     290  if ((!args["d"].empty()) && (args["il"] == "w"))
     291    {
     292      text_t &oid = args["d"];
     293      text_t &collection = args["c"];
     294
     295      recptprotolistclass* protocols = recpt->get_recptprotolist_ptr();
     296      recptproto* collectproto = protocols->getrecptproto (collection, logout);
     297
     298      text_tset metadata;
     299      FilterResponse_t filt_response;
     300
     301      metadata.insert ("URL");
     302   
     303      // get metadata for this document and it's parents
     304      if (get_info (oid, collection, metadata, true, collectproto, filt_response, logout))
     305    {
     306      text_t url = *(filt_response.docInfo[0].metadata[0].values.begin());
     307
     308      response = location;
     309      response_data = url;
     310    }
     311      else
     312    {
     313      // error, no URL
     314      logout << "Error: documentaction::get_cgihead_info failed on get_info" << endl;
     315    }
     316    }
     317  else
     318    {
     319      response = content;
     320      response_data = "text/html";
     321    }
    277322}
    278323
Note: See TracChangeset for help on using the changeset viewer.