Ignore:
Timestamp:
2018-10-24T20:11:33+13:00 (6 years ago)
Author:
ak19
Message:

First commit to do with reading back in from the SQL DB. This commit introduces the new GreenstoneSQLPlugin for this purpose, which should ideally only be used during buildcol (but its init(), deinit() and read() methods are also called on import.pl). The new plugin works with GreenstoneSQLPlugout which wrote meta and txt to the SQL DB. Lots of TODOs and questions still here, some debug statements too. Also have to run some decisions by Dr Bainbridge. There are many hardcoded values which still have to be parameterised (not always completely sure how) and still have to test the 2 cases of sending just meta and just fulltxt to db. Next commit will tidy some things up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugouts/GreenstoneXMLPlugout.pm

    r32534 r32536  
    9494        $outhandler = $self->{'group_outhandler'};
    9595    } else {
    96         $output_file = $self->get_output_file($doc_dir); #&FileUtils::filenameConcatenate($self->{'output_dir'}, $doc_dir, "doc.xml");
     96        $output_file = &FileUtils::filenameConcatenate(
     97        $self->{'output_dir'}, $doc_dir, $self->get_doc_xml_filename($doc_obj));
    9798        # open the new handle
    9899        $self->open_xslt_pipe($output_file, $self->{'xslt_file'});
     
    134135    }
    135136    }
    136     $self->{'short_doc_file'} = $self->get_short_doc_file($doc_dir); #&FileUtils::filenameConcatenate($doc_dir, "doc.xml"); 
     137    $self->{'short_doc_file'} = &FileUtils::filenameConcatenate(
     138    $doc_dir, $self->get_doc_xml_filename($doc_obj)); 
    137139   
    138140    $self->store_output_info_reference($doc_obj);
     
    142144# can be overridden in subclasses, for instance by GreenstoneSQLPlugout, to produce a different filename
    143145# like docsql.xml
    144 sub get_short_doc_file {
    145     my $self = shift (@_);
    146     my ($doc_dir) = @_;
    147     return &FileUtils::filenameConcatenate($doc_dir, "doc.xml");
    148 }
    149 
    150 # can be overridden in subclasses, for instance by GreenstoneSQLPlugout, to produce a different filename
    151 # like docsql.xml
    152 sub get_output_file {
    153     my $self = shift (@_);
    154     my ($doc_dir) = @_;
    155     return &FileUtils::filenameConcatenate($self->{'output_dir'}, $doc_dir, "doc.xml");
     146sub get_doc_xml_filename {
     147    my $self = shift (@_);
     148    my ($doc_obj) = @_;
     149    return "doc.xml";
    156150}
    157151
     
    175169        $outhandler = $self->{'group_outhandler'};
    176170    } else {
    177         $output_file = $self->get_output_file($doc_dir); #&FileUtils::filenameConcatenate($self->{'output_dir'}, $doc_dir, "doc.xml");
     171        $output_file = $output_file = &FileUtils::filenameConcatenate(
     172        $self->{'output_dir'}, $doc_dir, $self->get_doc_xml_filename($doc_obj));
    178173        # open the new handle
    179174        $self->open_xslt_pipe($output_file, $self->{'xslt_file'});
     
    235230    }
    236231    }
    237     $self->{'short_doc_file'} = $self->get_short_doc_file($doc_dir); #&FileUtils::filenameConcatenate($doc_dir, "doc.xml"); 
     232    $self->{'short_doc_file'} = &FileUtils::filenameConcatenate(
     233    $doc_dir, $self->get_doc_xml_filename($doc_obj));
    238234   
    239235    $self->store_output_info_reference($doc_obj);   
Note: See TracChangeset for help on using the changeset viewer.