Changeset 21554

Show
Ignore:
Timestamp:
21.01.2010 14:26:37 (9 years ago)
Author:
mdewsnip
Message:

Changed calls to GDBMUtils::gdbmRecordToHash() to dbutil::read_infodb_entry() + dbutil::convert_infodb_string_to_hash(). Part of removing GDBMUtils.pm and making the code less GDBM-specific.

Location:
main/trunk/greenstone2/perllib
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm

    r21551 r21554  
    182182    my $gdbm_db = &util::filename_cat($gdbm_directory,"$collect_tail.gdb"); 
    183183 
    184     my $doc_rec = GDBMUtils::gdbmRecordToHash($gdbm_db,$docid); 
     184    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid); 
     185    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string); 
    185186    foreach my $k (keys %$doc_rec) { 
    186187    my @escaped_v = (); 
     
    298299    my $gdbm_db = &util::filename_cat($gdbm_directory,"$collect_tail.gdb"); 
    299300 
    300     my $doc_rec = GDBMUtils::gdbmRecordToHash($gdbm_db,$docid); 
     301    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid); 
     302    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string); 
    301303    foreach my $k (keys %$doc_rec) { 
    302304    my @escaped_v = (); 
     
    516518    my $arcinfo_doc_filename = &util::filename_cat ($archive_dir, $doc_db); 
    517519 
    518     my $doc_rec = GDBMUtils::gdbmRecordToHash($arcinfo_doc_filename,$docid); 
     520    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $arcinfo_doc_filename, $docid); 
     521    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string); 
    519522 
    520523    my $doc_xml_file = $doc_rec->{'doc-file'}->[0]; 
     
    694697    my $arcinfo_doc_filename = &util::filename_cat ($archive_dir, $doc_db); 
    695698 
    696     my $doc_rec = GDBMUtils::gdbmRecordToHash($arcinfo_doc_filename,$docid); 
     699    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $arcinfo_doc_filename, $docid); 
     700    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string); 
    697701 
    698702    # This now stores the full pathname 
     
    810814    my $gdbm_db = &util::filename_cat($gdbm_directory,"$collect_tail.gdb"); 
    811815 
    812     my $doc_rec = GDBMUtils::gdbmRecordToHash($gdbm_db,$docid); 
     816    my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid); 
     817    my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string); 
    813818    foreach my $k (keys %$doc_rec) { 
    814819    my @escaped_v = (); 
  • main/trunk/greenstone2/perllib/inexport.pm

    r21553 r21554  
    305305    # that this file is used in (note in most cases, it's just one OID) 
    306306     
    307     my $src_rec = GDBMUtils::gdbmRecordToHash($arcinfo_src_filename,$file); 
     307    my $src_rec_string = &dbutil::read_infodb_entry("gdbm", $arcinfo_src_filename, $file); 
     308    my $src_rec = &dbutil::convert_infodb_string_to_hash($src_rec_string); 
    308309    my $oids = $src_rec->{'oid'}; 
    309310    my $file_record_deleted = 0; 
     
    315316 
    316317        # find the source doc (the primary file that becomes this oid) 
    317         my $doc_rec = GDBMUtils::gdbmRecordToHash($arcinfo_doc_filename,$oid); 
     318        my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $arcinfo_doc_filename, $oid); 
     319        my $doc_rec = &dbutil::convert_infodb_string_to_hash($doc_rec_string); 
    318320        my $doc_source_file = $doc_rec->{'src-file'}->[0]; 
    319321        if (!&util::filename_is_absolute($doc_source_file)) { 
  • main/trunk/greenstone2/perllib/plugin.pm

    r21314 r21554  
    231231    # that this file is used in (note in most cases, it's just one OID) 
    232232     
    233     my $src_rec = GDBMUtils::gdbmRecordToHash($arcinfo_src_filename,$file); 
     233    my $src_rec_string = &dbutil::read_infodb_entry("gdbm", $arcinfo_src_filename, $file); 
     234    my $src_rec = &dbutil::convert_infodb_string_to_hash($src_rec_string); 
    234235    my $oids = $src_rec->{'oid'}; 
    235236    my $rv;