Changeset 26324 for main/trunk/greenstone2/bin/script/g2f-buildcol.pl
- Timestamp:
- 2012-10-16T21:12:31+13:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/bin/script/g2f-buildcol.pl
r26322 r26324 208 208 # => Ingest individually! 209 209 210 # set up fedoragsearch for updating the index upon ingesting documents 211 my $fedoragsearch_webapp = &g2futil::gsearch_webapp_folder(); 212 213 # need the username and password preset in order to run fedoraGSearch's RESTClient script 214 # this assumes that the fedoragsearch authentication details are the same as for fedora 215 if (defined $fedoragsearch_webapp) { 216 $ENV{'fgsUserName'} = $options->{'username'}; 217 $ENV{'fgsPassword'} = $options->{'password'}; 218 } 219 210 220 if (opendir(DIR, $export_dir)) { 211 221 closedir DIR; … … 227 237 228 238 if ($dsinfo_status == 0) { 229 print " $pid being updated.\n"; 239 # first remove the doc from the gsearch index before removing it from the fedora repository 240 print " deleting $pid from GSearch index\n"; 241 &g2futil::run_delete_from_index($fedoragsearch_webapp,$pid,$options) if defined $fedoragsearch_webapp; 242 243 print " $pid being updated.\n"; 230 244 &g2futil::run_purge($pid,$options); 231 245 } … … 242 256 print "Ingesting $docmets_filename\n"; 243 257 244 &g2futil::run_ingest($docmets_filename,$options); 258 my $status = &g2futil::run_ingest($docmets_filename,$options); 259 260 # if the document was ingested into Fedora successfully, index it with GSearch next 261 if($status == 0) { 262 if(defined $hash_id) { 263 my $pid = "$pid_namespace:$gs_col-$hash_id"; 264 # now update the fedoragsearch index with the newly ingested document 265 &g2futil::run_update_index($fedoragsearch_webapp,$pid,$options) if defined $fedoragsearch_webapp; 266 } 267 } 268 245 269 print STDERR "</Build>\n" if $gli; 246 270
Note:
See TracChangeset
for help on using the changeset viewer.