File Coverage

blib/lib/WebService/Kramerius/API4/Item.pm
Criterion Covered Total %
statement 9 29 31.0
branch 0 2 0.0
condition 0 3 0.0
subroutine 3 12 25.0
pod 9 9 100.0
total 21 55 38.1


line stmt bran cond sub pod time code
1             package WebService::Kramerius::API4::Item;
2              
3 2     2   248499 use strict;
  2         3  
  2         57  
4 2     2   6 use warnings;
  2         3  
  2         75  
5              
6 2     2   7 use base qw(WebService::Kramerius::API4::Base);
  2         3  
  2         694  
7              
8             our $VERSION = 0.02;
9              
10             # Get item.
11             sub get_item {
12 0     0 1   my ($self, $item_id) = @_;
13              
14 0           return $self->_get_data($self->{'library_url'}.'search/api/v5.0/item/'.
15             "uuid:$item_id");
16             }
17              
18             sub get_item_children {
19 0     0 1   my ($self, $item_id) = @_;
20              
21 0           return $self->_get_data($self->{'library_url'}.'search/api/v5.0/item/'.
22             "uuid:$item_id/children");
23             }
24              
25             sub get_item_siblings {
26 0     0 1   my ($self, $item_id) = @_;
27              
28 0           return $self->_get_data($self->{'library_url'}.'search/api/v5.0/item/'.
29             "uuid:$item_id/siblings");
30             }
31              
32             sub get_item_streams {
33 0     0 1   my ($self, $item_id) = @_;
34              
35 0           return $self->_get_data($self->{'library_url'}.'search/api/v5.0/item/'.
36             "uuid:$item_id/streams");
37             }
38              
39             sub get_item_streams_one {
40 0     0 1   my ($self, $item_id, $stream_id) = @_;
41              
42             # XXX Hack for bad content type for alto.
43 0 0 0       if ($stream_id eq 'alto' || $stream_id eq 'ALTO') {
44 0           $self->{'_force_content_type'} = 'text/xml';
45             }
46              
47 0           return $self->_get_data($self->{'library_url'}.'search/api/v5.0/item/'.
48             "uuid:$item_id/streams/$stream_id");
49             }
50              
51             sub get_item_image {
52 0     0 1   my ($self, $item_id) = @_;
53              
54 0           return $self->_get_data($self->{'library_url'}.'search/api/v5.0/item/'.
55             "uuid:$item_id/full");
56             }
57              
58             sub get_item_preview {
59 0     0 1   my ($self, $item_id) = @_;
60              
61 0           return $self->_get_data($self->{'library_url'}.'search/api/v5.0/item/'.
62             "uuid:$item_id/preview");
63             }
64              
65             sub get_item_thumb {
66 0     0 1   my ($self, $item_id) = @_;
67              
68 0           return $self->_get_data($self->{'library_url'}.'search/api/v5.0/item/'.
69             "uuid:$item_id/thumb");
70             }
71              
72             sub get_item_foxml {
73 0     0 1   my ($self, $item_id) = @_;
74              
75 0           return $self->_get_data($self->{'library_url'}.'search/api/v5.0/item/'.
76             "uuid:$item_id/foxml");
77             }
78              
79             1;
80              
81             __END__