Changeset 2017 for trunk/gsdl


Ignore:
Timestamp:
2001-02-20T13:33:48+13:00 (23 years ago)
Author:
paynter
Message:

Extra Phind functionality: any special parameter values inserted into the
gdbm database by the phind.pm classifier are extracted and set as macros.
This lest us distinguish between multiple phind classifiers for one
collection (with the phindnumber macro, and will ultimately be used to pass
appearance parameters like colours and fonts from the from the collect.cfg
file all theway to the Java pplet.

File:
1 edited

Legend:

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

    r1991 r2017  
    650650      get_top (arg_cl, classtop);
    651651      metadata.insert ("childtype");
     652      metadata.insert ("parameters");
    652653
    653654      if (get_info (classtop, collection, metadata, false, collectproto, response, logout)) {
     
    675676    disp.setmacro ("relateddoc", "document", "");
    676677
    677     // Add a macro to display the phind classifier (if appropriate)
     678    // Add macros specific to the Phind lassifier
    678679    text_t &childtype = response.docInfo[0].metadata["childtype"].values[0];
    679680    if (childtype == "Phind") {
     681
     682      // First, a macro to display the phind classifier
    680683      disp.setmacro ("phindclassifier", "document", "_phindapplet_");
    681     }
    682       }
    683     }
     684
     685      // Next, macros that control the way the classifier is displayed
     686      text_t parameters = response.docInfo[0].metadata["parameters"].values[0];
     687      cout << "***** parameters >" <<  parameters << "<\n";
     688
     689      // extract key=value pairs and set as macros
     690      text_t::iterator here = parameters.begin();
     691      text_t::iterator end = parameters.end();
     692      text_t key, value;
     693     
     694      while (here != end) {
     695        // get the next key and value pair
     696        here = getdelimitstr (here, end, '=', key);
     697        here = getdelimitstr (here, end, ';', value);
     698
     699        // store this key=value pair
     700        if (!key.empty() && !value.empty()) {
     701          disp.setmacro (key, "document", value);
     702        }
     703      }
     704    } // end if (childtype == "Phind")
     705      }
     706    } // end if (!arg_cl.empty()) {
    684707  }
    685708}
Note: See TracChangeset for help on using the changeset viewer.