Changeset 21564

Show
Ignore:
Timestamp:
21.01.2010 15:59:35 (9 years ago)
Author:
mdewsnip
Message:

Changed lots of occurrences of "GDBM" in comments, variable names and function names, where the code isn't GDBM-specific. Part of making the code less GDBM-specific.

Location:
main/trunk/greenstone2
Files:
14 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/export.pl

    r21292 r21564  
    712712    } 
    713713    else { 
    714     $export_info->save_revinfo_gdbm($expinfo_src_filename); 
     714    $export_info->save_revinfo_db($expinfo_src_filename); 
    715715    } 
    716716 
  • main/trunk/greenstone2/bin/script/import.pl

    r21309 r21564  
    692692    } 
    693693    else { 
    694     $archive_info->save_revinfo_gdbm($arcinfo_src_filename); 
     694    $archive_info->save_revinfo_db($arcinfo_src_filename); 
    695695    } 
    696696 
  • main/trunk/greenstone2/collect/demo/etc/collect.cfg

    r20680 r21564  
    44 
    55buildtype   mgpp 
     6 
     7infodbtype  gdbm 
    68 
    79indexes     text dls.Title,ex.Title dls.Subject dls.Organization dls.Keyword 
     
    2224 
    2325classify    List -metadata dls.Keyword -partition_type_within_level constant_size -buttonname Howto 
     26 
     27dynamic_classifier  Titles1  "dls.Title" 
    2428 
    2529format CL4VList "<td>[link][icon][/link]</td><td>[link][dls.Keyword][/link]" 
  • main/trunk/greenstone2/perllib/ClassifyTreeModel.pm

    r21563 r21564  
    88#  * 
    99#  *  @param  $class       The name of the class to bless as a string 
    10 #  *  @param  $collection  The name of the collection whose GDBM database we 
     10#  *  @param  $collection  The name of the collection whose info database we 
    1111#  *                       will be accessing as a string 
    1212#  *  @param  $root        The oid of the root node of the classifier as a 
     
    125125    if (&dbutil::read_infodb_entry("gdbm", $infodb_file_path, $clid) =~ /\w+/) 
    126126      { 
    127         # Since the CLID can directly reference the correct entry in the GDBM we 
     127        # Since the CLID can directly reference the correct entry in the info database we 
    128128        # just create the node and return it 
    129129        $result = new ClassifyTreeNode($self, $clid); 
  • main/trunk/greenstone2/perllib/IncrementalBuildUtils.pm

    r21562 r21564  
    3131#  *               by John Rowe 
    3232#  *  @version 2.0 Package version including seperation from calling code and 
    33 #  *               modularisation by creating gdbmget, gdbmset and 
    34 #  *               get_database_path by John Rowe 
     33#  *               modularisation by John Rowe 
    3534#  * 
    3635#  *  @author John Thompson, DL Consulting Ltd. 
     
    153152#  *  1. The Lucene index must be updated. This will involve removing any 
    154153#  *     existing value and, if required, adding a new value in its place. 
    155 #  *  2. The GDBM database must be updated. Again any existing value will be 
     154#  *  2. The info database must be updated. Again any existing value will be 
    156155#  *     removed and, if required, a new value added. 
    157156#  *  3. Finally a check against the collect.cfg will be done to determine if 
     
    165164#  *  A. Establish connection to Lucene 
    166165#  *  B. Create a IncrementalDocument object for 'NT1' loading the information 
    167 #  *     from the GDBM 
     166#  *     from the info database 
    168167#  *  C. Check to see if this metadata is used to build a classifier(s) and if 
    169168#  *     so create the appropriate ClassifyTreeModel(s) 
     
    177176#  *     iii/ Call addDocument() in ClassifyTreeModel(s) as necessary 
    178177#  *  F. Complete Lucene transaction 
    179 #  *  G. Save IncrementalDocument to GDBM 
    180 #  *  Note: ClassifyTreeModel automatically updates GDBM as necessary. 
     178#  *  G. Save IncrementalDocument to info database 
     179#  *  Note: ClassifyTreeModel automatically updates the info database as necessary. 
    181180#  * 
    182181#  *  @param  $collection  The name of the collection to update as a string 
     
    202201    #    Lucene daemon. 
    203202    # B. Create a IncrementalDocument object for 'NT1' loading the information 
    204     #    from the GDBM 
     203    #    from the info database 
    205204    print STDERR "* creating incremental document for $oid\n" unless !$debug; 
    206205    my $doc_obj = new IncrementalDocument($collection, $oid); 
     
    232231    if (defined($old_value) && $old_value =~ /[\w\d]+/) 
    233232      { 
    234         print STDERR "* removing '$key'='$old_value' from GDBM database for document $oid\n" unless !$debug; 
     233        print STDERR "* removing '$key'='$old_value' from info database for document $oid\n" unless !$debug; 
    235234        # i/   Call ??? to remove key-value from Lucene index 
    236235        #      Moved elsewhere 
     
    247246    if (defined($new_value) && $new_value =~ /[\w\d]+/) 
    248247      { 
    249         print STDERR "* adding '$key'='$new_value' to GDBM database for document $oid\n" unless !$debug; 
     248        print STDERR "* adding '$key'='$new_value' to info database for document $oid\n" unless !$debug; 
    250249        # i/   Call ??? to add key-value from Lucene index 
    251250        #      Moved elsewhere 
     
    265264        &callGS2LuceneEditor($collection, $doc_obj->getDocNum, $key, $old_value, $new_value); 
    266265      } 
    267     # G. Save IncrementalDocument to GDBM 
     266    # G. Save IncrementalDocument to info database 
    268267    $doc_obj->saveDocument(); 
    269268    $doc_obj = 0; 
     
    371370# /** callGS2LuceneEditor() **/ 
    372371 
    373 ## Remove a document from the GDBM and Index. 
     372## Remove a document from the info database and Index. 
    374373# 
    375374#  @param  collection  The collection to alter 
     
    388387    if ($doc_num > -1) 
    389388      { 
    390         # Now use the GDBM utils to write a blank string to this oid in the 
    391         # database 
     389        # Now write a blank string to this oid in the info database 
    392390    my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection, "index", "text"); 
    393391    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collection, $index_text_directory_path); 
  • main/trunk/greenstone2/perllib/IncrementalDocument.pm

    r21563 r21564  
    22# 
    33# IncrementalDocument.pm -- An object to encapsulate the Greenstone  
    4 #                           document retrieved from the GDBM database. 
     4#                           document retrieved from the info database. 
    55# 
    66# A component of the Greenstone digital library software 
     
    4848    $self->{'collection'} = $collection; 
    4949 
    50     # An associative array of information retrieved from the GDBM database 
     50    # An associative array of information retrieved from the info database 
    5151    # which maps a key string to a nested associative array listing values. 
    5252    $self->{'data'} = {}; 
     
    147147    my ($self) = @_; 
    148148    #rint STDERR "IncrementalDocument::loadDocument()\n"; 
    149     # Load the raw text for the document object from GDBM 
     149    # Load the raw text for the document object from the info database 
    150150    my $collection = $self->{'collection'}; 
    151151    my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection, "index", "text"); 
     
    185185    my $text = $self->toString(); 
    186186 
    187     # Now store the object in the database using the GDBM utilities 
     187    # Now store the object in the info database 
    188188    my $collection = $self->{'collection'}; 
    189189 
  • main/trunk/greenstone2/perllib/arcinfo.pm

    r21543 r21564  
    8686} 
    8787 
    88 sub _load_info_gdbm 
     88sub _load_info_db 
    8989{ 
    9090    my $self = shift (@_); 
     
    118118    } 
    119119    else { 
    120         $self->_load_info_gdbm($filename); 
    121     } 
    122     } 
    123 } 
    124  
    125 sub _load_filelist_gdbm 
     120        $self->_load_info_db($filename); 
     121    } 
     122    } 
     123} 
     124 
     125sub _load_filelist_db 
    126126{ 
    127127    my $self = shift (@_); 
     
    151151    } 
    152152    else { 
    153         $self->_load_filelist_gdbm($filename); 
     153        $self->_load_filelist_db($filename); 
    154154    } 
    155155    } 
     
    192192} 
    193193 
    194 sub _save_info_gdbm { 
     194sub _save_info_db { 
    195195    my $self = shift (@_); 
    196196    my ($filename) = @_; 
     
    232232} 
    233233 
    234 sub save_revinfo_gdbm { 
     234sub save_revinfo_db { 
    235235    my $self = shift (@_); 
    236236    my ($rev_filename) = @_; 
     
    258258    } 
    259259    else { 
    260     $self->_save_info_gdbm($filename); 
     260    $self->_save_info_db($filename); 
    261261    } 
    262262} 
  • main/trunk/greenstone2/perllib/cgiactions/baseaction.pm

    r20820 r21564  
    205205    my $users_db_file_path = &util::filename_cat($etc_directory, "users.db"); 
    206206 
    207     # Use db2txt instead of GDBM_File to get the user accounts information 
     207    # Use db2txt to get the user accounts information 
    208208    my $users_db_content = ""; 
    209209    open(USERS_DB, "db2txt \"$users_db_file_path\" |"); 
  • main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm

    r21563 r21564  
    119119    $collect_tail =~ s/^.*[\/|\\]//; 
    120120 
    121     my $gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
    122     my $gdbm_db = &util::filename_cat($gdbm_directory,"live-$collect_tail.gdb"); 
     121    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
     122    my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb"); 
    123123 
    124124    my $cmd = "gdbmget $gdbm_db $dbkey"; 
     
    179179    $collect_tail =~ s/^.*[\/\\]//; 
    180180 
    181     my $gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
    182     my $gdbm_db = &util::filename_cat($gdbm_directory,"$collect_tail.gdb"); 
     181    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
     182    my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb"); 
    183183 
    184184    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid); 
     
    239239    $collect_tail =~ s/^.*[\/\\]//; 
    240240 
    241     my $gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
    242     my $gdbm_db = &util::filename_cat($gdbm_directory,"live-$collect_tail.gdb"); 
     241    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
     242    my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb"); 
    243243 
    244244    my $cmd = "gdbmset \"$gdbm_db\" \"$dbkey\" \"$metavalue\""; 
     
    296296    $collect_tail =~ s/^.*[\/\\]//; 
    297297 
    298     my $gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
    299     my $gdbm_db = &util::filename_cat($gdbm_directory,"$collect_tail.gdb"); 
     298    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
     299    my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb"); 
    300300 
    301301    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid); 
     
    755755    $collect_tail =~ s/^.*[\/\\]//; 
    756756 
    757     my $gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
    758     my $gdbm_db = &util::filename_cat($gdbm_directory,"live-$collect_tail.gdb"); 
     757    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
     758    my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb"); 
    759759 
    760760    my $cmd = "gdbmdel \"$gdbm_db\" \"$dbkey\""; 
     
    811811    $collect_tail =~ s/^.*[\/\\]//; 
    812812 
    813     my $gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
    814     my $gdbm_db = &util::filename_cat($gdbm_directory,"$collect_tail.gdb"); 
     813    my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 
     814    my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb"); 
    815815 
    816816    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid); 
  • main/trunk/greenstone2/perllib/classify.pm

    r20575 r21564  
    204204    # but do want things like hastxt and archivedir 
    205205    my @items = split /@/, $doc_db_hash->{$key}; 
    206     # metadata is all from gdbm so should already be in utf8 
     206    # metadata is all from the info database so should already be in utf8 
    207207    map {$doc_obj->add_utf8_metadata ($cursection, $key, $_); } @items; 
    208208 
     
    214214sub db_rec_to_hash { 
    215215     
    216     my ($gdb_str_ref) = @_; 
     216    my ($infodb_str_ref) = @_; 
    217217 
    218218    my $hashref = {}; 
    219219 
    220     my @entries = split(/\n/, $gdb_str_ref); 
     220    my @entries = split(/\n/, $infodb_str_ref); 
    221221    foreach my $entry (@entries) { 
    222222    my($key, $value) = ($entry =~ /^<([^>]*)>(.*?)$/ ); 
  • main/trunk/greenstone2/perllib/inexport.pm

    r21563 r21564  
    304304    # record files marked for deletion in arcinfo 
    305305    foreach my $file (@$deleted_files) { 
    306     # use 'archiveinf-src' GDBM file to look up all the OIDs 
     306    # use 'archiveinf-src' info database file to look up all the OIDs 
    307307    # that this file is used in (note in most cases, it's just one OID) 
    308308     
  • main/trunk/greenstone2/perllib/plugin.pm

    r21554 r21564  
    228228 
    229229    foreach my $file (@$deleted_files) { 
    230     # use 'archiveinf-src' GDBM file to look up all the OIDs 
     230    # use 'archiveinf-src' info database to look up all the OIDs 
    231231    # that this file is used in (note in most cases, it's just one OID) 
    232232     
  • main/trunk/greenstone2/perllib/plugins/ArchivesInfPlugin.pm

    r21563 r21564  
    2424########################################################################### 
    2525 
    26 # plugin which reads through an archives.inf (or GDBM equivalent, 
    27 # archiveinf-doc.gdb file (i.e. the file generated in the 
     26# plugin which reads through an archives.inf (or info database equivalent, 
     27# archiveinf-doc.gdb file -- i.e. the file generated in the 
    2828# archives directory when an import is done), processing each file it 
    2929# finds 
  • main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm

    r21563 r21564  
    409409    ############################## 
    410410    $self->saveas($doc_obj,$doc_dir); 
    411     $self->archiveinf_gdbm($doc_obj,$doc_dir);  
     411    $self->archiveinf_db($doc_obj,$doc_dir);  
    412412 
    413413} 
     
    699699} 
    700700 
    701 sub archiveinf_gdbm 
     701sub archiveinf_db 
    702702{ 
    703703    my $self = shift (@_); 
     
    740740    $self->archiveinf_files_to_field($doc_obj->get_meta_files(),"meta-file", 
    741741                     $collect_dir,$oid_files); 
    742  
    743  
    744     # better not to commit to a particular db implementation, but 
    745     # for simplicity, will use GDBM for now. 
    746742 
    747743    my $output_dir = $self->{'output_dir'};