Changeset 760 for trunk/gsdl/src/recpt/receptionist.cpp
- Timestamp:
- 1999-11-02T10:56:32+13:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/receptionist.cpp
r731 r760 28 28 /* 29 29 $Log$ 30 Revision 1.38 1999/11/01 21:49:34 sjboddie 31 changes to arguments of many functions 32 30 33 Revision 1.37 1999/10/20 03:55:03 sjboddie 31 34 yet another problem with calling browserclass … … 807 810 action *a = actions.getaction (args["a"]); 808 811 if (a != NULL) { 809 a->get_cgihead_info (args, response, response_data, logout);812 a->get_cgihead_info (args, &protocols, response, response_data, logout); 810 813 811 814 } else { … … 845 848 outconverter->reset(); 846 849 847 text_t &collection = args["c"]; 848 recptproto *collectproto = NULL; 849 if (!collection.empty()) { 850 // decide on the protocol used for communicating with 851 // the collection server 852 collectproto = protocols.getrecptproto (collection, logout); 853 854 // get collection information 855 collectinfo.clear(); 856 if (!collection.empty()) { 857 comerror_t err; 858 collectproto->get_collectinfo (collection, collectinfo, err, logout); 859 if (err != noError) collectinfo.clear(); 860 } 861 850 recptproto *collectproto = protocols.getrecptproto (args["c"], logout); 851 if (collectproto != NULL) { 862 852 // get browsers to process OID 863 853 text_t OID = args["d"]; … … 882 872 } 883 873 } 884 874 885 875 // translate "d" and "cl" arguments if required 886 876 translate_OIDs (args, collectproto, logout); 887 877 } 888 878 889 879 // produce the page using the desired action 890 880 action *a = actions.getaction (args["a"]); 891 881 if (a != NULL) { 892 if (a->uses_display(args)) prepare_page (a, args, collectproto, (*outconverter), logout); 893 if (!a->do_action (args, collectinfo, collectproto, disp, 894 (*outconverter), contentout, logout)) 882 if (a->uses_display(args)) prepare_page (a, args, (*outconverter), logout); 883 if (!a->do_action (args, &protocols, &browsers, disp, (*outconverter), contentout, logout)) 895 884 return false; 896 885 … … 1066 1055 // prepare_page sets up page parameters, sets display macros 1067 1056 // and opens the page ready for output 1068 void receptionist::prepare_page (action *a, cgiargsclass &args, recptproto *collectproto, 1069 outconvertclass &outconvert, ostream &logout) { 1057 void receptionist::prepare_page (action *a, cgiargsclass &args, 1058 outconvertclass &outconvert, 1059 ostream &logout) { 1070 1060 // set up page parameters 1071 1061 text_t pageparams; … … 1098 1088 assert ((*actionhere).second.a != NULL); 1099 1089 if ((*actionhere).second.a != NULL) 1100 (*actionhere).second.a->define_external_macros ( collectinfo, disp, args, collectproto, logout);1090 (*actionhere).second.a->define_external_macros (disp, args, &protocols, logout); 1101 1091 actionhere++; 1102 1092 } 1103 1093 1104 1094 // define internal macros for the current action 1105 a->define_internal_macros ( collectinfo, disp, args, collectproto, logout);1095 a->define_internal_macros (disp, args, &protocols, logout); 1106 1096 1107 1097 // define general macros. the defining of general macros is done here so that 1108 1098 // the last possible version of the cgi arguments are used 1109 define_general_macros (args, collectproto,outconvert, logout);1110 } 1111 1112 void receptionist::define_general_macros (cgiargsclass &args, recptproto *collectproto,1113 o utconvertclass &/*outconvert*/, ostream &logout) {1099 define_general_macros (args, outconvert, logout); 1100 } 1101 1102 void receptionist::define_general_macros (cgiargsclass &args, outconvertclass &/*outconvert*/, 1103 ostream &logout) { 1114 1104 1115 1105 text_t &collection = args["c"]; … … 1142 1132 1143 1133 // set collection specific macros 1144 if ((!collection.empty()) && (collectproto != NULL)) { 1145 FilterResponse_t response; 1146 text_tset metadata; 1147 get_info ("collection", collection, metadata, false, 1148 collectproto, response, logout); 1149 1150 if (!response.docInfo[0].metadata.empty()) { 1151 MetadataInfo_tmap::const_iterator here = response.docInfo[0].metadata.begin(); 1152 MetadataInfo_tmap::const_iterator end = response.docInfo[0].metadata.end(); 1153 while (here != end) { 1154 if (((*here).first != "haschildren") && ((*here).first != "hasnext") && 1155 ((*here).first != "hasprevious")) { 1156 disp.setmacro ((*here).first, "Global", (*here).second.values[0]); 1134 if (!collection.empty()) { 1135 recptproto *collectproto = protocols.getrecptproto (collection, logout); 1136 if (collectproto != NULL) { 1137 FilterResponse_t response; 1138 text_tset metadata; 1139 get_info ("collection", collection, metadata, false, 1140 collectproto, response, logout); 1141 1142 if (!response.docInfo[0].metadata.empty()) { 1143 MetadataInfo_tmap::const_iterator here = response.docInfo[0].metadata.begin(); 1144 MetadataInfo_tmap::const_iterator end = response.docInfo[0].metadata.end(); 1145 while (here != end) { 1146 if (((*here).first != "haschildren") && ((*here).first != "hasnext") && 1147 ((*here).first != "hasprevious")) { 1148 disp.setmacro ((*here).first, "Global", (*here).second.values[0]); 1149 } 1150 here ++; 1157 1151 } 1158 here ++;1159 1152 } 1160 1153 }
Note:
See TracChangeset
for help on using the changeset viewer.