Revision 2144
Added by sgarg over 20 years ago
register-dataset.cgi | ||
---|---|---|
1420 | 1420 |
# find out the tag <creator>. |
1421 | 1421 |
$results = $doc->findnodes('//dataset/creator/individualName'); |
1422 | 1422 |
debug("Registry: Creators: ".$results->size()); |
1423 |
if ($results->size() > 11) { |
|
1424 |
errMoreThanN("creator/individualName"); |
|
1425 |
} else { |
|
1426 |
foreach $node ($results->get_nodelist) { |
|
1423 |
foreach $node ($results->get_nodelist) { |
|
1427 | 1424 |
dontOccur($node, "../positionName|../onlineURL|../userId", |
1428 | 1425 |
"positionName, onlineURL, userId"); |
1429 | 1426 |
|
... | ... | |
1495 | 1492 |
} |
1496 | 1493 |
} |
1497 | 1494 |
} |
1498 |
} |
|
1499 | 1495 |
|
1500 | 1496 |
$results = $doc->findnodes('//dataset/creator/organizationName'); |
1501 | 1497 |
my $wgroups = $doc->findnodes("//dataset/creator/organizationName[contains(text(),'(NCEAS ')]"); |
... | ... | |
1524 | 1520 |
} |
1525 | 1521 |
|
1526 | 1522 |
$results = $doc->findnodes('//dataset/metadataProvider'); |
1527 |
if ($results->size() > 11) { |
|
1528 |
errMoreThanN("metadataProvider"); |
|
1529 |
} else { |
|
1530 |
foreach $node ($results->get_nodelist) { |
|
1523 |
foreach $node ($results->get_nodelist) { |
|
1531 | 1524 |
dontOccur($node, "./organizationName|./positionName|./onlineURL|./userId|./electronicMailAddress|./phone|./address", |
1532 | 1525 |
"organizationName, positionName, onlineURL, userId, electronicMailAddress, phone, address in metadataProvider"); |
1533 | 1526 |
|
1534 |
$tempResult = $node->findnodes('./individualName');
|
|
1527 |
$tempResult = $node->findnodes('./individualName');
|
|
1535 | 1528 |
if ($tempResult->size > 1) { |
1536 | 1529 |
errMoreThanOne("metadataProvider/indvidualName"); |
1537 | 1530 |
} else { |
... | ... | |
1548 | 1541 |
} |
1549 | 1542 |
} |
1550 | 1543 |
} |
1551 |
} |
|
1552 | 1544 |
|
1553 | 1545 |
$results = $doc->findnodes('//dataset/associatedParty'); |
1554 |
if ($results->size() > 10) { |
|
1555 |
errMoreThanN("associatedParty"); |
|
1556 |
} else { |
|
1557 |
foreach $node ($results->get_nodelist) { |
|
1546 |
foreach $node ($results->get_nodelist) { |
|
1558 | 1547 |
dontOccur($node, "./organizationName|./positionName|./onlineURL|./userId|./electronicMailAddress|./phone|./address", |
1559 | 1548 |
"organizationName, positionName, onlineURL, userId, electronicMailAddress, phone, address in associatedParty"); |
1560 | 1549 |
|
... | ... | |
1569 | 1558 |
$aoCount++; |
1570 | 1559 |
} |
1571 | 1560 |
} |
1572 |
} |
|
1573 |
} |
|
1561 |
} |
|
1574 | 1562 |
|
1575 | 1563 |
$results = $doc->findnodes('//dataset/publisher'); |
1576 |
if ($results->size() > 10) { |
|
1577 |
errMoreThanN("publisher"); |
|
1578 |
} else { |
|
1564 |
# if ($results->size() > 10) {
|
|
1565 |
# errMoreThanN("publisher");
|
|
1566 |
# } else {
|
|
1579 | 1567 |
foreach $node ($results->get_nodelist) { |
1580 | 1568 |
dontOccur($node, "./organizationName|./positionName|./onlineURL|./userId|./electronicMailAddress|./phone|./address", |
1581 | 1569 |
"organizationName, positionName, onlineURL, userId, electronicMailAddress, phone, address in associatedParty"); |
... | ... | |
1592 | 1580 |
} |
1593 | 1581 |
} |
1594 | 1582 |
} |
1595 |
} |
|
1583 |
# }
|
|
1596 | 1584 |
|
1597 |
if ($aoCount > 11) { |
|
1598 |
errMoreThanN("Additional Originators"); |
|
1599 |
} |
|
1585 |
# if ($aoCount > 11) {
|
|
1586 |
# errMoreThanN("Additional Originators");
|
|
1587 |
# }
|
|
1600 | 1588 |
|
1589 |
$$templateVars{'aoCount'} = $aoCount-1; |
|
1590 |
|
|
1601 | 1591 |
dontOccur($doc, "./pubDate", "pubDate"); |
1602 | 1592 |
dontOccur($doc, "./language", "language"); |
1603 | 1593 |
dontOccur($doc, "./series", "series"); |
... | ... | |
2171 | 2161 |
$$templateVars{'origFAXContact'} = normalizeCD($FORM::origFAXContact); |
2172 | 2162 |
$$templateVars{'origEmailContact'} = normalizeCD($FORM::origEmailContact); |
2173 | 2163 |
} |
2174 |
$$templateVars{'origNamefirst1'} = normalizeCD($FORM::origNamefirst1); |
|
2175 |
$$templateVars{'origNamelast1'} = normalizeCD($FORM::origNamelast1); |
|
2176 |
if($FORM::origNamefirst1 eq "" && $FORM::origNamelast1 eq ""){ |
|
2177 |
$$templateVars{'origRole1'} = ""; |
|
2178 |
}else{ |
|
2179 |
$$templateVars{'origRole1'} = $FORM::origRole1; |
|
2164 |
|
|
2165 |
$$templateVars{'aoCount'} = $FORM::aoCount; |
|
2166 |
foreach my $origName (param()) { |
|
2167 |
if ($origName =~ /origNamefirst/) { |
|
2168 |
my $origNameIndex = $origName; |
|
2169 |
$origNameIndex =~ s/origNamefirst//; # get the index of the parameter 0, ..., 10 |
|
2170 |
my $origNamelast = "origNamelast".$origNameIndex; |
|
2171 |
my $origRole = "origRole".$origNameIndex; |
|
2172 |
if ( $origNameIndex =~ /[0-9]/ && $origNameIndex > 0){ |
|
2173 |
if (hasContent(param($origName)) && hasContent(param($origNamelast)) && hasContent(param($origRole))) { |
|
2174 |
debug("Registry processing keyword: $origName = ".param($origName)." $origNamelast = ".param($origNamelast)." $origRole = ".param($origRole)); |
|
2175 |
$$templateVars{$origName} = normalizeCD(param($origName)); |
|
2176 |
$$templateVars{$origNamelast} = normalizeCD(param($origNamelast)); |
|
2177 |
$$templateVars{$origRole} = normalizeCD(param($origRole)); |
|
2178 |
} |
|
2179 |
} |
|
2180 |
} |
|
2180 | 2181 |
} |
2181 |
$$templateVars{'origNamefirst2'} = normalizeCD($FORM::origNamefirst2); |
|
2182 |
$$templateVars{'origNamelast2'} = normalizeCD($FORM::origNamelast2); |
|
2183 |
if($FORM::origNamefirst2 eq "" && $FORM::origNamelast2 eq ""){ |
|
2184 |
$$templateVars{'origRole2'} = ""; |
|
2185 |
}else{ |
|
2186 |
$$templateVars{'origRole2'} = $FORM::origRole2; |
|
2187 |
} |
|
2188 |
$$templateVars{'origNamefirst3'} = normalizeCD($FORM::origNamefirst3); |
|
2189 |
$$templateVars{'origNamelast3'} = normalizeCD($FORM::origNamelast3); |
|
2190 |
if($FORM::origNamefirst3 eq "" && $FORM::origNamelast3 eq ""){ |
|
2191 |
$$templateVars{'origRole3'} = ""; |
|
2192 |
}else{ |
|
2193 |
$$templateVars{'origRole3'} = $FORM::origRole3; |
|
2194 |
} |
|
2195 |
$$templateVars{'origNamefirst4'} = normalizeCD($FORM::origNamefirst4); |
|
2196 |
$$templateVars{'origNamelast4'} = normalizeCD($FORM::origNamelast4); |
|
2197 |
if($FORM::origNamefirst4 eq "" && $FORM::origNamelast4 eq ""){ |
|
2198 |
$$templateVars{'origRole4'} = ""; |
|
2199 |
}else{ |
|
2200 |
$$templateVars{'origRole4'} = $FORM::origRole4; |
|
2201 |
} |
|
2202 |
$$templateVars{'origNamefirst5'} = normalizeCD($FORM::origNamefirst5); |
|
2203 |
$$templateVars{'origNamelast5'} = normalizeCD($FORM::origNamelast5); |
|
2204 |
if($FORM::origNamefirst5 eq "" && $FORM::origNamelast5 eq ""){ |
|
2205 |
$$templateVars{'origRole5'} = ""; |
|
2206 |
}else{ |
|
2207 |
$$templateVars{'origRole5'} = $FORM::origRole5; |
|
2208 |
} |
|
2209 |
$$templateVars{'origNamefirst6'} = normalizeCD($FORM::origNamefirst6); |
|
2210 |
$$templateVars{'origNamelast6'} = normalizeCD($FORM::origNamelast6); |
|
2211 |
if($FORM::origNamefirst6 eq "" && $FORM::origNamelast6 eq ""){ |
|
2212 |
$$templateVars{'origRole6'} = ""; |
|
2213 |
}else{ |
|
2214 |
$$templateVars{'origRole6'} = $FORM::origRole6; |
|
2215 |
} |
|
2216 |
$$templateVars{'origNamefirst7'} = normalizeCD($FORM::origNamefirst7); |
|
2217 |
$$templateVars{'origNamelast7'} = normalizeCD($FORM::origNamelast7); |
|
2218 |
if($FORM::origNamefirst7 eq "" && $FORM::origNamelast7 eq ""){ |
|
2219 |
$$templateVars{'origRole7'} = ""; |
|
2220 |
}else{ |
|
2221 |
$$templateVars{'origRole7'} = $FORM::origRole7; |
|
2222 |
} |
|
2223 |
$$templateVars{'origNamefirst8'} = normalizeCD($FORM::origNamefirst8); |
|
2224 |
$$templateVars{'origNamelast8'} = normalizeCD($FORM::origNamelast8); |
|
2225 |
if($FORM::origNamefirst8 eq "" && $FORM::origNamelast8 eq ""){ |
|
2226 |
$$templateVars{'origRole8'} = ""; |
|
2227 |
}else{ |
|
2228 |
$$templateVars{'origRole8'} = $FORM::origRole8; |
|
2229 |
} |
|
2230 |
$$templateVars{'origNamefirst9'} = normalizeCD($FORM::origNamefirst9); |
|
2231 |
$$templateVars{'origNamelast9'} = normalizeCD($FORM::origNamelast9); |
|
2232 |
if($FORM::origNamefirst9 eq "" && $FORM::origNamelast9 eq ""){ |
|
2233 |
$$templateVars{'origRole9'} = ""; |
|
2234 |
}else{ |
|
2235 |
$$templateVars{'origRole9'} = $FORM::origRole9; |
|
2236 |
} |
|
2237 |
$$templateVars{'origNamefirst10'} = normalizeCD($FORM::origNamefirst10); |
|
2238 |
$$templateVars{'origNamelast10'} = normalizeCD($FORM::origNamelast10); |
|
2239 |
if($FORM::origNamefirst10 eq "" && $FORM::origNamelast10 eq ""){ |
|
2240 |
$$templateVars{'origRole10'} = ""; |
|
2241 |
}else{ |
|
2242 |
$$templateVars{'origRole10'} = $FORM::origRole10; |
|
2243 |
} |
|
2182 |
|
|
2244 | 2183 |
$$templateVars{'abstract'} = normalizeCD($FORM::abstract); |
2245 | 2184 |
$$templateVars{'keyCount'} = $FORM::keyCount; |
2246 | 2185 |
foreach my $kyd (param()) { |
... | ... | |
2413 | 2352 |
$$templateVars{'origPhoneContact'} = $FORM::origPhoneContact; |
2414 | 2353 |
$$templateVars{'origFAXContact'} = $FORM::origFAXContact; |
2415 | 2354 |
$$templateVars{'origEmailContact'} = $FORM::origEmailContact; |
2416 |
$$templateVars{'origNamefirst1'} = $FORM::origNamefirst1; |
|
2417 |
$$templateVars{'origNamelast1'} = $FORM::origNamelast1; |
|
2418 |
$$templateVars{'origRole1'} = $FORM::origRole1; |
|
2419 |
$$templateVars{'origNamefirst2'} = $FORM::origNamefirst2; |
|
2420 |
$$templateVars{'origNamelast2'} = $FORM::origNamelast2; |
|
2421 |
$$templateVars{'origRole2'} = $FORM::origRole2; |
|
2422 |
$$templateVars{'origNamefirst3'} = $FORM::origNamefirst3; |
|
2423 |
$$templateVars{'origNamelast3'} = $FORM::origNamelast3; |
|
2424 |
$$templateVars{'origRole3'} = $FORM::origRole3; |
|
2425 |
$$templateVars{'origNamefirst4'} = $FORM::origNamefirst4; |
|
2426 |
$$templateVars{'origNamelast4'} = $FORM::origNamelast4; |
|
2427 |
$$templateVars{'origRole4'} = $FORM::origRole4; |
|
2428 |
$$templateVars{'origNamefirst5'} = $FORM::origNamefirst5; |
|
2429 |
$$templateVars{'origNamelast5'} = $FORM::origNamelast5; |
|
2430 |
$$templateVars{'origRole5'} = $FORM::origRole5; |
|
2431 |
$$templateVars{'origNamefirst6'} = $FORM::origNamefirst6; |
|
2432 |
$$templateVars{'origNamelast6'} = $FORM::origNamelast6; |
|
2433 |
$$templateVars{'origRole6'} = $FORM::origRole6; |
|
2434 |
$$templateVars{'origNamefirst7'} = $FORM::origNamefirst7; |
|
2435 |
$$templateVars{'origNamelast7'} = $FORM::origNamelast7; |
|
2436 |
$$templateVars{'origRole7'} = $FORM::origRole7; |
|
2437 |
$$templateVars{'origNamefirst8'} = $FORM::origNamefirst8; |
|
2438 |
$$templateVars{'origNamelast8'} = $FORM::origNamelast8; |
|
2439 |
$$templateVars{'origRole8'} = $FORM::origRole8; |
|
2440 |
$$templateVars{'origNamefirst9'} = $FORM::origNamefirst9; |
|
2441 |
$$templateVars{'origNamelast9'} = $FORM::origNamelast9; |
|
2442 |
$$templateVars{'origRole9'} = $FORM::origRole9; |
|
2443 |
$$templateVars{'origNamefirst10'} = $FORM::origNamefirst10; |
|
2444 |
$$templateVars{'origNamelast10'} = $FORM::origNamelast10; |
|
2445 |
$$templateVars{'origRole10'} = $FORM::origRole10; |
|
2355 |
|
|
2356 |
$$templateVars{'aoCount'} = $FORM::aoCount; |
|
2357 |
foreach my $origName (param()) { |
|
2358 |
if ($origName =~ /origNamefirst/) { |
|
2359 |
my $origNameIndex = $origName; |
|
2360 |
$origNameIndex =~ s/origNamefirst//; # get the index of the parameter 0, ..., 10 |
|
2361 |
my $origNamelast = "origNamelast".$origNameIndex; |
|
2362 |
my $origRole = "origRole".$origNameIndex; |
|
2363 |
if ( $origNameIndex =~ /[0-9]/ && $origNameIndex > 0){ |
|
2364 |
if (hasContent(param($origName)) && hasContent(param($origNamelast)) && hasContent(param($origRole))) { |
|
2365 |
debug("Registry processing keyword: $origName = ".param($origName)." $origNamelast = ".param($origNamelast)." $origRole = ".param($origRole)); |
|
2366 |
$$templateVars{$origName} = normalizeCD(param($origName)); |
|
2367 |
$$templateVars{$origNamelast} = normalizeCD(param($origNamelast)); |
|
2368 |
$$templateVars{$origRole} = normalizeCD(param($origRole)); |
|
2369 |
} |
|
2370 |
} |
|
2371 |
} |
|
2372 |
} |
|
2373 |
|
|
2446 | 2374 |
$$templateVars{'abstract'} = $FORM::abstract; |
2447 | 2375 |
$$templateVars{'keyCount'} = $FORM::keyCount; |
2448 | 2376 |
foreach my $kyd (param()) { |
Also available in: Unified diff
Made changes to fix 1301. Works fine with eml2 - need to check if works with emlbeta6.