Changeset 11660 for trunk/gsdl/perllib
- Timestamp:
- 2006-04-20T11:14:52+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/docsave.pm
r10538 r11660 334 334 } 335 335 336 336 # /** 337 # */ 337 338 sub group_process { 339 338 340 my $self = shift (@_); 339 341 my ($doc_obj) = @_; 340 341 342 my $outhandle = $self->{'outhandle'}; 342 343 … … 349 350 350 351 # opening a new file, or document has assoicated files => directory needed 351 if (($open_new_file) || (scalar(@{$doc_obj->get_assoc_files()})>0)) { 352 353 # get document's directory 354 my $doc_dir = $self->get_doc_dir ($OID, $doc_obj->get_source_filename()); 355 356 # copy all the associated files, add this information as metadata 357 # to the document 358 $self->process_assoc_files ($doc_obj, $doc_dir); 359 360 361 if ($open_new_file) { 362 # only if opening new file 352 if (($open_new_file) || (scalar(@{$doc_obj->get_assoc_files()})>0)) 353 { 354 # The directory the archive file (doc.xml) and all associated files 355 # should end up in 356 my $doc_dir; 357 # If we've determined its time for a new file, open it now 358 if ($open_new_file || !defined($self->{'gs_doc_dir'})) 359 { 360 $doc_dir = $self->get_doc_dir ($OID, $doc_obj->get_source_filename()); 361 # only if opening new file 363 362 my $output_dir = $self->getoutputdir(); 364 my $doc_file 365 363 364 my $doc_file = &util::filename_cat ($output_dir, $doc_dir, "doc.xml"); 366 365 my $short_doc_file = &util::filename_cat ($doc_dir, "doc.xml"); 367 366 368 367 if ($gs_count>0) 369 368 { 370 369 return if (!$self->close_file_output()); 371 370 } 372 371 373 372 if (!open (OUTDOC, ">$doc_file")) { 374 373 print $outhandle "docsave::group_process could not write to file $doc_file\n"; … … 378 377 $self->{'gs_short_filename'} = $short_doc_file; 379 378 $self->{'gs_OID'} = $OID; 379 $self->{'gs_doc_dir'} = $doc_dir; 380 380 381 381 $self->output_xml_header('docsave::OUTDOC'); 382 382 } 383 # Otherwise load the same archive document directory used last time 384 else 385 { 386 $doc_dir = $self->{'gs_doc_dir'}; 387 } 388 # copy all the associated files, add this information as metadata 389 # to the document 390 print STDERR "Writing associated files to $doc_dir\n"; 391 $self->process_assoc_files ($doc_obj, $doc_dir); 383 392 } 384 393
Note:
See TracChangeset
for help on using the changeset viewer.