Changeset 11332


Ignore:
Timestamp:
2006-03-13T11:34:14+13:00 (18 years ago)
Author:
mdewsnip
Message:

Added a mechanism for plugins to do tidying up after exploding. ISISPlug uses this to delete the associated .fdt and .xrf files.

Location:
trunk/gsdl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/bin/script/explode_metadata_database.pl

    r11302 r11332  
    260260    # Explode means just that: the original file is deleted
    261261    &util::rm($filename);
     262    $plugobj->clean_up_after_exploding();
    262263}
    263264
  • trunk/gsdl/perllib/plugins/BasPlug.pm

    r11122 r11332  
    15561556}
    15571557
     1558
     1559# Overridden by exploding plugins (eg. ISISPlug)
     1560sub clean_up_after_exploding
     1561{
     1562    my $self = shift(@_);
     1563}
     1564
     1565
    155815661;
  • trunk/gsdl/perllib/plugins/ISISPlug.pm

    r11329 r11332  
    123123    # These files must have a lowercase extension for the IsisGdl program to work
    124124    # Bailing out because of this is kind of crappy but it is only an issue on Unix
    125     my $fdtfilename = $databasename . ".fdt";
    126     if (! -e $fdtfilename) {
    127     die "Error: Could not find ISIS FDT file $fdtfilename.\n";
     125    $self->{'fdt_filename'} = $databasename . ".fdt";
     126    if (!-e $self->{'fdt_filename'}) {
     127    die "Error: Could not find ISIS FDT file " . $self->{'fdt_filename'} . ".\n";
    128128    }
    129     my $xrffilename = $databasename . ".xrf";
    130     if (! -e $xrffilename) {
    131     die "Error: Could not find ISIS XRF file $xrffilename.\n";
     129    $self->{'xrf_filename'} = $databasename . ".xrf";
     130    if (!-e $self->{'xrf_filename'}) {
     131    die "Error: Could not find ISIS XRF file " . $self->{'xrf_filename'} . ".\n";
    132132    }
    133133
     
    143143
    144144    # Parse the associated ISIS database Field Definition Table file (.fdt)
    145     my %fdtmapping = &parse_field_definition_table($fdtfilename, $encoding);
    146     $self->{'fdt_mapping'} = \%fdtmapping;
     145    my %fdt_mapping = &parse_field_definition_table($self->{'fdt_filename'}, $encoding);
     146    $self->{'fdt_mapping'} = \%fdt_mapping;
    147147
    148148    # Remove the line at the start so it is split and processed properly
     
    341341
    342342
     343sub clean_up_after_exploding
     344{
     345    my $self = shift(@_);
     346
     347    # Delete the FDT and XRF files too
     348    &util::rm($self->{'fdt_filename'});
     349    &util::rm($self->{'xrf_filename'});
     350}
     351
     352
    3433531;
Note: See TracChangeset for help on using the changeset viewer.