Ignore:
Timestamp:
2008-06-20T17:30:23+12:00 (16 years ago)
Author:
mdewsnip
Message:

Changed output_child_classifier_nodes() to use display_classifier_nodes(), then removed display_classifier_node().

File:
1 edited

Legend:

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

    r16096 r16097  
    424424
    425425  // Display the child classifier nodes
     426  FilterResponse_t child_classifier_nodes_response;
    426427  map<text_t, int, lttext_t>::iterator child_classifier_nodes_iterator = child_classifier_nodes.begin();
    427428  while (child_classifier_nodes_iterator != child_classifier_nodes.end())
     
    432433      child_classifier_node_OID = classifier_node_OID + "|" + child_classifier_node_OID;
    433434    }
    434     text_t child_classifier_node_label = (*child_classifier_nodes_iterator).first;
    435     int child_classifier_node_numleafdocs = (*child_classifier_nodes_iterator).second;
    436     display_classifier_node (child_classifier_node_OID, child_classifier_node_label, child_classifier_node_numleafdocs, classifier_node_indent, args, collectproto, browsers, disp, outconvert, textout, logout);
     435
     436    ResultDocInfo_t child_classifier_node;
     437    child_classifier_node.OID = child_classifier_node_OID;
     438    child_classifier_node.metadata["doctype"].values.push_back ("classify");
     439    child_classifier_node.metadata["haschildren"].values.push_back ("1");
     440    child_classifier_node.metadata["numleafdocs"].values.push_back ((*child_classifier_nodes_iterator).second);
     441    child_classifier_node.metadata["Title"].values.push_back ((*child_classifier_nodes_iterator).first);
     442    child_classifier_nodes_response.docInfo.push_back (child_classifier_node);
     443
    437444    child_classifier_nodes_iterator++;
    438445  }
    439 }
    440 
    441 
    442 void dynamicclassifieraction::display_classifier_node (text_t classifier_node_OID, text_t classifier_node_label,
    443                                text_t classifier_node_numleafdocs, int classifier_node_indent,
    444                                cgiargsclass &args, recptproto *collectproto,
    445                                browsermapclass *browsers, displayclass &disp,
    446                                outconvertclass &outconvert, ostream &textout,
    447                                ostream &logout)
    448 {
    449   // Generate the ResultDocInfo_t containing the information for the classifier node
    450   ResultDocInfo_t classifier_node;
    451   classifier_node.OID = classifier_node_OID;
    452   classifier_node.metadata["doctype"].values.push_back ("classify");
    453   classifier_node.metadata["haschildren"].values.push_back ("1");
    454   classifier_node.metadata["numleafdocs"].values.push_back (classifier_node_numleafdocs);
    455   classifier_node.metadata["Title"].values.push_back (classifier_node_label);
     446
     447  display_classifier_nodes (child_classifier_nodes_response, classifier_node_indent, args, collectproto, browsers, disp, outconvert, textout, logout);
     448}
     449
     450
     451void dynamicclassifieraction::display_classifier_nodes (FilterResponse_t classifier_nodes_response,
     452                                int classifier_node_indent,
     453                            cgiargsclass &args, recptproto *collectproto,
     454                            browsermapclass *browsers, displayclass &disp,
     455                            outconvertclass &outconvert, ostream &textout,
     456                            ostream &logout)
     457{
     458  // Check there are some classifier nodes to display
     459  if (classifier_nodes_response.docInfo.empty()) return;
    456460
    457461  // Get the format statement for this classifier if there is one, or use the browser's default otherwise
     
    470474  bool use_table = is_table_content (formatlistptr);
    471475
    472   // Display the classifier node
    473   bptr->output_section_group (classifier_node, args, args["c"], classifier_node_indent, formatlistptr, use_table, metadata, getParents, collectproto, disp, outconvert, textout, logout);
    474 }
    475 
    476 
    477 void dynamicclassifieraction::display_classifier_nodes (FilterResponse_t classifier_nodes_response,
    478                                 int classifier_node_indent,
    479                             cgiargsclass &args, recptproto *collectproto,
    480                             browsermapclass *browsers, displayclass &disp,
    481                             outconvertclass &outconvert, ostream &textout,
    482                             ostream &logout)
    483 {
     476  // Display the classifier nodes
     477  bptr->output_section_group (classifier_nodes_response, args, args["c"], classifier_node_indent, formatlistptr, use_table, metadata, getParents, collectproto, disp, outconvert, textout, logout);
     478}
     479
     480
     481void dynamicclassifieraction::display_document_nodes (FilterResponse_t documents_response, int document_nodes_indent,
     482                              cgiargsclass &args, recptproto *collectproto,
     483                              browsermapclass *browsers, displayclass &disp,
     484                              outconvertclass &outconvert, ostream &textout,
     485                              ostream &logout)
     486{
     487  // Check there are some documents to display
     488  if (documents_response.docInfo.empty()) return;
     489
    484490  // Get the format statement for this classifier if there is one, or use the browser's default otherwise
    485491  text_t formatstring;
     
    497503  bool use_table = is_table_content (formatlistptr);
    498504
    499   // Display the classifier nodes
    500   bptr->output_section_group (classifier_nodes_response, args, args["c"], classifier_node_indent, formatlistptr, use_table, metadata, getParents, collectproto, disp, outconvert, textout, logout);
    501 }
    502 
    503 
    504 void dynamicclassifieraction::display_document_nodes (FilterResponse_t documents_response, int document_nodes_indent,
    505                               cgiargsclass &args, recptproto *collectproto,
    506                               browsermapclass *browsers, displayclass &disp,
    507                               outconvertclass &outconvert, ostream &textout,
    508                               ostream &logout)
    509 {
    510   // Get the format statement for this classifier if there is one, or use the browser's default otherwise
    511   text_t formatstring;
    512   text_t classifier_type = "VList";
    513   browserclass *bptr = browsers->getbrowser (classifier_type);
    514   ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr (collectproto, args["c"], logout);
    515   if (!get_formatstring (args["dcl"], classifier_type, cinfo->format, formatstring))
    516   {
    517     formatstring = bptr->get_default_formatstring();
    518   }
    519   format_t *formatlistptr = new format_t();
    520   text_tset metadata;
    521   bool getParents = false;
    522   parse_formatstring (formatstring, formatlistptr, metadata, getParents);
    523   bool use_table = is_table_content (formatlistptr);
    524 
    525505  // Request the necessary metadata for displaying the documents
    526506  text_tarray document_OIDs;
Note: See TracChangeset for help on using the changeset viewer.