Changeset 16097
- Timestamp:
- 2008-06-20T17:30:23+12:00 (16 years ago)
- Location:
- gsdl/trunk/src/recpt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/src/recpt/dynamicclassifieraction.cpp
r16096 r16097 424 424 425 425 // Display the child classifier nodes 426 FilterResponse_t child_classifier_nodes_response; 426 427 map<text_t, int, lttext_t>::iterator child_classifier_nodes_iterator = child_classifier_nodes.begin(); 427 428 while (child_classifier_nodes_iterator != child_classifier_nodes.end()) … … 432 433 child_classifier_node_OID = classifier_node_OID + "|" + child_classifier_node_OID; 433 434 } 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 437 444 child_classifier_nodes_iterator++; 438 445 } 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 451 void 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; 456 460 457 461 // Get the format statement for this classifier if there is one, or use the browser's default otherwise … … 470 474 bool use_table = is_table_content (formatlistptr); 471 475 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 481 void 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 484 490 // Get the format statement for this classifier if there is one, or use the browser's default otherwise 485 491 text_t formatstring; … … 497 503 bool use_table = is_table_content (formatlistptr); 498 504 499 // Display the classifier nodes500 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 otherwise511 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 525 505 // Request the necessary metadata for displaying the documents 526 506 text_tarray document_OIDs; -
gsdl/trunk/src/recpt/dynamicclassifieraction.h
r16061 r16097 94 94 ostream &logout); 95 95 96 void display_classifier_nodes (FilterResponse_t classifier_nodes_response, 97 int classifier_node_indent, 98 cgiargsclass &args, recptproto *collectproto, 99 browsermapclass *browsers, displayclass &disp, 100 outconvertclass &outconvert, ostream &textout, 101 ostream &logout); 102 96 103 void display_document_nodes (FilterResponse_t documents_response, int document_nodes_indent, 97 104 cgiargsclass &args, recptproto *collectproto,
Note:
See TracChangeset
for help on using the changeset viewer.