- Timestamp:
- 2018-10-26T15:10:47+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugouts/GreenstoneXMLPlugout.pm
r32542 r32543 76 76 } 77 77 78 sub old_unused_saveas {79 my $self = shift (@_);80 my ($doc_obj, $doc_dir) = @_;81 my $outhandler;82 my $output_file;83 if ($self->{'debug'}) {84 $outhandler = STDOUT;85 }86 else {87 88 $self->process_assoc_files($doc_obj, $doc_dir, '');89 $self->process_metafiles_metadata ($doc_obj);90 91 # open up the outhandler92 if ($self->is_group() && !$self->{'new_doc_dir'}) {93 # we already have a handle open ??94 $outhandler = $self->{'group_outhandler'};95 } else {96 $output_file = &FileUtils::filenameConcatenate(97 $self->{'output_dir'}, $doc_dir, $self->get_doc_xml_filename($doc_obj));98 # open the new handle99 $self->open_xslt_pipe($output_file, $self->{'xslt_file'});100 101 if (defined $self->{'xslt_writer'}){102 $outhandler = $self->{'xslt_writer'};103 }104 else{105 $outhandler = $self->get_output_handler($output_file);106 }107 108 if ($self->is_group()) {109 $self->{'group_outhandler'} = $outhandler;110 }111 }112 } # else not debug113 binmode($outhandler,":utf8");114 115 # only output the header if we have started a new doc116 if (!$self->is_group() || $self->{'new_doc_dir'}) {117 $self->output_xml_header($outhandler);118 }119 120 my $section_text = &docprint::get_section_xml($doc_obj);121 print $outhandler $section_text;122 123 # only output the footer if we are not doing group stuff. The group file will be finished in close_group_output124 if (!$self->is_group()) {125 $self->output_xml_footer($outhandler);126 }127 128 # close off the output - in a group process situation, this will be done by close_group_output129 if (!$self->is_group() && !$self->{'debug'}) {130 if (defined $self->{'xslt_writer'}){131 $self->close_xslt_pipe();132 }133 else {134 &FileUtils::closeFileHandle($output_file, \$outhandler) if defined $output_file;135 }136 }137 $self->{'short_doc_file'} = &FileUtils::filenameConcatenate(138 $doc_dir, $self->get_doc_xml_filename($doc_obj));139 140 $self->store_output_info_reference($doc_obj);141 142 }143 144 78 # can be overridden in subclasses, for instance by GreenstoneSQLPlugout, to produce a different filename 145 79 # like docsql.xml
Note:
See TracChangeset
for help on using the changeset viewer.