Changeset 20778 for gsdl


Ignore:
Timestamp:
2009-10-05T15:53:42+13:00 (15 years ago)
Author:
kjdon
Message:

plugins now need to add any auxiliary source files as source assoc files, so we know when to reimport for incremental import. Have started this, but not finished and not tested :-)

Location:
gsdl/trunk/perllib/plugins
Files:
4 edited

Legend:

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

    r20605 r20778  
    10501050        $tail_filename = &util::rename_file($tail_filename, $self->{'file_rename_method'});
    10511051        $doc_obj->associate_file($full_filename,$tail_filename,$mimetype);
     1052        $doc_obj->associate_source_file($full_filename);
    10521053        # If the filename is url_encoded, we need to encode the % signs
    10531054        # in the filename, so that it works in a url
     
    11121113
    11131114    if (-e $filename) {
     1115    $doc_obj->associate_source_file($filename);
    11141116        $doc_obj->associate_file($filename, "cover.jpg", "image/jpeg");
    11151117    $doc_obj->add_utf8_metadata($top_section, "hascover",  1);
     
    11181120    $upper_filename =~ s/jpg$/JPG/;
    11191121    if (-e $upper_filename) {
     1122        $doc_obj->associate_source_file($upper_filename);
    11201123        $doc_obj->associate_file($upper_filename, "cover.jpg",
    11211124                     "image/jpeg");
  • gsdl/trunk/perllib/plugins/HTMLPlugin.pm

    r20774 r20778  
    757757    return "_httpextlink_&rl=" . $rl . "&href=" . $href . $hash_part;
    758758    }
     759    # add the original image file as a source file
     760    $doc_obj->associate_source_file($filename);
    759761    if ($self->{'rename_assoc_files'}) {
    760762    if (defined $self->{'aux_files'}->{$href}) {
  • gsdl/trunk/perllib/plugins/ISISPlugin.pm

    r17479 r20778  
    214214    my $outhandle = $self->{'outhandle'};
    215215
     216    # store the auxiliary files so we know which ones were used
     217    # (mst file becomes the source file)
     218    $doc_obj->associate_source_file($self->{'fdt_file_path'});
     219    $doc_obj->associate_source_file($self->{'xrf_file_path'});
     220
    216221    my $section = $doc_obj->get_top_section();
    217222    my $fdt_mapping = $self->{'fdt_mapping'};
  • gsdl/trunk/perllib/plugins/PagedImagePlugin.pm

    r19999 r20778  
    394394    my $self = shift(@_);
    395395    my ($filename_full_path, $filename_no_path, $doc_obj, $section, $rotate) = @_;
     396    # check the filenames
     397    return 0 if ($filename_no_path eq "" || !-f $filename_full_path);
     398 
     399    # remember that this image file was one of our source files
     400    $doc_obj->associate_source_file($filename_full_path);
     401 
    396402    # do rotation
    397403    if  ((defined $rotate) && ($rotate eq "r")) {
    398     # check the filenames
    399     return 0 if ($filename_no_path eq "" || !-f $filename_full_path);
    400 
    401404    # we get a new temporary file which is rotated
    402405    $filename_full_path = $self->rotate_image($filename_full_path);
     
    617620    }
    618621
     622    # remember that this text file was one of our source files
     623    $doc_obj->associate_source_file($filename_full_path);
    619624    # Do encoding stuff
    620625    my ($language, $encoding) = $self->textcat_get_language_encoding ($filename_full_path);
Note: See TracChangeset for help on using the changeset viewer.