Changeset 17738 for gsdl/trunk
- Timestamp:
- 2008-11-06T13:50:44+13:00 (15 years ago)
- Location:
- gsdl/trunk/perllib/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/ArchivesInfPlugin.pm
r16392 r17738 24 24 ########################################################################### 25 25 26 # plugin which re curses through an archives.inf file26 # plugin which reads through an archives.inf file 27 27 # (i.e. the file generated in the archives directory 28 28 # when an import is done), processing each file it finds 29 29 30 # 12-05-02 Added usage datastructure - John Thompson31 32 30 package ArchivesInfPlugin; 33 31 34 32 use util; 35 use AbstractPlugin;33 use PrintInfo; 36 34 use plugin; 37 35 use arcinfo; … … 42 40 43 41 BEGIN { 44 @ArchivesInfPlugin::ISA = (' AbstractPlugin');42 @ArchivesInfPlugin::ISA = ('PrintInfo'); 45 43 } 46 44 … … 66 64 push(@{$hashArgOptLists->{"OptList"}},$options); 67 65 68 my $self = new AbstractPlugin($pluginlist, $inputargs, $hashArgOptLists);66 my $self = new PrintInfo($pluginlist, $inputargs, $hashArgOptLists); 69 67 70 68 return bless $self, $class; 69 } 70 71 # called once, at the start of processing 72 sub init { 73 my $self = shift (@_); 74 my ($verbosity, $outhandle, $failhandle) = @_; 75 76 # verbosity is passed through from the processor 77 $self->{'verbosity'} = $verbosity; 78 79 # as are the outhandle and failhandle 80 $self->{'outhandle'} = $outhandle if defined $outhandle; 81 $self->{'failhandle'} = $failhandle; 82 71 83 } 72 84 … … 94 106 } 95 107 108 # called at the beginning of each plugin pass (import has one, buildin has many) 109 sub begin { 110 my $self = shift (@_); 111 my ($pluginfo, $base_dir, $processor, $maxdocs) = @_; 112 113 } 114 115 # called at the end of each plugin pass 116 sub end { 117 my ($self) = shift (@_); 118 119 } 120 121 # called if we are doing incremental building 122 sub set_incremental { 123 my $self = shift(@_); 124 my ($incremental) = @_; 125 126 $self->{'incremental'} = $incremental; 127 } 128 96 129 # return 1 if this class might recurse using $pluginfo 97 130 sub is_recursive { … … 102 135 103 136 137 sub compile_stats { 138 my $self = shift(@_); 139 my ($stats) = @_; 140 } 141 142 # We don't do metadata_read 143 sub metadata_read { 144 my $self = shift (@_); 145 my ($pluginfo, $base_dir, $file, $block_hash, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli) = @_; 146 147 return undef; 148 } 149 150 # we don't do any file blocking 151 sub file_block_read { 152 153 my $self = shift (@_); 154 my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $gli) = @_; 155 156 return undef; 157 } 104 158 105 159 -
gsdl/trunk/perllib/plugins/DirectoryPlugin.pm
r17543 r17738 30 30 package DirectoryPlugin; 31 31 32 use AbstractPlugin;32 use PrintInfo; 33 33 use plugin; 34 34 use util; … … 43 43 44 44 BEGIN { 45 @DirectoryPlugin::ISA = (' AbstractPlugin');45 @DirectoryPlugin::ISA = ('PrintInfo'); 46 46 } 47 47 … … 77 77 push(@{$hashArgOptLists->{"OptList"}},$options); 78 78 79 my $self = new AbstractPlugin($pluginlist, $inputargs, $hashArgOptLists);79 my $self = new PrintInfo($pluginlist, $inputargs, $hashArgOptLists); 80 80 81 81 if ($self->{'info_only'}) { … … 89 89 } 90 90 91 $self->{'num_processed'} = 0; 92 $self->{'num_not_processed'} = 0; 93 $self->{'num_blocked'} = 0; 94 $self->{'num_archives'} = 0; 95 91 96 $self->{'subdir_extrametakeys'} = {}; 92 97 … … 94 99 } 95 100 101 # called once, at the start of processing 102 sub init { 103 my $self = shift (@_); 104 my ($verbosity, $outhandle, $failhandle) = @_; 105 106 # verbosity is passed through from the processor 107 $self->{'verbosity'} = $verbosity; 108 109 # as are the outhandle and failhandle 110 $self->{'outhandle'} = $outhandle if defined $outhandle; 111 $self->{'failhandle'} = $failhandle; 112 113 } 114 115 # called once, after all passes have finished 116 sub deinit { 117 my ($self) = @_; 118 119 } 120 121 # called at the beginning of each plugin pass (import has one, building has many) 96 122 sub begin { 97 123 my $self = shift (@_); … … 111 137 } 112 138 } 113 114 #$self->SUPER::begin($pluginfo, $base_dir, $processor, $maxdocs); 115 } 116 139 } 140 141 # called at the end of each plugin pass 117 142 sub end { 118 119 } 120 121 sub deinit { 122 123 } 143 my ($self) = shift (@_); 144 145 } 146 147 148 # called if we are doing incremental building 149 sub set_incremental { 150 my $self = shift(@_); 151 my ($incremental) = @_; 152 153 $self->{'incremental'} = $incremental; 154 } 155 124 156 # return 1 if this class might recurse using $pluginfo 125 157 sub is_recursive { … … 284 316 285 317 } 318 319 # We don't do metadata_read 320 sub metadata_read { 321 my $self = shift (@_); 322 my ($pluginfo, $base_dir, $file, $block_hash, $extrametakeys, $extrametadata, $processor, $maxdocs, $gli) = @_; 323 324 return undef; 325 } 326 327 286 328 # return number of files processed, undef if can't process 287 329 # Note that $base_dir might be "" and that $file might … … 551 593 } 552 594 595 sub compile_stats { 596 my $self = shift(@_); 597 my ($stats) = @_; 598 } 599 553 600 1;
Note:
See TracChangeset
for help on using the changeset viewer.