Changeset 22705


Ignore:
Timestamp:
2010-08-21T23:30:28+12:00 (14 years ago)
Author:
davidb
Message:

User of AutoloadConverterScripting expanded to encompass PowerPoint and Excel. No longer need OOConvertBinaryFile and PBConvertBinaryFile

Location:
main/trunk/greenstone2/perllib/plugins
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/AutoloadConverterScripting.pm

    r22702 r22705  
    7373
    7474####
    75 # This plugin takes an extra initial parameter in its constructor (compared with
    76 #   the norm).  The extra parameter specifies which plugin it should try to
    77 #   dynamically load
     75# This plugin takes an extra initial parameter in its constructor (compared
     76#   with the norm).  The extra parameter specifies which plugin it should
     77#   try to dynamically load
    7878#####
    7979
     
    8787    my $autoVar  = $dynamic_self->{'_autoVar'};
    8888
    89 #    print STDERR "**** autoload NEW autoVar = $dynamic_self->{'_autoVar'}\n";
    90 #    print STDERR "**** working ", $dynamic_self->{'scripting_ext_working} , "\n";
     89    if ($dynamic_self->{'scripting_ext_installed'}) {
     90    my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(0);
    9191
    92     if ($dynamic_self->{'scripting_ext_installed'}) {
    93     print STDERR "$class: $autoName Extension to Greenstone detected\n";
     92    print STDERR "$class: $autoName Extension to Greenstone detected for $cpackage\n";
    9493    if ($dynamic_self->{'scripting_ext_working'}) {
    9594        # print STDERR "... and it appears to be working\n";
  • main/trunk/greenstone2/perllib/plugins/BasePlugin.pm

    r22663 r22705  
    655655    my ($filemeta) = @_;
    656656
    657     # analyse filenames without extensions and digits (and trimmed of surrounding
    658     # whitespace), so that irrelevant chars don't confuse textcat
     657    # analyse filenames without extensions and digits (and trimmed of
     658    # surrounding whitespace), so that irrelevant chars don't confuse
     659    # textcat
    659660    my $strictfilemeta = $filemeta;
    660661    $strictfilemeta =~ s/\.[^\.]+$//g;
     
    10311032    my $file_derived_title = $file;
    10321033    $file_derived_title =~ s/_/ /g;
    1033     $file_derived_title =~ s/\..*?$//;
     1034    $file_derived_title =~ s/\.[^.]$//;
    10341035
    10351036    return $file_derived_title;
     
    10421043    my ($doc_obj,$section,$file) = @_;
    10431044
    1044     if (!defined $doc_obj->get_metadata_element ($section, "Title") or $doc_obj->get_metadata_element($section, "Title") eq "") {
     1045    if (!defined $doc_obj->get_metadata_element ($section, "Title")
     1046    or $doc_obj->get_metadata_element($section, "Title") eq "") {
    10451047
    10461048    my $file_derived_title = $self->filename_to_utf8_metadata($self->filename_based_title($file));
  • main/trunk/greenstone2/perllib/plugins/ExcelPlugin.pm

    r22639 r22705  
    2828package ExcelPlugin;
    2929
    30 use OOConvertBinaryFile;
    3130use strict;
    3231no strict 'refs'; # allow filehandles to be variables and viceversa
     
    3433use gsprintf 'gsprintf';
    3534
    36 sub BEGIN {
    37     @ExcelPlugin::ISA = ('OOConvertBinaryFile');
    38 }
     35use AutoloadConverterScripting;
     36
     37@ExcelPlugin::ISA = ('AutoloadConverterScripting');
     38
    3939
    4040my $arguments =
     
    6161    push(@{$hashArgOptLists->{"OptList"}},$options);
    6262
    63     my $self = new OOConvertBinaryFile($pluginlist, $inputargs, $hashArgOptLists);
     63    my $self = new AutoloadConverterScripting("OpenOfficeConverter",$pluginlist, $inputargs, $hashArgOptLists);
    6464   
    6565    if ($self->{'info_only'}) {
  • main/trunk/greenstone2/perllib/plugins/PDFPlugin.pm

    r22702 r22705  
    2525package PDFPlugin;
    2626
     27use strict;
     28no strict 'refs'; # so we can use a var for filehandles (e.g. STDERR)
     29
    2730use ReadTextFile;
    2831use unicode;
    29 use strict;
    30 no strict 'refs'; # so we can use a var for filehandles (e.g. STDERR)
    31 
    32 sub BEGIN {
    33     $::autoloadConverterScripting="PDFBoxConverter";
    34     require AutoloadConverterScripting;
    35 
    36     @PDFPlugin::ISA = ('AutoloadConverterScripting', 'ReadTextFile');
    37 }
     32
     33use AutoloadConverterScripting;
     34
     35@PDFPlugin::ISA = ('AutoloadConverterScripting', 'ReadTextFile');
     36
    3837
    3938my $convert_to_list =
  • main/trunk/greenstone2/perllib/plugins/PowerPointPlugin.pm

    r22640 r22705  
    2828package PowerPointPlugin;
    2929
    30 use OOConvertBinaryFile;
    31 
    3230use strict;
    3331no strict 'refs'; # allow filehandles to be variables and viceversa
    3432no strict 'subs';
     33
    3534use gsprintf 'gsprintf';
    3635
    37 sub BEGIN {
    38     @PowerPointPlugin::ISA = ('OOConvertBinaryFile');
    39 }
     36use AutoloadConverterScripting;
     37
     38@PowerPointPlugin::ISA = ('AutoloadConverterScripting');
     39
    4040
    4141my $windows_convert_to_list =
     
    9595
    9696
    97     my $self = new OOConvertBinaryFile($pluginlist, $inputargs, $hashArgOptLists);
     97    my $self
     98    = new AutoloadConverterScripting("OpenOfficeConverter",
     99                     $pluginlist, $inputargs,
     100                     $hashArgOptLists);
    98101 
    99102    if ($self->{'info_only'}) {
  • main/trunk/greenstone2/perllib/plugins/WordPlugin.pm

    r22702 r22705  
    3131use gsprintf 'gsprintf';
    3232
    33 sub BEGIN {
    34     $::autoloadConverterScripting="OpenOfficeConverter";
    35     require AutoloadConverterScripting;
    36 
    37     @WordPlugin::ISA = ('AutoloadConverterScripting');
    38 }
     33use AutoloadConverterScripting;
     34
     35@WordPlugin::ISA = ('AutoloadConverterScripting');
     36
    3937
    4038my $arguments =
Note: See TracChangeset for help on using the changeset viewer.