Ignore:
Timestamp:
2018-10-23T17:27:36+13:00 (5 years ago)
Author:
ak19
Message:

GS SQL Plugout now writes its docobj contents (if any) and structure into docsql.xml instead of doc.xml

Location:
main/trunk/greenstone2/perllib/plugouts
Files:
2 edited

Legend:

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

    r32531 r32533  
    185185}
    186186 
     187# produce files called docsql.xml instead of doc.xml
     188sub get_short_doc_file {
     189    my $self = shift (@_);
     190    my ($doc_dir) = @_;
     191    return &FileUtils::filenameConcatenate($doc_dir, "docsql.xml");
     192}
     193
     194# produce files called docsql.xml instead of doc.xml
     195sub get_output_file {
     196    my $self = shift (@_);
     197    my ($doc_dir) = @_;
     198    return &FileUtils::filenameConcatenate($self->{'output_dir'}, $doc_dir, "docsql.xml");
     199}
    187200   
    188201# TODO: check arc-inf.db for whether each entry is to be deleted/indexed/reindexed/been indexed
     
    290303        }
    291304        else {
    292        
    293         $metadata_table_sth->execute($doc_oid, $section_name, $meta_name, $escaped_meta_value) || warn ("Unable to write metadata row to db:\n\tOID $doc_oid, section $section_name,\n\tmeta name: $meta_name, val: $escaped_meta_value");
     305       
     306        $metadata_table_sth->execute($doc_oid, $section_name, $meta_name, $escaped_meta_value)
     307            || warn ("Unable to write metadata row to db:\n\tOID $doc_oid, section $section_name,\n\tmeta name: $meta_name, val: $escaped_meta_value");
    294308        # Execution failure will print out info anyway: since db connection sets PrintError
    295309        }
     
    311325       
    312326        # Write out the current section's text to collection db's FULLTeXT table
    313         $fulltxt_table_sth->execute($doc_oid, $section_name, $section_text) || warn ("Unable to write fulltxt row to db for row:\n\tOID $doc_oid, section $section_name");
     327        $fulltxt_table_sth->execute($doc_oid, $section_name, $section_text)
     328        || warn ("Unable to write fulltxt row to db for row:\n\tOID $doc_oid, section $section_name");
    314329        # Execution failure will print out info anyway: since db connection sets PrintError
    315330    }
  • main/trunk/greenstone2/perllib/plugouts/GreenstoneXMLPlugout.pm

    r32513 r32533  
    134134    }
    135135    }
    136     $self->{'short_doc_file'} = &FileUtils::filenameConcatenate($doc_dir, "doc.xml"); 
     136    $self->{'short_doc_file'} = $self->get_short_doc_file($doc_dir); #&FileUtils::filenameConcatenate($doc_dir, "doc.xml"); 
    137137   
    138138    $self->store_output_info_reference($doc_obj);
    139139   
     140}
     141
     142# can be overridden in subclasses, for instance by GreenstoneSQLPlugout, to produce a different filename
     143# like docsql.xml
     144sub 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
     152sub get_output_file {
     153    my $self = shift (@_);
     154    my ($doc_dir) = @_;
     155    return &FileUtils::filenameConcatenate($self->{'output_dir'}, $doc_dir, "doc.xml");
    140156}
    141157
     
    159175        $outhandler = $self->{'group_outhandler'};
    160176    } else {
    161         $output_file = &FileUtils::filenameConcatenate($self->{'output_dir'}, $doc_dir, "doc.xml");
     177        $output_file = $self->get_output_file($doc_dir); #&FileUtils::filenameConcatenate($self->{'output_dir'}, $doc_dir, "doc.xml");
    162178        # open the new handle
    163179        $self->open_xslt_pipe($output_file, $self->{'xslt_file'});
Note: See TracChangeset for help on using the changeset viewer.