- Timestamp:
- 2013-04-15T18:49:36+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm
r27176 r27180 167 167 my $gsdlhome = $self->{'gsdlhome'}; 168 168 my $infodbtype = $self->{'infodbtype'}; 169 169 170 170 # live metadata gets/saves value scoped (prefixed) by the current usename 171 171 # so (for now) let's not bother to enforce authentication … … 2817 2817 $doc_rec->{$metaname} = $filtered_metadata; 2818 2818 2819 ## The following code assumes gdbm 2819 2820 # Turn the record back to string 2820 my $serialized_doc_rec = &dbutil::convert_infodb_hash_to_string($doc_rec); 2821 2821 #my $serialized_doc_rec = &dbutil::convert_infodb_hash_to_string($doc_rec); 2822 2822 # Store it back to the database 2823 my $cmd = "gdbmset \"$infodb_file_path\" \"$docid\" \"$serialized_doc_rec\""; 2824 my $status = system($cmd); 2823 #my $cmd = "gdbmset \"$infodb_file_path\" \"$docid\" \"$serialized_doc_rec\""; 2824 #my $status = system($cmd); 2825 2826 ## Use the dbutil set_entry method instead of assuming the database is gdbm 2827 my $status = &dbutil::set_infodb_entry($infodbtype, $infodb_file_path, $docid, $doc_rec); 2828 2825 2829 if ($status != 0) { 2826 2830 my $mess = "Failed to set metadata key: $docid\n"; 2827 2831 2828 2832 $mess .= "PATH: $ENV{'PATH'}\n"; 2829 $mess .= "cmd = $cmd\n";2833 #$mess .= "cmd = $cmd\n"; 2830 2834 $mess .= "Exit status: $status\n"; 2831 2835 $mess .= "System Error Message: $!\n"; … … 3019 3023 } 3020 3024 3025 ## The following code assumes gdbm 3021 3026 # Generate the record string 3022 my $serialized_doc_rec = &dbutil::convert_infodb_hash_to_string($doc_rec); 3023 3027 #my $serialized_doc_rec = &dbutil::convert_infodb_hash_to_string($doc_rec); 3024 3028 # Store it into GDBM 3025 my $cmd = "gdbmset \"$infodb_file_path\" \"$docid\" \"$serialized_doc_rec\""; 3026 my $status = system($cmd); 3029 #my $cmd = "gdbmset \"$infodb_file_path\" \"$docid\" \"$serialized_doc_rec\""; 3030 #my $status = system($cmd); 3031 3032 ## Use the dbutil set_entry method instead of assuming the database is gdbm 3033 my $status = &dbutil::set_infodb_entry($infodbtype, $infodb_file_path, $docid, $doc_rec); 3034 3027 3035 if ($status != 0) { 3028 3036 # Catch error if gdbmget failed … … 3030 3038 3031 3039 $mess .= "PATH: $ENV{'PATH'}\n"; 3032 $mess .= "cmd = $cmd\n";3040 #$mess .= "cmd = $cmd\n"; 3033 3041 $mess .= "Exit status: $status\n"; 3034 3042 $mess .= "System Error Message: $!\n";
Note:
See TracChangeset
for help on using the changeset viewer.