Changeset 22709 for main/trunk/greenstone2/perllib/plugins/ExcelPlugin.pm
- Timestamp:
- 2010-08-23T00:27:23+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/ExcelPlugin.pm
r22705 r22709 2 2 # 3 3 # ExcelPlugin.pm -- plugin for importing Microsoft Excel files. 4 # (currently only versions 95 and 97) 4 # (basic version supports versions 95 and 97) 5 # (through OpenOffice extension, supports all contempoary formats) 5 6 # 6 7 # A component of the Greenstone digital library software … … 43 44 'type' => "regexp", 44 45 'reqd' => "no", 45 'deft' => &get_default_process_exp() } 46 'deft' => "&get_default_process_exp(\$self)" # delayed (see below) 47 } 46 48 ]; 47 49 … … 61 63 push(@{$hashArgOptLists->{"OptList"}},$options); 62 64 63 my $self = new AutoloadConverterScripting("OpenOfficeConverter",$pluginlist, $inputargs, $hashArgOptLists); 65 my $self 66 = new AutoloadConverterScripting("OpenOfficeConverter",$pluginlist, 67 $inputargs, $hashArgOptLists); 68 69 # plugin's process_exp can only be correctly determined once autoloading 70 # has taken place 71 my $plug_options = $self->{'option_list'}->[0]; 72 my $plug_args = $plug_options->{'args'}; 73 74 foreach my $a (@$plug_args) { 75 # consider changing this to search for all values that are 76 # tagged as 'deft-delayed' = 1 ?!? 77 78 if ($a->{'name'} eq "process_exp") { 79 my $eval_expr = $a->{'deft'}; 80 $a->{'deft'} = eval "$eval_expr"; 81 82 # Now see if process_exp needs updating 83 my $process_exp = $self->{'process_exp'}; 84 if (!$self->{'info_only'} && ($process_exp eq $eval_expr)) { 85 # process_exp is only defined if not 'info_only' 86 # 87 # if it does exist and it equals the unevaluated $eval_expr 88 # then it was set to the default (rather than overriden by 89 # the collect.cfg file) 90 91 $self->{'process_exp'} = $a->{'deft'}; 92 } 93 } 94 } 64 95 65 96 if ($self->{'info_only'}) { … … 124 155 sub get_default_process_exp { 125 156 my $self = shift (@_); 157 158 if ($self->{'scripting_ext_working'}) { 159 return q^(?i)\.(xls|xlsx|ods)$^; 160 } 161 126 162 return q^(?i)\.xls$^; 127 163 }
Note:
See TracChangeset
for help on using the changeset viewer.