Ignore:
Timestamp:
2017-02-08T19:08:39+13:00 (7 years ago)
Author:
ak19
Message:

Second commit to do with implementing OAI deletion policy for GS2. This commit is only loosely related, as it shifts functions duplicated in source.h and filter.h (and cpp files) into the new colserver.h and cpp files for sharing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/colservr/filter.cpp

    r31387 r31388  
    6161}
    6262
    63 text_t filterclass::getcollectionpath()
    64 {
    65   text_t resolved_filename;
    66  
    67   if (gsdlhome==dbhome) {
    68     // dbhome has defaulted to gsdlhome which we take to means the
    69     // database has been specifically moved out of gsdlhome area.
    70     // => it should be whereever collecthome is set to
    71     resolved_filename = filename_cat(collecthome, collection);
    72   }
    73   else {
    74     // dbhome is explicitly set to something other than gsdlhome
    75     // => use dbhome
    76     resolved_filename = filename_cat(dbhome, "collect", collection);
    77   }
    78 
    79   return resolved_filename;
    80 }
    81 
    82 text_t filterclass::resolve_db_filename(const text_t& idx,
    83                     const text_t& file_ext)
    84 {
    85   /*
    86   text_t resolved_filename;
    87 
    88   if (gsdlhome==dbhome) {
    89     // dbhome has defaulted to gsdlhome which we take to means the
    90     // database has been specifically moved out of gsdlhome area.
    91     // => it should be whereever collecthome is set to
    92     resolved_filename = filename_cat(collecthome, collection, "index", "text", idx);
    93   }
    94   else {
    95     // dbhome is explicitly set to something other than gsdlhome
    96     // => use dbhome
    97     resolved_filename = filename_cat(dbhome, "collect", collection, "index", "text", idx);
    98   }
    99   */
    100  
    101   text_t resolved_filename = filename_cat(getcollectionpath(), "index", "text", idx);
    102   resolved_filename += file_ext;
    103 
    104   return resolved_filename;
    105 }
    106 
    107 text_t filterclass::resolve_oaidb_filename(const text_t& file_ext)
    108 {
    109   text_t resolved_filename = filename_cat(getcollectionpath(), "etc", "oai-inf");
    110 
    111   resolved_filename += file_ext;
    112 
    113   return resolved_filename;
    114 }
    115 
    11663
    11764// init should be called after all the configuration is done but
Note: See TracChangeset for help on using the changeset viewer.