Changeset 7432 for trunk/gsdl/src/recpt/librarymain.cpp
- Timestamp:
- 2004-05-25T16:31:41+12:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/librarymain.cpp
r4122 r7432 24 24 *********************************************************************/ 25 25 26 #include "gsdl_modules_cfg.h" 26 27 #include "receptionist.h" 27 28 #include "cgiwrapper.h" 29 #include "recptconfig.h" 28 30 #include "fileutil.h" 29 31 #include "nullproto.h" … … 53 55 #include "usersaction.h" 54 56 #include "extlinkaction.h" 57 58 #ifdef GSDL_USE_EXPORT_ACTION 59 #include "exportaction.h" 60 #endif 61 62 #ifdef GSDL_USE_CL_DISPLAY_ACTION 63 #include "cldisplayaction.h" 64 #endif 65 66 #ifdef GSDL_USE_COURSES_ACTION 67 #include "coursesaction.h" 68 #endif 69 70 #ifdef GSDL_USE_COMPOSITION_ACTION 71 #include "compositionaction.h" 72 #endif 73 74 #ifdef GSDL_USE_INDEX_BROWSE_ACTION 75 #include "indexbrowseaction.h" 76 #endif 77 78 #ifdef GSDL_USE_DIR_BROWSE_ACTION 79 #include "dirbrowseaction.h" 80 #endif 81 82 #ifdef GSDL_USE_GENERATOR_ACTION 83 #include "generatoraction.h" 84 #endif 85 55 86 #include "tipaction.h" 56 87 #include "collectoraction.h" 57 88 #include "browseaction.h" 58 89 #include "phindaction.h" 59 #if defined( USE_LANGACTION)90 #if defined(GSDL_USE_LANG_ACTION) 60 91 #include "langaction.h" 61 92 #endif … … 69 100 #include "htmlbrowserclass.h" 70 101 #include "phindbrowserclass.h" 102 103 #ifdef GSDL_USE_CLASSIFIER_BROWSER 104 //classifier browsers 105 106 #include "treeclassifierbrowserclass.h" 107 #ifdef GSDL_USE_TREE_EX_CLASSIFIER_BROWSER 108 #include "treeexclassifierbrowserclass.h" 109 #endif 110 111 #endif //GSDL_USE_CLASSIFIER_BROWSER 71 112 72 113 int main () { … … 113 154 #endif 114 155 156 #ifdef GSDL_USE_TIP_ACTION 115 157 // the list of actions. Note: these actions will become invalid 116 // at the end of this function. 117 tipaction atipaction; 118 recpt.add_action (&atipaction); 119 120 statusaction astatusaction; 121 astatusaction.set_receptionist (&recpt); 122 recpt.add_action (&astatusaction); 123 124 pageaction apageaction; 125 apageaction.set_receptionist (&recpt); 126 recpt.add_action (&apageaction); 127 128 pingaction apingaction; 129 recpt.add_action (&apingaction); 130 131 queryaction aqueryaction; 132 aqueryaction.set_receptionist (&recpt); 133 recpt.add_action (&aqueryaction); 134 135 documentaction adocumentaction; 136 adocumentaction.set_receptionist (&recpt); 137 recpt.add_action (&adocumentaction); 138 139 usersaction ausersaction; 140 recpt.add_action (&ausersaction); 141 142 extlinkaction anextlinkaction; 143 recpt.add_action (&anextlinkaction); 144 145 authenaction aauthenaction; 146 aauthenaction.set_receptionist(&recpt); 147 recpt.add_action (&aauthenaction); 148 149 collectoraction acollectoraction; 150 acollectoraction.set_receptionist (&recpt); 151 recpt.add_action(&acollectoraction); 152 153 browseaction abrowseaction; 154 abrowseaction.set_receptionist (&recpt); 155 recpt.add_action(&abrowseaction); 156 157 phindaction aphindaction; 158 recpt.add_action(&aphindaction); 159 160 #if defined(USE_LANGACTION) 161 langaction alangaction; 162 alangaction.set_receptionist(&recpt); 163 recpt.add_action(&alangaction); 158 // at the end of this function. We will clean them. 159 recpt.add_action (new tipaction()); 160 #endif 161 162 #ifdef GSDL_USE_STATUS_ACTION 163 statusaction *astatusaction = new statusaction(); 164 astatusaction->set_receptionist (&recpt); 165 recpt.add_action (astatusaction); 166 #endif 167 168 pageaction *apageaction = new pageaction(); 169 apageaction->set_receptionist (&recpt); 170 recpt.add_action (apageaction); 171 172 #ifdef GSDL_USE_PING_ACTION 173 recpt.add_action (new pingaction()); 174 #endif 175 176 queryaction *aqueryaction = new queryaction(); 177 aqueryaction->set_receptionist (&recpt); 178 recpt.add_action (aqueryaction); 179 180 documentaction *adocumentaction = new documentaction(); 181 adocumentaction->set_receptionist (&recpt); 182 recpt.add_action (adocumentaction); 183 184 #ifdef GSDL_USE_USERS_ACTION 185 recpt.add_action (new usersaction()); 186 #endif 187 188 #ifdef GSDL_USE_EXTLINK_ACTION 189 recpt.add_action (new extlinkaction()); 190 #endif 191 192 #ifdef GSDL_USE_AUTHEN_ACTION 193 authenaction *aauthenaction = new authenaction(); 194 aauthenaction->set_receptionist(&recpt); 195 recpt.add_action (aauthenaction); 196 #endif 197 198 #ifdef GSDL_USE_COLLECTOR_ACTION 199 collectoraction *acollectoraction = new collectoraction(); 200 acollectoraction->set_receptionist (&recpt); 201 recpt.add_action(acollectoraction); 202 #endif 203 204 #ifdef GSDL_USE_BROWSE_ACTION 205 browseaction *abrowseaction = new browseaction(); 206 abrowseaction->set_receptionist (&recpt); 207 recpt.add_action(abrowseaction); 208 #endif 209 210 #ifdef GSDL_USE_PHIND_ACTION 211 recpt.add_action(new phindaction()); 212 #endif 213 214 #ifdef GSDL_USE_LANG_ACTION 215 langaction *alangaction = new langaction(); 216 alangaction->set_receptionist(&recpt); 217 recpt.add_action(alangaction); 164 218 #endif 165 219 166 220 // list of browsers 167 221 vlistbrowserclass avlistbrowserclass; 222 avlistbrowserclass.set_receptionist(&recpt); 168 223 recpt.add_browser (&avlistbrowserclass); 169 224 recpt.setdefaultbrowser ("VList"); 170 225 171 226 hlistbrowserclass ahlistbrowserclass; 227 ahlistbrowserclass.set_receptionist(&recpt); 172 228 recpt.add_browser (&ahlistbrowserclass); 173 229 230 #ifdef GSDL_USE_DATELIST_BROWSER 174 231 datelistbrowserclass adatelistbrowserclass; 175 232 recpt.add_browser (&adatelistbrowserclass); 233 #endif 176 234 177 235 invbrowserclass ainvbrowserclass; 178 236 recpt.add_browser (&ainvbrowserclass); 179 237 238 #ifdef GSDL_USE_PAGED_BROWSER 180 239 pagedbrowserclass apagedbrowserclass; 181 240 recpt.add_browser (&apagedbrowserclass); 182 241 #endif 242 243 #ifdef GSDL_USE_HTML_BROWSER 183 244 htmlbrowserclass ahtmlbrowserclass; 184 245 recpt.add_browser (&ahtmlbrowserclass); 185 246 #endif 247 248 #ifdef GSDL_USE_PHIND_BROWSER 186 249 phindbrowserclass aphindbrowserclass; 187 250 recpt.add_browser (&aphindbrowserclass); 251 #endif 252 253 #ifdef GSDL_USE_CLASSIFIER_BROWSER 254 //list of classifier browsers 255 CTreeClassifierBrowserClass *pTreeClassifierBrowser = new CTreeClassifierBrowserClass(); 256 if (pTreeClassifierBrowser != NULL) { 257 recpt.GetClassifierBrowsers().AddBrowser(pTreeClassifierBrowser); 258 recpt.GetClassifierBrowsers().SetDefaultBrowser(pTreeClassifierBrowser->GetBrowserName()); 259 } 260 #ifdef GSDL_USE_TREE_EX_CLASSIFIER_BROWSER 261 CTreeExClassifierBrowserClass *pTreeExClassifierBrowser = new CTreeExClassifierBrowserClass(); 262 if (pTreeExClassifierBrowser != NULL) { 263 recpt.GetClassifierBrowsers().AddBrowser(pTreeExClassifierBrowser); 264 } 265 #endif //GSDL_USE_TREE_EX_CLASSIFIER_BROWSER 266 #endif //GSDL_USE_CLASSIFIER_BROWSER 188 267 189 268 cgiwrapper (recpt, ""); 190 269 delete cservers; 270 271 // clean up the actions 272 actionmapclass::iterator thisAction = recpt.get_actionmap_ptr()->begin(); 273 actionmapclass::iterator endAction = recpt.get_actionmap_ptr()->begin(); 274 while (thisAction != endAction) { 275 delete thisAction->second.a; thisAction->second.a = NULL; 276 ++thisAction; 277 } 278 thisAction = recpt.get_actionmap_ptr()->begin(); 279 recpt.get_actionmap_ptr()->erase(thisAction, endAction); 191 280 return 0; 192 281 }
Note:
See TracChangeset
for help on using the changeset viewer.