Changeset 21564
- Timestamp:
- 2010-01-21T15:59:35+13:00 (14 years ago)
- Location:
- main/trunk/greenstone2
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/export.pl
r21292 r21564 712 712 } 713 713 else { 714 $export_info->save_revinfo_ gdbm($expinfo_src_filename);714 $export_info->save_revinfo_db($expinfo_src_filename); 715 715 } 716 716 -
main/trunk/greenstone2/bin/script/import.pl
r21309 r21564 692 692 } 693 693 else { 694 $archive_info->save_revinfo_ gdbm($arcinfo_src_filename);694 $archive_info->save_revinfo_db($arcinfo_src_filename); 695 695 } 696 696 -
main/trunk/greenstone2/collect/demo/etc/collect.cfg
r20680 r21564 4 4 5 5 buildtype mgpp 6 7 infodbtype gdbm 6 8 7 9 indexes text dls.Title,ex.Title dls.Subject dls.Organization dls.Keyword … … 22 24 23 25 classify List -metadata dls.Keyword -partition_type_within_level constant_size -buttonname Howto 26 27 dynamic_classifier Titles1 "dls.Title" 24 28 25 29 format CL4VList "<td>[link][icon][/link]</td><td>[link][dls.Keyword][/link]" -
main/trunk/greenstone2/perllib/ClassifyTreeModel.pm
r21563 r21564 8 8 # * 9 9 # * @param $class The name of the class to bless as a string 10 # * @param $collection The name of the collection whose GDBMdatabase we10 # * @param $collection The name of the collection whose info database we 11 11 # * will be accessing as a string 12 12 # * @param $root The oid of the root node of the classifier as a … … 125 125 if (&dbutil::read_infodb_entry("gdbm", $infodb_file_path, $clid) =~ /\w+/) 126 126 { 127 # Since the CLID can directly reference the correct entry in the GDBMwe127 # Since the CLID can directly reference the correct entry in the info database we 128 128 # just create the node and return it 129 129 $result = new ClassifyTreeNode($self, $clid); -
main/trunk/greenstone2/perllib/IncrementalBuildUtils.pm
r21562 r21564 31 31 # * by John Rowe 32 32 # * @version 2.0 Package version including seperation from calling code and 33 # * modularisation by creating gdbmget, gdbmset and 34 # * get_database_path by John Rowe 33 # * modularisation by John Rowe 35 34 # * 36 35 # * @author John Thompson, DL Consulting Ltd. … … 153 152 # * 1. The Lucene index must be updated. This will involve removing any 154 153 # * existing value and, if required, adding a new value in its place. 155 # * 2. The GDBMdatabase must be updated. Again any existing value will be154 # * 2. The info database must be updated. Again any existing value will be 156 155 # * removed and, if required, a new value added. 157 156 # * 3. Finally a check against the collect.cfg will be done to determine if … … 165 164 # * A. Establish connection to Lucene 166 165 # * B. Create a IncrementalDocument object for 'NT1' loading the information 167 # * from the GDBM166 # * from the info database 168 167 # * C. Check to see if this metadata is used to build a classifier(s) and if 169 168 # * so create the appropriate ClassifyTreeModel(s) … … 177 176 # * iii/ Call addDocument() in ClassifyTreeModel(s) as necessary 178 177 # * F. Complete Lucene transaction 179 # * G. Save IncrementalDocument to GDBM180 # * Note: ClassifyTreeModel automatically updates GDBMas necessary.178 # * G. Save IncrementalDocument to info database 179 # * Note: ClassifyTreeModel automatically updates the info database as necessary. 181 180 # * 182 181 # * @param $collection The name of the collection to update as a string … … 202 201 # Lucene daemon. 203 202 # B. Create a IncrementalDocument object for 'NT1' loading the information 204 # from the GDBM203 # from the info database 205 204 print STDERR "* creating incremental document for $oid\n" unless !$debug; 206 205 my $doc_obj = new IncrementalDocument($collection, $oid); … … 232 231 if (defined($old_value) && $old_value =~ /[\w\d]+/) 233 232 { 234 print STDERR "* removing '$key'='$old_value' from GDBMdatabase for document $oid\n" unless !$debug;233 print STDERR "* removing '$key'='$old_value' from info database for document $oid\n" unless !$debug; 235 234 # i/ Call ??? to remove key-value from Lucene index 236 235 # Moved elsewhere … … 247 246 if (defined($new_value) && $new_value =~ /[\w\d]+/) 248 247 { 249 print STDERR "* adding '$key'='$new_value' to GDBMdatabase for document $oid\n" unless !$debug;248 print STDERR "* adding '$key'='$new_value' to info database for document $oid\n" unless !$debug; 250 249 # i/ Call ??? to add key-value from Lucene index 251 250 # Moved elsewhere … … 265 264 &callGS2LuceneEditor($collection, $doc_obj->getDocNum, $key, $old_value, $new_value); 266 265 } 267 # G. Save IncrementalDocument to GDBM266 # G. Save IncrementalDocument to info database 268 267 $doc_obj->saveDocument(); 269 268 $doc_obj = 0; … … 371 370 # /** callGS2LuceneEditor() **/ 372 371 373 ## Remove a document from the GDBMand Index.372 ## Remove a document from the info database and Index. 374 373 # 375 374 # @param collection The collection to alter … … 388 387 if ($doc_num > -1) 389 388 { 390 # Now use the GDBM utils to write a blank string to this oid in the 391 # database 389 # Now write a blank string to this oid in the info database 392 390 my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection, "index", "text"); 393 391 my $infodb_file_path = &dbutil::get_infodb_file_path("gdbm", $collection, $index_text_directory_path); -
main/trunk/greenstone2/perllib/IncrementalDocument.pm
r21563 r21564 2 2 # 3 3 # IncrementalDocument.pm -- An object to encapsulate the Greenstone 4 # document retrieved from the GDBMdatabase.4 # document retrieved from the info database. 5 5 # 6 6 # A component of the Greenstone digital library software … … 48 48 $self->{'collection'} = $collection; 49 49 50 # An associative array of information retrieved from the GDBMdatabase50 # An associative array of information retrieved from the info database 51 51 # which maps a key string to a nested associative array listing values. 52 52 $self->{'data'} = {}; … … 147 147 my ($self) = @_; 148 148 #rint STDERR "IncrementalDocument::loadDocument()\n"; 149 # Load the raw text for the document object from GDBM149 # Load the raw text for the document object from the info database 150 150 my $collection = $self->{'collection'}; 151 151 my $index_text_directory_path = &util::filename_cat($ENV{'GSDLHOME'}, "collect", $collection, "index", "text"); … … 185 185 my $text = $self->toString(); 186 186 187 # Now store the object in the database using the GDBM utilities187 # Now store the object in the info database 188 188 my $collection = $self->{'collection'}; 189 189 -
main/trunk/greenstone2/perllib/arcinfo.pm
r21543 r21564 86 86 } 87 87 88 sub _load_info_ gdbm88 sub _load_info_db 89 89 { 90 90 my $self = shift (@_); … … 118 118 } 119 119 else { 120 $self->_load_info_ gdbm($filename);121 } 122 } 123 } 124 125 sub _load_filelist_ gdbm120 $self->_load_info_db($filename); 121 } 122 } 123 } 124 125 sub _load_filelist_db 126 126 { 127 127 my $self = shift (@_); … … 151 151 } 152 152 else { 153 $self->_load_filelist_ gdbm($filename);153 $self->_load_filelist_db($filename); 154 154 } 155 155 } … … 192 192 } 193 193 194 sub _save_info_ gdbm{194 sub _save_info_db { 195 195 my $self = shift (@_); 196 196 my ($filename) = @_; … … 232 232 } 233 233 234 sub save_revinfo_ gdbm{234 sub save_revinfo_db { 235 235 my $self = shift (@_); 236 236 my ($rev_filename) = @_; … … 258 258 } 259 259 else { 260 $self->_save_info_ gdbm($filename);260 $self->_save_info_db($filename); 261 261 } 262 262 } -
main/trunk/greenstone2/perllib/cgiactions/baseaction.pm
r20820 r21564 205 205 my $users_db_file_path = &util::filename_cat($etc_directory, "users.db"); 206 206 207 # Use db2txt instead of GDBM_Fileto get the user accounts information207 # Use db2txt to get the user accounts information 208 208 my $users_db_content = ""; 209 209 open(USERS_DB, "db2txt \"$users_db_file_path\" |"); -
main/trunk/greenstone2/perllib/cgiactions/metadataaction.pm
r21563 r21564 119 119 $collect_tail =~ s/^.*[\/|\\]//; 120 120 121 my $ gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text");122 my $gdbm_db = &util::filename_cat($ gdbm_directory,"live-$collect_tail.gdb");121 my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 122 my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb"); 123 123 124 124 my $cmd = "gdbmget $gdbm_db $dbkey"; … … 179 179 $collect_tail =~ s/^.*[\/\\]//; 180 180 181 my $ gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text");182 my $gdbm_db = &util::filename_cat($ gdbm_directory,"$collect_tail.gdb");181 my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 182 my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb"); 183 183 184 184 my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid); … … 239 239 $collect_tail =~ s/^.*[\/\\]//; 240 240 241 my $ gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text");242 my $gdbm_db = &util::filename_cat($ gdbm_directory,"live-$collect_tail.gdb");241 my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 242 my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb"); 243 243 244 244 my $cmd = "gdbmset \"$gdbm_db\" \"$dbkey\" \"$metavalue\""; … … 296 296 $collect_tail =~ s/^.*[\/\\]//; 297 297 298 my $ gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text");299 my $gdbm_db = &util::filename_cat($ gdbm_directory,"$collect_tail.gdb");298 my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 299 my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb"); 300 300 301 301 my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid); … … 755 755 $collect_tail =~ s/^.*[\/\\]//; 756 756 757 my $ gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text");758 my $gdbm_db = &util::filename_cat($ gdbm_directory,"live-$collect_tail.gdb");757 my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 758 my $gdbm_db = &util::filename_cat($index_text_directory,"live-$collect_tail.gdb"); 759 759 760 760 my $cmd = "gdbmdel \"$gdbm_db\" \"$dbkey\""; … … 811 811 $collect_tail =~ s/^.*[\/\\]//; 812 812 813 my $ gdbm_directory = &util::filename_cat($collect_dir,$collect,"index","text");814 my $gdbm_db = &util::filename_cat($ gdbm_directory,"$collect_tail.gdb");813 my $index_text_directory = &util::filename_cat($collect_dir,$collect,"index","text"); 814 my $gdbm_db = &util::filename_cat($index_text_directory,"$collect_tail.gdb"); 815 815 816 816 my $doc_rec_string = &dbutil::read_infodb_entry("gdbm", $gdbm_db, $docid); -
main/trunk/greenstone2/perllib/classify.pm
r20575 r21564 204 204 # but do want things like hastxt and archivedir 205 205 my @items = split /@/, $doc_db_hash->{$key}; 206 # metadata is all from gdbmso should already be in utf8206 # metadata is all from the info database so should already be in utf8 207 207 map {$doc_obj->add_utf8_metadata ($cursection, $key, $_); } @items; 208 208 … … 214 214 sub db_rec_to_hash { 215 215 216 my ($ gdb_str_ref) = @_;216 my ($infodb_str_ref) = @_; 217 217 218 218 my $hashref = {}; 219 219 220 my @entries = split(/\n/, $ gdb_str_ref);220 my @entries = split(/\n/, $infodb_str_ref); 221 221 foreach my $entry (@entries) { 222 222 my($key, $value) = ($entry =~ /^<([^>]*)>(.*?)$/ ); -
main/trunk/greenstone2/perllib/inexport.pm
r21563 r21564 304 304 # record files marked for deletion in arcinfo 305 305 foreach my $file (@$deleted_files) { 306 # use 'archiveinf-src' GDBMfile to look up all the OIDs306 # use 'archiveinf-src' info database file to look up all the OIDs 307 307 # that this file is used in (note in most cases, it's just one OID) 308 308 -
main/trunk/greenstone2/perllib/plugin.pm
r21554 r21564 228 228 229 229 foreach my $file (@$deleted_files) { 230 # use 'archiveinf-src' GDBM file to look up all the OIDs230 # use 'archiveinf-src' info database to look up all the OIDs 231 231 # that this file is used in (note in most cases, it's just one OID) 232 232 -
main/trunk/greenstone2/perllib/plugins/ArchivesInfPlugin.pm
r21563 r21564 24 24 ########################################################################### 25 25 26 # plugin which reads through an archives.inf (or GDBMequivalent,27 # archiveinf-doc.gdb file (i.e. the file generated in the26 # plugin which reads through an archives.inf (or info database equivalent, 27 # archiveinf-doc.gdb file -- i.e. the file generated in the 28 28 # archives directory when an import is done), processing each file it 29 29 # finds -
main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm
r21563 r21564 409 409 ############################## 410 410 $self->saveas($doc_obj,$doc_dir); 411 $self->archiveinf_ gdbm($doc_obj,$doc_dir);411 $self->archiveinf_db($doc_obj,$doc_dir); 412 412 413 413 } … … 699 699 } 700 700 701 sub archiveinf_ gdbm701 sub archiveinf_db 702 702 { 703 703 my $self = shift (@_); … … 740 740 $self->archiveinf_files_to_field($doc_obj->get_meta_files(),"meta-file", 741 741 $collect_dir,$oid_files); 742 743 744 # better not to commit to a particular db implementation, but745 # for simplicity, will use GDBM for now.746 742 747 743 my $output_dir = $self->{'output_dir'};
Note:
See TracChangeset
for help on using the changeset viewer.