Ignore:
Timestamp:
2018-10-24T20:11:33+13:00 (6 years ago)
Author:
ak19
Message:

First commit to do with reading back in from the SQL DB. This commit introduces the new GreenstoneSQLPlugin for this purpose, which should ideally only be used during buildcol (but its init(), deinit() and read() methods are also called on import.pl). The new plugin works with GreenstoneSQLPlugout which wrote meta and txt to the SQL DB. Lots of TODOs and questions still here, some debug statements too. Also have to run some decisions by Dr Bainbridge. There are many hardcoded values which still have to be parameterised (not always completely sure how) and still have to test the 2 cases of sending just meta and just fulltxt to db. Next commit will tidy some things up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/docprint.pm

    r32532 r32536  
    2727# Greenstone XML format.
    2828# This is used by GreenstoneXMLPlugout and doc.pm
     29# It's also used by GreenstoneSQLPlugout to output a doc_obj's meta and/or
     30# fulltxt to an SQL db, while subroutine  unescape_text() is used by
     31# GreenstoneSQLPlugin for unescaping txt read back in.
    2932
    3033package docprint;
     
    117120}
    118121
     122# used by GreenstoneSQLPlugin when reading back from sqldb
     123sub unescape_text {
     124    my ($text) = @_;
     125    # special characters in the xml encoding
     126    $text =~ s/& &/&&/g;
     127    $text =~ s/&/&/g; # this has to be first...
     128    $text =~ s/&lt;/</g;
     129    $text =~ s/&gt;/>/g;
     130    $text =~ s/&quot;/"/g;
     131
     132    return $text;
     133}
     134
    1191351;
Note: See TracChangeset for help on using the changeset viewer.