Ignore:
Timestamp:
2008-06-05T09:29:32+12:00 (16 years ago)
Author:
kjdon
Message:

plugin overhaul: plugins renamed to xxPlugin, and in some cases the names are made more sensible. They now use the new base plugins. Hopefully we have better code reuse. Some of the plugins still need work done as I didn't want to spend another month doing this before committing it. Alos, I haven't really tested anything yet...

File:
1 edited

Legend:

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

    r15865 r15872  
    11###########################################################################
    22#
    3 # ConvertToRogPlug.pm -- plugin that inherits from RogPlug
     3# ConvertToRogPlugin.pm -- plugin that inherits from RogPlugin
    44#
    55# A component of the Greenstone digital library software
     
    2626
    2727
    28 package ConvertToRogPlug;
    29 
    30 use BasPlug;
    31 use RogPlug;
     28package ConvertToRogPlugin;
     29
     30use RogPlugin;
    3231use strict;
    3332no strict 'refs'; # allow filehandles to be variables and viceversa
    3433
    3534sub BEGIN {
    36     @ConvertToRogPlug::ISA = ('RogPlug');
     35    @ConvertToRogPlugin::ISA = ('RogPlugin');
    3736}
    3837
    3938my $arguments = [
    4039         ];
    41 my $options = { 'name'     => "ConvertToRogPlug",
    42         'desc'     => "{ConvertToRogPlug.desc}",
     40my $options = { 'name'     => "ConvertToRogPlugin",
     41        'desc'     => "{ConvertToRogPlugin.desc}",
    4342        'abstract' => "yes",
    4443        'inherits' => "yes" };
     
    4948    push(@$pluginlist, $class);
    5049
    51     if(defined $arguments){ push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});}
    52     if(defined $options) { push(@{$hashArgOptLists->{"OptList"}},$options)};
    53 
    54     my $self = new RogPlug($pluginlist, $inputargs, $hashArgOptLists);
     50    push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
     51    push(@{$hashArgOptLists->{"OptList"}},$options);
     52
     53    my $self = new RogPlugin($pluginlist, $inputargs, $hashArgOptLists);
    5554
    5655    $self->{'convert_to'} = "Rog";
     
    171170
    172171
    173 # Exact copy of read_rog_record from RogPlug
     172# Exact copy of read_rog_record from RogPlugin
    174173# Needed for FILE in right scope
    175174
     
    271270}
    272271
    273 # Override RogPlug function so rog files are stored as sections (not docs)
     272# Override RogPlugin function so rog files are stored as sections (not docs)
    274273
    275274sub process_rog_record
     
    307306
    308307
    309 # Override BasPlug read
     308# Override BasePlugin read
    310309# We don't want to get language encoding stuff until after we've converted
    311310# our file to Rog format
     
    347346    $doc_obj->set_OIDtype ($processor->{'OIDtype'}, $processor->{'OIDmetadata'});
    348347    my ($filemeta) = $file =~ /([^\\\/]+)$/;
    349     $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), "Source", &ghtml::dmsafe($filemeta));
     348    $self->set_Source_metadata($doc_obj, $filemeta);
     349   
    350350    if ($self->{'cover_image'}) {
    351351    $self->associate_cover_image($doc_obj, $filename);
     
    436436    my $ret_val = 1;   
    437437
    438 #   $ret_val = &RogPlug::process($self, $textref, $pluginfo,
     438#   $ret_val = &RogPlugin::process($self, $textref, $pluginfo,
    439439#                $tmp_dirname, $tmp_tailname,
    440440#                $metadata, $doc_obj);
Note: See TracChangeset for help on using the changeset viewer.