Ignore:
Timestamp:
2012-07-17T15:17:30+12:00 (12 years ago)
Author:
kjdon
Message:

adding in support for plugins knowing what version of greenstone (2/3) they are running in. gs_version now passed in when loading plugins, and '-gs_version 2/3' will be added to input args. base plugin class PrintInfo defines the gs_version arg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/pluginfo.pl

    r25499 r25957  
    7777    'type' => "string",
    7878    'reqd' => "no" },
     79      { 'name' => "gs_version",
     80    'desc' => "{pluginfo.gs_version}",
     81    'type' => "string",
     82    'reqd' => "no",
     83    'hiddengli' => "yes" },
    7984      { 'name' => "xml",
    8085    'desc' => "{scripts.xml}",
     
    107112    my $site = "";
    108113    my $collection = "";
     114    my $gs_version = "";
    109115    my $xml = 0;
    110116    my $listall = 0;
     
    121127    die "\n";
    122128    }
    123    
    124129    foreach my $strVariable (keys %$hashParsingResult)
    125130    {
     
    188193    if ($site ne "") {
    189194    # assume Greenstone 3
     195    $gs_version = "3" if $gs_version eq "";
    190196    if ($collection ne "") {
    191197        $ENV{'GSDLCOLLECTDIR'} = &util::filename_cat ($ENV{'GSDL3HOME'}, "sites", $site, "collect", $collection);
     
    196202    }
    197203    else {
     204    $gs_version = "2" if $gs_version eq "";
    198205    if ($collection ne "") {
    199206        $ENV{'GSDLCOLLECTDIR'} = &util::filename_cat ($ENV{'GSDLHOME'}, "collect", $collection);
     
    247254    foreach my $plugin (@plugin_list) {
    248255        $plugin =~ s/\.pm$//;
    249         my $plugobj = &plugin::load_plugin_for_info ($plugin);
     256        my $plugobj = &plugin::load_plugin_for_info ($plugin, $gs_version);
    250257        push (@plugobj_list, $plugobj);
    251258    }
     
    267274    }
    268275    else {
    269     &print_single_plugin($plugin, $xml, 1);
     276    &print_single_plugin($plugin, $gs_version, $xml, 1);
    270277    }
    271278}
     
    273280
    274281sub print_single_plugin {
    275     my ($plugin, $xml, $header) = @_;
    276     my $plugobj = &plugin::load_plugin_for_info ($plugin);
     282    my ($plugin, $gs_version, $xml, $header) = @_;
     283    my $plugobj = &plugin::load_plugin_for_info ($plugin, $gs_version);
    277284    if ($xml) {
    278285    &gsprintf::set_print_xml_tags();
Note: See TracChangeset for help on using the changeset viewer.