Changeset 16061
- Timestamp:
- 2008-06-18T20:00:43+12:00 (16 years ago)
- Location:
- gsdl/trunk/src/recpt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/src/recpt/dynamicclassifieraction.cpp
r16059 r16061 164 164 selected_grouping_node_OID = output_grouping_nodes (classifier_options, args, collectproto, browsers, disp, outconvert, textout, logout); 165 165 } 166 167 // Prepare to output the classifier (and maybe document) nodes 168 text_t classifier_node_OID = args["dcn"]; 166 text_t classifier_node_OID = args["dcn"]; // args["dcn"] may have been modified by output_grouping_nodes() 169 167 int classifier_node_indent = 0; 170 168 171 169 // Simple case at the top level: just output the child classifier nodes 172 if ( args["dcn"]== selected_grouping_node_OID)173 { 174 text_t metadata_value_filter = args["dcn"]+ "*";175 output_child_classifier_nodes (classifier_node_OID, metadata_value_filter, classifier_node_indent, classifier_options, args, collectproto, browsers, disp, outconvert, textout, logout);170 if (classifier_node_OID == selected_grouping_node_OID) 171 { 172 text_t metadata_value_filter = selected_grouping_node_OID + "*"; 173 output_child_classifier_nodes (classifier_node_OID, "", metadata_value_filter, classifier_node_indent, classifier_options, args, collectproto, browsers, disp, outconvert, textout, logout); 176 174 } 177 175 … … 179 177 else 180 178 { 181 // Output the parent classifier nodes 182 output_parent_classifier_nodes (classifier_node_OID, classifier_node_indent, classifier_options, args, collectproto, browsers, disp, outconvert, textout, logout); 183 184 // Display the selected classifier node 185 text_tarray classifier_node_labels; 186 splitchar(classifier_node_OID.begin(), classifier_node_OID.end(), '|', classifier_node_labels); 187 text_t classifier_node_label = classifier_node_labels.back(); 188 text_t classifier_node_numleafdocs = "?"; 189 display_classifier_node (classifier_node_OID, classifier_node_label, classifier_node_numleafdocs, classifier_node_indent, args, collectproto, browsers, disp, outconvert, textout, logout); 190 classifier_node_indent++; 179 // This is the classifier node OID without any grouping information 180 text_t classifier_node_OID_sans_grouping = classifier_node_OID; 181 if (starts_with (classifier_node_OID, selected_grouping_node_OID + "|")) 182 { 183 classifier_node_OID_sans_grouping = substr (classifier_node_OID.begin() + (selected_grouping_node_OID + "|").size(), classifier_node_OID.end()); 184 } 185 186 // Determine the parent classifier node labels 187 text_tlist parent_classifier_node_labels; 188 splitchar(classifier_node_OID_sans_grouping.begin(), classifier_node_OID_sans_grouping.end(), '|', parent_classifier_node_labels); 189 190 // Output the parent classifier nodes and the current classifier node 191 output_upper_classifier_nodes (selected_grouping_node_OID, parent_classifier_node_labels, classifier_node_indent, classifier_options, args, collectproto, browsers, disp, outconvert, textout, logout); 191 192 192 193 // Output the child classifier nodes 193 text_t metadata_value_filter = args["dcn"] + "|*"; 194 output_child_classifier_nodes (classifier_node_OID, metadata_value_filter, classifier_node_indent, classifier_options, args, collectproto, browsers, disp, outconvert, textout, logout); 194 text_t classifier_node_metadata_value = classifier_node_OID_sans_grouping; 195 text_t metadata_value_filter = classifier_node_OID_sans_grouping + "|*"; 196 output_child_classifier_nodes (classifier_node_OID, classifier_node_metadata_value, metadata_value_filter, classifier_node_indent, classifier_options, args, collectproto, browsers, disp, outconvert, textout, logout); 195 197 196 198 // Get the document nodes at this level 197 199 text_t metadata_element_name = classifier_options["metadata_element_name"]; 198 text_t classifier_node_metadata_value = args["dcn"];199 200 text_t sort_documents_by = classifier_options["-sort_documents_by"]; 200 201 FilterResponse_t documents_response; … … 285 286 { 286 287 // Is this the grouping node that is currently selected? 287 if ( (*grouping_node_iterator).OID == args["dcn"])288 if (starts_with (args["dcn"], (*grouping_node_iterator).OID)) 288 289 { 289 290 selected_grouping_node_OID = (*grouping_node_iterator).OID; … … 320 321 321 322 322 void dynamicclassifieraction::output_parent_classifier_nodes (text_t classifier_node_OID, 323 int& classifier_node_indent, 324 text_tmap classifier_options, cgiargsclass &args, 325 recptproto *collectproto, browsermapclass *browsers, 326 displayclass &disp, outconvertclass &outconvert, 327 ostream &textout, ostream &logout) 328 { 329 // Determine the parent classifier nodes 330 text_tarray parent_classifier_node_labels; 331 splitchar(classifier_node_OID.begin(), classifier_node_OID.end(), '|', parent_classifier_node_labels); 332 parent_classifier_node_labels.pop_back(); 333 323 void dynamicclassifieraction::output_upper_classifier_nodes (text_t root_classifier_node_OID, 324 text_tlist parent_classifier_node_labels, 325 int& classifier_node_indent, 326 text_tmap classifier_options, cgiargsclass &args, 327 recptproto *collectproto, browsermapclass *browsers, 328 displayclass &disp, outconvertclass &outconvert, 329 ostream &textout, ostream &logout) 330 { 334 331 // Display the parent classifier nodes 335 text_t parent_classifier_node_OID = "";336 text_t array::iterator parent_classifier_node_labels_iterator = parent_classifier_node_labels.begin();332 text_t parent_classifier_node_OID = root_classifier_node_OID; 333 text_tlist::iterator parent_classifier_node_labels_iterator = parent_classifier_node_labels.begin(); 337 334 while (parent_classifier_node_labels_iterator != parent_classifier_node_labels.end()) 338 335 { … … 350 347 351 348 void dynamicclassifieraction::output_child_classifier_nodes (text_t classifier_node_OID, 349 text_t classifier_node_metadata_value, 352 350 text_t metadata_value_filter, 353 351 int& classifier_node_indent, … … 371 369 // After processing any hierarchical metadata values we're left with the child classifer nodes 372 370 map<text_t, int, lttext_t> child_classifier_nodes; 373 text_t current_position = args["dcn"];374 371 ResultDocInfo_tarray::iterator metadata_value_iterator = metadata_values_response.docInfo.begin(); 375 372 while (metadata_value_iterator != metadata_values_response.docInfo.end()) 376 373 { 377 374 text_t metadata_value = (*metadata_value_iterator).OID; 375 // logout << "Metadata value: " << metadata_value << ", current position: " << current_position << endl; 378 376 379 377 // If we're not at the top-level we need to remove the current position from the metadata values 380 if ( current_position != "" && starts_with(metadata_value, current_position+ "|"))381 { 382 metadata_value = substr(metadata_value.begin() + (c urrent_position+ "|").size(), metadata_value.end());378 if (starts_with(metadata_value, classifier_node_metadata_value + "|")) 379 { 380 metadata_value = substr(metadata_value.begin() + (classifier_node_metadata_value + "|").size(), metadata_value.end()); 383 381 } 384 382 -
gsdl/trunk/src/recpt/dynamicclassifieraction.h
r16058 r16061 70 70 ostream &textout, ostream &logout); 71 71 72 void output_parent_classifier_nodes (text_t classifier_node_OID, 73 int& classifier_node_indent, 74 text_tmap classifier_options, cgiargsclass &args, 75 recptproto *collectproto, browsermapclass *browsers, 76 displayclass &disp, outconvertclass &outconvert, 77 ostream &textout, ostream &logout); 72 void output_upper_classifier_nodes (text_t root_classifier_node_OID, 73 text_tlist parent_classifier_node_labels, 74 int& classifier_node_indent, 75 text_tmap classifier_options, cgiargsclass &args, 76 recptproto *collectproto, browsermapclass *browsers, 77 displayclass &disp, outconvertclass &outconvert, 78 ostream &textout, ostream &logout); 78 79 79 80 void output_child_classifier_nodes (text_t classifier_node_OID, 81 text_t classifier_node_metadata_value, 80 82 text_t metadata_value_filter, 81 83 int& classifier_node_indent,
Note:
See TracChangeset
for help on using the changeset viewer.