Revision 4739
Added by walbridge almost 16 years ago
register-dataset.cgi | ||
---|---|---|
88 | 88 |
} elsif (hasContent($ARGV[0])) { |
89 | 89 |
$skinName = $ARGV[0]; |
90 | 90 |
} else { |
91 |
debug("Registry: No configuration set.");
|
|
91 |
debug("No configuration set."); |
|
92 | 92 |
print "Content-type: text/html\n\n"; |
93 | 93 |
'Registry Error: The registry requires a skin name to continue.'; |
94 | 94 |
exit(); |
... | ... | |
96 | 96 |
|
97 | 97 |
# Metacat isn't initialized, the registry will fail in strange ways. |
98 | 98 |
if (!hasContent($metacatUrl)) { |
99 |
debug("Registry: No Metacat.");
|
|
99 |
debug("No Metacat."); |
|
100 | 100 |
print "Content-type: text/html\n\n"; |
101 | 101 |
'Registry Error: Metacat is not initialized! Make sure' . |
102 | 102 |
' MetacatUrl is set correctly in ' . $skinName . '.cfg'; |
... | ... | |
185 | 185 |
$$templateVars{'required'} = $required; |
186 | 186 |
$$templateVars{'config'} = $config; |
187 | 187 |
|
188 |
debug("Registry: Initialized -- stage set: $FORM::stage");
|
|
188 |
debug("Initialized -- stage set: $FORM::stage"); |
|
189 | 189 |
|
190 | 190 |
# Process the form based on stage parameter. |
191 | 191 |
if ($FORM::stage =~ "loginform") { |
... | ... | |
305 | 305 |
} else { |
306 | 306 |
|
307 | 307 |
# Hence, send back entry form for entry of data. |
308 |
debug("Registry: Sending form");
|
|
308 |
debug("Sending form"); |
|
309 | 309 |
my @sortedSites; |
310 | 310 |
foreach my $site (sort @sitelist) { |
311 | 311 |
push(@sortedSites, $site); |
... | ... | |
326 | 326 |
$$templateVars{'siteList'} = \@sortedSites; |
327 | 327 |
$$templateVars{'section'} = "Entry Form"; |
328 | 328 |
$$templateVars{'docid'} = ""; |
329 |
debug("Registry: Sending form: ready to process template");
|
|
329 |
debug("Sending form: ready to process template"); |
|
330 | 330 |
$template->process($templates->{'entry'}, $templateVars); |
331 |
debug("Registry: Sending form: template processed");
|
|
331 |
debug("Sending form: template processed"); |
|
332 | 332 |
} |
333 | 333 |
exit(); |
334 | 334 |
} |
... | ... | |
399 | 399 |
} else { |
400 | 400 |
|
401 | 401 |
if ($config->{'adminIsDocOwner'} eq 'true') { |
402 |
debug("Registry: adminIsDocOwner is set.");
|
|
402 |
debug("adminIsDocOwner is set."); |
|
403 | 403 |
$response = $metacat->login($username, $password); |
404 | 404 |
if (! $response) { |
405 | 405 |
push(@errorMessages, $metacat->getMessage()); |
... | ... | |
415 | 415 |
} |
416 | 416 |
} |
417 | 417 |
|
418 |
debug("Registry: A");
|
|
418 |
debug("A"); |
|
419 | 419 |
if ($FORM::docid eq "") { |
420 |
debug("Registry: B1");
|
|
420 |
debug("B1"); |
|
421 | 421 |
# document is being inserted |
422 | 422 |
my $docStatus = "INCOMPLETE"; |
423 | 423 |
while ($docStatus eq "INCOMPLETE") { |
... | ... | |
427 | 427 |
debugDoc($xmldocWithDocID); |
428 | 428 |
$docStatus = insertMetadata($xmldocWithDocID, $docid); |
429 | 429 |
} |
430 |
debug("Registry: B2");
|
|
430 |
debug("B2"); |
|
431 | 431 |
if ($docStatus ne "SUCCESS") { |
432 |
debug("Registry: NO SUCCESS");
|
|
432 |
debug("NO SUCCESS"); |
|
433 | 433 |
debug("Message is: $docStatus"); |
434 | 434 |
push(@errorMessages, $docStatus); |
435 | 435 |
} |
436 | 436 |
|
437 |
debug("Registry: B3");
|
|
437 |
debug("B3"); |
|
438 | 438 |
} else { |
439 | 439 |
# document is being modified |
440 | 440 |
$docid = incrementRevision($FORM::docid); |
... | ... | |
450 | 450 |
} |
451 | 451 |
|
452 | 452 |
if (scalar(@errorMessages)) { |
453 |
debug("Registry: ErrorMessages defined in modify.");
|
|
453 |
debug("ErrorMessages defined in modify."); |
|
454 | 454 |
|
455 | 455 |
$$templateVars{'docid'} = $FORM::docid; |
456 | 456 |
copyFormToTemplateVars(); |
... | ... | |
472 | 472 |
} |
473 | 473 |
} |
474 | 474 |
|
475 |
debug("Registry: C");
|
|
475 |
debug("C"); |
|
476 | 476 |
|
477 | 477 |
if (scalar(@errorMessages)) { |
478 |
debug("Registry: ErrorMessages defined.");
|
|
478 |
debug("ErrorMessages defined."); |
|
479 | 479 |
$$templateVars{'docid'} = $FORM::docid; |
480 | 480 |
copyFormToTemplateVars(); |
481 | 481 |
$$templateVars{'status'} = 'failure'; |
... | ... | |
513 | 513 |
|
514 | 514 |
debug("Trying to insert the following document"); |
515 | 515 |
my $docStatus = "SUCCESS"; |
516 |
debug("Registry: Starting insert (D1)");
|
|
516 |
debug("Starting insert (D1)"); |
|
517 | 517 |
|
518 | 518 |
my $response = $metacat->insert($docid, $xmldoc); |
519 | 519 |
if (! $response) { |
520 |
debug("Registry: Response gotten (D2)");
|
|
520 |
debug("Response gotten (D2)"); |
|
521 | 521 |
my $errormsg = $metacat->getMessage();i |
522 |
debug("Registry: Error is (D3): " . $errormsg);
|
|
522 |
debug("Error is (D3): " . $errormsg); |
|
523 | 523 |
if ($errormsg =~ /is already in use/) { |
524 | 524 |
$docStatus = "INCOMPLETE"; |
525 | 525 |
} elsif ($errormsg =~ /<login>/) { |
... | ... | |
528 | 528 |
$docStatus = $errormsg; |
529 | 529 |
} |
530 | 530 |
} |
531 |
debug("Registry: Ending insert (D4)");
|
|
531 |
debug("Ending insert (D4)"); |
|
532 | 532 |
|
533 | 533 |
return $docStatus; |
534 | 534 |
} |
... | ... | |
553 | 553 |
$id++; |
554 | 554 |
$docid = "$scope.$id.1"; |
555 | 555 |
} |
556 |
debug("Registry: Metcat handed us a new docid: $docid");
|
|
556 |
debug("Metcat handed us a new docid: $docid"); |
|
557 | 557 |
return $docid; |
558 | 558 |
} |
559 | 559 |
|
... | ... | |
561 | 561 |
my $initDocid = shift; |
562 | 562 |
my $docid = ''; |
563 | 563 |
if (!$initDocid) { |
564 |
debug("Registry: No docid entered.");
|
|
564 |
debug("No docid entered."); |
|
565 | 565 |
} else { |
566 | 566 |
my ($scope, $id, $rev) = split(/\./, $initDocid); |
567 | 567 |
$rev++; |
... | ... | |
884 | 884 |
for (my $fileNum = 0; $fileNum <= $FORM::upCount; $fileNum++) { |
885 | 885 |
my $fn = 'upload_' . $fileNum; |
886 | 886 |
if (hasContent(param($fn))) { |
887 |
debug("Registry: retrieving metadata for file: $fn");
|
|
887 |
debug("Retrieving metadata for file: $fn"); |
|
888 | 888 |
($docid, $fileInfo) = fileMetadata($fileNum); |
889 | 889 |
$uploadedFiles{ $docid } = $fileInfo; |
890 | 890 |
} |
... | ... | |
907 | 907 |
if ($fileHash =~ /ondisk/) { |
908 | 908 |
my $finfo = $fileHash; |
909 | 909 |
$finfo =~ s/ondisk://g; |
910 |
(my $docid, $fileHash) = split(":", $finfo);
|
|
910 |
($docid, $fileHash) = split(":", $finfo); |
|
911 | 911 |
$outFile = $dataDir . "/" . $docid; |
912 | 912 |
} else { |
913 | 913 |
# normalize input filenames; Windows filenames include full paths |
914 | 914 |
$cleanName =~ s/.*[\/\\](.*)/$1/; |
915 | 915 |
$outFile = $tempDir . "/" . $cleanName; |
916 | 916 |
} |
917 |
debug("Registry: Reading file from disk: $outFile");
|
|
917 |
debug("Reading file from disk: $outFile"); |
|
918 | 918 |
|
919 | 919 |
my $fileSize = stat($outFile)->size; |
920 | 920 |
if ($fileSize == 0) { |
921 | 921 |
push(@errorMessages, "file $fileName is zero bytes!"); |
922 |
debug("Registry: file $fileName is zero bytes!");
|
|
922 |
debug("File $fileName is zero bytes!");
|
|
923 | 923 |
} |
924 | 924 |
|
925 | 925 |
# Now the file is on disk, send the object to Metacat |
926 | 926 |
my $session = CGI::Session->load(); |
927 | 927 |
if ($session->is_empty) { |
928 | 928 |
push(@errorMessages, "Must be logged in to upload files."); |
929 |
debug("Registry: Not logged in, cannot upload files.");
|
|
929 |
debug("Not logged in, cannot upload files."); |
|
930 | 930 |
return 0; |
931 | 931 |
} |
932 | 932 |
|
933 |
if ($fileHash !~ /ondisk/) {
|
|
933 |
if (!$docid) {
|
|
934 | 934 |
$docid = newAccessionNumber($config->{'scope'}); |
935 | 935 |
my $uploadReturn = uploadData($outFile, $docid); |
936 | 936 |
if (!$uploadReturn) { |
937 |
debug("Registry: uploading the data failed.");
|
|
937 |
debug("Uploading the data failed.");
|
|
938 | 938 |
} |
939 | 939 |
} |
940 | 940 |
my $entityid = $fileHash."001"; |
... | ... | |
975 | 975 |
my $fileSize = stat($outFile)->size; |
976 | 976 |
if ($fileSize == 0) { |
977 | 977 |
push(@errorMessages, "file $fileName is zero bytes!"); |
978 |
debug("Registry: file $fileName is zero bytes!");
|
|
978 |
debug("File $fileName is zero bytes!");
|
|
979 | 979 |
} |
980 | 980 |
|
981 | 981 |
# file is in Metacat, generate the pertinent EML elements |
... | ... | |
1021 | 1021 |
open(OUT,">$outputName") or die "Could not open: $!"; |
1022 | 1022 |
print OUT $fileData; |
1023 | 1023 |
close(OUT); |
1024 |
debug("Registry: writing output, result is: $outputName");
|
|
1024 |
debug("Writing output, result is: $outputName");
|
|
1025 | 1025 |
|
1026 | 1026 |
return ($outputName, $digest); |
1027 | 1027 |
} |
... | ... | |
1038 | 1038 |
if (!$response) { |
1039 | 1039 |
my $msg = $metacat->getMessage(); |
1040 | 1040 |
push(@errorMessages, "Failed to delete existing file. Error was: $msg\n"); |
1041 |
debug("Registry: Delete -- Error is: $msg");
|
|
1041 |
debug("Delete -- Error is: $msg"); |
|
1042 | 1042 |
} else { |
1043 |
debug("Registry: Delete -- Success! Removed docid $docid");
|
|
1043 |
debug("Delete -- Success! Removed docid $docid"); |
|
1044 | 1044 |
} |
1045 | 1045 |
} else { |
1046 | 1046 |
my $fileName = $tempDir . "/" . $input; |
1047 | 1047 |
|
1048 | 1048 |
if (-e $fileName) { |
1049 | 1049 |
unlink $fileName or |
1050 |
debug("Registry: failed to delete file $fileName.");
|
|
1050 |
debug("Failed to delete file $fileName.");
|
|
1051 | 1051 |
} else { |
1052 |
debug("Registry: unable to find file $fileName");
|
|
1052 |
debug("Unable to find file $fileName");
|
|
1053 | 1053 |
} |
1054 | 1054 |
if (!-e $fileName) { |
1055 |
debug("Registry: successfully deleted $fileName");
|
|
1055 |
debug("Successfully deleted $fileName");
|
|
1056 | 1056 |
} |
1057 | 1057 |
} |
1058 | 1058 |
} |
... | ... | |
1061 | 1061 |
my $data = shift; |
1062 | 1062 |
my $docid = shift; |
1063 | 1063 |
|
1064 |
debug("Registry: Upload -- Starting upload of $docid");
|
|
1064 |
debug("Upload -- Starting upload of $docid"); |
|
1065 | 1065 |
my $response = $metacat->upload($docid, $data); |
1066 | 1066 |
if (!$response) { |
1067 | 1067 |
my $uploadMsg = $metacat->getMessage(); |
1068 | 1068 |
push(@errorMessages, "Failed to upload file. Error was: $uploadMsg\n"); |
1069 |
debug("Registry: Upload -- Error is: $uploadMsg");
|
|
1069 |
debug("Upload -- Error is: $uploadMsg"); |
|
1070 | 1070 |
} else { |
1071 |
debug("Registry: Upload -- Success! New docid $docid");
|
|
1071 |
debug("Upload -- Success! New docid $docid"); |
|
1072 | 1072 |
} |
1073 | 1073 |
} |
1074 | 1074 |
|
... | ... | |
1906 | 1906 |
my $emlns = $root->lookupNamespaceURI("eml"); |
1907 | 1907 |
|
1908 | 1908 |
if ($emlns =~ 'eml-2.0') { |
1909 |
debug("Registry: Translation: Upgrading a 2.0.x doc to 2.1.0");
|
|
1909 |
debug("Translation: Upgrading a 2.0.x doc to 2.1.0"); |
|
1910 | 1910 |
$doc = transformEmlTo210($doc); |
1911 | 1911 |
} |
1912 | 1912 |
elsif ($emlns =~ 'eml-2.1') { |
1913 |
debug("Registry: Translation: Found a 2.1.x doc.");
|
|
1913 |
debug("Translation: Found a 2.1.x doc."); |
|
1914 | 1914 |
} |
1915 | 1915 |
else { |
1916 | 1916 |
$error = "Unrecognized document type!"; |
1917 |
debug("Registry: Translation: $error");
|
|
1917 |
debug("Translation: $error"); |
|
1918 | 1918 |
push(@errorMessages, $error."\n"); |
1919 | 1919 |
} |
1920 | 1920 |
return $doc; |
... | ... | |
1971 | 1971 |
|
1972 | 1972 |
# find out the tag <creator>. |
1973 | 1973 |
$results = $doc->findnodes('//dataset/creator/individualName'); |
1974 |
debug("Registry: Creators: ".$results->size());
|
|
1974 |
debug("Creators: ".$results->size()); |
|
1975 | 1975 |
foreach $node ($results->get_nodelist) { |
1976 | 1976 |
dontOccur($node, "../positionName|../onlineURL|../userId", |
1977 | 1977 |
"positionName, onlineURL, userId"); |
1978 | 1978 |
|
1979 | 1979 |
dontOccur($node, "./saluation", "saluation"); |
1980 | 1980 |
|
1981 |
debug("Registry: Checking a creator in loop 1...");
|
|
1981 |
debug("Checking a creator in loop 1..."); |
|
1982 | 1982 |
$tempResult = $node->findnodes('../address|../phone|../electronicmailAddress|../organizationName'); |
1983 | 1983 |
if($tempResult->size > 0) { |
1984 | 1984 |
if($foundDSO == 0) { |
1985 | 1985 |
$foundDSO = 1; |
1986 | 1986 |
|
1987 |
debug("Registry: Recording a creator in loop 1...");
|
|
1987 |
debug("Recording a creator in loop 1..."); |
|
1988 | 1988 |
$$templateVars{'origNamefirst0'} = findValue($node, 'givenName'); |
1989 | 1989 |
$$templateVars{'origNamelast0'} = findValue($node, 'surName'); |
1990 | 1990 |
|
... | ... | |
2026 | 2026 |
} |
2027 | 2027 |
} |
2028 | 2028 |
foreach $node ($results->get_nodelist) { |
2029 |
debug("Registry: Checking a creator in loop 2...");
|
|
2029 |
debug("Checking a creator in loop 2..."); |
|
2030 | 2030 |
$tempResult = $node->findnodes('../address|../phone|../electronicmailAddress|../organizationName'); |
2031 | 2031 |
if ($tempResult->size == 0) { |
2032 | 2032 |
if ($foundDSO == 0) { |
2033 |
debug("Registry: Recording a creator in loop 2 block A...");
|
|
2033 |
debug("Recording a creator in loop 2 block A..."); |
|
2034 | 2034 |
$foundDSO = 1; |
2035 | 2035 |
$$templateVars{'origNamefirst0'} = findValue($node, 'givenName'); |
2036 | 2036 |
$$templateVars{'origNamelast0'} = findValue($node, 'surName'); |
2037 | 2037 |
$$templateVars{'origNameOrg'} = findValue($node, '../organizationName'); |
2038 | 2038 |
} else { |
2039 |
debug("Registry: Recording a creator in loop 2 block B...");
|
|
2039 |
debug("Recording a creator in loop 2 block B..."); |
|
2040 | 2040 |
$$templateVars{"origNamefirst$aoCount"} = findValue($node, './givenName'); |
2041 | 2041 |
$$templateVars{"origNamelast$aoCount"} = findValue($node, './surName'); |
2042 | 2042 |
$$templateVars{"origRole$aoCount"} = "Originator"; |
... | ... | |
2047 | 2047 |
|
2048 | 2048 |
$results = $doc->findnodes('//dataset/creator/organizationName'); |
2049 | 2049 |
my $wgroups = $doc->findnodes("//dataset/creator/organizationName[contains(text(),'(NCEAS ')]"); |
2050 |
debug("Registry: Number Org: ".$results->size());
|
|
2051 |
debug("Registry: Number WG: ".$wgroups->size());
|
|
2050 |
debug("Number Org: ".$results->size()); |
|
2051 |
debug(" Number WG: ".$wgroups->size()); |
|
2052 | 2052 |
if ($results->size() - $wgroups->size() > 3) { |
2053 | 2053 |
errMoreThanN("creator/organizationName"); |
2054 | 2054 |
} else { |
... | ... | |
2300 | 2300 |
} else { |
2301 | 2301 |
foreach $tempNode ($tempResult->get_nodelist) { |
2302 | 2302 |
my $geogdesc = findValue($tempNode, "geographicDescription"); |
2303 |
debug("Registry: geogdesc from xml is: $geogdesc");
|
|
2303 |
debug("Geogdesc from xml is: $geogdesc");
|
|
2304 | 2304 |
$$templateVars{'geogdesc'} = $geogdesc; |
2305 | 2305 |
my $coord = findValue($tempNode, "boundingCoordinates/westBoundingCoordinate"); |
2306 | 2306 |
if ($coord > 0) { |
... | ... | |
2440 | 2440 |
|
2441 | 2441 |
$results = $doc->findnodes( |
2442 | 2442 |
'//dataset/methods/methodStep/description/section'); |
2443 |
debug("Registry: Number methods: ".$results->size());
|
|
2443 |
debug("Number methods: ".$results->size()); |
|
2444 | 2444 |
if ($results->size() > 1) { |
2445 | 2445 |
errMoreThanN("methods/methodStep/description/section"); |
2446 | 2446 |
} else { |
... | ... | |
2448 | 2448 |
foreach $node ($results->get_nodelist) { |
2449 | 2449 |
my @children = $node->childNodes; |
2450 | 2450 |
for (my $i = 0; $i < scalar(@children); $i++) { |
2451 |
debug("Registry: Method child loop ($i)");
|
|
2451 |
debug("Method child loop ($i)"); |
|
2452 | 2452 |
my $child = $children[$i]; |
2453 | 2453 |
if ($child->nodeName eq 'title') { |
2454 | 2454 |
my $title = $child->textContent(); |
2455 |
debug("Registry: Method title ($title)");
|
|
2455 |
debug("Method title ($title)"); |
|
2456 | 2456 |
$$templateVars{'methodTitle'} = $title; |
2457 | 2457 |
} elsif ($child->nodeName eq 'para') { |
2458 | 2458 |
my $para = $child->textContent(); |
2459 |
debug("Registry: Method para ($para)");
|
|
2459 |
debug("Method para ($para)"); |
|
2460 | 2460 |
$methodPara[scalar(@methodPara)] = $para; |
2461 | 2461 |
} |
2462 | 2462 |
} |
... | ... | |
2564 | 2564 |
my $upCount = 0; |
2565 | 2565 |
foreach $node ($results->get_nodelist) { |
2566 | 2566 |
my $distUrl = findValue($node, 'distribution/online/url'); |
2567 |
debug("Registry: found distUrl of value $distUrl.");
|
|
2567 |
debug("Found distUrl of value $distUrl.");
|
|
2568 | 2568 |
if ($distUrl !~ /^ecogrid/) { |
2569 | 2569 |
my $error = "The file URL referenced is not a local resource and has been changed outside the registry. Please use Morpho to edit this document."; |
2570 | 2570 |
push(@errorMessages, $error."\n"); |
... | ... | |
2596 | 2596 |
$$templateVars{"uploadname_$upCount"} = findValue($node, 'objectName'); |
2597 | 2597 |
$$templateVars{"uploadtype_$upCount"} = findValue($node, 'dataFormat/externallyDefinedFormat/formatName'); |
2598 | 2598 |
$$templateVars{"uploadperm_$upCount"} = $accessRule; |
2599 |
debug("Registry: setting upload data: " . $$templateVars{"upload_$upCount"} . ", " . $$templateVars{"uploadname_$upCount"} . ", " . $$templateVars{"uploadtype_$upCount"} . ", " . $$templateVars{"uploadperm_$upCount"});
|
|
2599 |
debug("Setting upload data: " . $$templateVars{"upload_$upCount"} . ", " . $$templateVars{"uploadname_$upCount"} . ", " . $$templateVars{"uploadtype_$upCount"} . ", " . $$templateVars{"uploadperm_$upCount"});
|
|
2600 | 2600 |
$upCount++; |
2601 | 2601 |
} |
2602 | 2602 |
} |
... | ... | |
2740 | 2740 |
# |
2741 | 2741 |
################################################################################ |
2742 | 2742 |
sub handleLoginRequest(){ |
2743 |
#debug("Registry: handling login request"); |
|
2744 | 2743 |
# Check if a session already exists |
2745 | 2744 |
my $session = CGI::Session->load() or die CGI::Session->errstr(); |
2746 | 2745 |
if ($session->is_empty) { |
... | ... | |
2750 | 2749 |
|
2751 | 2750 |
my $metacat = Metacat->new($metacatUrl); |
2752 | 2751 |
my $returnVal = $metacat->login($username,$password); |
2753 |
debug("Registry: Login was $returnVal for login attempt to $metacatUrl, with $username");
|
|
2752 |
debug("Login was $returnVal for login attempt to $metacatUrl, with $username"); |
|
2754 | 2753 |
if ($returnVal > 0) { |
2755 | 2754 |
# valid username and passwd |
2756 | 2755 |
# create a new session and store username and passswd |
... | ... | |
2890 | 2889 |
sub handleRead { |
2891 | 2890 |
my $docid = $FORM::docid; |
2892 | 2891 |
my $errorMessage; |
2893 |
#debug("REGISTRY: \n\n\n\n$docid");
|
|
2892 |
#debug("\n\n\n\n$docid"); |
|
2894 | 2893 |
print "Content-type: text/html\n\n"; |
2895 | 2894 |
|
2896 | 2895 |
# Check if the session exists |
... | ... | |
3659 | 3658 |
|
3660 | 3659 |
for (my $i = 0; $i <= $#$aoRoleArray; $i++) { |
3661 | 3660 |
if (hasContent($aoFNArray->[$i]) && hasContent($aoLNArray->[$i])) { |
3662 |
debug("Registry processing Associated Party: origName = ".$aoFNArray->[$i]
|
|
3661 |
debug("Processing Associated Party: origName = ".$aoFNArray->[$i]
|
|
3663 | 3662 |
." origNamelast = ".$aoLNArray->[$i]." origRole = " |
3664 | 3663 |
.$aoRoleArray->[$i]); |
3665 | 3664 |
$$templateVars{"origNamefirst".$aoCount} = normalizeCD($aoFNArray->[$i]); |
... | ... | |
3680 | 3679 |
|
3681 | 3680 |
for (my $i = 0; $i <= $#$keywordArray; $i++) { |
3682 | 3681 |
if (hasContent($keywordArray->[$i])) { |
3683 |
debug("Registry processing keyword: keyword = ".$keywordArray->[$i]."
|
|
3682 |
debug("Processing keyword: keyword = ".$keywordArray->[$i]."
|
|
3684 | 3683 |
keywordType = ".$keywordTypeArray->[$i]." |
3685 | 3684 |
keywordTh = ".$keywordThArray->[$i]); |
3686 | 3685 |
$$templateVars{"keyword".$keyCount} = normalizeCD($keywordArray->[$i]); |
... | ... | |
3732 | 3731 |
|
3733 | 3732 |
for (my $i = 0; $i <= $#$taxonNameArray; $i++) { |
3734 | 3733 |
if (hasContent($taxonRankArray->[$i]) && hasContent($taxonNameArray->[$i])) { |
3735 |
debug("Registry processing keyword: trv = ".$taxonRankArray->[$i]
|
|
3734 |
debug("Processing keyword: trv = ".$taxonRankArray->[$i]
|
|
3736 | 3735 |
." trn = ".$taxonNameArray->[$i]); |
3737 | 3736 |
$$templateVars{"taxonRankName".$taxonCount} = normalizeCD($taxonRankArray->[$i]); |
3738 | 3737 |
$$templateVars{"taxonRankValue".$taxonCount} = normalizeCD($taxonNameArray->[$i]); |
... | ... | |
3750 | 3749 |
deleteFile(param("uploadname_$upNum")); |
3751 | 3750 |
$deleteCount++; |
3752 | 3751 |
} else { |
3753 |
debug("Registry: processing existing file: $upn");
|
|
3752 |
debug("Processing existing file: $upn");
|
|
3754 | 3753 |
$$templateVars{"upload_$upNum"} = param("upload_$upNum"); |
3755 | 3754 |
$$templateVars{"uploadname_$upNum"} = param("uploadname_$upNum"); |
3756 | 3755 |
$$templateVars{"uploadtype_$upNum"} = param("uploadtype_$upNum"); |
... | ... | |
3764 | 3763 |
my $fn = 'file_' . $fileNum; |
3765 | 3764 |
if (hasContent(param($fn))) { |
3766 | 3765 |
my $fileName = eval "\$FORM::file_$fileNum"; |
3767 |
debug("Registry: processing file: $fn");
|
|
3766 |
debug("Processing file: $fn");
|
|
3768 | 3767 |
# Upload the file object itself to a temporary file, copy file |
3769 | 3768 |
# metadata to form |
3770 | 3769 |
my $fileInfo = processFile($fileName); |
... | ... | |
3899 | 3898 |
my $origRole = "origRole".$origNameIndex; |
3900 | 3899 |
if ($origNameIndex =~ /[0-9]+/ && $origNameIndex > 0) { |
3901 | 3900 |
if (hasContent(param($origName)) && hasContent(param($origNamelast)) && hasContent(param($origRole))) { |
3902 |
debug("Registry processing keyword: $origName = ".param($origName)." $origNamelast = ".param($origNamelast)." $origRole = ".param($origRole));
|
|
3901 |
debug("Processing keyword: $origName = ".param($origName)." $origNamelast = ".param($origNamelast)." $origRole = ".param($origRole));
|
|
3903 | 3902 |
$$templateVars{$origName} = normalizeCD(param($origName)); |
3904 | 3903 |
$$templateVars{$origNamelast} = normalizeCD(param($origNamelast)); |
3905 | 3904 |
$$templateVars{$origRole} = normalizeCD(param($origRole)); |
... | ... | |
3918 | 3917 |
my $keyTh = "kwTh".$keyIndex; |
3919 | 3918 |
if ($keyIndex =~ /[0-9]+/) { |
3920 | 3919 |
if (hasContent(param($kyd)) && hasContent(param($keyType)) && hasContent(param($keyTh))) { |
3921 |
debug("Registry processing keyword: $kyd = ".param($kyd)." $keyType = ".param($keyType)." $keyTh = ".param($keyTh));
|
|
3920 |
debug("Processing keyword: $kyd = ".param($kyd)." $keyType = ".param($keyType)." $keyTh = ".param($keyTh));
|
|
3922 | 3921 |
$$templateVars{$kyd} = param($kyd); |
3923 | 3922 |
my $tmp = param($keyType); #convert the first letter to upper case |
3924 | 3923 |
$tmp =~ s/\b(\w)/\U$1/g; |
... | ... | |
3971 | 3970 |
my $trv = "taxonRankValue".$taxIndex; |
3972 | 3971 |
if ($taxIndex =~ /[0-9]+/) { |
3973 | 3972 |
if (hasContent(param($trn)) && hasContent(param($trv))) { |
3974 |
debug("Registry processing taxon: $trn = ".param($trn)." $trv = ".param($trv));
|
|
3973 |
debug("Processing taxon: $trn = ".param($trn)." $trv = ".param($trv));
|
|
3975 | 3974 |
$$templateVars{$trn} = param($trn); |
3976 | 3975 |
$$templateVars{$trv} = param($trv); |
3977 | 3976 |
} |
... | ... | |
3997 | 3996 |
$fileIndex =~ s/upload_//; |
3998 | 3997 |
if ($fileIndex =~ /[0-9]+/) { |
3999 | 3998 |
if (hasContent(param($upload))) { |
4000 |
debug("Registry: returning filename: " . param($upload));
|
|
3999 |
debug("Returning filename: " . param($upload)); |
|
4001 | 4000 |
$$templateVars{"upload_$fileIndex"} = param($upload); |
4002 | 4001 |
$$templateVars{"uploadname_$fileIndex"} = param("uploadname_$fileIndex"); |
4003 | 4002 |
$$templateVars{"uploadtype_$fileIndex"} = param("uploadtype_$fileIndex"); |
... | ... | |
4078 | 4077 |
|
4079 | 4078 |
my $result = $node->findnodes("$value"); |
4080 | 4079 |
if ($result->size > 0) { |
4081 |
debug("Registry: error trying to find $value, $errVal.");
|
|
4080 |
debug("Error trying to find $value, $errVal.");
|
|
4082 | 4081 |
$error ="One of the following tags found: $errVal. Please use Morpho to edit this document"; |
4083 | 4082 |
push(@errorMessages, $error."\n"); |
4084 | 4083 |
} |
... | ... | |
4132 | 4131 |
my $msg = shift; |
4133 | 4132 |
|
4134 | 4133 |
if ($debug_enabled) { |
4135 |
print STDERR "$msg\n"; |
|
4134 |
print STDERR "Registry: $msg\n";
|
|
4136 | 4135 |
} |
4137 | 4136 |
else { |
4138 | 4137 |
# This empty print statement is to prevent a bizzare error of the NCEAS |
Also available in: Unified diff
standardize registry debug messages with 'Registry:' prefix