Ignore:
Timestamp:
2010-01-21T15:22:28+13:00 (14 years ago)
Author:
mdewsnip
Message:

Changed calls to GDBMUtils::gdbmCachedCollectionSet() to dbutil::write_infodb_entry(). Part of removing GDBMUtils.pm and making the code less GDBM-specific.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/IncrementalDocument.pm

    r21561 r21562  
    187187    # Now store the object in the database using the GDBM utilities
    188188    my $collection = $self->{'collection'};
    189     &GDBMUtils::gdbmCachedCollectionSet($collection, $self->{'oid'}, $text);
     189
     190    my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection, "index", "text");
     191    my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collection, $index_text_directory_path);
     192    my $infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $infodb_file_path, "append");
     193    &dbutil::write_infodb_entry("gdbm", $infodb_file_handle, $self->{'oid'}, &dbutil::convert_infodb_string_to_hash($text));
     194    &dbutil::close_infodb_write_handle("gdbm", $infodb_file_handle);
    190195
    191196    # There is a little bit of extra complexity when saving an incremental
     
    195200    if($doc_num >= 0)
    196201      {
    197     my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection, "index", "text");
    198     my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collection, $index_text_directory_path);
    199202    my $text = &dbutil::read_infodb_entry("gdbm", $infodb_file_path, $doc_num);
    200203
     
    202205        if($text !~ /<section>/)
    203206          {
    204             &GDBMUtils::gdbmCachedCollectionSet($collection, $doc_num, "<section>" . $self->{'oid'});
     207        $infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $infodb_file_path, "append");
     208        &dbutil::write_infodb_entry("gdbm", $infodb_file_handle, $doc_num, &dbutil::convert_infodb_string_to_hash("<section>" . $self->{'oid'}));
     209        &dbutil::close_infodb_write_handle("gdbm", $infodb_file_handle);
    205210          }
    206211      }
Note: See TracChangeset for help on using the changeset viewer.