Changeset 21642


Ignore:
Timestamp:
2010-01-26T17:10:39+13:00 (14 years ago)
Author:
mdewsnip
Message:

Changed IncrementalBuildUtils::deleteDocument() to take the infodbtype type as a parameter, instead of assuming GDBM. Part of making the code less GDBM-specific.

Location:
main/trunk/greenstone2
Files:
2 edited

Legend:

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

    r12844 r21642  
    2828my $oid = $ARGV[1];
    2929
    30 &IncrementalBuildUtils::deleteDocument($collection, $oid);
     30&IncrementalBuildUtils::deleteDocument($collection, "gdbm", $oid);
    3131
    3232exit;
  • main/trunk/greenstone2/perllib/IncrementalBuildUtils.pm

    r21564 r21642  
    377377sub deleteDocument()
    378378  {
    379     my ($collection, $oid) = @_;
     379    my ($collection, $infodbtype, $oid) = @_;
    380380    # Load the incremental document to go with this oid, as we need some
    381381    # information from it.
     
    389389        # Now write a blank string to this oid in the info database
    390390    my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection, "index", "text");
    391     my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collection, $index_text_directory_path);
    392     my $infodb_file_handle = &dbutil::open_infodb_write_handle("gdbm", $infodb_file_path, "append");
    393     &dbutil::write_infodb_entry("gdbm", $infodb_file_handle, $oid, &dbutil::convert_infodb_string_to_hash(""));
     391    my $infodb_file_path = &dbutil::get_infodb_file_path($infodbtype, $collection, $index_text_directory_path);
     392    my $infodb_file_handle = &dbutil::open_infodb_write_handle($infodbtype, $infodb_file_path, "append");
     393    &dbutil::write_infodb_entry($infodbtype, $infodb_file_handle, $oid, &dbutil::convert_infodb_string_to_hash(""));
    394394        # Remove reverse lookup
    395     &dbutil::write_infodb_entry("gdbm", $infodb_file_handle, $doc_num, &dbutil::convert_infodb_string_to_hash(""));
    396     &dbutil::close_infodb_write_handle("gdbm", $infodb_file_handle);
     395    &dbutil::write_infodb_entry($infodbtype, $infodb_file_handle, $doc_num, &dbutil::convert_infodb_string_to_hash(""));
     396    &dbutil::close_infodb_write_handle($infodbtype, $infodb_file_handle);
    397397
    398398        # And remove from the database
Note: See TracChangeset for help on using the changeset viewer.