- Timestamp:
- 2018-11-09T19:01:04+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugouts/GreenstoneSQLPlugout.pm
r32589 r32591 41 41 # + TODO: SIGTERM rollback and disconnect? 42 42 # + TODO Q: what about verbosity for debugging, instead of current situation of printing out upon debug set at the expense of writing to db 43 # XTODO Q: introduced site param to plugins and plugouts. Did I do it right? And should they have hiddengli = "yes". No longer a param44 # Did I do the pass by ref in docprint's escape and unescape textref functions correctly, and how they're called here?43 #+ TODO Q: introduced site param to plugins and plugouts. Did I do it right? And should they have hiddengli = "yes". No longer a param 44 # !!!! Did I do the pass by ref in docprint's escape and unescape textref functions correctly, and how they're called here? 45 45 # Any more optimisation I can do around this? 46 46 … … 88 88 'type' => "enum", 89 89 'list' => $rollback_on_cancel_list, 90 'deft' => "false", # TODO Q: what's the better default? If "true", any memory concerns?90 'deft' => "false", # better default than true 91 91 'reqd' => "no", 92 92 'hiddengli' => "no"}, … … 105 105 'type' => "string", 106 106 'deft' => "", 107 'reqd' => "no"}, # pwd required? NO.107 'reqd' => "no"}, # pwd not required: can create mysql accounts without pwd 108 108 { 'name' => "db_host", 109 109 'desc' => "{GreenstoneSQLPlug.db_host}", 110 110 'type' => "string", 111 'deft' => "127.0.0.1", 111 'deft' => "127.0.0.1", # localhost doesn't work for us, but 127.0.0.1 works. See gsmysql.pm 112 112 'reqd' => "yes"}, 113 113 { 'name' => "db_port", … … 347 347 # TODO: does it need to be stored escaped, as it requires unescaping when read back in 348 348 # from db (unlike for reading back in from doc.xml) 349 my $escaped_meta_value = &docprint::escape_text($data->[1]); 349 350 # Treat db like a text file instead of an html/xml file: don't need to escape text 351 # going into it 352 #my $escaped_meta_value = &docprint::escape_text($data->[1]); 353 my $meta_value = $data->[1]; 350 354 351 355 # Write out the current section's meta to collection db's METADATA table … … 356 360 # OR if debugging, then it will print the SQL insert statement but not execute it 357 361 358 $gs_sql->insert_row_into_metadata_table($doc_oid, $section_name, $meta_name, $ escaped_meta_value, $self->{'debug'});362 $gs_sql->insert_row_into_metadata_table($doc_oid, $section_name, $meta_name, $meta_value, $self->{'debug'}); 359 363 } 360 364 } … … 362 366 363 367 if($proc_mode eq "all" || $proc_mode eq "text_only" ) { 364 365 my $section_textref = &docprint::escape_textref(\$section_ptr->{'text'}); 368 369 # See above, no need to html-escape for db 370 my $section_text = $section_ptr->{'text'}; #&docprint::escape_textref(\$section_ptr->{'text'}); 366 371 367 372 # fulltxt column can be SQL NULL. undef value gets written out as NULL: … … 369 374 # The following will do the SQL insertion 370 375 # or if debug, the following will print the SQL insert stmt without executing it 371 $gs_sql->insert_row_into_fulltxt_table($doc_oid, $section_name, $section_textref, $self->{'debug'});376 $gs_sql->insert_row_into_fulltxt_table($doc_oid, $section_name, \$section_text, $self->{'debug'}); 372 377 373 378 }
Note:
See TracChangeset
for help on using the changeset viewer.