source: trunk/gsdl/perllib/plugins/ExcelPlug.pm@ 5680

Last change on this file since 5680 was 5680, checked in by mdewsnip, 21 years ago

Moved plugin descriptions into the resource bundle (perllib/strings.rb), for translation by UNESCO.

  • Property svn:keywords set to Author Date Id Revision
File size: 2.2 KB
Line 
1###########################################################################
2#
3# ExcelPlug.pm -- plugin for importing Microsoft Excel files.
4# (currently only versions 95 and 97)
5#
6# A component of the Greenstone digital library software
7# from the New Zealand Digital Library Project at the
8# University of Waikato, New Zealand.
9#
10# Copyright (C) 2002 New Zealand Digital Library Project
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2 of the License, or
15# (at your option) any later version.
16#
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, write to the Free Software
24# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25#
26###########################################################################
27
28package ExcelPlug;
29
30use ConvertToPlug;
31
32sub BEGIN {
33 @ISA = ('ConvertToPlug');
34}
35
36my $options = { 'name' => "ExcelPlug",
37 'desc' => "{ExcelPlug.desc}",
38 'inherits' => "Yes" };
39
40sub new {
41 my $class = shift (@_);
42
43 my $self = new ConvertToPlug ($class, @_);
44
45# I'm not sure what encoding xlhtml produces - I think it puts it
46# into the Content-Type meta tag in the header of the HTML file.
47
48# if ($self->{'input_encoding'} eq "auto") {
49# $self->{'input_encoding'} = "utf8";
50# }
51
52 # 14-05-02 To allow for proper inheritance of arguments - John Thompson
53 my $option_list = $self->{'option_list'};
54 push( @{$option_list}, $options );
55
56 return bless $self, $class;
57}
58
59sub get_default_process_exp {
60 my $self = shift (@_);
61 return q^(?i)\.xls$^;
62}
63
64sub process {
65 my $self = shift (@_);
66
67 my $outhandle = $self->{'outhandle'};
68 print $outhandle "ExcelPlug: passing $_[3] on to $self->{'converted_to'}Plug\n"
69 if $self->{'verbosity'} > 1;
70
71 return ConvertToPlug::process_type($self,"xls",@_);
72}
73
741;
Note: See TracBrowser for help on using the repository browser.