Changeset 32563 for main/trunk/greenstone2/perllib/plugouts
- Timestamp:
- 2018-11-02T19:07:16+13:00 (5 years ago)
- Location:
- main/trunk/greenstone2/perllib/plugouts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm
r32555 r32563 347 347 } 348 348 349 # GreenstoneSQLPlugout needs to know whether we're doing removeold or not350 sub set_incremental_options {351 my $self= shift (@_);352 my ($removeold, $keepold, $incremental, $incremental_mode) = @_;353 354 $self->{'removeold'} = $removeold;355 $self->{'keepold'} = $keepold;356 $self->{'incremental'} = $incremental;357 $self->{'incremental_mode'} = $incremental_mode;358 }359 349 360 350 # OIDtype may be "hash" or "hash_on_full_filename" or "incremental" or "filename" or "dirname" or "full_filename" or "assigned" -
main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm
r32560 r32563 53 53 # It's fine: the die() stmts all take place before setting up the super class' begin 54 54 55 # TODO Q: about build_mode: how to detect removeold 55 # TODO Q: about build_mode: how to detect removeold. Now handled by 56 # GreenstoneSQLPlugout::remove_all(), which is inherited from a base plugin. 56 57 # TODO: deal with -removeold and everything? Or type out instructions for user 57 58 … … 117 118 return bless $self, $class; 118 119 } 119 print STDERR "***** GreenstoneSQLPlugout process mode = \"", $self->{'process_mode'}, "\"\n";120 #print STDERR "***** GreenstoneSQLPlugout process mode = \"", $self->{'process_mode'}, "\"\n"; 120 121 121 122 return bless $self, $class; … … 163 164 164 165 my $db_name = $self->{'site_name'} || "greenstone2"; # one database per GS3 site, for GS2 the db is called greenstone2 165 my $build_mode = ($self->{'removeold'}) ? "removeold" : "incremental"; 166 print STDERR "@@@@@@@@@@@@ remove_old: $build_mode\n"; 167 168 if(!$gs_sql->load_db_and_tables($db_name, $build_mode)) { 169 166 my $proc_mode = $self->{'process_mode'}; 167 168 169 my $success = $gs_sql->use_db($db_name); 170 171 if($success && $proc_mode ne "text_only") { 172 ##print STDERR "@@@@ Ensuring meta table exists\n"; 173 $success = $gs_sql->ensure_meta_table_exists(); 174 } 175 if($success && $proc_mode ne "meta_only") { 176 ##print STDERR "@@@@ Ensuring fulltxt table exists\n"; 177 $success = $gs_sql->ensure_fulltxt_table_exists(); 178 } 179 #if(!$gs_sql->load_db_and_tables($db_name, $proc_mode)) { 180 if(!$success) { 170 181 # This is fatal for the plugout, let's terminate here after disconnecting again 171 182 # PrintError would already have displayed the warning message on load fail … … 177 188 # prepare the shared/common HANDLES to SQL insert statements that contain placeholders 178 189 # and which we will reuse repeatedly when actually executing the insert statements 179 my $proc_mode = $self->{'process_mode'};190 180 191 if($proc_mode eq "all" || $proc_mode eq "meta_only" ) { 181 192 $self->{'metadata_prepared_insert_statement_handle'} = $gs_sql->prepare_insert_metadata_row_stmthandle(); … … 188 199 $self->{'gs_sql'} = $gs_sql; 189 200 190 print STDERR "#### Meta stmt: " . $self->{'metadata_prepared_insert_statement_handle'}->{'Statement'} . "\n";191 print STDERR "#### Full stmt: " . $self->{'fulltxt_prepared_insert_statement_handle'}->{'Statement'} . "\n";201 ##print STDERR "#### Meta stmt: " . $self->{'metadata_prepared_insert_statement_handle'}->{'Statement'} . "\n"; 202 ##print STDERR "#### Full stmt: " . $self->{'fulltxt_prepared_insert_statement_handle'}->{'Statement'} . "\n"; 192 203 193 204 # if setting up to work with sql db failed, we'd have terminated and wouldn't come up to here:
Note:
See TracChangeset
for help on using the changeset viewer.