Changeset 2502
- Timestamp:
- 2001-06-07T11:10:32+12:00 (23 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/phindaction.cpp
r2491 r2502 129 129 ostream &logout) { 130 130 131 // must have a valid collection server132 recptproto *collectproto = protos->getrecptproto (args["c"], logout);133 if (collectproto == NULL) {134 logout << "phindaction::do_action called with NULL collectproto\n";135 textout << outconvert << disp << "_header_\n"136 << "Error: Attempt to get document without setting collection\n"137 << "_footer_\n";138 return true;139 }140 141 131 unsigned long count_l, count_e, count_d; 142 132 unsigned long phrase = args["ppnum"].getulong(); … … 151 141 if (args["pxml"] == "1") XMLmode = true; 152 142 143 // must have a valid collection server 144 recptproto *collectproto = protos->getrecptproto (args["c"], logout); 145 if (collectproto == NULL) { 146 output_error("phindaction: ERROR: collection not set", textout, 147 outconvert, disp, logout, XMLmode); 148 return true; 149 } 153 150 154 151 // the frequency and occurances of the phrase … … 167 164 168 165 if (word.empty()) { 169 logout << "phindaction::do_action ERROR: No phrase number or word\n"; 170 textout << outconvert << disp << "_header_\n" 171 << "Error: No phrase number or word." 172 << "_footer_\n"; 166 output_error("phindaction: ERROR: no phrase number or word", textout, 167 outconvert, disp, logout, XMLmode); 173 168 return true; 174 169 } … … 178 173 179 174 if (result.empty()) { 180 logout << "phindaction::do_action ERROR: The search term does not occur in the collection."; 181 textout << outconvert << disp << "_header_\n" 182 << "ERROR: The search term does not occur in the collection." 183 << "_footer_\n"; 175 output_error("phindaction: The search term does not occur in the collection", 176 textout, outconvert, disp, logout, XMLmode); 184 177 return true; 185 178 } else { … … 937 930 } 938 931 932 void phindaction::output_error (const text_t &message, ostream &textout, 933 outconvertclass &outconvert, 934 displayclass & disp, ostream &logout, 935 bool XMLmode) { 936 937 logout << outconvert << message << "\n"; 938 if (XMLmode) { 939 textout << outconvert 940 << "<phinddata>\n" 941 << "<phinderror>" << message << "</phinderror>\n" 942 << "</phinddata>\n"; 943 } else { 944 textout << outconvert << disp 945 << "_header_\n" 946 << message 947 << "_footer_\n"; 948 } 949 } -
trunk/gsdl/src/recpt/phindaction.h
r2491 r2502 91 91 void toUCArray(const text_t &in, UCArray &out); 92 92 93 void output_error (const text_t &message, ostream &textout, 94 outconvertclass &outconvert, 95 displayclass & disp, ostream &logout, 96 bool XMLmode); 97 93 98 94 99 public:
Note:
See TracChangeset
for help on using the changeset viewer.