Ignore:
Timestamp:
2004-12-01T16:14:11+13:00 (20 years ago)
Author:
kjdon
Message:

added some changes made by Emanuel Dejanu (Simple Words)

Location:
trunk/gsdl/perllib/plugins
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/ArcPlug.pm

    r6408 r8716  
    3939
    4040BEGIN {
    41     @ISA = ('BasPlug');
     41    @ArcPlug::ISA = ('BasPlug');
    4242}
    4343
  • trunk/gsdl/perllib/plugins/BasPlug.pm

    r8678 r8716  
    143143sub get_arguments
    144144{
    145     local $self = shift(@_);
    146     local $optionlistref = $self->{'option_list'};
    147     local @optionlist = @$optionlistref;
    148     local $pluginoptions = pop(@$optionlistref);
    149     local $pluginarguments = $pluginoptions->{'args'};
     145    my $self = shift(@_);
     146    my $optionlistref = $self->{'option_list'};
     147    my @optionlist = @$optionlistref;
     148    my $pluginoptions = pop(@$optionlistref);
     149    my $pluginarguments = $pluginoptions->{'args'};
    150150    return $pluginarguments;
    151151}
     
    154154sub print_xml_usage
    155155{
    156     local $self = shift(@_);
     156    my $self = shift(@_);
    157157
    158158    # XML output is always in UTF-8
     
    166166sub print_xml
    167167{
    168     local $self = shift(@_);
    169 
    170     local $optionlistref = $self->{'option_list'};
    171     local @optionlist = @$optionlistref;
    172     local $pluginoptions = pop(@$optionlistref);
     168    my $self = shift(@_);
     169
     170    my $optionlistref = $self->{'option_list'};
     171    my @optionlist = @$optionlistref;
     172    my $pluginoptions = pop(@$optionlistref);
    173173    return if (!defined($pluginoptions));
    174174
     
    197197sub print_txt_usage
    198198{
    199     local $self = shift(@_);
     199    my $self = shift(@_);
    200200
    201201    # Print the usage message for a plugin (recursively)
    202     local $descoffset = $self->determine_description_offset(0);
     202    my $descoffset = $self->determine_description_offset(0);
    203203    $self->print_plugin_usage($descoffset, 1);
    204204}
     
    207207sub determine_description_offset
    208208{
    209     local $self = shift(@_);
    210     local $maxoffset = shift(@_);
    211 
    212     local $optionlistref = $self->{'option_list'};
    213     local @optionlist = @$optionlistref;
    214     local $pluginoptions = pop(@$optionlistref);
     209    my $self = shift(@_);
     210    my $maxoffset = shift(@_);
     211
     212    my $optionlistref = $self->{'option_list'};
     213    my @optionlist = @$optionlistref;
     214    my $pluginoptions = pop(@$optionlistref);
    215215    return $maxoffset if (!defined($pluginoptions));
    216216
    217217    # Find the length of the longest option string of this plugin
    218     local $pluginargs = $pluginoptions->{'args'};
     218    my $pluginargs = $pluginoptions->{'args'};
    219219    if (defined($pluginargs)) {
    220     local $longest = &PrintUsage::find_longest_option_string($pluginargs);
     220    my $longest = &PrintUsage::find_longest_option_string($pluginargs);
    221221    if ($longest > $maxoffset) {
    222222        $maxoffset = $longest;
     
    233233sub print_plugin_usage
    234234{
    235     local $self = shift(@_);
    236     local $descoffset = shift(@_);
    237     local $isleafclass = shift(@_);
    238 
    239     local $optionlistref = $self->{'option_list'};
    240     local @optionlist = @$optionlistref;
    241     local $pluginoptions = pop(@$optionlistref);
     235    my $self = shift(@_);
     236    my $descoffset = shift(@_);
     237    my $isleafclass = shift(@_);
     238
     239    my $optionlistref = $self->{'option_list'};
     240    my @optionlist = @$optionlistref;
     241    my $pluginoptions = pop(@$optionlistref);
    242242    return if (!defined($pluginoptions));
    243243
    244     local $pluginname = $pluginoptions->{'name'};
    245     local $pluginargs = $pluginoptions->{'args'};
    246     local $plugindesc = $pluginoptions->{'desc'};
     244    my $pluginname = $pluginoptions->{'name'};
     245    my $pluginargs = $pluginoptions->{'args'};
     246    my $plugindesc = $pluginoptions->{'desc'};
    247247
    248248    # Produce the usage information using the data structure above
     
    257257    if (defined($pluginargs)) {
    258258    # Calculate the column offset of the option descriptions
    259     local $optiondescoffset = $descoffset + 2;  # 2 spaces between options & descriptions
     259    my $optiondescoffset = $descoffset + 2;  # 2 spaces between options & descriptions
    260260
    261261    if ($isleafclass) {
     
    486486
    487487    $self->extra_metadata ($doc_obj, $doc_obj->get_top_section(), $metadata);
    488 
     488   
    489489    # do plugin specific processing of doc_obj
    490     return -1  unless defined ($self->process (\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli));
    491    
     490    unless (defined ($self->process (\$text, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli))) {
     491    $text = '';
     492    undef $text;
     493    return -1;
     494    }
     495    $text='';
     496    undef $text;
     497
    492498    # do any automatic metadata extraction
    493499    $self->auto_extract_metadata ($doc_obj);
     
    495501    # add an OID
    496502    # see if there is a plugin-specific set_OID function...
    497     if (defined ($self->can(set_OID))) {
     503    if (defined ($self->can('set_OID'))) {
    498504    # it will need $doc_obj to set the Identifier metadata...
    499505    $self->set_OID($doc_obj);
     
    507513
    508514    $self->{'num_processed'} ++;
    509 
     515    undef $doc_obj;
    510516    return 1; # processed the file
    511517}
  • trunk/gsdl/perllib/plugins/GAPlug.pm

    r7900 r8716  
    2929# to their DTD.
    3030
    31 # 12/05/02 Added usage datastructure - John Thompson
    32 
    3331package GAPlug;
    3432
     
    3634
    3735sub BEGIN {
    38     @ISA = ('XMLPlug');
     36    @GAPlug::ISA = ('XMLPlug');
    3937}
    4038
  • trunk/gsdl/perllib/plugins/HTMLPlug.pm

    r8668 r8716  
    4545
    4646sub BEGIN {
    47     @ISA = ('BasPlug');
     47    @HTMLPlug::ISA = ('BasPlug');
    4848}
    4949
  • trunk/gsdl/perllib/plugins/OAIPlug.pm

    r8684 r8716  
    3333
    3434sub BEGIN {
    35     @ISA = ('BasPlug');
     35    @OAIPlug::ISA = ('BasPlug');
    3636}
    3737
  • trunk/gsdl/perllib/plugins/PDFPlug.pm

    r8278 r8716  
    3131use unicode;
    3232
     33sub BEGIN {
    3334@PDFPlug::ISA = ('ConvertToPlug');
     35}
    3436
    3537my $arguments =
  • trunk/gsdl/perllib/plugins/RecPlug.pm

    r8512 r8716  
    100100
    101101BEGIN {
    102     @ISA = ('BasPlug');
     102    @RecPlug::ISA = ('BasPlug');
    103103    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
    104104}
     
    238238
    239239    # Re-order the files in the list so any directories ending with .all are moved to the end
    240     for ($i = scalar(@dir) - 1; $i >= 0; $i--) {
     240    for (my $i = scalar(@dir) - 1; $i >= 0; $i--) {
    241241    if (-d &util::filename_cat($dirname, $dir[$i]) && $dir[$i] =~ /\.all$/) {
    242242        push(@dir, splice(@dir, $i, 1));
     
    302302
    303303        # Any new files are added to the end of @dir to get processed by the loop
     304        my $j;
    304305        foreach my $subfilenow (@dirnow) {
    305306        for ($j = 0; $j < $num_files; $j++) {
  • trunk/gsdl/perllib/plugins/SplitPlug.pm

    r8121 r8716  
    4141
    4242use BasPlug;
    43 # SplitPlug is a sub-class of BasPlug.
    44 @SplitPlug::ISA = ('BasPlug');
    4543use gsprintf 'gsprintf';
    4644use util;
    4745
     46# SplitPlug is a sub-class of BasPlug.
     47sub BEGIN {
     48@SplitPlug::ISA = ('BasPlug');
     49}
    4850
    4951
  • trunk/gsdl/perllib/plugins/UnknownPlug.pm

    r8519 r8716  
    6161
    6262sub BEGIN {
    63     @ISA = ('BasPlug');
     63    @UnknownPlug::ISA = ('BasPlug');
    6464}
    6565
  • trunk/gsdl/perllib/plugins/XMLPlug.pm

    r8121 r8716  
    3030
    3131sub BEGIN {
    32     @ISA = ('BasPlug');
     32    @XMLPlug::ISA = ('BasPlug');
    3333    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
    3434}
     
    232232sub close_document {
    233233    my $self = shift(@_);
    234 
     234    my $doc_obj = $self->{'doc_obj'};
    235235    # include any metadata passed in from previous plugins
    236236    # note that this metadata is associated with the top level section
    237     $self->extra_metadata ($self->{'doc_obj'},
    238                $self->{'doc_obj'}->get_top_section(),
     237    $self->extra_metadata ($doc_obj,
     238               $doc_obj->get_top_section(),
    239239               $self->{'metadata'});
    240240   
    241241    # do any automatic metadata extraction
    242     $self->auto_extract_metadata ($self->{'doc_obj'});
     242    $self->auto_extract_metadata ($doc_obj);
    243243   
    244244    # add an OID
    245     $self->{'doc_obj'}->set_OID();
     245    $doc_obj->set_OID();
    246246   
    247247    $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Plugin", "$self->{'plugin_type'}");
     
    249249
    250250    # process the document
    251     $self->{'processor'}->process($self->{'doc_obj'});
     251    $self->{'processor'}->process($doc_obj);
    252252   
    253253    $self->{'num_processed'} ++;
Note: See TracChangeset for help on using the changeset viewer.