| 1 | package Catmandu::WoS::SearchRecords; | ||
| 2 | |||
| 3 | 4 | ▶ | use Catmandu::Sane; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 4 | our $VERSION = '0.0303'; | |
| 6 | |||
| 7 | 4 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 4 | ▶ | use Catmandu::Util qw(xml_escape); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 4 | ▶ | use XML::LibXML::Simple qw(XMLin); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 4 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 4 | with 'Catmandu::WoS::SearchBase'; | |
| 13 | |||
| 14 | 0 | ▶ | sub _retrieve_content { |
|
Subroutine
_retrieve_content: not called CC=1 SCAR=6.9
| |||
| 15 | 0 | my ($self, $query_id, $start, $limit) = @_; | |
| 16 | |||
| 17 | 0 | $query_id = xml_escape($query_id); | |
| 18 | |||
| 19 | 0 | <<EOF; | |
| 20 | <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> | ||
| 21 | <soap:Body> | ||
| 22 | <ns2:retrieve xmlns:ns2="http://woksearch.v3.wokmws.thomsonreuters.com"> | ||
| 23 | <queryId>$query_id</queryId> | ||
| 24 | <retrieveParameters> | ||
| 25 | <firstRecord>$start</firstRecord> | ||
| 26 | <count>$limit</count> | ||
| 27 | </retrieveParameters> | ||
| 28 | </ns2:retrieve> | ||
| 29 | </soap:Body> | ||
| 30 | </soap:Envelope> | ||
| 31 | EOF | ||
| 32 | } | ||
| 33 | |||
| 34 | 0 | ▶ | sub _retrieve_response_type { |
|
Subroutine
_retrieve_response_type: not called CC=1 SCAR=6.9
| |||
| 35 | 0 | 'retrieveResponse'; | |
| 36 | } | ||
| 37 | |||
| 38 | 0 | ▶ | sub _find_records { |
|
Subroutine
_find_records: not called CC=1 SCAR=6.9
| |||
| 39 | 0 | my ($self, $xpc, $response_type) = @_; | |
| 40 | |||
| 41 | 0 | my $xml = $xpc->findvalue( | |
| 42 | "/soap:Envelope/soap:Body/ns2:$response_type/return/records"); | ||
| 43 | 0 | XMLin($xml, ForceArray => 1)->{REC}; | |
| 44 | } | ||
| 45 | |||
| 46 | 4 | 1; | |