Revision 5201
Added by daigle over 14 years ago
Metacat.pm | ||
---|---|---|
379 | 379 |
); |
380 | 380 |
|
381 | 381 |
my $response = $self->sendData(%postData); |
382 |
if (($response) && $response->content =~ /<docid>(.*)<\/docid>/s) { |
|
382 |
if (($response) && $response->content =~ /<docid>(.*)<\/docid>/s) {
|
|
383 | 383 |
$returnval = "$1"; |
384 | 384 |
} elsif (($response)) { |
385 | 385 |
$returnval = 0; |
... | ... | |
392 | 392 |
|
393 | 393 |
return $returnval; |
394 | 394 |
} |
395 |
|
|
395 | 396 |
############################################################# |
397 |
# subroutine to get the maximimum id in a series |
|
398 |
# If success, return max id, else return 0 |
|
399 |
############################################################# |
|
400 |
sub getLastRevision { |
|
401 |
my $self = shift; |
|
402 |
my $docid = shift; |
|
403 |
|
|
404 |
my $returnval = 0; |
|
405 |
|
|
406 |
my %postData = ( action => 'getrevisionanddoctype', |
|
407 |
docid => $docid |
|
408 |
); |
|
409 |
|
|
410 |
my $response = $self->sendData(%postData); |
|
411 |
if (($response) && $response->content =~ /(.*);(.*)/s) { |
|
412 |
$returnval = "$1"; |
|
413 |
} elsif (($response)) { |
|
414 |
$returnval = 0; |
|
415 |
#print "Error response from sendData!\n"; |
|
416 |
#print $response->content, "\n"; |
|
417 |
} else { |
|
418 |
$returnval = 0; |
|
419 |
#print "Invalid response from sendData!\n"; |
|
420 |
} |
|
421 |
|
|
422 |
return $returnval; |
|
423 |
} |
|
424 |
|
|
425 |
############################################################# |
|
396 | 426 |
# subroutine to get the message returned from the last executed |
397 | 427 |
# metacat action. These are generally XML formatted messages. |
398 | 428 |
############################################################# |
Also available in: Unified diff
Get the latest revision from metacat when a modify call docid does not have a revision number.