Changeset 24959 for main/trunk/greenstone2/runtime-src
- Timestamp:
- 2012-01-20T20:48:26+13:00 (12 years ago)
- Location:
- main/trunk/greenstone2/runtime-src/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/corba/corbaServer.mpp
r15459 r24959 397 397 } 398 398 399 void getRssItems (const struct corbatext_t &corbaCollect, 400 const struct corbatext_t &corbaGsdlHome, 401 const struct corbatext_t &corbaRssItems, 402 enum corbaComError &corbaError) 403 { 404 text_t collection; 405 text_t gsdlhome; 406 text_t rss_items; 407 comerror_t error = noError; 408 ofstream logout; 409 410 this->openLogfile("/etc/corbaout.txt", logout); 411 412 corbaconv_text_t::setCorbatext(collection,corbaCollect); 413 corbaconv_text_t::setCorbatext(gsdlhome,corbaGsdlHome); 414 415 // do actual operation 416 protocol->get_rss_items(collection, gsdlhome, rss_items, error, logout); 417 corbaconv_text_t::getCorbatext(rss_items,corbaRssItems); 418 419 // decode response 420 corbaError = (corbaComError) error; 421 422 logout.close(); 423 } 424 399 425 void collectionList(corbatext_tarray &corbalist, corbaComError &error) 400 426 { -
main/trunk/greenstone2/runtime-src/src/corba/corbaproto.h
r15471 r24959 86 86 InfoFilterOptionsResponse_t &response, 87 87 comerror_t &err, ostream &logout); 88 89 // returns the contents of a collection's rss-items.rdf file (generated by BasePlugout) 90 void get_rss_items (const text_t &collection, 91 const text_t &gsdlhome, 92 text_t &rss_items, 93 comerror_t &err, 94 ostream &logout); 95 88 96 void filter (const text_t &collection, 89 97 FilterRequest_t &request, -
main/trunk/greenstone2/runtime-src/src/corba/corbaproto.mpp
r15471 r24959 673 673 } 674 674 675 // returns the contents of a collection's rss-items.rdf file (generated by BasePlugout) 676 void corbaproto::get_rss_items (const text_t &collection, 677 const text_t &gsdlhome, 678 text_t &rss_items, 679 comerror_t &err, 680 ostream &logout) { 681 682 corbatext_t corbaCollection; 683 corbatext_t corbaGsdlHome; 684 corbatext_t corbaRssItems; 685 corbaComError corbaError = corbaNoError; 686 687 // convert all the requisite structures into their CORBA form 688 corbaconv_text_t::getCorbatext(collection,corbaCollection); 689 corbaconv_text_t::getCorbatext(collection,corbaGsdlHome); 690 corbaconv_text_t::getCorbatext(collection,corbaRssItems); 691 692 // get the corba client reference 693 // corbaiface_var lclient = this->getCorbaClient(); // **** 694 corbaiface_var lclient = client; 695 696 // execute the corba transaction 697 lclient->get_rss_items (corbaCollection, corbaGsdlHome, corbaRssItems, corbaError); 698 699 // convert the response back to normal form 700 rss_items = corbaRssItems; 701 702 // text_t rss_filename = filename_cat(gsdlhome,"collect",collection,"index","rss-items.rdf"); 703 //if (!read_file(rss_filename,rss_items)) { // read contents of file rss_filename into the string rss_items 704 // err = protocolError; // else an error occurred 705 //} 706 } 675 707 676 708 void corbaproto::filter (const text_t &collection, -
main/trunk/greenstone2/runtime-src/src/protocol/nullproto.cpp
r20821 r24959 30 30 #include "browsefilter.h" 31 31 32 #include "fileutil.h" 33 // for read_file 32 34 33 35 nullproto::nullproto() { … … 134 136 } 135 137 138 // returns the contents of a collection's rss-items.rdf file (generated by BasePlugout) 139 void nullproto::get_rss_items (const text_t &collection, 140 const text_t &gsdlhome, 141 text_t &rss_items, 142 comerror_t &err, 143 ostream &logout) { 144 145 text_t rss_filename = filename_cat(gsdlhome,"collect",collection,"index","rss-items.rdf"); 146 // read contents of file rss_filename into the string rss_items 147 if (read_file(rss_filename,rss_items)) { 148 err = noError; 149 } else { 150 err = protocolError; 151 } 152 } 153 136 154 void nullproto::filter (const text_t &collection, 137 155 FilterRequest_t &request, -
main/trunk/greenstone2/runtime-src/src/protocol/nullproto.h
r16310 r24959 81 81 InfoFilterOptionsResponse_t &response, 82 82 comerror_t &err, ostream &logout); 83 84 // returns the contents of a collection's rss-items.rdf file (generated by BasePlugout) 85 void get_rss_items (const text_t &collection, 86 const text_t &gsdlhome, 87 text_t &rss_items, 88 comerror_t &err, 89 ostream &logout); 90 83 91 void filter (const text_t &collection, 84 92 FilterRequest_t &request, -
main/trunk/greenstone2/runtime-src/src/protocol/recptproto.cpp
r16310 r24959 113 113 } 114 114 115 // returns the contents of a collection's rss-items.rdf file (generated by BasePlugout) 116 void recptproto::get_rss_items (const text_t &/*collection*/, 117 const text_t &/*gsdlhome*/, 118 text_t &/*rss_items*/, 119 comerror_t &err, 120 ostream &/*logout*/) { 121 err = protocolError; 122 } 123 115 124 // filters (search or browse) a result set 116 125 void recptproto::filter (const text_t &/*collection*/, -
main/trunk/greenstone2/runtime-src/src/protocol/recptproto.h
r22142 r24959 116 116 InfoFilterOptionsResponse_t &response, 117 117 comerror_t &err, ostream &logout); 118 119 // returns the contents of a collection's rss-items.rdf file (generated by BasePlugout) 120 virtual void get_rss_items (const text_t &collection, 121 const text_t &gsdlhome, 122 text_t &rss_items, 123 comerror_t &err, 124 ostream &logout); 118 125 119 126 // filters (search or browse) a result set and returns information -
main/trunk/greenstone2/runtime-src/src/recpt/rssaction.cpp
r24958 r24959 84 84 } 85 85 86 void rssaction::generate_rss_content(text_t& rss_ filename, displayclass &disp,86 void rssaction::generate_rss_content(text_t& rss_items, displayclass &disp, 87 87 outconvertclass &outconvert, ostream &textout, 88 88 ostream &logout) 89 89 { 90 text_t rss_items; 91 92 if (read_file(rss_filename,rss_items)) { 93 textout << outconvert << disp << rss_items; 94 } 95 96 90 textout << outconvert << disp << rss_items; 97 91 } 98 92 … … 108 102 109 103 110 111 112 104 bool rssaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 113 105 browsermapclass * /*browsers*/, displayclass& disp, 114 106 outconvertclass &outconvert, ostream &textout, 115 107 ostream &logout) { 116 //bool wassuccess = false;117 //comerror_t err;118 108 text_t rss_items; 109 bool success = false; 110 comerror_t err; 119 111 120 /* 121 recptproto *collectproto = protos->getrecptproto (args["c"], logout); 122 if (!args["c"].empty() && (collectproto != NULL)) { 123 collectproto->ping (args["c"], wassuccess, err, logout); 124 if (err != noError) wassuccess = false; // a communication error 112 text_t &arg_c = args["c"]; 113 114 115 if (!args["c"].empty()) { 116 recptproto* collectproto = protos->getrecptproto (arg_c, logout); 117 if (collectproto != NULL) { 118 collectproto->get_rss_items (arg_c, gsdlhome, rss_items, err, logout); 119 if (err == noError) success = true; 120 // else a communication error 121 } 125 122 } 126 */127 128 text_t rss_filename = filename_cat(gsdlhome,"collect",args["c"],"index","rss-items.rdf");129 123 130 124 generate_rss_header(disp,outconvert,textout,logout); 131 generate_rss_content(rss_filename,disp,outconvert,textout,logout); 125 if(success) { 126 generate_rss_content(rss_items,disp,outconvert,textout,logout); 127 } 132 128 generate_rss_footer(disp,outconvert,textout,logout); 133 129 134 return true;130 return success; 135 131 }; 136 132 -
main/trunk/greenstone2/runtime-src/src/recpt/rssaction.h
r24958 r24959 54 54 outconvertclass &outconvert, ostream &textout, 55 55 ostream &logout); 56 void generate_rss_content(text_t& rss_ filename, displayclass &disp,56 void generate_rss_content(text_t& rss_items, displayclass &disp, 57 57 outconvertclass &outconvert, ostream &textout, 58 58 ostream &logout);
Note:
See TracChangeset
for help on using the changeset viewer.