Changeset 21562 for main/trunk/greenstone2/perllib/IncrementalDocument.pm
- Timestamp:
- 2010-01-21T15:22:28+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/IncrementalDocument.pm
r21561 r21562 187 187 # Now store the object in the database using the GDBM utilities 188 188 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); 190 195 191 196 # There is a little bit of extra complexity when saving an incremental … … 195 200 if($doc_num >= 0) 196 201 { 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);199 202 my $text = &dbutil::read_infodb_entry("gdbm", $infodb_file_path, $doc_num); 200 203 … … 202 205 if($text !~ /<section>/) 203 206 { 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); 205 210 } 206 211 }
Note:
See TracChangeset
for help on using the changeset viewer.