Changeset 16096


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

Added a new display_classifier_nodes() to eventually replace display_classifier_node(), and changed output_upper_classifier_nodes() to use this. This is required for outputting hlists instead of vlists and also to fix an HTML validation problem.

File:
1 edited

Legend:

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

    r16095 r16096  
    351351    upper_classifier_node_OID += (upper_classifier_node_OID != "" ? "|" : "");
    352352    upper_classifier_node_OID += *upper_classifier_node_labels_iterator;
    353     text_t upper_classifier_node_label = *upper_classifier_node_labels_iterator;
    354     text_t upper_classifier_node_numleafdocs = "?";  // We can't determine this without more database requests
    355     display_classifier_node (upper_classifier_node_OID, upper_classifier_node_label, upper_classifier_node_numleafdocs, classifier_node_indent, args, collectproto, browsers, disp, outconvert, textout, logout);
     353
     354    ResultDocInfo_t upper_classifier_node;
     355    upper_classifier_node.OID = upper_classifier_node_OID;
     356    upper_classifier_node.metadata["doctype"].values.push_back ("classify");
     357    upper_classifier_node.metadata["haschildren"].values.push_back ("1");
     358    upper_classifier_node.metadata["numleafdocs"].values.push_back ("?");  // We can't determine this without more database requests
     359    upper_classifier_node.metadata["Title"].values.push_back (*upper_classifier_node_labels_iterator);
     360
     361    FilterResponse_t upper_classifier_node_response;
     362    upper_classifier_node_response.docInfo.push_back(upper_classifier_node);
     363    display_classifier_nodes (upper_classifier_node_response, classifier_node_indent, args, collectproto, browsers, disp, outconvert, textout, logout);
    356364    classifier_node_indent++;
    357365
     
    467475
    468476
    469 void dynamicclassifieraction::display_document_nodes (FilterResponse_t documents_response, int document_nodes_indent,
    470                               cgiargsclass &args, recptproto *collectproto,
    471                               browsermapclass *browsers, displayclass &disp,
    472                               outconvertclass &outconvert, ostream &textout,
    473                               ostream &logout)
     477void 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)
    474483{
    475484  // Get the format statement for this classifier if there is one, or use the browser's default otherwise
     
    488497  bool use_table = is_table_content (formatlistptr);
    489498
     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
     504void 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
    490525  // Request the necessary metadata for displaying the documents
    491526  text_tarray document_OIDs;
Note: See TracChangeset for help on using the changeset viewer.