Project

General

Profile

« Previous | Next » 

Revision 4519

Added by walbridge over 15 years ago

Dump copy of EML document being uploaded when debug mode is enabled.

View differences:

register-dataset.cgi
380 380
    # Parameters have been validated and Create the XML document
381 381
    my $xmldoc = createXMLDocument();
382 382
    
383
    # Write out the XML file for debugging purposes
384
    my $testFile = $tempDir . "/registry-eml-upload.xml";
385
    open (TFILE,">$testFile") || die ("Cant open xml file...\n");
386
    print TFILE $xmldoc;
387
    close(TFILE);
388

  
389 383
    my $xmldocWithDocID = $xmldoc;
390 384
    my $errorMessage = "";
391 385

  
......
429 423
                $docid = newAccessionNumber($config->{'scope'});
430 424

  
431 425
                $xmldocWithDocID =~ s/docid/$docid/;
426
                debugDoc($xmldocWithDocID);
432 427
                $docStatus = insertMetadata($xmldocWithDocID, $docid);
433 428
            }
434 429
            debug("Registry: B2");
......
442 437
        } else {
443 438
            # document is being modified
444 439
            $docid = $FORM::docid;
445
    
440

  
446 441
            my $x;
447 442
            my $y;
448 443
            my $z;
449
        
444

  
450 445
            ($x, $y, $z) = split(/\./, $docid); 
451 446
            $z++;
452 447
            $docid = "$x.$y.$z";
453
    
448

  
454 449
            $xmldoc =~ s/docid/$docid/;
455
        
450
            debugDoc($xmldoc);$
451

  
456 452
            my $response = $metacat->update($docid, $xmldoc);
457 453

  
458 454
            if (! $response) {
......
473 469
                $$templateVars{'cfg'} = $skinName;
474 470
            }
475 471

  
476
            #if (! $error) {
477
                #sendNotification($docid, $mailhost, $sender, $recipient);
478
            #}
479

  
480 472
            # Create our HTML response and send it back
481 473
            $$templateVars{'function'} = "modified";
482 474
            $$templateVars{'section'} = "Modification Status";
......
509 501
    
510 502
}
511 503

  
512
#if (! $error) {
513
#sendNotification($docid, $mailhost, $sender, $recipient);
514
#}
515

  
516 504
# Create our HTML response and send it back
517 505
$$templateVars{'function'} = "submitted";
518 506
$$templateVars{'section'} = "Submission Status";
......
4126 4114

  
4127 4115
################################################################################
4128 4116
# 
4117
# dump the EML document to disk
4118
#
4119
################################################################################
4120

  
4121
sub debugDoc {
4122
    my $doc = shift;
4123

  
4124
    if ($debug_enabled) {
4125
        # Write out the XML file for debugging purposes
4126
        my $testFile = $tempDir . "/registry-eml-upload.xml";
4127
        open (TFILE,">$testFile") || die ("Cant open xml file...\n");
4128
        print TFILE $doc;
4129
        close(TFILE);
4130
     }
4131
}
4132

  
4133
################################################################################
4134
# 
4129 4135
# get the list of projects
4130 4136
#
4131 4137
################################################################################

Also available in: Unified diff