Ignore:
Timestamp:
1999-02-08T14:28:04+13:00 (25 years ago)
Author:
rjmcnab
Message:

Got the receptionist producing something using the statusaction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/receptionist.h

    r150 r155  
    1717#include "text_t.h"
    1818#include "cgiargs.h"
     19#include "display.h"
     20#include "action.h"
    1921
    2022#ifndef MACROPRECEDENCE
     
    3133  // is being run for multiple collections ("general" mode).
    3234  void set_gsdlhome (const text_t &thegsdlhome);
     35  text_t get_gsdlhome () {return gsdlhome;}
    3336
    3437  // this version of set_gsdlhome should be used if the receptionist
    3538  // is being run for a single collection ("collection specific" mode).
    3639  void set_gsdlhome (const text_t &thegsdlhome, const text_t &thecollection);
     40  text_t get_collection () {return collection;}
    3741
    3842  // sets the http address of the images directory. This is used to
     
    4145  // images via gwcgi which will be a lot slower (especially if the
    4246  // browser does not cache the images).
    43   void set_httpimg (const text_t &thehttpimg);
     47  void set_httpimg (const text_t &thehttpimg) {httpimg=thehttpimg;}
     48  text_t get_httpimg () {return httpimg;}
    4449
    4550  // sets the http address of the gateway cgi program (ie. the program
    4651  // that contains this receptionist).
    47   void set_gwcgi (const text_t &thegwcgi);
     52  void set_gwcgi (const text_t &thegwcgi) {gwcgi=thegwcgi;}
     53  text_t get_gwcgi () {return gwcgi;}
     54
     55  // set_macrofiles defines the macro files which will be read when
     56  // the init function is called.
     57  void set_macrofiles (const text_tarray &themacrofiles) {macrofiles=themacrofiles;}
     58  text_tarray get_macrofiles () {return macrofiles;}
     59
     60  // set_saveconf defines what should be included in the compressed
     61  // arguments. This string should consist of cgi argument names
     62  // seperated by "-".
     63  void set_saveconf (const text_t &thesaveconf) {saveconf=thesaveconf;}
     64  text_t get_saveconf () {return saveconf;}
     65
     66  // add_action makes another action available to the receptionist
     67  // the action becomes the property of the receptionist
     68  void add_action (action *theaction) {actions.addaction(theaction);}
     69
     70  // configure_actions should be called for each line in the
     71  // configuration files to configure the actions. The configuration
     72  // should take place after all the actions have been added.
     73  void configure_actions (const text_t &key, const text_tarray &cfgline);
    4874
    4975  // init should be called after setgsdhome has been called.
     
    5581 
    5682  // There are two ways to produce a page. You can either call parse_cgi_args,
    57   // get_cgihead_info, and produce_content or you can just call produce_cgi_page
    58   // which will be satisfactory in most cases. You might want to call
     83  // get_cgihead_info, and produce_content or you can just call parse_cgi_args and
     84  // produce_cgi_page (which will be satisfactory in most cases). You might want to call
    5985  // parse_cgi_args, get_cgihead_info, and produce_content when you want to
    60   // call get_compressed_arg or interface directly with a web server for which
    61   // the standard header is inappropriate.
    62 
    63   // produce_cgi_page will call parse_cgi_args, get_cgihead_info and
    64   // produce_content in the appropriate way to output a cgi header and
    65   // the page content (if needed).
    66   void produce_cgi_page (const text_t &argstr, ostream &contentout,
    67              ostream &logout);
     86  // interface directly with a web server for which the standard header is inappropriate.
    6887
    6988  // parse_cgi_args parses cgi arguments into an argument class.
    70   // This function should be called for each page request.
    71   void parse_cgi_args (const text_t &argstr, cgiargsclass &args, ostream &logout);
     89  // This function should be called for each page request. It returns false
     90  // if there was a major problem with the cgi arguments.
     91  bool parse_cgi_args (const text_t &argstr, cgiargsclass &args, ostream &logout);
    7292
    73   // response_t is used to inform the calling code what type of
    74   // cgi header it should produce
    75   // eventually this should reside in cgiutils.h
    76   enum response_t {location, content};
     93  // produce_cgi_page will call get_cgihead_info and
     94  // produce_content in the appropriate way to output a cgi header and
     95  // the page content (if needed). If a page could not be created it
     96  // will return false
     97  bool produce_cgi_page (cgiargsclass &args, ostream &contentout,
     98                     ostream &logout);
    7799
    78100  // get_cgihead_info determines the cgi header information for
     
    85107
    86108  // produce the page content
    87   void produce_content (cgiargsclass &args, ostream &contentout,
     109  bool produce_content (cgiargsclass &args, ostream &contentout,
    88110            ostream &logout);
    89111
     
    99121  text_t gwcgi;
    100122
     123  displayclass disp;
     124  text_tarray macrofiles;
    101125
     126  text_t saveconf;
     127  cgiargsinfoclass argsinfo;
     128  actionmapclass actions;
     129
     130  // will read in all the macro files. If one is not found an
     131  // error message will be written to logout and the method will
     132  // return false.
     133  bool read_macrofiles (ostream &logout);
    102134 
     135  // Will define the main general arguments used by the receptionist.
     136  // If an error occurs a message will be written to logout and the
     137  // method will return false.
     138  virtual bool define_mainargs (ostream &logout);
     139
     140  // check_mainargs will check all the main arguments. If a major
     141  // error is found it will return false and no cgi page should
     142  // be created using the arguments.
     143  virtual bool check_mainargs (cgiargsclass &args, ostream &logout);
    103144};
    104145
    105146
    106 
    107147#endif
Note: See TracChangeset for help on using the changeset viewer.