Changeset 19052
- Timestamp:
- 2009-04-19T19:26:14+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/CONTENTdmPlugin.pm
r18406 r19052 108 108 109 109 my $parser = new XML::Parser('Style' => 'Stream', 110 'Pkg' => ' CONTENTdmPlugin',110 'Pkg' => 'ReadXMLFile', 111 111 'PluginObj' => $self, 112 'Handlers' => {'Char' => \& Char,113 'XMLDecl' => \& XMLDecl,114 'Entity' => \&Entity,115 'Doctype' => \& Doctype,116 'Default' => \& Default112 'Handlers' => {'Char' => \&ReadXMLFile::Char, 113 'XMLDecl' => \&ReadXMLFile::XMLDecl, 114 'Entity' => \&ReadXMLFile::Entity, 115 'Doctype' => \&ReadXMLFile::Doctype, 116 'Default' => \&ReadXMLFile::Default 117 117 }); 118 118 $self->{'parser'} = $parser; 119 120 119 121 $self->{'rdf_desc'} = undef; 120 122 $self->{'about_key'} = undef; … … 134 136 135 137 $self = bless $self, $class; 138 139 # ***** no longer needed! 140 # # This needs to be done after blss, to $self passed to XML::Parser 141 # # can correctly resolve the right call-back methods during XML parsing 142 143 136 144 $self->load_secondary_plugins($class,$secondary_plugin_options,$hashArgOptLists); 137 145 return $self; … … 232 240 = &File::Basename::fileparse($txt_filename, "\\.[^\\.]+\$"); 233 241 234 my $txt_file = "$tailname .$suffix";242 my $txt_file = "$tailname$suffix"; 235 243 236 244 return $txt_file; … … 384 392 my $transformed_xml = $self->apply_xslt($xslt,$input_filename); 385 393 394 open(TOUT,">/tmp/tout.xml") 395 || die "Unable to open /tmp/tout.xml: $!\n"; 396 print TOUT $transformed_xml; 397 close(TOUT); 398 399 386 400 # feed transformed file (now in memory as string) into XML parser 387 401 $self->{'parser'}->parse($transformed_xml); … … 513 527 my $fakeimg_tmp_filename = &util::filename_cat($tmp_dirname, "empty.jpg"); 514 528 515 print STDERR "***** Setting up fake filename $fakeimg_filename -> $fakeimg_tmp_filename\n"; 529 print STDERR "***** No source image identified with item\n"; 530 531 print STDERR "***** Using default \"no image available\" $fakeimg_filename -> $fakeimg_tmp_filename\n"; 516 532 517 533 &util::soft_link($fakeimg_filename, $fakeimg_tmp_filename); … … 565 581 my ($pluginfo, $base_dir, $file, $block_hash, $metadata, $processor, $maxdocs, $total_count, $gli) = @_; 566 582 583 567 584 $self->{'gli'} = $gli; 568 585 $self->{'file'} = $file; … … 576 593 577 594 $file =~ s/^[\/\\]+//; # $file often begins with / so we'll tidy it up 578 595 579 596 # read() deviates at this point from ConvertBinaryFile 580 597 # Need to work with list of filename returned … … 584 601 585 602 $conv_filename_list = $self->tmp_area_convert_file($output_ext, $filename_full_path); 586 603 587 604 if (scalar(@$conv_filename_list)==0) { 588 605 return -1; … … 610 627 611 628 my $secondary_plugin = $secondary_plugins->{$plugin_name}; 612 629 613 630 # note: metadata is not carried on to the next level 614 631 my ($rv,$doc_obj) … … 616 633 $block_hash, $metadata, $processor, $maxdocs, $total_count, 617 634 $gli); 635 636 print STDERR "**** $conv_filename => returned rv = $rv\n"; 618 637 619 638 if ((defined $rv) && ($rv>=0)) { … … 638 657 # do plugin specific processing of doc_obj 639 658 unless (defined ($self->process(undef, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli))) { 659 print STDERR "***** process returned undef: $base_dir $file\n"; 640 660 print STDERR "<ProcessingError n='$file'>\n" if ($gli); 641 661 return -1; … … 660 680 sub process { 661 681 662 } 682 return 1; 683 } 684 663 685 # do we need this? sec pluginn process would have already been called as part of read_into_doc_obj?? 664 686 sub process_old { … … 781 803 my $self = shift(@_); 782 804 my ($expat) = @_; 783 784 805 } 785 806
Note:
See TracChangeset
for help on using the changeset viewer.