Changeset 1759


Ignore:
Timestamp:
2000-12-07T13:06:32+13:00 (23 years ago)
Author:
sjboddie
Message:

Made a start on tidying up the main.cfg configuration file and adding a
few more options to it. Some of the options I've added to the file but
have yet to implement.

Location:
trunk/gsdl
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/etc/main.cfg

    r1725 r1759  
     1# This is the main configuration file for configuring
     2# your Greenstone receptionist (i.e. the bit responsible
     3# for the way things are displayed).
     4
     5# Email address of the webmaster of this Greenstone installation
    16maintainer      [email protected]
    27
     8# Outgoing (SMTP) mail server for this Greenstone installation.
     9# This will default to mail.maintainer-domain if it's not set
     10# (i.e. if maintainer is [email protected] then MailServer
     11# will default to mail.cs.waikato.ac.nz). If MailServer doesn't
     12# resolve to a valid SMTP server then the EmailEvents and
     13# EmailUserEvents options (see below) won't be functional. Likewise,
     14# turning off EmailEvents and EmailUserEvents will remove any
     15# reliance on MailServer.
     16#MailServer mail.cs.waikato.ac.nz
     17
     18# Set status to "disabled" if you don't want the Maintenance and
     19# Administration facility to be available.
     20status          enabled
     21
     22# Set collector to "disabled" if you don't want the "collector"
     23# end-user collection building facility to be available.
     24collector       enabled
     25
     26# Set logcgiargs to true to keep a log of usage information in
     27# $GSDLHOME/etc/usage.txt.
     28logcgiargs      false
     29
     30# Set usecookies to true to use cookies to identify users (cookie
     31# information will be written to the usage log if logcgiargs is
     32# true).
     33usecookies      false
     34
     35# Log any events that Greenstone deems important in
     36# $GSDLHOME/etc/events.txt.
     37# The only events that are currently implemented come from the
     38# collector (e.g. someone just built/deleted the following collection)
     39# LogEvents may take values of:
     40# AllEvents: All important events
     41# CollectorEvents: Just those events originating from the collector
     42#                  (e.g. someone just built a collection)
     43# Disabled: Don't log events
     44LogEvents       AllEvents
     45
     46# Email the maintainer whenever any event occurs. EmailEvents
     47# takes the same values as LogEvents.
     48# Note that perl must be installed for EmailEvents or
     49# EmailUserEvents to work.
     50EmailEvents     AllEvents
     51
     52# In some cases it may be appropriate to email the user about a
     53# certain event (e.g. notification from the collector that a collection
     54# was built successfully)
     55EmailUserEvents true
     56
     57
     58# The list of display macro files used by this receptionist
    359macrofiles      tip.dm style.dm base.dm query.dm help.dm pref.dm \
    460                about.dm document.dm status.dm authen.dm \
     
    864        port.dm home.dm collect.dm phind.dm
    965
    10 status          enabled
    11 usecookies      false
    12 logcgiargs      false
     66# Define any additional page parameters to be used by the above macro files
     67# (the current default page parameters are c (collection) and l (language)
     68
     69# Define v (version -- text or graphic) page parameter and give it a default
     70# value of 0 (0 = text version off)
    1371pageparam       v 0
     72
     73# Set the precedence given to the page parameters. This effects which macro
     74# will be selected for display when there are multiple versions of the same
     75# macro with different page parameters.
     76# e.g. Given a macroprecedence of "c,v,l" and the following macro definitions:
     77# _content_ []
     78# _content_ [l=en]
     79# _content_ [c=demo]
     80# _content_ [v=1]
     81# _content_ [l=fr,v=1,c=hdl]
     82# If the corresponding cgi arguments were set to l=en&v=1&c=hdl then the
     83# _content_[v=1] macro would be selected for display. It would be selected
     84# ahead of the _content_[l=en] macro because "v" has a higher precedence
     85# than "l". The _content_[l=fr,v=1,c=hdl] macro would not be selected
     86# because one of the page parameters is completely wrong ("l").
    1487macroprecedence c,v,l
     88
     89
     90# Define any additional cgi arguments. Most cgi arguments are built into
     91# Greenstone but it's possible to define them here (or set defaults for
     92# existing built-in cgi arguments).
     93
     94# define the "v" cgi argument (to correspond to the "v" page parameter defined
     95# above).
    1596cgiarg          shortname=v longname=version multiplechar=false argdefault=0 \
    1697                defaultstatus=weak savedarginfo=must
    1798
     99# set a default value for the built-in "a" cgi argument
    18100cgiarg          shortname=a argdefault=p
     101
     102# set a default value for the built-in "p" cgi argument
     103cgiarg          shortname=p argdefault=home
  • trunk/gsdl/macros/home.dm

    r1592 r1759  
    3838#######################################################################
    3939
     40
    4041_imagecollector_ {_gsimage_(_httppagecollector_,_httpimg_/ccolof.gif,_httpimg_/ccolon.gif,col,The Collector)}
    4142_imageadmin_ {_gsimage_(_httppagestatus_,_httpimg_/cadminof.gif,_httpimg_/cadminon.gif,admin,Administration Page)}
     
    5859<p>_iconblankbar_
    5960</center>
     61_If_("_textgocollector__textgoadmin_" != "",
    6062<p><table>
    61 <tr valign=middle>
    62 <td>_imagecollector_</td>
    63 <td>Helps you create new collections, modify or add to existing ones, or
    64 delete collections</td>
    65 </tr>
    66 <tr valign=middle>
    67 <td>_imageadmin_</td>
    68 <td>Allows you to add new users, summarizes the collections in the system,
    69 gives technical information on the Greenstone installation</td>
    70 </tr>
     63_textgocollector_
     64_textgoadmin_
    7165</table>
    7266<center>
    7367<p>_iconblankbar_
    74 </center>
     68</center>)
    7569
    7670<p><center><h2>_textprojhead_</h2></center>
     
    10296}
    10397
     98
     99# the _textgocollector_ and _textgoadmin_ macros may be overridden
     100# to be empty from within the receptionist if the collector or admin
     101# facilities are disabled
     102_textgocollector_ {
     103<tr valign=middle>
     104<td>_imagecollector_</td>
     105<td>Helps you create new collections, modify or add to existing ones, or
     106delete collections</td>
     107</tr>
     108}
     109
     110_textgoadmin_ {
     111<tr valign=middle>
     112<td>_imageadmin_</td>
     113<td>Allows you to add new users, summarizes the collections in the system,
     114gives technical information on the Greenstone installation</td>
     115</tr>
     116}
  • trunk/gsdl/src/recpt/collectoraction.cpp

    r1679 r1759  
    4545
    4646  recpt = NULL;
     47  disabled = true;
    4748  do_mkcol = false;
    4849  gsdlosc = NULL;
     
    220221  if (pathc != NULL) delete pathc;
    221222}
     223
     224
     225void collectoraction::configure (const text_t &key, const text_tarray &cfgline) {
     226  if ((key == "collector") && (cfgline.size() == 1) &&
     227      (cfgline[0] == "true" || cfgline[0] == "on" || cfgline[0] == "enabled")) {
     228    disabled = false;
     229  } else {
     230    // call the parent class to deal with the things which
     231    // are not dealt with here
     232    action::configure (key, cfgline);
     233  }
     234}
     235
    222236
    223237bool collectoraction::init (ostream & /*logout*/) {
     
    965979                 ostream &logout) {
    966980
     981  // make sure the collector is enabled
     982  if (disabled) {
     983    textout << outconvert
     984        << "<html>\n"
     985        << "<head>\n"
     986        << "<title>Collector disabled</title>\n"
     987        << "</head>\n"
     988        << "<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#006666\" "
     989        << "alink=\"#cc9900\" vlink=\"#666633\">\n"
     990        << "<h2>Facility disabled</h2>\n"
     991        << "Sorry, the Collector end-user collection building facility is currently disabled\n"
     992        << "\n</body>\n"
     993        << "</html>\n";
     994    return true;
     995  }
     996
    967997  text_t &collector_page = args["cp"];
    968998  text_t &collection = args["bc1dirname"];
  • trunk/gsdl/src/recpt/collectoraction.h

    r1679 r1759  
    3535protected:
    3636
     37  bool disabled;
    3738  receptionist *recpt;
    3839  char *gsdlosc;
     
    8687  virtual ~collectoraction ();
    8788
     89  void configure (const text_t &key, const text_tarray &cfgline);
     90
    8891  bool init (ostream &logout);
    8992
  • trunk/gsdl/src/recpt/pageaction.cpp

    r1667 r1759  
    3131pageaction::pageaction () {
    3232
     33  status_disabled = true;
     34  collector_disabled = true;
    3335  recpt = NULL;
    3436
     
    9799    bool first = true;
    98100    while (collist_here != collist_end) {
    99      
    100101      ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout);
    101102     
     
    117118       
    118119        if (!response.docInfo[0].metadata["iconcollectionsmall"].values[0].empty())
    119             collectionname = "<img width=150 border=1 src=\""
    120               + response.docInfo[0].metadata["iconcollectionsmall"].values[0]
    121               + "\" alt=\"" + alt + "\">";
     120          collectionname = "<img width=150 border=1 src=\""
     121            + response.docInfo[0].metadata["iconcollectionsmall"].values[0]
     122            + "\" alt=\"" + alt + "\">";
    122123        else if (!response.docInfo[0].metadata["iconcollection"].values[0].empty())
    123124          collectionname = "<img width=150 border=1 src=\""
     
    126127        else collectionname = alt;
    127128          }
    128        
    129129          if ((count%3 == 0) && (!first))
    130130        homeextra += "</tr><tr valign=top>\n";
     
    145145        }
    146146      }
    147      
    148147      collist_here ++;
    149148    }
     
    162161  homeextra += "</tr></table></center>\n";
    163162  disp.setmacro ("homeextra", "home", homeextra);
    164 
    165163}
    166164
     
    208206  // _textreadingdocs_     collection it is (e.g. html collection, bibliographic collection etc.)
    209207  // _texthelpreadingdocs_
     208
     209  // _textgocollector_     set to "" if collector is disabled in main.cfg
     210  // _textgoadmin_         set to "" if status is disabled in main.cfg
    210211
    211212 
     
    231232  }
    232233
    233   if (arg_p == "home") set_homeextra_macro (disp, protos, logout);
     234  if (arg_p == "home") {
     235    set_homeextra_macro (disp, protos, logout);
     236    if (status_disabled) disp.setmacro ("textgoadmin", "home", "");
     237    if (collector_disabled) disp.setmacro ("textgocollector", "home", "");
     238  }
    234239
    235240  else if (arg_p == "preferences") {
     
    433438  return true;
    434439}
     440
     441void pageaction::configure (const text_t &key, const text_tarray &cfgline) {
     442  if ((key == "status") && (cfgline.size() == 1) &&
     443      (cfgline[0] == "true" || cfgline[0] == "on" || cfgline[0] == "enabled")) {
     444    status_disabled = false;
     445  } else if ((key == "collector") && (cfgline.size() == 1) &&
     446         (cfgline[0] == "true" || cfgline[0] == "on" || cfgline[0] == "enabled")) {
     447    collector_disabled = false;
     448  } else {
     449    // call the parent class to deal with the things which
     450    // are not dealt with here
     451    action::configure (key, cfgline);
     452  }
     453}
  • trunk/gsdl/src/recpt/pageaction.h

    r1285 r1759  
    6464          ostream &logout);
    6565
     66  void configure (const text_t &key, const text_tarray &cfgline);
     67
    6668protected:
    6769  void set_homeextra_macro (displayclass &disp, recptprotolistclass *protos,
    6870                ostream &logout);
     71
     72  bool status_disabled;
     73  bool collector_disabled;
    6974
    7075};
  • trunk/gsdl/src/recpt/statusaction.cpp

    r1285 r1759  
    903903  // make sure the status function is enabled
    904904  if (disabled) {
    905     output_errorpage (outconvert, textout, logout,
    906               "The status action is disabled. "
    907               "See the documentation (what documentation!) on how "
    908               "to enable it.");
     905    textout << outconvert
     906        << "<html>\n"
     907        << "<head>\n"
     908        << "<title>Status disabled</title>\n"
     909        << "</head>\n"
     910        << "<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#006666\" "
     911        << "alink=\"#cc9900\" vlink=\"#666633\">\n"
     912        << "<h2>Facility disabled</h2>\n"
     913        << "Sorry, the Maintenance and Administration facility is currently disabled\n"
     914        << "\n</body>\n"
     915        << "</html>\n";
    909916    return true;
    910917  }
Note: See TracChangeset for help on using the changeset viewer.