Changeset 12001


Ignore:
Timestamp:
2006-07-04T15:31:08+12:00 (18 years ago)
Author:
davidb
Message:

Experimental addition for nicer URLs for retrieving a document from Grenstone.
Works in conjunction with re-write rules in Apache web server.
Off by default -- need to define DOCHANDLE to switch on.

File:
1 edited

Legend:

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

    r11503 r12001  
    7474
    7575  text_t collink = collection;
     76
     77#ifndef DOCHANDLE
    7678  if (!collink.empty()) collink = "&c=" + collink;
     79#endif
    7780
    7881  get_link_icon (section, args, collink, link, icon);
     
    131134
    132135  text_t collink = collection;
     136#ifndef DOCHANDLE
    133137  if (!collink.empty()) collink = "&c=" + collink;
     138#endif
    134139
    135140  if (colnumber > 0) {
     
    223228                       const text_t &collink, text_t &link, text_t &icon) {
    224229
     230#ifndef DOCHANDLE
    225231  link = "<a href=\"_httpdocument_" + collink;
     232#else
     233  link = "<a href=\"_httpdocumenthandle_(" + collink;
     234#endif
     235
    226236  text_t link_end = "\">";
     237#ifndef DOCHANDLE
    227238  text_t detach_link_end = "&amp;x=1\" target=\\_blank>"; // to detach the link, and x=1 signifies it is a detached page
     239#else
     240  text_t detach_link_end = "\" target=\\_blank>"; // to detach the link, and x=1 signifies it is a detached page
     241#endif
     242
    228243  icon = "_document:icontext_";
    229244
     
    241256  if (args["a"] == "q") {
    242257    // query results list
     258#ifndef DOCHANDLE
    243259    link += "&amp;cl=search&amp;d=" + section.OID;
    244    
     260#else
     261    link += "," + section.OID+")";
     262#endif
    245263    if (args["xx"] == "1") {
    246264      link += detach_link_end;
     
    259277    link = "<a href=\"_httpquery_\">";
    260278      }
    261       else link += "&amp;cl=" + arg_cl + "\">";
     279      else {
     280#ifndef DOCHANDLE
     281    link += "&amp;cl=" + arg_cl + "\">";
     282#else
     283    link += ","+arg_cl + ")\">";
     284#endif
     285      }   
    262286     
    263287    } else if (haschildren == 1) {
     
    266290      (section.OID == arg_d)) {
    267291    icon = "_document:iconopenfolder_";
     292#ifndef DOCHANDLE
    268293    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID + ".pr\">";
     294#else
     295    link += ","+section.OID + ".pr)\">";
     296#endif
    269297      } else {
    270298    icon = "_document:iconclosedfolder_";
     299#ifndef DOCHANDLE
    271300    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID + "\">";
     301#else
     302    link += ","+section.OID + ")\">";
     303#endif
    272304      }
    273305    } else {
    274306      if (args["gt"] == "0") {
     307#ifndef DOCHANDLE
    275308    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID + "\">";
     309#else
     310    link += ","+section.OID + ")\">";
     311#endif
    276312      } else {
     313#ifndef DOCHANDLE
    277314    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID + "#" + section.OID + "\">";
     315#else
     316    link += ","+section.OID + "#" + section.OID + ")\">";
     317#endif
    278318      }
    279319    }
     
    287327        (section.OID == arg_cl)) {
    288328      icon = "_document:iconopenbookshelf_";
     329
     330#ifndef DOCHANDLE
    289331      link += "&amp;cl=" + section.OID + ".pr\">";
     332#else
     333      link += ","+section.OID + ".pr)\">";
     334#endif
     335
     336
    290337    } else {
    291338      icon = "_document:iconclosedbookshelf_";
     339
     340#ifndef DOCHANDLE
    292341      link += "&amp;cl=" + section.OID + "\">";
     342#else
     343      link += ","+section.OID + ")\">";
     344#endif
     345
    293346    }
    294347      } else {
    295348   
    296349    icon = "_document:iconclosedbook_";
     350#ifndef DOCHANDLE
    297351    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID;
     352#else
     353    link += ","+section.OID+")";
     354#endif
    298355    if (args["xx"] == "1") {
    299356      link +=  detach_link_end;
     
    306363      if (doctype == "classify") link = "";
    307364      else {
     365#ifndef DOCHANDLE
    308366    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID;
     367#else
     368    link += "," + section.OID +")";
     369#endif
    309370    if (args["xx"] == "1") {
    310371      link +=  detach_link_end;
Note: See TracChangeset for help on using the changeset viewer.