[32518] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
[32527] | 3 | # GreenstoneSQLPlugout.pm -- plugout module for writing all or some the
|
---|
| 4 | # Greenstone document format (metadata and/or fulltext) into a (My)SQL db.
|
---|
[32526] | 5 | # The rest is then still written out by GreenstoneXMLPlugout as usual.
|
---|
[32518] | 6 | # A component of the Greenstone digital library software
|
---|
| 7 | # from the New Zealand Digital Library Project at the
|
---|
| 8 | # University of Waikato, New Zealand.
|
---|
| 9 | #
|
---|
| 10 | # Copyright (C) 2006 New Zealand Digital Library Project
|
---|
| 11 | #
|
---|
| 12 | # This program is free software; you can redistribute it and/or modify
|
---|
| 13 | # it under the terms of the GNU General Public License as published by
|
---|
| 14 | # the Free Software Foundation; either version 2 of the License, or
|
---|
| 15 | # (at your option) any later version.
|
---|
| 16 | #
|
---|
| 17 | # This program is distributed in the hope that it will be useful,
|
---|
| 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 20 | # GNU General Public License for more details.
|
---|
| 21 | #
|
---|
| 22 | # You should have received a copy of the GNU General Public License
|
---|
| 23 | # along with this program; if not, write to the Free Software
|
---|
| 24 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 25 | #
|
---|
| 26 | ###########################################################################
|
---|
| 27 |
|
---|
[32527] | 28 | package GreenstoneSQLPlugout;
|
---|
[32518] | 29 |
|
---|
| 30 | use strict;
|
---|
| 31 | no strict 'refs';
|
---|
| 32 | no strict 'subs';
|
---|
| 33 |
|
---|
[32520] | 34 | use GreenstoneXMLPlugout;
|
---|
[32518] | 35 | use docprint;
|
---|
[32529] | 36 | use gssql;
|
---|
[32518] | 37 |
|
---|
[32524] | 38 | use DBI; # the central package for this plugout
|
---|
| 39 |
|
---|
[32518] | 40 |
|
---|
[32583] | 41 | # + TODO: SIGTERM rollback and disconnect?
|
---|
| 42 | # + TODO Q: what about verbosity for debugging, instead of current situation of printing out upon debug set at the expense of writing to db
|
---|
[32586] | 43 | #X TODO Q: introduced site param to plugins and plugouts. Did I do it right? And should they have hiddengli = "yes". No longer a param
|
---|
[32580] | 44 | # Did I do the pass by ref in docprint's escape and unescape textref functions correctly, and how they're called here?
|
---|
| 45 | # Any more optimisation I can do around this?
|
---|
[32521] | 46 |
|
---|
[32543] | 47 | # this plugout does not output the metadata and/or fulltxt xml to a file,
|
---|
| 48 | # but outputs rows into a mysql table for metadata and/or a table for fulltxt
|
---|
[32518] | 49 | sub BEGIN {
|
---|
[32527] | 50 | @GreenstoneSQLPlugout::ISA = ('GreenstoneXMLPlugout');
|
---|
[32518] | 51 | }
|
---|
| 52 |
|
---|
[32580] | 53 | # + NOTTODO: die() statements need to be replaced with premature_termination
|
---|
[32529] | 54 | # which should ensure the GreenstoneXMLPlugin (group)'s stuff is closed and cleaned up SOMEHOW
|
---|
| 55 | # It's fine: the die() stmts all take place before setting up the super class' begin
|
---|
[32520] | 56 |
|
---|
[32580] | 57 | # + TODO Q: about build_mode: how to detect removeold. Now handled by
|
---|
[32563] | 58 | # GreenstoneSQLPlugout::remove_all(), which is inherited from a base plugin.
|
---|
[32580] | 59 | # + TODO: deal with -removeold and everything? Or type out instructions for user
|
---|
[32520] | 60 |
|
---|
[32580] | 61 | # + TODO Q: what is "group" in GreenstoneXMLPlugout?
|
---|
[32518] | 62 |
|
---|
| 63 | my $process_mode_list =
|
---|
| 64 | [ { 'name' => "meta_only",
|
---|
[32537] | 65 | 'desc' => "{GreenstoneSQLPlug.process_mode.meta_only}" },
|
---|
[32518] | 66 | { 'name' => "text_only",
|
---|
[32537] | 67 | 'desc' => "{GreenstoneSQLPlug.process_mode.text_only}" },
|
---|
[32518] | 68 | { 'name' => "all",
|
---|
[32537] | 69 | 'desc' => "{GreenstoneSQLPlug.process_mode.all}" } ];
|
---|
[32518] | 70 |
|
---|
[32582] | 71 | my $rollback_on_cancel_list =
|
---|
| 72 | [ { 'name' => "true",
|
---|
| 73 | 'desc' => "{GreenstoneSQLPlug.rollback_on_cancel}" },
|
---|
| 74 | { 'name' => "false",
|
---|
| 75 | 'desc' => "{GreenstoneSQLPlug.rollbacl_on_cancel}" } ];
|
---|
| 76 |
|
---|
[32541] | 77 | # The following are the saveas.options:
|
---|
[32518] | 78 | my $arguments = [
|
---|
[32541] | 79 | { 'name' => "process_mode",
|
---|
| 80 | 'desc' => "{GreenstoneSQLPlug.process_mode}",
|
---|
| 81 | 'type' => "enum",
|
---|
| 82 | 'list' => $process_mode_list,
|
---|
| 83 | 'deft' => "all",
|
---|
| 84 | 'reqd' => "no",
|
---|
| 85 | 'hiddengli' => "no"},
|
---|
[32582] | 86 | { 'name' => "rollback_on_cancel",
|
---|
| 87 | 'desc' => "{GreenstoneSQLPlug.rollback_on_cancel}",
|
---|
| 88 | 'type' => "enum",
|
---|
| 89 | 'list' => $rollback_on_cancel_list,
|
---|
[32586] | 90 | 'deft' => "false", # TODO Q: what's the better default? If "true", any memory concerns?
|
---|
[32582] | 91 | 'reqd' => "no",
|
---|
| 92 | 'hiddengli' => "no"},
|
---|
[32541] | 93 | { 'name' => "db_driver",
|
---|
| 94 | 'desc' => "{GreenstoneSQLPlug.db_driver}",
|
---|
| 95 | 'type' => "string",
|
---|
| 96 | 'deft' => "mysql",
|
---|
| 97 | 'reqd' => "yes"},
|
---|
| 98 | { 'name' => "db_client_user",
|
---|
| 99 | 'desc' => "{GreenstoneSQLPlug.db_client_user}",
|
---|
| 100 | 'type' => "string",
|
---|
| 101 | 'deft' => "root",
|
---|
| 102 | 'reqd' => "yes"},
|
---|
| 103 | { 'name' => "db_client_pwd",
|
---|
| 104 | 'desc' => "{GreenstoneSQLPlug.db_client_pwd}",
|
---|
| 105 | 'type' => "string",
|
---|
| 106 | 'deft' => "",
|
---|
| 107 | 'reqd' => "yes"}, # pwd required?
|
---|
| 108 | { 'name' => "db_host",
|
---|
| 109 | 'desc' => "{GreenstoneSQLPlug.db_host}",
|
---|
| 110 | 'type' => "string",
|
---|
| 111 | 'deft' => "127.0.0.1",
|
---|
| 112 | 'reqd' => "yes"}
|
---|
| 113 | ];
|
---|
[32518] | 114 |
|
---|
[32527] | 115 | my $options = { 'name' => "GreenstoneSQLPlugout",
|
---|
| 116 | 'desc' => "{GreenstoneSQLPlugout.desc}",
|
---|
[32518] | 117 | 'abstract' => "no",
|
---|
| 118 | 'inherits' => "yes",
|
---|
| 119 | 'args' => $arguments };
|
---|
| 120 |
|
---|
[32583] | 121 | ##### This entire class is called only during import.pl #####
|
---|
| 122 |
|
---|
| 123 | ##### Overridden methods #####
|
---|
| 124 |
|
---|
[32518] | 125 | sub new {
|
---|
| 126 | my ($class) = shift (@_);
|
---|
| 127 | my ($plugoutlist, $inputargs,$hashArgOptLists) = @_;
|
---|
| 128 | push(@$plugoutlist, $class);
|
---|
| 129 |
|
---|
| 130 | push(@{$hashArgOptLists->{"ArgList"}},@{$arguments});
|
---|
| 131 | push(@{$hashArgOptLists->{"OptList"}},$options);
|
---|
| 132 |
|
---|
| 133 | my $self = new GreenstoneXMLPlugout($plugoutlist,$inputargs,$hashArgOptLists);
|
---|
| 134 |
|
---|
| 135 | if ($self->{'info_only'}) {
|
---|
| 136 | # don't worry about any options etc
|
---|
| 137 | return bless $self, $class;
|
---|
| 138 | }
|
---|
[32563] | 139 | #print STDERR "***** GreenstoneSQLPlugout process mode = \"", $self->{'process_mode'}, "\"\n";
|
---|
[32518] | 140 |
|
---|
| 141 | return bless $self, $class;
|
---|
| 142 | }
|
---|
| 143 |
|
---|
[32520] | 144 | # connect here and ensure all tables and databases exist
|
---|
| 145 | sub begin {
|
---|
| 146 |
|
---|
| 147 | my $self= shift (@_);
|
---|
[32580] | 148 |
|
---|
[32541] | 149 | # The saveas.options
|
---|
| 150 | #print STDERR "@@@@ PLUGOUT db_pwd: " . $self->{'db_client_pwd'} . "\n";
|
---|
| 151 | #print STDERR "@@@@ user: " . $self->{'db_client_user'} . "\n";
|
---|
| 152 | #print STDERR "@@@@ db_host: " . $self->{'db_host'} . "\n";
|
---|
| 153 | #print STDERR "@@@@ db_driver: " . $self->{'db_driver'} . "\n";
|
---|
| 154 | #print STDERR "@@@@ proc_mode: " . $self->{'process_mode'} . "\n";
|
---|
| 155 |
|
---|
[32520] | 156 | ############ LOAD NECESSARY OPTIONS ###########
|
---|
[32586] | 157 | #print "@@@ plugout SITE NAME: ". $self->{'site'} . "\n" if defined $self->{'site'};
|
---|
[32541] | 158 | #print STDERR "########## COLLECTION: ". $ENV{'GSDLCOLLECTION'}."\n";
|
---|
| 159 |
|
---|
[32527] | 160 | print STDERR "***** GreenstoneSQLPlugout process mode = \"", $self->{'process_mode'}, "\"\n";
|
---|
[32529] | 161 |
|
---|
| 162 | my $db_params = {
|
---|
[32560] | 163 | 'collection_name' => $ENV{'GSDLCOLLECTION'},
|
---|
[32580] | 164 | 'verbosity' => $self->{'verbosity'} || 0
|
---|
[32582] | 165 |
|
---|
[32529] | 166 | };
|
---|
| 167 |
|
---|
| 168 | my $gs_sql = new gssql($db_params);
|
---|
[32582] | 169 |
|
---|
| 170 | # if autocommit is set, there's no rollback support
|
---|
| 171 | my $autocommit = ($self->{'rollback_on_cancel'} eq "false") ? 1 : 0;
|
---|
[32520] | 172 |
|
---|
[32578] | 173 | # try connecting to the mysql db, die if that fails
|
---|
| 174 | # So don't bother preparing GreenstoneXMLPlugout by calling superclass' begin() yet
|
---|
[32530] | 175 | if(!$gs_sql->connect_to_db({
|
---|
| 176 | 'db_driver' => $self->{'db_driver'},
|
---|
| 177 | 'db_client_user' => $self->{'db_client_user'},
|
---|
| 178 | 'db_client_pwd' => $self->{'db_client_pwd'},
|
---|
[32582] | 179 | 'db_host' => $self->{'db_host'},
|
---|
| 180 | 'autocommit' => $autocommit
|
---|
[32530] | 181 | })
|
---|
| 182 | )
|
---|
| 183 | {
|
---|
[32520] | 184 | # This is fatal for the plugout, let's terminate here
|
---|
| 185 | # PrintError would already have displayed the warning message on connection fail
|
---|
| 186 | die("Could not connect to db. Can't proceed.\n");
|
---|
| 187 | }
|
---|
[32582] | 188 |
|
---|
| 189 | #die("@@@@ TEST. Connected successfully. Testing gssql::destructor.\n"); # WORKS
|
---|
[32524] | 190 |
|
---|
[32586] | 191 | my $db_name = $self->{'site'} || "greenstone2"; # one database per GS3 site, for GS2 the db is called greenstone2
|
---|
[32563] | 192 | my $proc_mode = $self->{'process_mode'};
|
---|
[32555] | 193 |
|
---|
[32563] | 194 |
|
---|
| 195 | my $success = $gs_sql->use_db($db_name);
|
---|
| 196 |
|
---|
| 197 | if($success && $proc_mode ne "text_only") {
|
---|
| 198 | ##print STDERR "@@@@ Ensuring meta table exists\n";
|
---|
| 199 | $success = $gs_sql->ensure_meta_table_exists();
|
---|
| 200 | }
|
---|
| 201 | if($success && $proc_mode ne "meta_only") {
|
---|
| 202 | ##print STDERR "@@@@ Ensuring fulltxt table exists\n";
|
---|
| 203 | $success = $gs_sql->ensure_fulltxt_table_exists();
|
---|
| 204 | }
|
---|
[32573] | 205 |
|
---|
[32563] | 206 | if(!$success) {
|
---|
[32536] | 207 | # This is fatal for the plugout, let's terminate here after disconnecting again
|
---|
| 208 | # PrintError would already have displayed the warning message on load fail
|
---|
[32583] | 209 | # And on die() perl will call gssql destroy which will ensure a disconnect() from db
|
---|
| 210 | #$gs_sql->force_disconnect_from_db(); # disconnect_from_db() will issue a warning on error
|
---|
[32536] | 211 | die("Could not use db $db_name and/or prepare its tables. Can't proceed.\n");
|
---|
[32520] | 212 | }
|
---|
| 213 |
|
---|
[32529] | 214 | # store the DBI wrapper instance
|
---|
| 215 | $self->{'gs_sql'} = $gs_sql;
|
---|
| 216 |
|
---|
[32524] | 217 |
|
---|
[32521] | 218 | # if setting up to work with sql db failed, we'd have terminated and wouldn't come up to here:
|
---|
| 219 | # won't bother preparing GreenstoneXMLPlugout by calling superclass' begin()
|
---|
| 220 | # finally, can call begin on super - important as doc.xml is opened as a group etc
|
---|
[32523] | 221 |
|
---|
[32526] | 222 | $self->SUPER::begin(@_);
|
---|
[32520] | 223 | }
|
---|
| 224 |
|
---|
| 225 | # disconnect from database here, see inexport.pm
|
---|
| 226 | sub end
|
---|
| 227 | {
|
---|
| 228 | my $self = shift(@_);
|
---|
| 229 |
|
---|
[32521] | 230 | # do the superclass stuff first, as any sql db failures should not prevent superclass cleanup
|
---|
[32526] | 231 | $self->SUPER::end(@_);
|
---|
[32583] | 232 |
|
---|
| 233 | # Important to call finished():
|
---|
| 234 | # it will disconnect from db if this is the last gssql instance,
|
---|
| 235 | # and it will commit to db before disconnecting if rollbback_on_cancel turned on
|
---|
| 236 | $self->{'gs_sql'}->finished();
|
---|
[32578] | 237 | delete $self->{'gs_sql'}; # key gs_sql no longer exists, not just the value being undef
|
---|
[32520] | 238 | }
|
---|
[32533] | 239 |
|
---|
[32542] | 240 | # Produce files called docsql.xml instead of doc.xml
|
---|
[32536] | 241 | sub get_doc_xml_filename {
|
---|
[32533] | 242 | my $self = shift (@_);
|
---|
[32536] | 243 | my ($doc_obj) = @_;
|
---|
| 244 |
|
---|
[32542] | 245 | return "docsql.xml";
|
---|
[32533] | 246 | }
|
---|
[32542] | 247 |
|
---|
| 248 | # overriding to store doc OID as attribute of top level element: <Archive docoid="oid">
|
---|
| 249 | sub output_xml_header {
|
---|
| 250 | my $self = shift (@_);
|
---|
| 251 | my ($outhandle, $doc_oid) = @_;
|
---|
| 252 |
|
---|
| 253 | print $outhandle '<?xml version="1.0" encoding="utf-8" standalone="no"?>' . "\n";
|
---|
| 254 | print $outhandle "<!DOCTYPE Archive SYSTEM \"http://greenstone.org/dtd/Archive/1.0/Archive.dtd\">\n";
|
---|
| 255 | print $outhandle "<Archive docoid=\"$doc_oid\">\n";
|
---|
| 256 | }
|
---|
| 257 |
|
---|
[32580] | 258 | # + X TODO: check arc-inf.db for whether each entry is to be deleted/indexed/reindexed/been indexed?
|
---|
[32543] | 259 | # That's only for indexing, not for this step which only generates the content in archives dir
|
---|
[32518] | 260 | sub saveas {
|
---|
| 261 | my $self = shift (@_);
|
---|
| 262 | my ($doc_obj, $doc_dir) = @_;
|
---|
| 263 |
|
---|
[32522] | 264 | my $proc_mode = $self->{'process_mode'};
|
---|
| 265 |
|
---|
[32521] | 266 | # 1. pre save out and saving debug handle
|
---|
| 267 |
|
---|
[32523] | 268 | # must call superclass (pre/post) saveas methods, as they handle assoc_files too
|
---|
[32526] | 269 | my ($docxml_outhandler, $output_file) = $self->SUPER::pre_saveas(@_);
|
---|
[32523] | 270 |
|
---|
| 271 | $self->{'debug_outhandle'} = $docxml_outhandler if ($self->{'debug'}); # STDOUT if debug
|
---|
| 272 |
|
---|
| 273 | # TODO: also set debugging in begin()? Then stmts creating db and tables also sent to debug out and not executed
|
---|
[32543] | 274 |
|
---|
[32520] | 275 |
|
---|
[32543] | 276 | # 2. overriding saving behaviour to do what the superclass does (writing out doc.xml files,
|
---|
| 277 | # under new name of docsql.xml, with breadcrumbs pointing to sql db) PLUS saving to sql db
|
---|
[32518] | 278 |
|
---|
[32543] | 279 | # NOTE: if proc_mode == all, then "breadcrumbs" (statements pointing viewer to the sql db
|
---|
| 280 | # for contents) go into both meta and txt elements of doc.xml (docsql.xml specifically):
|
---|
[32522] | 281 |
|
---|
[32543] | 282 | # write the INVERSE into doc.xml as to what is written to the SQL db
|
---|
[32523] | 283 | my $docxml_output_options = { 'output' => docprint::OUTPUT_NONE };
|
---|
| 284 | if($proc_mode eq "meta_only" ) { # since only meta to go into MySQL db, text will go into docxml
|
---|
| 285 | $docxml_output_options->{'output'} = docprint::OUTPUT_TEXT_ONLY;
|
---|
| 286 | } elsif($proc_mode eq "text_only" ) { # since only full text to go into MySQL db, meta will go into docxml
|
---|
| 287 | $docxml_output_options->{'output'} = docprint::OUTPUT_META_ONLY;
|
---|
[32518] | 288 | }
|
---|
[32521] | 289 |
|
---|
[32523] | 290 | # now we've prepared to write out whatever is meant to go into docxml
|
---|
| 291 | # and can do actual the steps superclass GreenstoneXMLPlugout carries out to write out docxml
|
---|
[32543] | 292 | # So: write out the doc xml file, "docsql.xml", for the current document
|
---|
[32523] | 293 | my $section_text = &docprint::get_section_xml($doc_obj, $docxml_output_options);
|
---|
| 294 | print $docxml_outhandler $section_text;
|
---|
| 295 |
|
---|
| 296 |
|
---|
[32518] | 297 | # We also write out whatever needs to go into the MySQL database
|
---|
| 298 | $self->write_meta_and_text($doc_obj);
|
---|
| 299 |
|
---|
[32520] | 300 |
|
---|
[32583] | 301 | # 3. post save out
|
---|
[32526] | 302 | $self->SUPER::post_saveas($doc_obj, $doc_dir, $docxml_outhandler, $output_file);
|
---|
[32521] | 303 |
|
---|
[32523] | 304 |
|
---|
[32521] | 305 | # database connection is closed in end() method
|
---|
| 306 | # so we don't open and close over and over for each doc during a single build
|
---|
[32518] | 307 | }
|
---|
| 308 |
|
---|
[32583] | 309 | ##### New methods, not inherited #####
|
---|
[32518] | 310 |
|
---|
[32520] | 311 | # write meta and/or text PER DOC out to DB
|
---|
[32518] | 312 | sub write_meta_and_text {
|
---|
| 313 | my $self = shift (@_);
|
---|
| 314 | my ($doc_obj) = @_;
|
---|
[32531] | 315 | my $doc_oid = $doc_obj->get_OID(); # this method processes a single doc at a time, so it uses the same OID throughout
|
---|
[32518] | 316 | my $root_section = $doc_obj->get_top_section();
|
---|
| 317 |
|
---|
[32573] | 318 | $self->recursive_write_meta_and_text($doc_obj, $doc_oid, $root_section);
|
---|
[32521] | 319 | }
|
---|
[32518] | 320 |
|
---|
| 321 | # Perl: Reading or Writing to Another Program
|
---|
| 322 | # https://nnc3.com/mags/Perl3/cookbook/ch16_05.htm
|
---|
| 323 | sub recursive_write_meta_and_text {
|
---|
[32520] | 324 | my $self = shift (@_);
|
---|
[32573] | 325 | my ($doc_obj, $doc_oid, $section) = @_;
|
---|
[32520] | 326 |
|
---|
| 327 | # If section=ROOT, write "root" as section name into table
|
---|
| 328 | # doc->get_top_section() is the name of the doc root section, which is ""
|
---|
| 329 | my $section_name = ($section eq "") ? "root" : $section;
|
---|
[32518] | 330 |
|
---|
| 331 | my $section_ptr = $doc_obj->_lookup_section ($section);
|
---|
| 332 | return "" unless defined $section_ptr;
|
---|
| 333 |
|
---|
[32520] | 334 | my $debug_out = $self->{'debug_outhandle'};
|
---|
[32573] | 335 |
|
---|
| 336 | my $gs_sql = $self->{'gs_sql'};
|
---|
| 337 | my $proc_mode = $self->{'process_mode'};
|
---|
| 338 | if($proc_mode eq "all" || $proc_mode eq "meta_only" ) {
|
---|
[32520] | 339 |
|
---|
| 340 | foreach my $data (@{$section_ptr->{'metadata'}}) {
|
---|
| 341 | my $meta_name = $data->[0];
|
---|
[32536] | 342 | # TODO: does it need to be stored escaped, as it requires unescaping when read back in
|
---|
| 343 | # from db (unlike for reading back in from doc.xml)
|
---|
[32524] | 344 | my $escaped_meta_value = &docprint::escape_text($data->[1]);
|
---|
[32580] | 345 |
|
---|
[32520] | 346 | # Write out the current section's meta to collection db's METADATA table
|
---|
| 347 |
|
---|
[32573] | 348 | # For each set of values to write to meta table, this next method call will
|
---|
| 349 | # efficiently execute an insert SQL statement (using a prepared insert statement),
|
---|
| 350 | # filling in the values
|
---|
| 351 | # OR if debugging, then it will print the SQL insert statement but not execute it
|
---|
[32580] | 352 |
|
---|
| 353 | $gs_sql->insert_row_into_metadata_table($doc_oid, $section_name, $meta_name, $escaped_meta_value, $self->{'debug'});
|
---|
| 354 | }
|
---|
[32518] | 355 | }
|
---|
[32520] | 356 |
|
---|
[32573] | 357 |
|
---|
| 358 | if($proc_mode eq "all" || $proc_mode eq "text_only" ) {
|
---|
| 359 |
|
---|
| 360 | my $section_textref = &docprint::escape_textref(\$section_ptr->{'text'});
|
---|
| 361 |
|
---|
| 362 | # fulltxt column can be SQL NULL. undef value gets written out as NULL:
|
---|
| 363 | # https://stackoverflow.com/questions/12708633/which-one-represents-null-undef-or-empty-string
|
---|
| 364 | # The following will do the SQL insertion
|
---|
| 365 | # or if debug, the following will print the SQL insert stmt without executing it
|
---|
[32580] | 366 | $gs_sql->insert_row_into_fulltxt_table($doc_oid, $section_name, $section_textref, $self->{'debug'});
|
---|
[32573] | 367 |
|
---|
[32518] | 368 | }
|
---|
| 369 |
|
---|
| 370 | # output all subsections: RECURSIVE CALL
|
---|
| 371 | foreach my $subsection (@{$section_ptr->{'subsection_order'}}) {
|
---|
[32573] | 372 | $self->recursive_write_meta_and_text($doc_obj, $doc_oid, "$section.$subsection");
|
---|
[32518] | 373 | }
|
---|
| 374 | }
|
---|
| 375 |
|
---|
| 376 |
|
---|
| 377 | 1;
|
---|