Revision 4754
Added by walbridge almost 16 years ago
src/perl/register-dataset.cgi | ||
---|---|---|
142 | 142 |
my $adminPassword = $config->{'password'}; |
143 | 143 |
|
144 | 144 |
# contains sender, recipient, admin, mailhost |
145 |
my $email = $skinProperties->splitToTree(qr/\./, 'email'); |
|
145 |
my $skinEmail = $skinProperties->splitToTree(qr/\./, 'email'); |
|
146 |
my $email = $properties->splitToTree(qr/\./, 'email'); |
|
146 | 147 |
|
147 |
#Convert the lat and lon configs into usable data structures |
|
148 |
# override email properties with skin-based ones |
|
149 |
my @emailData = keys(%$email); |
|
150 |
foreach my $d (@emailData) { |
|
151 |
if (%$skinEmail->{$d}) { |
|
152 |
$email->{$d} = %$skinEmail->{$d}; |
|
153 |
} |
|
154 |
} |
|
155 |
|
|
156 |
# convert the lat and lon configs into usable data structures |
|
148 | 157 |
my @sitelist; |
149 | 158 |
my %siteLatDMS; |
150 | 159 |
my %siteLongDMS; |
... | ... | |
198 | 207 |
$$templateVars{'message'} = 'You must login to view your submissions.'; |
199 | 208 |
} |
200 | 209 |
|
201 |
if ($session->is_empty) { |
|
202 |
# no session found ... redirect to login page template |
|
203 |
$template->process($templates->{'login'}, $templateVars); |
|
204 |
} else { |
|
210 |
if (!$session->is_empty) { |
|
205 | 211 |
# session found ... delete the session.... |
206 | 212 |
$session->delete(); |
207 |
$template->process($templates->{'login'}, $templateVars); |
|
208 | 213 |
} |
214 |
|
|
215 |
$template->process($templates->{'login'}, $templateVars); |
|
209 | 216 |
exit(); |
210 | 217 |
} elsif ($FORM::stage =~ "logout") { |
211 | 218 |
handleLogoutRequest(); |
... | ... | |
301 | 308 |
# no session found ... redirect to login page template |
302 | 309 |
$$templateVars{'showInstructions'} = 'true'; |
303 | 310 |
$$templateVars{'message'} = 'You must login to register your dataset.'; |
304 |
debug($templates->{'login'}); |
|
305 | 311 |
$template->process($templates->{'login'}, $templateVars); |
306 | 312 |
} else { |
307 | 313 |
|
... | ... | |
1940 | 1946 |
$results = $stylesheet->transform($xmldoc); |
1941 | 1947 |
# if debugging is enabled, dump the transformed document to disk |
1942 | 1948 |
debugDoc($stylesheet->output_string($results)); |
1949 |
|
|
1943 | 1950 |
return $results; |
1944 | 1951 |
} |
1945 | 1952 |
|
... | ... | |
2661 | 2668 |
dontOccur($doc, "//software", "software"); |
2662 | 2669 |
dontOccur($doc, "//protocol", "protocol"); |
2663 | 2670 |
$results = $doc->findnodes( |
2664 |
'//additionalMetadata/moderatorComment'); |
|
2671 |
'//additionalMetadata/metadata/moderatorComment');
|
|
2665 | 2672 |
if ($results->size == 0) { |
2666 | 2673 |
dontOccur($doc, "//additionalMetadata", "additionalMetadata"); |
2667 | 2674 |
} |
... | ... | |
3063 | 3070 |
my $newDocid = incrementRevision($docid); |
3064 | 3071 |
|
3065 | 3072 |
$emldoc =~ s/packageId=\"$docid\"/packageId=\"$newDocid\"/; |
3073 |
debugDoc($emldoc); |
|
3066 | 3074 |
$response = $metacat->update($docid, $emldoc); |
3067 | 3075 |
|
3068 | 3076 |
if (! $response) { |
... | ... | |
3296 | 3304 |
$response = $metacat->read($docid); |
3297 | 3305 |
my $doc = $response->content(); |
3298 | 3306 |
my $xmldoc = $parser->parse_string($doc); |
3299 |
|
|
3307 |
|
|
3300 | 3308 |
if ($xmldoc eq "" || $doc=~ /<error/) { |
3301 | 3309 |
# not able to parse |
3302 | 3310 |
$errorMessage = $errorMessage." Error in reading the docid:".$docid; |
3303 | 3311 |
} else { |
3312 |
$xmldoc = transformEml($xmldoc); |
|
3304 | 3313 |
my $findNodes = $xmldoc->findnodes('//dataset/contact'); |
3305 | 3314 |
if ($findNodes->size() > 0) { |
3306 | 3315 |
# found contact email address |
... | ... | |
3353 | 3362 |
my $accessElem = ''; |
3354 | 3363 |
|
3355 | 3364 |
# pull out existing dataset entry |
3356 |
my $results = $doc->findnodes('//dataset'); |
|
3365 |
my $results = $xmldoc->findnodes('//dataset');
|
|
3357 | 3366 |
foreach my $r ($results->get_nodelist) { |
3358 | 3367 |
$dataElem .= $r->toString(); |
3359 | 3368 |
} |
3360 | 3369 |
# also grab the access element |
3361 |
$results = $doc->findnodes('//access'); |
|
3370 |
$results = $xmldoc->findnodes('//access');
|
|
3362 | 3371 |
foreach my $r ($results->get_nodelist) { |
3363 | 3372 |
$accessElem .= $r->toString(); |
3364 | 3373 |
} |
3365 | 3374 |
|
3366 | 3375 |
my $addlMetadata = qq| |
3367 | 3376 |
<additionalMetadata> |
3368 |
<moderatorComment>Revision Requested</moderatorComment> |
|
3377 |
<metadata> |
|
3378 |
<moderatorComment>Revision Requested</moderatorComment> |
|
3379 |
</metadata> |
|
3369 | 3380 |
</additionalMetadata>|; |
3370 | 3381 |
|
3371 | 3382 |
$emldoc .= EMLStart(); |
... | ... | |
3373 | 3384 |
$emldoc .= $dataElem; |
3374 | 3385 |
$emldoc .= $addlMetadata; |
3375 | 3386 |
$emldoc .= EMLEnd(); |
3376 |
|
|
3377 |
#debug("Document created by handleModAccept is " . $emldoc);
|
|
3387 |
|
|
3388 |
debugDoc($emldoc);
|
|
3378 | 3389 |
# update the document |
3379 | 3390 |
my $newDocid = incrementRevision($docid); |
3380 | 3391 |
|
Also available in: Unified diff
- move moderatorComments into //additionalMetadata/metadata/ as per EML 2.1 (Bug #3679)
- overlay skin-specific email properties on system-level properties (email hostname)