Changeset 22900
- Timestamp:
- 2010-09-14T14:12:16+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/LOMPlugin.pm
r19493 r22900 26 26 27 27 ### Note this plugin currently can't download source documents from outside if you are behind a firewall. 28 # Unless, you set the http_proxy environment variable to be your proxy server, 29 # and set proxy_user and proxy_password in .wgetrc file in home directory. 30 # (does that work on windows??) 28 31 29 32 package LOMPlugin; … … 155 158 $lom_srcdoc =~ s/^$base_dir($dirsep)//; 156 159 $self->{'extra_blocks'}->{$file}++; 157 158 160 $file_re = $lom_srcdoc; 159 161 } … … 161 163 $file_re = $tail; 162 164 } 163 $file_re =~ s/\./\\\./g; 164 165 $file_re = &util::filename_to_regex($file_re); 165 166 $self->{'lom_srcdoc'} = undef; # reset for next file to be processed 166 167 167 168 push(@$extrametakeys,$file_re); 168 169 $extrametadata->{$file_re} = $self->{'saved_metadata'}; 169 170 if (defined $lom_srcdoc) { 171 # copied from oaiplugin 172 if (!defined $extrametafile->{$file_re}) { 173 $extrametafile->{$file_re} = {}; 174 } 175 #maps the file to full path 176 $extrametafile->{$file_re}->{$file} = $filename_full_path; 177 } 178 170 179 return 1; 171 180 } … … 268 277 my $outhandle = $self->{'outhandle'}; 269 278 270 print STDERR "<Processing n='$file' p='LOMPlugin'>\n" if ($gli);271 272 print $outhandle "LOMPLug: processing $file\n";273 274 279 my $cursection = $doc_obj->get_top_section(); 275 280 $doc_obj->add_utf8_text($cursection, $$textref); … … 583 588 584 589 my $full_file_url = &util::filename_cat($output_dir,$file_url); 585 590 # the path to srcdoc will be used later in extrametadata to associate 591 # the lom metadata with the document. Needs to be relative to current 592 # directory. 593 my $srcdoc_path = &util::filename_cat("_gsdldown.all", $file_url); 586 594 my $check_timestamp = $self->{'check_timestamp'}; 587 595 my $status; … … 610 618 $wget_cmd = "wget -nv -P \"$output_dir\" --timestamping -k -p \"$doc_url\""; 611 619 } 612 #my $wget_cmd = "wget -nv -P$output_dir --timestamping -k -p \"$doc_url\""; 613 ### my $full_dir_url = &File::Basename::dirname($full_file_url); 614 615 ## my $wget_cmd = "wget -O $full_file_url --timestamping -k \"$doc_url\""; 616 #my $wget_cmd = "wget -nv -P$output_dir --timestamping -x -k \"$doc_url\""; 617 print STDERR "**** wget = $wget_cmd\n"; 620 ##print STDERR "**** wget = $wget_cmd\n"; 618 621 619 622 … … 623 626 } 624 627 if ($status==0) { 625 $self->{'lom_srcdoc'} = $ full_file_url;628 $self->{'lom_srcdoc'} = $srcdoc_path; 626 629 } 627 630 else { … … 633 636 # not time-stamping and file already exists 634 637 $status=0; 635 $self->{'lom_srcdoc'} = $ full_file_url;638 $self->{'lom_srcdoc'} = $srcdoc_path; 636 639 } 637 640
Note:
See TracChangeset
for help on using the changeset viewer.