- Timestamp:
- 2010-11-03T10:48:50+13:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/ZIPPlugin.pm
r23261 r23280 85 85 } 86 86 87 sub begin { 88 my $self = shift (@_); 89 my ($pluginfo, $base_dir, $processor, $maxdocs) = @_; 90 91 # Are we actually incremental and doing import? 92 my $proc_package_name = ref $processor; 93 if ($proc_package_name !~ /buildproc$/ && $self->{'incremental'} == 1) { 94 # Get the infodbtype value for this collection from the arcinfo object 95 my $infodbtype = $processor->getoutputinfo()->{'infodbtype'}; 96 $infodbtype = "gdbm" if $infodbtype eq "gdbm-txtgz"; # in archives, cannot use txtgz version 97 my $output_dir = $processor->getoutputdir(); 98 my $archives_inf = &dbutil::get_infodb_file_path($infodbtype, "archiveinf-doc", $output_dir); 99 100 if ( -e $archives_inf ) { 101 $self->{'actually_incremental'} = 1; 102 } 103 } 104 105 106 } 87 107 # this is a recursive plugin 88 108 sub is_recursive { … … 108 128 return undef unless $self->can_process_this_file($filename_full_path); 109 129 110 my $tmpdir = &util::get_tmp_filename (); 130 my $tmpdir = $file; 131 $tmpdir =~ s/\.[^\.]*//; 132 $tmpdir = &util::rename_file($tmpdir, $self->{'file_rename_method'}); 133 $tmpdir = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "tmp", $tmpdir); 111 134 &util::mk_all_dir ($tmpdir); 112 135 … … 136 159 &plugin::file_block_read ($pluginfo, "", $tmpdir, 137 160 $block_hash, $metadata, $gli); 138 my $numdocs = &plugin::read ($pluginfo, "", $tmpdir, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli); 161 162 # if we are incremental, then we need to add all the files in the tmp folder into the new_files list otherwise they won't get processed. 163 if ($self->{'actually_incremental'}) { 164 my @file_list = (); 165 &inexport::add_dir_contents_to_list($tmpdir, \@file_list); 166 foreach my $file (@file_list) { 167 $block_hash->{'new_files'}->{$file} = 1; 168 } 169 } 170 # all files in the tmp folder need to get the gsdlzipfilenmae metadata 171 my $this_metadata = {}; 172 $this_metadata->{"gsdlzipfilename"} = $filename_full_path; 173 &metadatautil::combine_metadata_structures($this_metadata, $metadata); 174 my $numdocs = &plugin::read ($pluginfo, "", $tmpdir, $block_hash, $this_metadata, $processor, $maxdocs, $total_count, $gli); 139 175 &util::rm_r ($tmpdir); 140 176 … … 191 227 } 192 228 229 230 193 231 1;
Note:
See TracChangeset
for help on using the changeset viewer.