| 1 | package Catmandu::Importer::WoS; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use Catmandu::Sane; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | 1 | our $VERSION = '0.0303'; | |||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 1 | ▶ | use Moo; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 1 | ▶ | use Catmandu::Util qw(xml_escape); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 1 | ▶ | use namespace::clean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 1 | with 'Catmandu::WoS::SearchRecords'; | |||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 1 | has query => (is => 'ro', required => 1); | |||||||||||||||||||
| 14 | 1 | has edition => (is => 'ro'); | |||||||||||||||||||
| 15 | 1 | has symbolic_timespan => (is => 'ro'); | |||||||||||||||||||
| 16 | 1 | has timespan_begin => (is => 'ro'); | |||||||||||||||||||
| 17 | 1 | has timespan_end => (is => 'ro'); | |||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 0 | ▶ | sub _search_content { | ||||||||||||||||||
|
Subroutine
_search_content: not called CC=5 SCAR=34.0
| |||||||||||||||||||||
| 20 | 0 | my ($self, $start, $limit) = @_; | |||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 0 | my $query = xml_escape($self->query); | |||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 0 | my $edition_xml = ''; | |||||||||||||||||||
| 25 | 0 | my $symbolic_timespan_xml = ''; | |||||||||||||||||||
| 26 | 0 | my $timespan_xml = ''; | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 0 | ▶ | if (my $edition = $self->edition) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 29 | 0 | $edition_xml | |||||||||||||||||||
| 30 | = "<editions><collection>WOS</collection><edition>$edition</edition></editions>"; | ||||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 0 | ▶ | if (my $ts = $self->symbolic_timespan) { | ||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||
| 34 | 0 | $symbolic_timespan_xml = "<symbolicTimeSpan>$ts</symbolicTimeSpan>"; | |||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | ▶ | elsif ($self->timespan_begin && $self->timespan_end) { | |||||||||||||||||||
|
Condition0%0/3
$self->timespan_begin and $self->timespan_end
MC/DC0%0/2
$self->timespan_begin and $self->timespan_end
$self->timespan_begin
$self->timespan_end
Truth table0%0/3
A and B
A= $self->timespan_beginB= $self->timespan_end
| |||||||||||||||||||||
| 37 | 0 | my $tsb = $self->timespan_begin; | |||||||||||||||||||
| 38 | 0 | my $tse = $self->timespan_end; | |||||||||||||||||||
| 39 | 0 | $timespan_xml | |||||||||||||||||||
| 40 | = "<timeSpan><begin>$tsb</begin><end>$tse</end></timeSpan>"; | ||||||||||||||||||||
| 41 | } | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 0 | <<EOF; | |||||||||||||||||||
| 44 | <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" | ||||||||||||||||||||
| 45 | xmlns:woksearch="http://woksearch.v3.wokmws.thomsonreuters.com"> | ||||||||||||||||||||
| 46 | <soapenv:Header/> | ||||||||||||||||||||
| 47 | <soapenv:Body> | ||||||||||||||||||||
| 48 | <woksearch:search> | ||||||||||||||||||||
| 49 | <queryParameters> | ||||||||||||||||||||
| 50 | <databaseId>WOS</databaseId> | ||||||||||||||||||||
| 51 | <userQuery>$query</userQuery> | ||||||||||||||||||||
| 52 | $edition_xml | ||||||||||||||||||||
| 53 | $symbolic_timespan_xml | ||||||||||||||||||||
| 54 | $timespan_xml | ||||||||||||||||||||
| 55 | <queryLanguage>en</queryLanguage> | ||||||||||||||||||||
| 56 | </queryParameters> | ||||||||||||||||||||
| 57 | <retrieveParameters> | ||||||||||||||||||||
| 58 | <firstRecord>$start</firstRecord> | ||||||||||||||||||||
| 59 | <count>$limit</count> | ||||||||||||||||||||
| 60 | <option> | ||||||||||||||||||||
| 61 | <key>RecordIDs</key> | ||||||||||||||||||||
| 62 | <value>On</value> | ||||||||||||||||||||
| 63 | </option> | ||||||||||||||||||||
| 64 | <option> | ||||||||||||||||||||
| 65 | <key>targetNamespace</key> | ||||||||||||||||||||
| 66 | <value>http://scientific.thomsonreuters.com/schema/wok5.4/public/FullRecord</value> | ||||||||||||||||||||
| 67 | </option> | ||||||||||||||||||||
| 68 | </retrieveParameters> | ||||||||||||||||||||
| 69 | </woksearch:search> | ||||||||||||||||||||
| 70 | </soapenv:Body> | ||||||||||||||||||||
| 71 | </soapenv:Envelope> | ||||||||||||||||||||
| 72 | EOF | ||||||||||||||||||||
| 73 | } | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 0 | ▶ | sub _search_response_type { | ||||||||||||||||||
|
Subroutine
_search_response_type: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 76 | 0 | 'searchResponse'; | |||||||||||||||||||
| 77 | } | ||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | 1 | 1; | |||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | __END__ | ||||||||||||||||||||