Changeset 31744

Show
Ignore:
Timestamp:
22.06.2017 17:41:38 (3 months ago)
Author:
ak19
Message:

Further changes to new UnknownConverterPlugin? that's still in progress. Now I can at least run pluginfo.pl on the plugin to get a description of it.

Location:
main/trunk/greenstone2/perllib
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/UnknownConverterPlugin.pm.bak

    r31743 r31744  
    3333no strict 'refs'; # allow filehandles to be variables and viceversa 
    3434 
     35use ConvertBinaryFile; 
     36use UnknownPlugin; 
    3537 
    3638# TO DO: 
     
    3840# - Have a TEMPDIR placeholder in the command, which, if present, gets replaced with the usual tempdir location 
    3941# of a collection, and in which case we have to clean up intermediate files generated in there at the end? 
     42# Add a check that the generated file or files generated in the output dir match the convert_to option selected 
     43# before trying to process them 
    4044 
    4145sub BEGIN { 
     
    4953    'desc' => "{ConvertBinaryFile.convert_to.html}" }, 
    5054      { 'name' => "pagedimg_jpg", 
    51     'desc' => "{{ConvertBinaryFile.convert_to.pagedimg_jpg}" }, 
     55    'desc' => "{ConvertBinaryFile.convert_to.pagedimg_jpg}" }, 
    5256      { 'name' => "pagedimg_gif", 
    53     'desc' => "{{ConvertBinaryFile.convert_to.pagedimg_gif}" }, 
     57    'desc' => "{ConvertBinaryFile.convert_to.pagedimg_gif}" }, 
    5458      { 'name' => "pagedimg_png", 
    55     'desc' => "{{ConvertBinaryFile.convert_to.pagedimg_png}" } 
     59    'desc' => "{ConvertBinaryFile.convert_to.pagedimg_png}" } 
    5660      ]; 
    5761 
     
    118122    push(@$specific_options, "-processing_tmp_files"); 
    119123    } 
     124    elsif ($secondary_plugin_name eq "PagedImagePlugin") { 
     125    push(@$specific_options, "-screenviewsize", "1000"); 
     126    push(@$specific_options, "-enable_cache"); 
     127    push(@$specific_options, "-processing_tmp_files"); 
     128    } 
    120129 
    121130    # bless again, copied from PDFPlugin, PowerPointPlugin 
    122131    $self = bless $self, $class; 
    123     $self->load_secondary_plugins($class,$secondary_plugin_options,$hashArgOptLists;) 
     132    $self->load_secondary_plugins($class,$secondary_plugin_options,$hashArgOptLists); 
    124133    return $self; 
    125134} 
     
    175184    # replace occurrences of '*' placeholder in cmd string with input filename 
    176185    my ($tailname, $dir, $suffix) = &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$"); 
    177     $cmd ~= s/\*/$tailname/g; 
     186    $cmd =~ s/\*/$tailname/g; 
    178187    print STDERR "@@@@ $plugin_name: executing conversion cmd $cmd\n"; 
    179188    my $status = system($cmd); 
  • main/trunk/greenstone2/perllib/strings.properties

    r31496 r31744  
    12661266TextPlugin.title_sub:Substitution expression to modify string stored as Title. Used by, for example, PostScriptPlugin to remove "Page 1" etc from text used as the title. 
    12671267 
     1268UnknownConverterPlugin.desc:If you have a custom conversion tool installed that you're able to run from the command line to convert from an unsupported document format to either text or HTML, provide that command to this Plugin and it will run the command for you, capturing the output for indexing by Greenstone, making your document searchable. Use * as placeholder for input file name, but specify suffix of file to be converted (and also of any output file generated, if a file and not dir of files is generated). 
     1269 
     1270UnknownConverterPlugin.exec_cmd:Command line command string to execute that will do the conversion. 
     1271 
     1272UnknownConverterPlugin.output_file_or_dir_name: Full pathname of the output file or of the directory (of output files) that get generated by the conversion 
     1273 
    12681274UnknownPlugin.assoc_field:Name of the metadata field that will hold the associated file's name. 
    12691275