Changeset 32540 for main


Ignore:
Timestamp:
2018-10-25T19:35:32+13:00 (5 years ago)
Author:
ak19
Message:

Modified BasePlugout so that plugouts now take the site_name parameter, needed by GreenstoneSQLPlugout. Similar changes were made in the previous commit for plugins, where GreenstoneSQLPlugin needed to have access to site_name. In both cases, for GS2, the site_name (and hence SQL database name) is greenstone2.

Location:
main/trunk/greenstone2/perllib
Files:
3 edited

Legend:

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

    r32539 r32540  
    680680    push @$plugout,("-gzip_output")                if ($gzip);
    681681    push @$plugout,("-output_handle",$out)         if (defined $out);
     682    push @$plugout,("-site_name",$self->{'site'})  if (defined $self->{'site'});
    682683
    683684    push @$plugout,("-xslt_file",$xsltfile)        if (defined $xsltfile && $xsltfile ne "");
  • main/trunk/greenstone2/perllib/plugouts/BasePlugout.pm

    r32519 r32540  
    4444$SIG{__WARN__} = sub {warn($_[0]) unless ($_[0] =~ /Subroutine\s+\S+\sredefined/)};
    4545
    46 my $arguments = [
     46my $arguments = [
     47        { 'name' => "site_name",
     48      'desc' => "{BasPlugout.site_name}",
     49      'type' => "string",
     50      'reqd' => "no",
     51      'hiddengli' => "yes" },
    4752       { 'name' => "xslt_file",
    4853    'desc' => "{BasPlugout.xslt_file}",
     
    135140    # the args, just return the object.
    136141    #print STDERR "#### " . join(",", @${args}) . "\n\n";
     142    my $v=0;
    137143    foreach my $strArg (@{$args})
    138144    {
    139     if(defined $strArg && $strArg eq "-gsdlinfo")
    140     {
    141         $self->{"info_only"} = 1;
    142         return bless $self, $class;
     145    if(defined $strArg) {
     146        if($strArg eq "-gsdlinfo")
     147        {
     148        $self->{"info_only"} = 1;
     149        return bless $self, $class;
     150        }       
     151        elsif ($strArg eq "-site_name") {
     152        $v = $strArg;
     153        }
     154        elsif($v eq "-site_name") {
     155        $self->{'site_name'} = $strArg;
     156        }
    143157    }
    144158    }
  • main/trunk/greenstone2/perllib/strings.properties

    r32537 r32540  
    12361236PrintInfo.desc:Most base plugin, handles printing info (using pluginfo.pl) and parsing of the arguments.
    12371237
     1238PrintInfo.site_name:The name of the Greenstone 3 site. The default site for a GS3 installation is localsite.
     1239
    12381240ProCitePlugin.desc:A plugin for (exported) ProCite databases
    12391241
     
    14181420BasPlugout.no_auxiliary_databases:Don't generate archivesinf databases - useful when exporting.
    14191421# '
     1422BasPlugout.site_name:The name of the Greenstone 3 site. The default site for a GS3 installation is localsite.
    14201423BasPlugout.output_handle: the file descriptor used to receive output data
    14211424BasPlugout.output_info:The reference to an arcinfo object used to store information about the archives.
     
    14451448METSPlugout.xslt_mets:Transform a mets's docmets.xml with the XSLT in the named file. 
    14461449
    1447 GreenstoneSQLPlugout.desc:Output metadata and/or full text to a MySQL database instead of doc.xml.
     1450GreenstoneSQLPlugout.desc:Output metadata and/or full text to a MySQL database (named after GS3 site name for GS3 or named greenstone2 for GS2) instead of doc.xml. For Greenstone 3, the database name is the GS3 site name. For Greenstone 2, the database name is greenstone2.
    14481451
    14491452#
     
    14541457GreenstoneSQLPlug.process_mode.meta_only:Import stage outputs the metadata to a MySQL database and any text to doc.xml.
    14551458GreenstoneSQLPlug.process_mode.text_only:Import stage outputs the full text to a MySQL database and any metadata to doc.xml.
    1456 
     1459GreenstoneSQLPlug.db_driver:The database driver. Support has been implemented for MySQL so far, so the default is mysql.
     1460GreenstoneSQLPlug.db_client_user:The username with which you connect to the (My)SQL database, root by default.
     1461GreenstoneSQLPlug.db_client_pwd:The password with which you connect to the (My)SQL database.
     1462GreenstoneSQLPlug.db_host:The hostname on which the (My)SQL database server is running, 127.0.0.1 by default. Other values to try include localhost.
     1463GreenstoneSQLPlug.db_encoding:The encoding of the contents of the database, utf8 by default. For other options, see https://dev.mysql.com/doc/refman/5.7/en/charset-applications.html. Use the same encoding to write contents to the database with GreenstoneSQLPlugout as to read back in with GreenstoneSQLPlugin.
    14571464
    14581465#
Note: See TracChangeset for help on using the changeset viewer.