Changeset 7390


Ignore:
Timestamp:
2004-05-24T16:48:21+12:00 (20 years ago)
Author:
davidb
Message:

Functionality extended to support collection specific macro files. Most
of the changes are in 'display.cpp'. Here the main change is to -- at
the point a page is away to be produced -- look in the collection's
macro folder for any macro files. If any are found then they are loaded
in on to of existing macros definitions.

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

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

    r7347 r7390  
    11491149  return true;
    11501150}
     1151
     1152
     1153
     1154
     1155// Go through the list of macro files looking to see
     1156// if any exist in the collectoin specific area.  If they
     1157// do then read them in and add them to the set of existing
     1158// current macros
     1159
     1160void receptionist::read_collection_macrofiles (const text_t& collection, ostream &logout)
     1161{
     1162  outconvertclass text_t2ascii;
     1163
     1164  disp.unloadcollectionmacros();
     1165
     1166  // redirect the error output to logout
     1167  ostream *savedlogout = disp.setlogout (&logout);
     1168
     1169  text_t colmacrodir
     1170    = filename_cat (configinfo.gsdlhome,"collect",collection, "macros");
     1171
     1172  if (file_exists (colmacrodir)) {
     1173
     1174    text_tset::iterator arrhere = configinfo.macrofiles.begin();
     1175    text_tset::iterator arrend = configinfo.macrofiles.end();
     1176    text_t filename;
     1177    while (arrhere != arrend) {
     1178
     1179      filename = filename_cat (colmacrodir, *arrhere);
     1180      if (file_exists (filename)) {
     1181    disp.loadcollectionmacros(filename);
     1182      }
     1183     
     1184      arrhere++;
     1185    }
     1186  }
     1187
     1188  // reset logout to what it was
     1189  disp.setlogout (savedlogout);
     1190}
     1191
     1192
    11511193
    11521194
     
    13111353  }
    13121354
     1355  text_t collection = args["c"];
     1356  if (!collection.empty()) {
     1357    read_collection_macrofiles(collection,logout);
     1358  }
     1359
    13131360  // define internal macros for the current action
    13141361  a->define_internal_macros (disp, args, &protocols, logout);
     
    13301377
    13311378  if (!collection.empty()) {
    1332     // DB // ****
    13331379    ColInfoResponse_t cinfo;
    13341380    comerror_t err;
  • trunk/gsdl/src/recpt/receptionist.h

    r7349 r7390  
    269269  virtual bool read_macrofiles (ostream &logout);
    270270 
     271  virtual void read_collection_macrofiles (const text_t& collection, ostream &logout);
     272
    271273  // check_mainargs will check all the main arguments. If a major
    272274  // error is found it will return false and no cgi page should
Note: See TracChangeset for help on using the changeset viewer.