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/gssql.pm

    r32531 r32536  
    3131no strict 'subs';
    3232
    33 use GreenstoneXMLPlugout;
    34 use docprint;
    35 
    36 use DBI; # the central package for this plugout
     33use DBI; # the central package for this module used by GreenstoneSQL Plugout and Plugin
    3734
    3835# Need params_map keys:
     
    151148}
    152149
     150# will attempt to load the specified db and the <coll>_metadata and <coll>_fulltxt for this
     151# collection, or create any of these (db, tables) that don't yet exist. At the end
     152# it will have loaded the requested database (in MySQL: "use <db>;")
    153153sub load_db_and_tables {
    154154    my $self= shift (@_);
     
    205205}
    206206
    207 # this will terminate if the db does not exist
    208 # it will not attempt to create the requested db (nor its tables)
    209 # The upcoming GreenstoneSQLPlugin can use this.
     207# GreenstoneSQLPlugin calls this method to load an existing db.
     208# This will terminate if the db does not exist. Unlike load_db_and_tables() above, used by
     209# GreenstoneSQLPlugout, this method will not attempt to create the requested db (nor its tables)
    210210sub use_db {
    211211    my $self= shift (@_);
     
    370370}
    371371
     372# returns database handle, dbh
     373sub get_db_handle {
     374    my $self= shift (@_);
     375    return $self->{'db_handle'};
     376}
     377
    372378
    373379# I can get my version of table_exists to work, but it's not so ideal
Note: See TracChangeset for help on using the changeset viewer.