Changeset 15999


Ignore:
Timestamp:
2008-06-13T14:49:07+12:00 (16 years ago)
Author:
mdewsnip
Message:

(Adding dynamic classifiers) Some modifications in preparation for allowing options to be specified to the dynamic classifiers in the collect.cfg file.

Location:
gsdl/trunk/src/recpt
Files:
2 edited

Legend:

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

    r15993 r15999  
    149149  }
    150150
     151  // Parse the classifier options from the specification
     152  text_t classifier_specification = cinfo->dynamic_classifiers[arg_dcl];
     153  text_tmap classifier_options;
     154
     155  // The metadata element to classify by should be left after all the options have been parsed off
     156  classifier_options["metadata_element_name"] = classifier_specification;
     157
    151158  // Output the "<ID>Header" format statement if there is one
    152159  text_t classifier_header_format_statement = "";
    153   get_formatstring(arg_dcl + "Header", cinfo->format, classifier_header_format_statement);
     160  get_formatstring (arg_dcl + "Header", cinfo->format, classifier_header_format_statement);
    154161  textout << outconvert << disp << classifier_header_format_statement << "\n";
    155162
    156163  // Output the dynamic classifier
    157   text_t metadata_element_name = cinfo->dynamic_classifiers[arg_dcl];
    158164  if (args["dcn"].empty())
    159165  {
    160166    // Simple case for the top-level page
    161     output_top_level_page (metadata_element_name, args, collectproto, browsers, disp, outconvert, textout, logout);
     167    output_top_level_page (classifier_options, args, collectproto, browsers, disp, outconvert, textout, logout);
    162168  }
    163169  else
    164170  {
    165171    // More complex case for an internal page
    166     output_internal_page (metadata_element_name, args, collectproto, browsers, disp, outconvert, textout, logout);
     172    output_internal_page (classifier_options, args, collectproto, browsers, disp, outconvert, textout, logout);
    167173  }
    168174
    169175  // Output the "<ID>Footer" format statement if there is one
    170176  text_t classifier_footer_format_statement = "";
    171   get_formatstring(arg_dcl + "Footer", cinfo->format, classifier_footer_format_statement);
     177  get_formatstring (arg_dcl + "Footer", cinfo->format, classifier_footer_format_statement);
    172178  textout << outconvert << disp << classifier_footer_format_statement << "\n";
    173179
     
    177183
    178184
    179 void dynamicclassifieraction::output_top_level_page (text_t metadata_element_name, cgiargsclass &args,
     185void dynamicclassifieraction::output_top_level_page (text_tmap classifier_options, cgiargsclass &args,
    180186                             recptproto *collectproto, browsermapclass *browsers,
    181187                             displayclass &disp, outconvertclass &outconvert,
     
    183189{
    184190  // Get all the metadata values for the specified element (these become the classifier nodes at the top level)
     191  text_t metadata_element_name = classifier_options["metadata_element_name"];
    185192  FilterResponse_t metadata_values_response;
    186193  get_metadata_values (metadata_element_name, "", args["c"], collectproto, metadata_values_response, logout);
     
    225232
    226233
    227 void dynamicclassifieraction::output_internal_page (text_t metadata_element_name, cgiargsclass &args,
     234void dynamicclassifieraction::output_internal_page (text_tmap classifier_options, cgiargsclass &args,
    228235                            recptproto *collectproto, browsermapclass *browsers,
    229236                            displayclass &disp, outconvertclass &outconvert,
     
    236243
    237244  // Get all the classifier nodes at this level
     245  text_t metadata_element_name = classifier_options["metadata_element_name"];
    238246  text_t metadata_value_filter = classifier_node_metadata_value + "|*";
    239247  FilterResponse_t metadata_values_response;
  • gsdl/trunk/src/recpt/dynamicclassifieraction.h

    r15949 r15999  
    6363          ostream &logout);
    6464
    65   void output_top_level_page (text_t metadata_element_name, cgiargsclass &args,
     65  void output_top_level_page (text_tmap classifier_options, cgiargsclass &args,
    6666                  recptproto *collectproto, browsermapclass *browsers,
    6767                  displayclass &disp, outconvertclass &outconvert,
    6868                  ostream &textout, ostream &logout);
    6969
    70   void output_internal_page (text_t metadata_element_name, cgiargsclass &args,
     70  void output_internal_page (text_tmap classifier_options, cgiargsclass &args,
    7171                 recptproto *collectproto, browsermapclass *browsers,
    7272                 displayclass &disp, outconvertclass &outconvert,
Note: See TracChangeset for help on using the changeset viewer.