Changeset 15795 for gsdl/trunk/src/recpt/dynamicclassifieraction.cpp
- Timestamp:
- 2008-05-29T14:59:42+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/src/recpt/dynamicclassifieraction.cpp
r15772 r15795 33 33 34 34 cgiarginfo arg_ainfo; 35 arg_ainfo.shortname = "dc n";36 arg_ainfo.longname = "dynamic classifier node";35 arg_ainfo.shortname = "dcl"; 36 arg_ainfo.longname = "dynamic classifier ID"; 37 37 arg_ainfo.multiplechar = true; 38 38 arg_ainfo.defaultstatus = cgiarginfo::weak; … … 88 88 ostream &logout) 89 89 { 90 // must have a valid collection server90 // A valid collection server is vital 91 91 recptproto *collectproto = protos->getrecptproto (args["c"], logout); 92 92 if (collectproto == NULL) … … 99 99 textout << outconvert << disp << "_document:content_\n"; 100 100 101 text_t arg_dcn = args["dcn"]; 102 if (arg_dcn.empty()) 101 // Check a dynamic classifier ID has been specified 102 text_t arg_dcl = args["dcl"]; 103 if (arg_dcl.empty()) 103 104 { 104 textout << outconvert << disp << "Error: Missing \"dc n\" value.\n";105 textout << outconvert << disp << "Error: Missing \"dcl\" value.\n"; 105 106 textout << outconvert << disp << "_document:footer_\n"; 106 return false;107 return true; 107 108 } 108 109 110 // Check the dynamic classifier ID is valid (ie. there is an entry in the collect.cfg file for it) 109 111 ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr (collectproto, args["c"], logout); 110 if (cinfo->dynamic_classifiers.find(arg_dc n) == cinfo->dynamic_classifiers.end())112 if (cinfo->dynamic_classifiers.find(arg_dcl) == cinfo->dynamic_classifiers.end()) 111 113 { 112 textout << outconvert << disp << "Error: Invalid \"dc n\" value " << arg_dcn<< ".\n";114 textout << outconvert << disp << "Error: Invalid \"dcl\" value " << arg_dcl << ".\n"; 113 115 textout << outconvert << disp << "_document:footer_\n"; 114 return false;116 return true; 115 117 } 116 118 117 text_t metadata_element_name = cinfo->dynamic_classifiers[arg_dcn]; 119 text_t classifier_type = "VList"; 120 browserclass *bptr = browsers->getbrowser (classifier_type); 121 122 // Get the formatstring if there is one, or use the browser's default otherwise 123 text_t formatstring; 124 if (!get_formatstring (arg_dcl, classifier_type, cinfo->format, formatstring)) 125 { 126 formatstring = bptr->get_default_formatstring(); 127 } 128 format_t *formatlistptr = new format_t(); 129 text_tset metadata; 130 bool getParents = false; 131 parse_formatstring (formatstring, formatlistptr, metadata, getParents); 132 133 text_t metadata_element_name = cinfo->dynamic_classifiers[arg_dcl]; 118 134 FilterResponse_t metadata_values_response; 119 135 get_metadata_values (metadata_element_name, args["c"], collectproto, metadata_values_response, logout); … … 129 145 } 130 146 131 browserclass *bptr = browsers->getbrowser ("VList"); 132 text_t formatstring = bptr->get_default_formatstring(); 133 format_t *formatlistptr = new format_t(); 134 text_tset metadata; 135 bool getParents = false; 136 parse_formatstring (formatstring, formatlistptr, metadata, getParents); 147 // Display the nodes 137 148 bool use_table = is_table_content (formatlistptr); 138 149 bptr->output_section_group (metadata_values_response, args, args["c"], 0, formatlistptr, use_table,
Note:
See TracChangeset
for help on using the changeset viewer.