Revision 8815
Added by Lauren Walker over 10 years ago
src/perl/register-dataset.cgi | ||
---|---|---|
44 | 44 |
use File::Temp; |
45 | 45 |
use File::Copy; |
46 | 46 |
use Fcntl qw(:flock); |
47 |
use Data::UUID; |
|
48 | 47 |
use strict; |
49 | 48 |
|
50 | 49 |
#debug("running register-dataset.cgi"); |
... | ... | |
447 | 446 |
} |
448 | 447 |
} |
449 | 448 |
|
449 |
open my $log, ">>", "log.txt"; |
|
450 |
|
|
450 | 451 |
my $docid; |
452 |
my $scope = $FORM::scope; |
|
451 | 453 |
|
454 |
print $log "scope: $scope\n"; |
|
455 |
print $log "FORM:scope: $FORM::scope\n"; |
|
456 |
|
|
457 |
if(($scope eq "") || (!$scope)){ |
|
458 |
$scope = $config->{'scope'}; |
|
459 |
print $log "using config scope\n"; |
|
460 |
} |
|
461 |
|
|
452 | 462 |
# Create a metacat object |
453 | 463 |
my $metacat = Metacat->new($metacatUrl); |
454 | 464 |
|
... | ... | |
507 | 517 |
while ($docStatus eq "INCOMPLETE") { |
508 | 518 |
|
509 | 519 |
#Create the docid |
510 |
$docid = newDocid($config->{'scope'}, $metacat); |
|
520 |
$docid = newDocid($scope, $metacat); |
|
521 |
|
|
522 |
print $log "created docid: $docid\n scope is: $scope\n"; |
|
511 | 523 |
|
512 | 524 |
$xmldocWithDocID =~ s/docid/$docid/; |
513 | 525 |
debugDoc($xmldocWithDocID); |
... | ... | |
762 | 774 |
|
763 | 775 |
my $scope = shift; |
764 | 776 |
my $metacat = shift; |
765 |
my $getFromMetacat = shift; |
|
766 | 777 |
my $scopeFound = 0; |
767 | 778 |
|
768 | 779 |
#Lock a local file while we are creating a new docid |
... | ... | |
1289 | 1300 |
|
1290 | 1301 |
while(!$uploadStatus){ |
1291 | 1302 |
|
1292 |
$docid = newDocid($config->{'scope'}, $metacat);
|
|
1303 |
$docid = newDocid($scope, $metacat);
|
|
1293 | 1304 |
|
1294 | 1305 |
$uploadStatus = uploadData( $outFile, $docid, $cleanName ); |
1295 | 1306 |
|
... | ... | |
1492 | 1503 |
|
1493 | 1504 |
my $uploadMsg = $metacat->getMessage(); |
1494 | 1505 |
|
1495 |
#push( @errorMessages,
|
|
1496 |
# "Failed to upload file. Error was: $uploadMsg\n" );
|
|
1506 |
push( @errorMessages, |
|
1507 |
"Failed to upload file. Error was: $uploadMsg\n" ); |
|
1497 | 1508 |
|
1498 | 1509 |
debug("Upload -- Error is: $uploadMsg"); |
1499 | 1510 |
} |
Also available in: Unified diff
Allow the registry form to specify a docid scope