Ignore:
Timestamp:
2004-01-28T15:10:55+13:00 (20 years ago)
Author:
kjdon
Message:

modified the datelist display so that it can use other metadata eg dc.Date not just Date. The classifier itself had been modified a while ago to take a datemeta argument, and then build the classifier on that metadata rather than assuming Date. It now adds a mdtype value into the top level classifier node, which contains the name of the date metadata. The documentaction when making the nav bar macros looks for mdtype if it comes across a datelist, and sets the dm arg for that classifier button. datelist browser now looks for the dm arg and uses that metadata to create the special years and months bit down the side. Formattools is also modified. It used to modify the Date metadata to display it as xx month YYYY - now it does that for any metadata that ends in .Date - ignores namespaces

File:
1 edited

Legend:

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

    r6584 r6645  
    167167  arg_ainfo.defaultstatus = cgiarginfo::weak;
    168168  arg_ainfo.argdefault = "0";
     169  arg_ainfo.savedarginfo = cgiarginfo::must;
     170  argsinfo.addarginfo (NULL, arg_ainfo);
     171
     172  //dm is the metadata that has been used for the datelist
     173  arg_ainfo.shortname = "dm";
     174  arg_ainfo.longname = "date metadata";
     175  arg_ainfo.multiplechar = true;
     176  arg_ainfo.defaultstatus = cgiarginfo::weak;
     177  arg_ainfo.argdefault = "";
    169178  arg_ainfo.savedarginfo = cgiarginfo::must;
    170179  argsinfo.addarginfo (NULL, arg_ainfo);
     
    362371   text_t navigationbar = "<!-- Navigation Bar -->\n";
    363372
     373   text_t date_extra = "";
    364374   get_top (args["cl"], topparent);
    365375   int numc = response.docInfo.size();
     
    381391      bool first = true;
    382392      while (dochere != docend) {
    383      
     393    date_extra = "";
    384394     if (!first) navigationbar += "_imagespacer_";
    385395     
    386396     text_t title = (*dochere).metadata["Title"].values[0];
    387      
     397     if (title == "Date") { // a date list
     398       text_t date_meta = (*dochere).metadata["mdtype"].values[0];
     399       if (date_meta == "") {
     400         date_meta = "Date";
     401       }
     402       date_extra = "&dm="+date_meta;
     403     }
    388404     bool unknown = false;
    389405     
     
    403419        // set the _httpbrowseXXX_ macro for this classification
    404420        if (unknown) navigationbar += " <a href=\"_httpdocument_&cl=" +
    405                 (*dochere).OID + "\">" + title + "</a> ";
     421                (*dochere).OID + date_extra+"\">" + title + "</a> ";
    406422        else {
    407423           navigationbar += "_image" + title + "_";
    408            disp.setmacro ("httpbrowse" + title, "Global", "_httpdocument_&cl=" + (*dochere).OID);
     424           disp.setmacro ("httpbrowse" + title, "Global", "_httpdocument_&cl=" + (*dochere).OID+date_extra);
    409425        }
    410426     }
     
    438454      while (dochere != docend) {
    439455     text_t title = dochere->metadata["Title"].values[0];   
    440      navigationbar += "<option value=\"_httpdocument_&cl=" + dochere->OID + "\"";
     456     if (title == "Date") { // a date list
     457       text_t date_meta = (*dochere).metadata["mdtype"].values[0];
     458       if (date_meta == "") {
     459         date_meta = "Date";
     460       }
     461       date_extra = "&dm="+date_meta;
     462     }
     463
     464     navigationbar += "<option value=\"_httpdocument_&cl=" + dochere->OID +date_extra+ "\"";
    441465     if (topparent == dochere->OID) {
    442466        navigationbar += " selected";
     
    545569   
    546570    metadata.insert ("Title");
     571    metadata.insert ("mdtype"); // in case there is a datelist
    547572    bool getParents = false;
    548573    get_children ("", collection, metadata, getParents, collectproto, response, logout);
Note: See TracChangeset for help on using the changeset viewer.