Ignore:
Timestamp:
2001-10-09T17:21:29+13:00 (23 years ago)
Author:
sjboddie
Message:

The build process now creates a summary of how many files were included,
which were rejected, etc. A link to a page containing this summary is
provided from the final page of the collector (once the collection is built
successfully) and from the default "about this collection" text for
collections built by the collector.

Also did a little bit of tidying in a couple of places

File:
1 edited

Legend:

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

    r2755 r2785  
    142142
    143143    $self->{'textcat'} = new textcat();
     144
     145    $self->{'num_processed'} = 0;
     146    $self->{'num_not_processed'} = 0;
     147    $self->{'num_blocked'} = 0;
     148    $self->{'num_archives'} = 0;
    144149   
    145150    # general options available to all plugins
     
    175180sub init {
    176181    my $self = shift (@_);
    177     my ($verbosity, $outhandle, $faillogname) = @_;
     182    my ($verbosity, $outhandle, $failhandle) = @_;
    178183
    179184    # verbosity is passed through from the processor
    180185    $self->{'verbosity'} = $verbosity;
    181186
    182     # as is the outhandle ...
     187    # as are the outhandle and failhandle
    183188    $self->{'outhandle'} = $outhandle if defined $outhandle;
    184     $self->{'faillogname'} = $faillogname;
     189    $self->{'failhandle'} = $failhandle;
    185190
    186191    # set process_exp and block_exp to defaults unless they were
     
    258263
    259264    my $filename = &util::filename_cat($base_dir, $file);
    260     return 0 if $self->{'block_exp'} ne "" && $filename =~ /$self->{'block_exp'}/;
     265    if ($self->{'block_exp'} ne "" && $filename =~ /$self->{'block_exp'}/) {
     266    $self->{'num_blocked'} ++;
     267    return 0;
     268    }
    261269    if ($filename !~ /$self->{'process_exp'}/ || !-f $filename) {
    262270    return undef;
     
    298306    if (!length ($text)) {
    299307    print $outhandle "$plugin_name: ERROR: $file contains no text\n" if $self->{'verbosity'};
     308
     309    my $failhandle = $self->{'failhandle'};
     310    print $failhandle "$file: " . ref($self) . ": file contains no text\n";
     311    $self->{'num_not_processed'} ++;
     312
    300313    return 0;
    301314    }
     
    316329    # process the document
    317330    $processor->process($doc_obj);
     331
     332    $self->{'num_processed'} ++;
    318333
    319334    return 1; # processed the file
     
    671686}
    672687
     688sub compile_stats {
     689    my $self = shift(@_);
     690    my ($stats) = @_;
     691
     692    $stats->{'num_processed'} += $self->{'num_processed'};
     693    $stats->{'num_not_processed'} += $self->{'num_not_processed'};
     694
     695}
     696
     697
    6736981;
Note: See TracChangeset for help on using the changeset viewer.