Changeset 15768

Show
Ignore:
Timestamp:
28.05.2008 16:49:14 (11 years ago)
Author:
mdewsnip
Message:

(Adding dynamic classifiers) Adding the first bit of functionality to the "dc" action: displays the metadata values for a certain metadata element as clickable folder nodes. Still a lot of work to do on this...

Files:
1 modified

Legend:

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

    r15744 r15768  
    2525 
    2626#include "dynamicclassifieraction.h" 
     27#include "recptprototools.h" 
    2728 
    2829 
     
    8687  } 
    8788 
     89  textout << outconvert << disp << "_document:header_\n"; 
     90  textout << outconvert << disp << "_document:content_\n"; 
     91 
     92  FilterResponse_t metadata_values_response; 
     93  get_metadata_values ("dls.Organization", args["c"], collectproto, metadata_values_response, logout); 
     94 
     95  ResultDocInfo_tarray::iterator metadata_value_iterator = metadata_values_response.docInfo.begin(); 
     96  while (metadata_value_iterator != metadata_values_response.docInfo.end()) 
     97  { 
     98    (*metadata_value_iterator).metadata["doctype"].values.push_back("classify"); 
     99    (*metadata_value_iterator).metadata["haschildren"].values.push_back("1"); 
     100    (*metadata_value_iterator).metadata["numleafdocs"].values.push_back((*metadata_value_iterator).result_num); 
     101    (*metadata_value_iterator).metadata["Title"].values.push_back((*metadata_value_iterator).OID); 
     102    metadata_value_iterator++; 
     103  } 
     104 
     105  browserclass *bptr = browsers->getbrowser ("VList"); 
     106  text_t formatstring = bptr->get_default_formatstring(); 
     107  format_t *formatlistptr = new format_t(); 
     108  text_tset metadata; 
     109  bool getParents = false; 
     110  parse_formatstring (formatstring, formatlistptr, metadata, getParents); 
     111  bool use_table = is_table_content (formatlistptr); 
     112  bptr->output_section_group (metadata_values_response, args, args["c"], 0, formatlistptr, use_table,  
     113                  metadata, getParents, collectproto, disp, outconvert, textout, logout); 
     114 
     115  textout << outconvert << disp << "_document:footer_\n"; 
     116 
    88117  return true; 
    89118}