- Timestamp:
- 2018-11-09T19:13:32+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/GreenstoneSQLPlugin.pm
r32591 r32592 35 35 use docprint; # for new unescape_text() subroutine 36 36 use GreenstoneXMLPlugin; 37 use gs sql;37 use gsmysql; 38 38 39 39 40 40 # TODO: 41 # - Run TODOs here, in Plugout and in gs sql.pm by Dr Bainbridge.41 # - Run TODOs here, in Plugout and in gsmysql.pm by Dr Bainbridge. 42 42 # - Have not yet tested writing out just meta or just fulltxt to sql db and reading just that 43 43 # back in from the sql db while the remainder is to be read back in from the docsql .xml files. … … 71 71 # Test doc with meta and text like macron in Maori text. 72 72 # + TODO Q: During import, the GS SQL Plugin is called before the GS SQL Plugout with undesirable side 73 # effect that if the db doesn't exist, gs sql::use_db() fails, as it won't create db.73 # effect that if the db doesn't exist, gsmysql::use_db() fails, as it won't create db. 74 74 # This got fixed when GSSQLPlugin stopped connecting on init(). 75 75 # … … 89 89 # Overriding plugins' remove_one() method is all I needed to do for reindex and deletion 90 90 # (incremental and non-incremental) to work. 91 # but doing all this needed an overhaul of gs sql.pm and its use by the GS SQL plugin and plugout.91 # but doing all this needed an overhaul of gsmysql.pm and its use by the GS SQL plugin and plugout. 92 92 # - needed to correct plugin.pm::remove_some() to process all files 93 93 # - and needed to correct GreenstoneSQLPlugin::close_document() to setOID() after all … … 145 145 'desc' => "{GreenstoneSQLPlug.rollbacl_on_cancel}" } ]; 146 146 147 # TODO: If subclassing gs sql for other supporting databases and if they have different required147 # TODO: If subclassing gsmysql for other supporting databases and if they have different required 148 148 # connection parameters, we can check how WordPlugin, upon detecting Word is installed, 149 149 # dynamically loads Word specific configuration options. … … 229 229 # as removeold, which should drop the collection tables, happens during the import phase, 230 230 # calling GreenstoneSQLPlugin::and therefore also requires a db connection. 231 # + TODO: Eventually can try moving get_gssql_instance into gs sql.pm? That way both GS SQL Plugin231 # + TODO: Eventually can try moving get_gssql_instance into gsmysql.pm? That way both GS SQL Plugin 232 232 # and Plugout would be using one connection during import.pl phase when both plugs exist. 233 233 … … 252 252 #################### 253 253 254 # create gs sql object.254 # create gsmysql object. 255 255 # collection name will be used for naming tables (site name will be used for naming database) 256 my $gs_sql = new gs sql({256 my $gs_sql = new gsmysql({ 257 257 'collection_name' => $ENV{'GSDLCOLLECTION'}, 258 258 'verbosity' => $self->{'verbosity'} || 0 … … 286 286 # This is fatal for the plugout, let's terminate here after disconnecting again 287 287 # PrintError would already have displayed the warning message on load fail 288 # And on die() perl will call gs sql destroy which will ensure a disconnect() from db288 # And on die() perl will call gsmysql destroy which will ensure a disconnect() from db 289 289 #$gs_sql->force_disconnect_from_db(); 290 290 die("Could not use db $db_name. Can't proceed.\n"); … … 310 310 311 311 # Important to call finished(): 312 # it will disconnect from db if this is the last gs sql instance,312 # it will disconnect from db if this is the last gsmysql instance, 313 313 # and it will commit to db before disconnecting if rollbback_on_cancel turned on 314 314 $self->{'gs_sql'}->finished();
Note:
See TracChangeset
for help on using the changeset viewer.