Ignore:
Timestamp:
2009-04-06T13:18:45+12:00 (15 years ago)
Author:
kjdon
Message:

added is_valid_element to metaformat, which checks elementSet for the element name. metaformat subclass constructors must set up elementSet. Currently they do this in the code. would be good if it could read in from a file eventually, maybe?? When metaformat is outputting the m,etadata, it checks whether the element is valid before outputting. otherwise it will invalidate the response as it won't conform to the schema. also, changed where we lowercased the entire name to lowercasing only the first letter - some qdc fields have an internal upper case letter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/oaiservr/metaformat.h

    r18875 r18895  
    1919 protected:
    2020  virtual void output_metadata_header(ostream &output) = 0;
    21   virtual void output_item(ostream &output, outconvertclass &outconvert, bool &headerDone, const text_t &label,
     21  virtual void output_item(ostream &output, outconvertclass &outconvert,
     22               bool &headerDone, const text_t &label,
    2223               const text_tarray &values);
    2324  virtual void output_metadata_footer(ostream &output) = 0;
    24   virtual bool scan_metadata(ostream &output, const text_t &collection,  ResultDocInfo_t &docInfo,
    25                  bool doOutput);
     25  virtual bool is_valid_element(text_t &meta_name);
     26  virtual bool scan_metadata(ostream &output, const text_t &collection, 
     27                 ResultDocInfo_t &docInfo, bool doOutput);
    2628  oaiconfig *    oaiConfigure;
     29
     30  // a set containing all the valid element names for the set. Must be
     31  // initialized by each metadata class
     32  text_tset elementSet;
    2733
    2834 public:
     
    3036  virtual const text_t formatName() = 0;
    3137  virtual const text_t formatPrefix() = 0;
    32   virtual bool output_record(ostream &output, recptproto *protocol, const text_t &collection,
     38  virtual bool output_record(ostream &output, recptproto *protocol,
     39                 const text_t &collection,
    3340                 const text_t &record_OID);
    3441  virtual bool is_available(const text_t &collection, ResultDocInfo_t &docInfo);
    35   virtual bool output_metadata(ostream &output, const text_t &collection,  ResultDocInfo_t &docInfo);
     42  virtual bool output_metadata(ostream &output, const text_t &collection, 
     43                   ResultDocInfo_t &docInfo);
    3644  virtual bool output_formatdata(ostream &output) = 0;
    3745  void    set_configuration(oaiconfig *config) { this->oaiConfigure = config; }
Note: See TracChangeset for help on using the changeset viewer.