Changeset 22597 for main/trunk/greenstone2/perllib/plugins/RTFPlugin.pm
- Timestamp:
- 2010-08-10T14:31:53+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/RTFPlugin.pm
r20790 r22597 35 35 } 36 36 37 # currently only converts to HTML 38 my $convert_to_list = 39 [ { 'name' => "html", 40 'desc' => "{ConvertBinaryFile.convert_to.html}" } ]; 41 37 42 my $arguments = 38 [ { 'name' => "process_exp", 43 [ { 'name' => "convert_to", 44 'desc' => "{ConvertBinaryFile.convert_to}", 45 'type' => "enum", 46 'reqd' => "yes", 47 'list' => $convert_to_list, 48 'deft' => "html" }, 49 { 'name' => "process_exp", 39 50 'desc' => "{BasePlugin.process_exp}", 40 51 'type' => "regexp", … … 71 82 $self->{'file_type'} = "RTF"; 72 83 84 # set convert_to_plugin and convert_to_ext 85 $self->ConvertBinaryFile::set_standard_convert_settings(); 86 my $secondary_plugin_name = $self->{'convert_to_plugin'}; 73 87 my $secondary_plugin_options = $self->{'secondary_plugin_options'}; 74 if (!defined $secondary_plugin_options->{'TextPlugin'}) { 75 $secondary_plugin_options->{'TextPlugin'} = []; 88 89 if (!defined $secondary_plugin_options->{$secondary_plugin_name}) { 90 $secondary_plugin_options->{$secondary_plugin_name} = []; 76 91 } 77 if (!defined $secondary_plugin_options->{'HTMLPlugin'}) { 78 $secondary_plugin_options->{'HTMLPlugin'} = []; 92 my $specific_options = $secondary_plugin_options->{$secondary_plugin_name}; 93 94 push(@$specific_options, "-file_rename_method", "none"); 95 push(@$specific_options, "-extract_language") if $self->{'extract_language'}; 96 if ($secondary_plugin_name eq "TextPlugin") { 97 push(@$specific_options, "-input_encoding", "utf8"); 79 98 } 80 my $text_options = $secondary_plugin_options->{'TextPlugin'}; 81 my $html_options = $secondary_plugin_options->{'HTMLPlugin'}; 82 83 #$self->{'input_encoding'} = "utf8"; 84 #$self->{'extract_language'} = 1; 85 push(@$text_options, "-input_encoding", "utf8"); 86 push(@$text_options,"-extract_language") if $self->{'extract_language'}; 87 push(@$html_options, "-description_tags") if $self->{'description_tags'}; 88 push(@$html_options,"-extract_language") if $self->{'extract_language'}; 89 90 push(@$html_options, "-file_rename_method", "none"); 91 push(@$text_options, "-file_rename_method", "none"); 92 93 # tell the secondary plugins that they are processing tmp files 94 push(@$html_options, "-processing_tmp_files"); 99 elsif ($secondary_plugin_name eq "HTMLPlugin") { 100 push(@$specific_options, "-description_tags") if $self->{'description_tags'}; 101 push(@$specific_options, "-processing_tmp_files"); 102 } 95 103 96 104 $self = bless $self, $class;
Note:
See TracChangeset
for help on using the changeset viewer.