| 1 | # -*- cperl; cperl-indent-level: 4 -*- | ||||||||||||||||||||||||||||||||||||||
| 2 | package WWW::Wookie::Connector::Service v1.1.1; | ||||||||||||||||||||||||||||||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||
| 6 | 5 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 7 | 5 | ▶ | use 5.020000; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||
| 9 | 5 | ▶ | use Exception::Class; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 10 | 5 | ▶ | use HTTP::Headers; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 11 | 5 | ▶ | use HTTP::Request; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 12 | 5 | ▶ | use HTTP::Request::Common; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 13 | 5 | ▶ | use HTTP::Status qw(HTTP_CREATED HTTP_OK HTTP_UNAUTHORIZED HTTP_FORBIDDEN); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 14 | 5 | ▶ | use LWP::UserAgent qw/POST/; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 15 | 5 | ▶ | use Log::Log4perl qw(:easy get_logger); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 16 | 5 | ▶ | use Moose qw/around has with/; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 17 | 5 | ▶ | use Regexp::Common qw(URI); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 18 | 5 | ▶ | use URI::Escape qw(uri_escape); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 19 | 5 | ▶ | use XML::Simple; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 20 | 5 | ▶ | use namespace::autoclean '-except' => 'meta', '-also' => qr/^__/sxm; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||
| 22 | 5 | ▶ | use WWW::Wookie::Connector::Exceptions; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 23 | 5 | ▶ | use WWW::Wookie::Server::Connection; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 24 | 5 | ▶ | use WWW::Wookie::User; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 25 | 5 | ▶ | use WWW::Wookie::Widget; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 26 | 5 | ▶ | use WWW::Wookie::Widget::Category; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 27 | 5 | ▶ | use WWW::Wookie::Widget::Property; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 28 | 5 | ▶ | use WWW::Wookie::Widget::Instance; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 29 | 5 | ▶ | use WWW::Wookie::Widget::Instances; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||
| 31 | 5 | ▶ | use Readonly; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 32 | ## no critic qw(ProhibitCallsToUnexportedSubs) | ||||||||||||||||||||||||||||||||||||||
| 33 | 5 | Readonly::Scalar my $DEFAULT_ICON => | |||||||||||||||||||||||||||||||||||||
| 34 | q{http://www.oss-watch.ac.uk/images/logo2.gif}; | ||||||||||||||||||||||||||||||||||||||
| 35 | 5 | Readonly::Scalar my $TIMEOUT => 15; | |||||||||||||||||||||||||||||||||||||
| 36 | 5 | Readonly::Scalar my $AGENT => q{WWW::Wookie/} | |||||||||||||||||||||||||||||||||||||
| 37 | . $WWW::Wookie::Connector::Service::VERSION; | ||||||||||||||||||||||||||||||||||||||
| 38 | 5 | Readonly::Scalar my $TESTUSER => q{testuser}; | |||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||
| 40 | 5 | Readonly::Scalar my $EMPTY => q{}; | |||||||||||||||||||||||||||||||||||||
| 41 | 5 | Readonly::Scalar my $QUERY => q{?}; | |||||||||||||||||||||||||||||||||||||
| 42 | 5 | Readonly::Scalar my $SLASH => q{/}; | |||||||||||||||||||||||||||||||||||||
| 43 | 5 | Readonly::Scalar my $TRUE => 1; | |||||||||||||||||||||||||||||||||||||
| 44 | 5 | Readonly::Scalar my $FALSE => 0; | |||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||
| 46 | 5 | Readonly::Scalar my $MORE_ARGS => 4; | |||||||||||||||||||||||||||||||||||||
| 47 | 5 | Readonly::Scalar my $MOST_ARGS => 5; | |||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||
| 49 | 5 | Readonly::Scalar my $GET => q{GET}; | |||||||||||||||||||||||||||||||||||||
| 50 | 5 | Readonly::Scalar my $POST => q{POST}; | |||||||||||||||||||||||||||||||||||||
| 51 | 5 | Readonly::Scalar my $DELETE => q{DELETE}; | |||||||||||||||||||||||||||||||||||||
| 52 | 5 | Readonly::Scalar my $PUT => q{PUT}; | |||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||
| 54 | 5 | Readonly::Scalar my $ALL => q{all}; | |||||||||||||||||||||||||||||||||||||
| 55 | 5 | Readonly::Scalar my $PARTICIPANTS => q{participants}; | |||||||||||||||||||||||||||||||||||||
| 56 | 5 | Readonly::Scalar my $PROPERTIES => q{properties}; | |||||||||||||||||||||||||||||||||||||
| 57 | 5 | Readonly::Scalar my $SERVICES => q{services}; | |||||||||||||||||||||||||||||||||||||
| 58 | 5 | Readonly::Scalar my $WIDGETS => q{widgets}; | |||||||||||||||||||||||||||||||||||||
| 59 | 5 | Readonly::Scalar my $WIDGETINSTANCES => q{widgetinstances}; | |||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||
| 61 | 5 | Readonly::Scalar my $DEFAULT_SCHEME => q{http}; | |||||||||||||||||||||||||||||||||||||
| 62 | 5 | Readonly::Scalar my $VALID_SCHEMES => $DEFAULT_SCHEME . q{s?}; # http(s) | |||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||
| 64 | 5 | Readonly::Hash my %LOG => ( | |||||||||||||||||||||||||||||||||||||
| 65 | 'GET_USERS' => q{Getting users for instance of '%s'}, | ||||||||||||||||||||||||||||||||||||||
| 66 | 'USING_URL' => q{Using URL '%s'}, | ||||||||||||||||||||||||||||||||||||||
| 67 | 'RESPONSE_CODE' => q{Got response code %s}, | ||||||||||||||||||||||||||||||||||||||
| 68 | 'DO_REQUEST' => q{Requesting %s '%s'}, | ||||||||||||||||||||||||||||||||||||||
| 69 | 'ALL_TRUE' => q{Requesting all widgets}, | ||||||||||||||||||||||||||||||||||||||
| 70 | ); | ||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||
| 72 | 5 | Readonly::Hash my %ERR => ( | |||||||||||||||||||||||||||||||||||||
| 73 | 'NO_WIDGET_INSTANCE' => q{No Widget instance}, | ||||||||||||||||||||||||||||||||||||||
| 74 | 'NO_PROPERTIES_INSTANCE' => q{No properties instance}, | ||||||||||||||||||||||||||||||||||||||
| 75 | 'NO_USER_OBJECT' => q{No User object}, | ||||||||||||||||||||||||||||||||||||||
| 76 | 'NO_WIDGET_GUID' => q{No GUID nor widget object}, | ||||||||||||||||||||||||||||||||||||||
| 77 | 'MALFORMED_URL' => q{URL for supplied Wookie Server is malformed: %s}, | ||||||||||||||||||||||||||||||||||||||
| 78 | 'INCORRECT_PARTICIPANTS_REST_URL' => | ||||||||||||||||||||||||||||||||||||||
| 79 | q{Participants rest URL is incorrect: %s}, | ||||||||||||||||||||||||||||||||||||||
| 80 | 'INCORRECT_PROPERTIES_REST_URL' => q{Properties rest URL is incorrect: %s}, | ||||||||||||||||||||||||||||||||||||||
| 81 | 'INVALID_API_KEY' => q{Invalid API key}, | ||||||||||||||||||||||||||||||||||||||
| 82 | 'HTTP' => q{%s<br />%s}, | ||||||||||||||||||||||||||||||||||||||
| 83 | ); | ||||||||||||||||||||||||||||||||||||||
| 84 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||
| 86 | ## no critic qw(ProhibitCallsToUnexportedSubs) | ||||||||||||||||||||||||||||||||||||||
| 87 | 5 | Log::Log4perl::easy_init($ERROR); | |||||||||||||||||||||||||||||||||||||
| 88 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||
| 90 | has '_logger' => ( | ||||||||||||||||||||||||||||||||||||||
| 91 | 'is' => 'ro', | ||||||||||||||||||||||||||||||||||||||
| 92 | 'isa' => 'Log::Log4perl::Logger', | ||||||||||||||||||||||||||||||||||||||
| 93 | 'default' => | ||||||||||||||||||||||||||||||||||||||
| 94 | 9 | ▶ | sub { Log::Log4perl->get_logger('WWW::Wookie::Connector::Service') }, | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 95 | 5 | 'reader' => 'getLogger', | |||||||||||||||||||||||||||||||||||||
| 96 | ); | ||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||
| 98 | 5 | has '_conn' => ( | |||||||||||||||||||||||||||||||||||||
| 99 | 'is' => 'rw', | ||||||||||||||||||||||||||||||||||||||
| 100 | 'isa' => 'WWW::Wookie::Server::Connection', | ||||||||||||||||||||||||||||||||||||||
| 101 | 'reader' => 'getConnection', | ||||||||||||||||||||||||||||||||||||||
| 102 | 'writer' => '_setConnection', | ||||||||||||||||||||||||||||||||||||||
| 103 | ); | ||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||
| 105 | 5 | has '_locale' => ( | |||||||||||||||||||||||||||||||||||||
| 106 | 'is' => 'rw', | ||||||||||||||||||||||||||||||||||||||
| 107 | 'isa' => 'Str', | ||||||||||||||||||||||||||||||||||||||
| 108 | 'reader' => 'getLocale', | ||||||||||||||||||||||||||||||||||||||
| 109 | 'writer' => 'setLocale', | ||||||||||||||||||||||||||||||||||||||
| 110 | ); | ||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||
| 112 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 113 | sub getAvailableServices { | ||||||||||||||||||||||||||||||||||||||
| 114 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 115 | 1 | ▶ | my ( $self, $service_name ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
getAvailableServices: called CC=5 SCAR=31.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 116 | 1 | my $url = $self->_append_path($SERVICES); | |||||||||||||||||||||||||||||||||||||
| 117 | 1 | __check_url( $url, $ERR{'MALFORMED_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 118 | 0 | my $content = {}; | |||||||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | if ($service_name) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 120 | 0 | $url .= $SLASH . URI::Escape::uri_escape($service_name); | |||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | if ( $self->getLocale ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 123 | 0 | $content->{'locale'} = $self->getLocale; | |||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||
| 126 | 0 | my %services = (); | |||||||||||||||||||||||||||||||||||||
| 127 | 0 | my $response = $self->_do_request( $url, $content, $GET ); | |||||||||||||||||||||||||||||||||||||
| 128 | 0 | my $xml_obj = XML::Simple->new( | |||||||||||||||||||||||||||||||||||||
| 129 | 'ForceArray' => 1, | ||||||||||||||||||||||||||||||||||||||
| 130 | 'KeyAttr' => { 'widget' => q{id}, 'service' => q{name} }, | ||||||||||||||||||||||||||||||||||||||
| 131 | )->XMLin( $response->content ); | ||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | while ( my ( $name, $value ) = each %{ $xml_obj->{'service'} } ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 133 | 0 | $self->getLogger->debug($name); | |||||||||||||||||||||||||||||||||||||
| 134 | 0 | my $service = WWW::Wookie::Widget::Category->new( 'name' => $name ); | |||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | while ( my ( $id, $value ) = each %{ $value->{'widget'} } ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 136 | 0 | $service->put( | |||||||||||||||||||||||||||||||||||||
| 137 | WWW::Wookie::Widget->new( $id, $self->_parse_widget($value) ) ); | ||||||||||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||||||||
| 139 | 0 | $services{$name} = $service; | |||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||
| 141 | 0 | return values %services; | |||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||||||||
| 144 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 145 | sub getAvailableWidgets { | ||||||||||||||||||||||||||||||||||||||
| 146 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 147 | 1 | ▶ | my ( $self, $service ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
getAvailableWidgets: called CC=6 SCAR=25.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 148 | 1 | my %widgets = (); | |||||||||||||||||||||||||||||||||||||
| 149 | 1 | my $url = $self->_append_path($WIDGETS); | |||||||||||||||||||||||||||||||||||||
| 150 | 1 | my $content = {}; | |||||||||||||||||||||||||||||||||||||
| 151 | 1 | ▶ | if ( !defined $service || $service eq $ALL ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
not defined $service or $service eq $ALL
MC/DC0%0/2
not defined $service or $service eq $ALL
not defined $service
$service eq $ALL
Truth table33%1/3
not(A) or B
A= not defined $serviceB= $service eq $ALL
| |||||||||||||||||||||||||||||||||||||||
| 152 | 1 | $self->getLogger->debug( $LOG{'ALL_TRUE'} ); | |||||||||||||||||||||||||||||||||||||
| 153 | 1 | $content->{'all'} = q{true}; | |||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||
| 155 | elsif ($service) { | ||||||||||||||||||||||||||||||||||||||
| 156 | 0 | $url .= $SLASH . URI::Escape::uri_escape($service); | |||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||
| 158 | 1 | ▶ | if ( $self->getLocale ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 159 | 0 | $content->{'locale'} = $self->getLocale; | |||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||
| 161 | 1 | __check_url( $url, $ERR{'MALFORMED_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||
| 163 | 0 | my $response = $self->_do_request( $url, $content, $GET ); | |||||||||||||||||||||||||||||||||||||
| 164 | 0 | my $xml_obj = | |||||||||||||||||||||||||||||||||||||
| 165 | XML::Simple->new( 'ForceArray' => 1, 'KeyAttr' => 'id' ) | ||||||||||||||||||||||||||||||||||||||
| 166 | ->XMLin( $response->content ); | ||||||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | while ( my ( $id, $value ) = each %{ $xml_obj->{'widget'} } ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 168 | $widgets{$id} = | ||||||||||||||||||||||||||||||||||||||
| 169 | WWW::Wookie::Widget->new( $id, | ||||||||||||||||||||||||||||||||||||||
| 170 | 0 | $self->_parse_widget( $xml_obj->{'widget'}->{$id} ) ); | |||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||
| 172 | 0 | return values %widgets; | |||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||
| 175 | 5 | has '_user' => ( | |||||||||||||||||||||||||||||||||||||
| 176 | 'is' => 'ro', | ||||||||||||||||||||||||||||||||||||||
| 177 | 'isa' => 'WWW::Wookie::User', | ||||||||||||||||||||||||||||||||||||||
| 178 | 'reader' => '_getUser', | ||||||||||||||||||||||||||||||||||||||
| 179 | 'writer' => '_setUser', | ||||||||||||||||||||||||||||||||||||||
| 180 | ); | ||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||
| 182 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 183 | sub getUser { | ||||||||||||||||||||||||||||||||||||||
| 184 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 185 | 1 | ▶ | my ( $self, $userid ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
getUser: called CC=3 SCAR=13.3
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 186 | 1 | ▶ | if ( defined $userid && $userid =~ /$TESTUSER(\d+)/gsmxi ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $userid and $userid =~ /$TESTUSER(\d+)/gimsux
MC/DC0%0/2
defined $userid and $userid =~ /$TESTUSER(\d+)/gimsux
defined $userid
$userid =~ /$TESTUSER(\d+)/gimsux
Truth table33%1/3
A and B
A= defined $useridB= $userid =~ /$TESTUSER(\d+)/gimsux
| |||||||||||||||||||||||||||||||||||||||
| 187 | 0 | return WWW::Wookie::User->new( $userid, qq{Test User $1} ); | |||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||
| 189 | 1 | return $self->_getUser; | |||||||||||||||||||||||||||||||||||||
| 190 | } | ||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||
| 192 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 193 | sub setUser { | ||||||||||||||||||||||||||||||||||||||
| 194 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | my ( $self, $login, $screen ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
setUser: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 196 | 0 | $self->_setUser( WWW::Wookie::User->new( $login, $screen ) ); | |||||||||||||||||||||||||||||||||||||
| 197 | 0 | return; | |||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||
| 200 | has 'WidgetInstances' => ( | ||||||||||||||||||||||||||||||||||||||
| 201 | 'is' => 'rw', | ||||||||||||||||||||||||||||||||||||||
| 202 | 'isa' => 'WWW::Wookie::Widget::Instances', | ||||||||||||||||||||||||||||||||||||||
| 203 | 9 | ▶ | 'default' => sub { WWW::Wookie::Widget::Instances->new() }, | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 204 | 5 | 'writer' => '_setWidgetInstances', | |||||||||||||||||||||||||||||||||||||
| 205 | ); | ||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||
| 207 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 208 | sub getWidget { | ||||||||||||||||||||||||||||||||||||||
| 209 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | my ( $self, $widget_id ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
getWidget: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 211 | my @widgets = | ||||||||||||||||||||||||||||||||||||||
| 212 | 0 | grep { $_->getIdentifier eq $widget_id } $self->getAvailableWidgets; | |||||||||||||||||||||||||||||||||||||
| 213 | 0 | return shift @widgets; | |||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||
| 215 | ## no critic qw(ProhibitCommentedOutCode) | ||||||||||||||||||||||||||||||||||||||
| 216 | # API method isn't implemented using proper id on the server. | ||||||||||||||||||||||||||||||||||||||
| 217 | #my $url = $self->_append_path($WIDGETS); | ||||||||||||||||||||||||||||||||||||||
| 218 | #if ( defined $widget_id ) { | ||||||||||||||||||||||||||||||||||||||
| 219 | # $url .= $SLASH . URI::Escape::uri_escape($widget_id); | ||||||||||||||||||||||||||||||||||||||
| 220 | #} | ||||||||||||||||||||||||||||||||||||||
| 221 | #__check_url($url, $ERR{'MALFORMED_URL'}); | ||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||
| 223 | #my $response = $self->_do_request( $url, {}, $GET ); | ||||||||||||||||||||||||||||||||||||||
| 224 | #my $xs = XML::Simple->new( 'ForceArray' => 1, 'KeyAttr' => 'id' ); | ||||||||||||||||||||||||||||||||||||||
| 225 | #my $xml_obj = $xs->XMLin( $response->content ); | ||||||||||||||||||||||||||||||||||||||
| 226 | #return WWW::Wookie::Widget->new( $widget_id, | ||||||||||||||||||||||||||||||||||||||
| 227 | # $self->_parse_widget($xml_obj) ); | ||||||||||||||||||||||||||||||||||||||
| 228 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 229 | } | ||||||||||||||||||||||||||||||||||||||
| 230 | |||||||||||||||||||||||||||||||||||||||
| 231 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 232 | sub getOrCreateInstance { | ||||||||||||||||||||||||||||||||||||||
| 233 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 234 | 2 | ▶ | my ( $self, $widget_or_guid ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
getOrCreateInstance: called CC=8 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 235 | 2 | my $guid = $widget_or_guid; | |||||||||||||||||||||||||||||||||||||
| 236 | 2 | ▶ | if ( q{WWW::Wookie::Widget} eq ref $widget_or_guid ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 237 | 0 | $guid = $widget_or_guid->getIdentifier; | |||||||||||||||||||||||||||||||||||||
| 238 | } | ||||||||||||||||||||||||||||||||||||||
| 239 | 2 | my $result = eval { | |||||||||||||||||||||||||||||||||||||
| 240 | 2 | ▶ | if ( defined $guid && $guid eq $EMPTY ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $guid and $guid eq $EMPTY
MC/DC50%1/2
defined $guid and $guid eq $EMPTY
defined $guid
$guid eq $EMPTY
Truth table66%2/3
A and B
A= defined $guidB= $guid eq $EMPTY
| |||||||||||||||||||||||||||||||||||||||
| 241 | ## no critic qw(RequireExplicitInclusion) | ||||||||||||||||||||||||||||||||||||||
| 242 | WookieConnectorException->throw( | ||||||||||||||||||||||||||||||||||||||
| 243 | 1 | 'error' => $ERR{'NO_WIDGET_GUID'} ); | |||||||||||||||||||||||||||||||||||||
| 244 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||
| 246 | 1 | my $url = $self->_append_path($WIDGETINSTANCES); | |||||||||||||||||||||||||||||||||||||
| 247 | 1 | __check_url( $url, $ERR{'MALFORMED_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 248 | 0 | my $content = { 'widgetid' => $guid }; | |||||||||||||||||||||||||||||||||||||
| 249 | 0 | ▶ | if ( my $locale = $self->getLocale ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 250 | 0 | $content->{'locale'} = $locale; | |||||||||||||||||||||||||||||||||||||
| 251 | } | ||||||||||||||||||||||||||||||||||||||
| 252 | 0 | my $response = $self->_do_request( $url, $content ); | |||||||||||||||||||||||||||||||||||||
| 253 | 0 | ▶ | if ( $response->code == HTTP_CREATED ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 254 | 0 | $response = $self->_do_request( $url, $content ); | |||||||||||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||
| 257 | 0 | my $instance = $self->_parse_instance( $guid, $response->content ); | |||||||||||||||||||||||||||||||||||||
| 258 | 0 | ▶ | if ($instance) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 259 | 0 | $self->WidgetInstances->put($instance); | |||||||||||||||||||||||||||||||||||||
| 260 | 0 | $self->addParticipant( $instance, $self->getUser ); | |||||||||||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||||||||||||
| 262 | 0 | return $instance; | |||||||||||||||||||||||||||||||||||||
| 263 | }; | ||||||||||||||||||||||||||||||||||||||
| 264 | |||||||||||||||||||||||||||||||||||||||
| 265 | 2 | ▶ | if ( my $e = Exception::Class->caught('WookieConnectorException') ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 266 | 2 | $self->getLogger->error( $e->error ); | |||||||||||||||||||||||||||||||||||||
| 267 | 2 | $e->rethrow; | |||||||||||||||||||||||||||||||||||||
| 268 | 0 | return $FALSE; | |||||||||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||||||||
| 270 | 0 | return $result; | |||||||||||||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||
| 273 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 274 | sub getUsers { | ||||||||||||||||||||||||||||||||||||||
| 275 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 276 | 0 | ▶ | my ( $self, $instance ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
getUsers: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 277 | 0 | ▶ | if ( ref $instance ne q{WWW::Wookie::Widget::Instance} ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 278 | 0 | $instance = $self->getOrCreateInstance($instance); | |||||||||||||||||||||||||||||||||||||
| 279 | } | ||||||||||||||||||||||||||||||||||||||
| 280 | 0 | $self->getLogger->debug( sprintf $LOG{'GET_USERS'}, | |||||||||||||||||||||||||||||||||||||
| 281 | $instance->getIdentifier ); | ||||||||||||||||||||||||||||||||||||||
| 282 | 0 | my $url = $self->_append_path($PARTICIPANTS); | |||||||||||||||||||||||||||||||||||||
| 283 | 0 | $self->getLogger->debug( sprintf $LOG{'USING_URL'}, $url ); | |||||||||||||||||||||||||||||||||||||
| 284 | |||||||||||||||||||||||||||||||||||||||
| 285 | 0 | __check_url( $url, $ERR{'MALFORMED_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 286 | 0 | my $response = | |||||||||||||||||||||||||||||||||||||
| 287 | $self->_do_request( $url, { 'widgetid' => $instance->getIdentifier, }, | ||||||||||||||||||||||||||||||||||||||
| 288 | $GET, ); | ||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||
| 290 | 0 | ▶ | if ( $response->code > HTTP_OK ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 291 | 0 | __throw_http_err($response); | |||||||||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||||||||
| 293 | 0 | my $xml_obj = | |||||||||||||||||||||||||||||||||||||
| 294 | XML::Simple->new( 'ForceArray' => 1, 'KeyAttr' => 'id' ) | ||||||||||||||||||||||||||||||||||||||
| 295 | ->XMLin( $response->content ); | ||||||||||||||||||||||||||||||||||||||
| 296 | 0 | my @users = (); | |||||||||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | while ( my ( $id, $value ) = each %{ $xml_obj->{'participant'} } ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 298 | my $new_user = WWW::Wookie::User->new( | ||||||||||||||||||||||||||||||||||||||
| 299 | $id, | ||||||||||||||||||||||||||||||||||||||
| 300 | defined $value->{'displayName'} || $id, | ||||||||||||||||||||||||||||||||||||||
| 301 | 0 | ▶ | defined $value->{'thumbnail_url'} || $EMPTY, | ||||||||||||||||||||||||||||||||||||
|
Condition0%0/6
defined $value->{'displayName'} || $id
defined $value->{'thumbnail_url'} || $EMPTY
MC/DC0%0/2
defined $value->{'displayName'} || $id
defined $value->{'displayName'}
$id
MC/DC0%0/2
defined $value->{'thumbnail_url'} || $EMPTY
defined $value->{'thumbnail_url'}
$EMPTY
Truth table0%0/3
A || B
A= defined $value->{'displayName'}B= $id
Truth table0%0/3
A || B
A= defined $value->{'thumbnail_url'}B= $EMPTY
| |||||||||||||||||||||||||||||||||||||||
| 302 | ); | ||||||||||||||||||||||||||||||||||||||
| 303 | 0 | push @users, $new_user; | |||||||||||||||||||||||||||||||||||||
| 304 | } | ||||||||||||||||||||||||||||||||||||||
| 305 | 0 | return @users; | |||||||||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||
| 308 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 309 | sub addProperty { | ||||||||||||||||||||||||||||||||||||||
| 310 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 311 | 1 | ▶ | my ( $self, $widget, $property ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
addProperty: called CC=4 SCAR=25.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 312 | 1 | my $url = $self->_append_path($PROPERTIES); | |||||||||||||||||||||||||||||||||||||
| 313 | 1 | __check_url( $url, $ERR{'INCORRECT_PROPERTIES_REST_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 314 | 0 | my $response = $self->_do_request( | |||||||||||||||||||||||||||||||||||||
| 315 | $url, | ||||||||||||||||||||||||||||||||||||||
| 316 | { | ||||||||||||||||||||||||||||||||||||||
| 317 | 'widgetid' => $widget->getIdentifier, | ||||||||||||||||||||||||||||||||||||||
| 318 | 'propertyname' => $property->getName, | ||||||||||||||||||||||||||||||||||||||
| 319 | 'propertyvalue' => $property->getValue, | ||||||||||||||||||||||||||||||||||||||
| 320 | 'is_public' => $property->getIsPublic, | ||||||||||||||||||||||||||||||||||||||
| 321 | }, | ||||||||||||||||||||||||||||||||||||||
| 322 | $POST, | ||||||||||||||||||||||||||||||||||||||
| 323 | ); | ||||||||||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | if ( $response->code == HTTP_OK || $response->code == HTTP_CREATED ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$response->code == 200 or $response->code == 201
MC/DC0%0/2
$response->code == 200 or $response->code == 201
$response->code == 200
$response->code == 201
Truth table0%0/3
A or B
A= $response->code == 200B= $response->code == 201
| |||||||||||||||||||||||||||||||||||||||
| 325 | 0 | return $TRUE; | |||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||
| 327 | elsif ( $response->code > HTTP_CREATED ) { | ||||||||||||||||||||||||||||||||||||||
| 328 | 0 | return $response->content; | |||||||||||||||||||||||||||||||||||||
| 329 | } | ||||||||||||||||||||||||||||||||||||||
| 330 | 0 | return $FALSE; | |||||||||||||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||||||||||||
| 332 | |||||||||||||||||||||||||||||||||||||||
| 333 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 334 | sub getProperty { | ||||||||||||||||||||||||||||||||||||||
| 335 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 336 | 4 | ▶ | my ( $self, $widget_instance, $property_instance ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
getProperty: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 337 | 4 | my $url = $self->_append_path($PROPERTIES); | |||||||||||||||||||||||||||||||||||||
| 338 | 4 | __check_widget($widget_instance); | |||||||||||||||||||||||||||||||||||||
| 339 | 3 | __check_property($property_instance); | |||||||||||||||||||||||||||||||||||||
| 340 | 2 | __check_url( $url, $ERR{'MALFORMED_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 341 | 1 | my $response = $self->_do_request( | |||||||||||||||||||||||||||||||||||||
| 342 | $url, | ||||||||||||||||||||||||||||||||||||||
| 343 | { | ||||||||||||||||||||||||||||||||||||||
| 344 | 'widgetid' => $widget_instance->getIdentifier, | ||||||||||||||||||||||||||||||||||||||
| 345 | 'propertyname' => $property_instance->getName, | ||||||||||||||||||||||||||||||||||||||
| 346 | }, | ||||||||||||||||||||||||||||||||||||||
| 347 | $GET, | ||||||||||||||||||||||||||||||||||||||
| 348 | ); | ||||||||||||||||||||||||||||||||||||||
| 349 | 1 | ▶ | if ( !$response->is_success ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 350 | 1 | __throw_http_err($response); | |||||||||||||||||||||||||||||||||||||
| 351 | 0 | return $FALSE; | |||||||||||||||||||||||||||||||||||||
| 352 | } | ||||||||||||||||||||||||||||||||||||||
| 353 | 0 | return WWW::Wookie::Widget::Property->new( $property_instance->getName, | |||||||||||||||||||||||||||||||||||||
| 354 | $response->content ); | ||||||||||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||||||||||||
| 358 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 359 | sub setProperty { | ||||||||||||||||||||||||||||||||||||||
| 360 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 361 | 3 | ▶ | my ( $self, $widget, $property ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
setProperty: called CC=5 SCAR=20.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 362 | 3 | my $url = $self->_append_path($PROPERTIES); | |||||||||||||||||||||||||||||||||||||
| 363 | 3 | my $result = eval { | |||||||||||||||||||||||||||||||||||||
| 364 | 3 | __check_widget($widget); | |||||||||||||||||||||||||||||||||||||
| 365 | 2 | __check_property($property); | |||||||||||||||||||||||||||||||||||||
| 366 | 1 | __check_url( $url, $ERR{'INCORRECT_PROPERTIES_REST_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 367 | 0 | my $response = $self->_do_request( | |||||||||||||||||||||||||||||||||||||
| 368 | $url, | ||||||||||||||||||||||||||||||||||||||
| 369 | { | ||||||||||||||||||||||||||||||||||||||
| 370 | 'widgetid' => $widget->getIdentifier, | ||||||||||||||||||||||||||||||||||||||
| 371 | 'propertyname' => $property->getName, | ||||||||||||||||||||||||||||||||||||||
| 372 | 'propertyvalue' => $property->getValue, | ||||||||||||||||||||||||||||||||||||||
| 373 | 'is_public' => $property->getIsPublic, | ||||||||||||||||||||||||||||||||||||||
| 374 | }, | ||||||||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||||||||
| 376 | ## no critic qw(ProhibitFlagComments) | ||||||||||||||||||||||||||||||||||||||
| 377 | # TODO: $PUT breaks, but should be used instead of $POST | ||||||||||||||||||||||||||||||||||||||
| 378 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 379 | $POST, | ||||||||||||||||||||||||||||||||||||||
| 380 | ); | ||||||||||||||||||||||||||||||||||||||
| 381 | 0 | ▶ | if ( $response->code == HTTP_CREATED || $response == HTTP_OK ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$response->code == 201 or $response == 200
MC/DC0%0/2
$response->code == 201 or $response == 200
$response->code == 201
$response == 200
Truth table0%0/3
A or B
A= $response->code == 201B= $response == 200
| |||||||||||||||||||||||||||||||||||||||
| 382 | 0 | return $property; | |||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||
| 384 | else { | ||||||||||||||||||||||||||||||||||||||
| 385 | 0 | __throw_http_err($response); | |||||||||||||||||||||||||||||||||||||
| 386 | } | ||||||||||||||||||||||||||||||||||||||
| 387 | }; | ||||||||||||||||||||||||||||||||||||||
| 388 | 3 | ▶ | if ( my $e = Exception::Class->caught('WookieConnectorException') ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 389 | 2 | $self->getLogger->error( $e->error ); | |||||||||||||||||||||||||||||||||||||
| 390 | 2 | $e->rethrow; | |||||||||||||||||||||||||||||||||||||
| 391 | 0 | return $FALSE; | |||||||||||||||||||||||||||||||||||||
| 392 | } | ||||||||||||||||||||||||||||||||||||||
| 393 | 1 | ▶ | if ( my $e = Exception::Class->caught('WookieWidgetInstanceException') ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 394 | 1 | $self->getLogger->error( $e->error ); | |||||||||||||||||||||||||||||||||||||
| 395 | 1 | $e->rethrow; | |||||||||||||||||||||||||||||||||||||
| 396 | 0 | return $FALSE; | |||||||||||||||||||||||||||||||||||||
| 397 | } | ||||||||||||||||||||||||||||||||||||||
| 398 | 0 | return $result; | |||||||||||||||||||||||||||||||||||||
| 399 | } | ||||||||||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||||||||||
| 401 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 402 | sub deleteProperty { | ||||||||||||||||||||||||||||||||||||||
| 403 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 404 | 3 | ▶ | my ( $self, $widget, $property ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
deleteProperty: called CC=2 SCAR=9.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 405 | 3 | my $url = $self->_append_path($PROPERTIES); | |||||||||||||||||||||||||||||||||||||
| 406 | 3 | __check_url( $url, $ERR{'INCORRECT_PROPERTIES_REST_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 407 | 2 | __check_widget($widget); | |||||||||||||||||||||||||||||||||||||
| 408 | 1 | __check_property($property); | |||||||||||||||||||||||||||||||||||||
| 409 | 0 | my $response = $self->_do_request( | |||||||||||||||||||||||||||||||||||||
| 410 | $url, | ||||||||||||||||||||||||||||||||||||||
| 411 | { | ||||||||||||||||||||||||||||||||||||||
| 412 | 'widgetid' => $widget->getIdentifier, | ||||||||||||||||||||||||||||||||||||||
| 413 | 'propertyname' => $property->getName, | ||||||||||||||||||||||||||||||||||||||
| 414 | }, | ||||||||||||||||||||||||||||||||||||||
| 415 | $DELETE, | ||||||||||||||||||||||||||||||||||||||
| 416 | ); | ||||||||||||||||||||||||||||||||||||||
| 417 | 0 | ▶ | if ( $response->code == HTTP_OK ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 418 | 0 | return $TRUE; | |||||||||||||||||||||||||||||||||||||
| 419 | } | ||||||||||||||||||||||||||||||||||||||
| 420 | 0 | return $FALSE; | |||||||||||||||||||||||||||||||||||||
| 421 | } | ||||||||||||||||||||||||||||||||||||||
| 422 | |||||||||||||||||||||||||||||||||||||||
| 423 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 424 | sub addParticipant { | ||||||||||||||||||||||||||||||||||||||
| 425 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 426 | 2 | ▶ | my ( $self, $widget_instance, $user ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
addParticipant: called CC=4 SCAR=23.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 427 | 2 | __check_widget($widget_instance); | |||||||||||||||||||||||||||||||||||||
| 428 | 1 | my $url = $self->_append_path($PARTICIPANTS); | |||||||||||||||||||||||||||||||||||||
| 429 | 1 | __check_url( $url, $ERR{'INCORRECT_PARTICIPANTS_REST_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 430 | 0 | my $response = $self->_do_request( | |||||||||||||||||||||||||||||||||||||
| 431 | $url, | ||||||||||||||||||||||||||||||||||||||
| 432 | { | ||||||||||||||||||||||||||||||||||||||
| 433 | 'widgetid' => $widget_instance->getIdentifier, | ||||||||||||||||||||||||||||||||||||||
| 434 | 'participant_id' => $self->getUser->getLoginName, | ||||||||||||||||||||||||||||||||||||||
| 435 | 'participant_display_name' => $user->getScreenName, | ||||||||||||||||||||||||||||||||||||||
| 436 | 'participant_thumbnail_url' => $user->getThumbnailUrl, | ||||||||||||||||||||||||||||||||||||||
| 437 | }, | ||||||||||||||||||||||||||||||||||||||
| 438 | ); | ||||||||||||||||||||||||||||||||||||||
| 439 | 0 | ▶ | if ( $response->code == HTTP_OK ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||
| 440 | 0 | return $TRUE; | |||||||||||||||||||||||||||||||||||||
| 441 | } | ||||||||||||||||||||||||||||||||||||||
| 442 | elsif ( $response->code == HTTP_CREATED ) { | ||||||||||||||||||||||||||||||||||||||
| 443 | 0 | return $TRUE; | |||||||||||||||||||||||||||||||||||||
| 444 | } | ||||||||||||||||||||||||||||||||||||||
| 445 | elsif ( $response->code > HTTP_CREATED ) { | ||||||||||||||||||||||||||||||||||||||
| 446 | 0 | return $response->content; | |||||||||||||||||||||||||||||||||||||
| 447 | } | ||||||||||||||||||||||||||||||||||||||
| 448 | 0 | return $FALSE; | |||||||||||||||||||||||||||||||||||||
| 449 | } | ||||||||||||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||||||||||||
| 451 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 452 | sub deleteParticipant { | ||||||||||||||||||||||||||||||||||||||
| 453 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 454 | 2 | ▶ | my ( $self, $widget, $user ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
deleteParticipant: called CC=4 SCAR=23.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 455 | 2 | __check_widget($widget); | |||||||||||||||||||||||||||||||||||||
| 456 | 1 | my $url = $self->_append_path($PARTICIPANTS); | |||||||||||||||||||||||||||||||||||||
| 457 | 1 | __check_url( $url, $ERR{'INCORRECT_PARTICIPANTS_REST_URL'} ); | |||||||||||||||||||||||||||||||||||||
| 458 | 0 | my $response = $self->_do_request( | |||||||||||||||||||||||||||||||||||||
| 459 | $url, | ||||||||||||||||||||||||||||||||||||||
| 460 | { | ||||||||||||||||||||||||||||||||||||||
| 461 | 'widgetid' => $widget->getIdentifier, | ||||||||||||||||||||||||||||||||||||||
| 462 | 'participant_id' => $self->getUser->getLoginName, | ||||||||||||||||||||||||||||||||||||||
| 463 | 'participant_display_name' => $user->getScreenName, | ||||||||||||||||||||||||||||||||||||||
| 464 | 'participant_thumbnail_url' => $user->getThumbnailUrl, | ||||||||||||||||||||||||||||||||||||||
| 465 | }, | ||||||||||||||||||||||||||||||||||||||
| 466 | $DELETE, | ||||||||||||||||||||||||||||||||||||||
| 467 | ); | ||||||||||||||||||||||||||||||||||||||
| 468 | 0 | ▶ | if ( $response->code == HTTP_OK ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||
| 469 | 0 | return $TRUE; | |||||||||||||||||||||||||||||||||||||
| 470 | } | ||||||||||||||||||||||||||||||||||||||
| 471 | elsif ( $response->code == HTTP_CREATED ) { | ||||||||||||||||||||||||||||||||||||||
| 472 | 0 | return $TRUE; | |||||||||||||||||||||||||||||||||||||
| 473 | } | ||||||||||||||||||||||||||||||||||||||
| 474 | elsif ( $response->code > HTTP_CREATED ) { | ||||||||||||||||||||||||||||||||||||||
| 475 | 0 | __throw_http_err($response); | |||||||||||||||||||||||||||||||||||||
| 476 | } | ||||||||||||||||||||||||||||||||||||||
| 477 | 0 | return $FALSE; | |||||||||||||||||||||||||||||||||||||
| 478 | } | ||||||||||||||||||||||||||||||||||||||
| 479 | |||||||||||||||||||||||||||||||||||||||
| 480 | ## no critic qw(Capitalization) | ||||||||||||||||||||||||||||||||||||||
| 481 | sub _setWidgetInstancesHolder { | ||||||||||||||||||||||||||||||||||||||
| 482 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 483 | 9 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
_setWidgetInstancesHolder: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 484 | 9 | $self->_setWidgetInstances( WWW::Wookie::Widget::Instances->new ); | |||||||||||||||||||||||||||||||||||||
| 485 | 9 | return; | |||||||||||||||||||||||||||||||||||||
| 486 | } | ||||||||||||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||||||||||||
| 488 | has '_ua' => ( | ||||||||||||||||||||||||||||||||||||||
| 489 | 'is' => 'rw', | ||||||||||||||||||||||||||||||||||||||
| 490 | 'isa' => 'LWP::UserAgent', | ||||||||||||||||||||||||||||||||||||||
| 491 | 'default' => sub { | ||||||||||||||||||||||||||||||||||||||
| 492 | 9 | ▶ | LWP::UserAgent->new( | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 493 | 'timeout' => $TIMEOUT, | ||||||||||||||||||||||||||||||||||||||
| 494 | 'agent' => $AGENT, | ||||||||||||||||||||||||||||||||||||||
| 495 | ); | ||||||||||||||||||||||||||||||||||||||
| 496 | }, | ||||||||||||||||||||||||||||||||||||||
| 497 | 5 | ); | |||||||||||||||||||||||||||||||||||||
| 498 | |||||||||||||||||||||||||||||||||||||||
| 499 | around 'BUILDARGS' => sub { | ||||||||||||||||||||||||||||||||||||||
| 500 | 9 | ▶ | my $orig = shift; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=4 SCAR=14.2
| |||||||||||||||||||||||||||||||||||||||
| 501 | 9 | my $class = shift; | |||||||||||||||||||||||||||||||||||||
| 502 | |||||||||||||||||||||||||||||||||||||||
| 503 | 9 | ▶ | if ( @_ == $MORE_ARGS ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 504 | 0 | push @_, $EMPTY; | |||||||||||||||||||||||||||||||||||||
| 505 | } | ||||||||||||||||||||||||||||||||||||||
| 506 | 9 | ▶ | if ( @_ == $MOST_ARGS && !ref $_[0] ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
@_ == $MOST_ARGS and not ref $_[0]
MC/DC50%1/2
@_ == $MOST_ARGS and not ref $_[0]
@_ == $MOST_ARGS
not ref $_[0]
Truth table66%2/3
A and not(B)
A= @_ == $MOST_ARGSB= not ref $_[0]
| |||||||||||||||||||||||||||||||||||||||
| 507 | 7 | my ( $url, $api_key, $shareddata_key, $loginname, $screenname ) = @_; | |||||||||||||||||||||||||||||||||||||
| 508 | 7 | return $class->$orig( | |||||||||||||||||||||||||||||||||||||
| 509 | '_user' => WWW::Wookie::User->new( $loginname, $screenname ), | ||||||||||||||||||||||||||||||||||||||
| 510 | '_conn' => WWW::Wookie::Server::Connection->new( | ||||||||||||||||||||||||||||||||||||||
| 511 | $url, $api_key, $shareddata_key, | ||||||||||||||||||||||||||||||||||||||
| 512 | ), | ||||||||||||||||||||||||||||||||||||||
| 513 | ); | ||||||||||||||||||||||||||||||||||||||
| 514 | } | ||||||||||||||||||||||||||||||||||||||
| 515 | 2 | return $class->$orig(@_); | |||||||||||||||||||||||||||||||||||||
| 516 | 5 | }; | |||||||||||||||||||||||||||||||||||||
| 517 | |||||||||||||||||||||||||||||||||||||||
| 518 | sub BUILD { | ||||||||||||||||||||||||||||||||||||||
| 519 | 9 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BUILD: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||
| 520 | 9 | $self->_setWidgetInstancesHolder; | |||||||||||||||||||||||||||||||||||||
| 521 | 9 | return; | |||||||||||||||||||||||||||||||||||||
| 522 | } | ||||||||||||||||||||||||||||||||||||||
| 523 | |||||||||||||||||||||||||||||||||||||||
| 524 | sub _append_path { | ||||||||||||||||||||||||||||||||||||||
| 525 | 16 | ▶ | my ( $self, $path ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
_append_path: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 526 | 16 | return $self->getConnection->getURL . URI::Escape::uri_escape($path); | |||||||||||||||||||||||||||||||||||||
| 527 | } | ||||||||||||||||||||||||||||||||||||||
| 528 | |||||||||||||||||||||||||||||||||||||||
| 529 | sub __check_url { | ||||||||||||||||||||||||||||||||||||||
| 530 | 12 | ▶ | my ( $url, $message ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__check_url: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||
| 531 | 12 | ▶ | if ( $url !~ m{^$RE{URI}{HTTP}{-keep}{ '-scheme' => $VALID_SCHEMES }$}smx ) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 532 | { | ||||||||||||||||||||||||||||||||||||||
| 533 | ## no critic qw(RequireExplicitInclusion) | ||||||||||||||||||||||||||||||||||||||
| 534 | 9 | WookieConnectorException->throw( 'error' => sprintf $message, $url ); | |||||||||||||||||||||||||||||||||||||
| 535 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 536 | } | ||||||||||||||||||||||||||||||||||||||
| 537 | 3 | return; | |||||||||||||||||||||||||||||||||||||
| 538 | } | ||||||||||||||||||||||||||||||||||||||
| 539 | |||||||||||||||||||||||||||||||||||||||
| 540 | sub __check_widget { | ||||||||||||||||||||||||||||||||||||||
| 541 | 13 | ▶ | my ($ref) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__check_widget: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||
| 542 | 13 | ▶ | if ( ref $ref ne q{WWW::Wookie::Widget::Instance} ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 543 | ## no critic qw(RequireExplicitInclusion) | ||||||||||||||||||||||||||||||||||||||
| 544 | WookieWidgetInstanceException->throw( | ||||||||||||||||||||||||||||||||||||||
| 545 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 546 | 5 | 'error' => $ERR{'NO_WIDGET_INSTANCE'}, | |||||||||||||||||||||||||||||||||||||
| 547 | ); | ||||||||||||||||||||||||||||||||||||||
| 548 | } | ||||||||||||||||||||||||||||||||||||||
| 549 | 8 | return; | |||||||||||||||||||||||||||||||||||||
| 550 | } | ||||||||||||||||||||||||||||||||||||||
| 551 | |||||||||||||||||||||||||||||||||||||||
| 552 | sub __check_property { | ||||||||||||||||||||||||||||||||||||||
| 553 | 6 | ▶ | my ($ref) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__check_property: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||
| 554 | 6 | ▶ | if ( ref $ref ne q{WWW::Wookie::Widget::Property} ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 555 | ## no critic qw(RequireExplicitInclusion) | ||||||||||||||||||||||||||||||||||||||
| 556 | WookieConnectorException->throw( | ||||||||||||||||||||||||||||||||||||||
| 557 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 558 | 3 | 'error' => $ERR{'NO_PROPERTIES_INSTANCE'}, | |||||||||||||||||||||||||||||||||||||
| 559 | ); | ||||||||||||||||||||||||||||||||||||||
| 560 | } | ||||||||||||||||||||||||||||||||||||||
| 561 | 3 | return; | |||||||||||||||||||||||||||||||||||||
| 562 | } | ||||||||||||||||||||||||||||||||||||||
| 563 | |||||||||||||||||||||||||||||||||||||||
| 564 | sub __throw_http_err { | ||||||||||||||||||||||||||||||||||||||
| 565 | 1 | ▶ | my ($response) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__throw_http_err: called CC=1 SCAR=0.4
| |||||||||||||||||||||||||||||||||||||||
| 566 | ## no critic qw(RequireExplicitInclusion) | ||||||||||||||||||||||||||||||||||||||
| 567 | WookieConnectorException->throw( | ||||||||||||||||||||||||||||||||||||||
| 568 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 569 | 1 | 'error' => sprintf $ERR{'HTTP'}, | |||||||||||||||||||||||||||||||||||||
| 570 | $response->headers->as_string, $response->content, | ||||||||||||||||||||||||||||||||||||||
| 571 | ); | ||||||||||||||||||||||||||||||||||||||
| 572 | 0 | return; | |||||||||||||||||||||||||||||||||||||
| 573 | } | ||||||||||||||||||||||||||||||||||||||
| 574 | |||||||||||||||||||||||||||||||||||||||
| 575 | sub _do_request { | ||||||||||||||||||||||||||||||||||||||
| 576 | 1 | ▶ | my ( $self, $url, $payload, $method ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
_do_request: called CC=6 SCAR=19.4
| |||||||||||||||||||||||||||||||||||||||
| 577 | |||||||||||||||||||||||||||||||||||||||
| 578 | # Widgets and Services request doesn't require API key stuff: | ||||||||||||||||||||||||||||||||||||||
| 579 | 1 | ▶ | if ( $url !~ m{/(?:widgets|services)(?:[?/]|$)}gismx ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 580 | $payload = { | ||||||||||||||||||||||||||||||||||||||
| 581 | 'api_key' => $self->getConnection->getApiKey, | ||||||||||||||||||||||||||||||||||||||
| 582 | 'shareddatakey' => $self->getConnection->getSharedDataKey, | ||||||||||||||||||||||||||||||||||||||
| 583 | 'userid' => $self->getUser->getLoginName, | ||||||||||||||||||||||||||||||||||||||
| 584 | 1 | %{$payload}, | |||||||||||||||||||||||||||||||||||||
| 585 | }; | ||||||||||||||||||||||||||||||||||||||
| 586 | } | ||||||||||||||||||||||||||||||||||||||
| 587 | 1 | ▶ | if ( !defined $method ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 588 | 0 | $method = $POST; | |||||||||||||||||||||||||||||||||||||
| 589 | } | ||||||||||||||||||||||||||||||||||||||
| 590 | |||||||||||||||||||||||||||||||||||||||
| 591 | 1 | ▶ | if ( ( my $content = [ POST $url, [ %{$payload} ] ]->[0]->content ) ne | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 592 | $EMPTY ) | ||||||||||||||||||||||||||||||||||||||
| 593 | { | ||||||||||||||||||||||||||||||||||||||
| 594 | 1 | $url .= $QUERY . $content; | |||||||||||||||||||||||||||||||||||||
| 595 | } | ||||||||||||||||||||||||||||||||||||||
| 596 | 1 | $self->getLogger->debug( sprintf $LOG{'DO_REQUEST'}, $method, $url ); | |||||||||||||||||||||||||||||||||||||
| 597 | 1 | my $request = HTTP::Request->new( | |||||||||||||||||||||||||||||||||||||
| 598 | $method => $url, | ||||||||||||||||||||||||||||||||||||||
| 599 | HTTP::Headers->new(), | ||||||||||||||||||||||||||||||||||||||
| 600 | ); | ||||||||||||||||||||||||||||||||||||||
| 601 | 1 | my $response = $self->_ua->request($request); | |||||||||||||||||||||||||||||||||||||
| 602 | 1 | $self->getLogger->debug( sprintf $LOG{'RESPONSE_CODE'}, $response->code ); | |||||||||||||||||||||||||||||||||||||
| 603 | 1 | ▶ | if ( $response->code == HTTP_UNAUTHORIZED | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$response->code == 401 or $response->code == 403
MC/DC0%0/2
$response->code == 401 or $response->code == 403
$response->code == 401
$response->code == 403
Truth table33%1/3
A or B
A= $response->code == 401B= $response->code == 403
| |||||||||||||||||||||||||||||||||||||||
| 604 | || $response->code == HTTP_FORBIDDEN ) | ||||||||||||||||||||||||||||||||||||||
| 605 | { | ||||||||||||||||||||||||||||||||||||||
| 606 | ## no critic qw(RequireExplicitInclusion) | ||||||||||||||||||||||||||||||||||||||
| 607 | 0 | WookieConnectorException->throw( 'error' => $ERR{'INVALID_API_KEY'} ); | |||||||||||||||||||||||||||||||||||||
| 608 | ## use critic | ||||||||||||||||||||||||||||||||||||||
| 609 | } | ||||||||||||||||||||||||||||||||||||||
| 610 | 1 | return $response; | |||||||||||||||||||||||||||||||||||||
| 611 | } | ||||||||||||||||||||||||||||||||||||||
| 612 | |||||||||||||||||||||||||||||||||||||||
| 613 | sub _parse_instance { | ||||||||||||||||||||||||||||||||||||||
| 614 | 0 | ▶ | my ( $self, $guid, $xml ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
_parse_instance: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||
| 615 | 0 | my $xml_obj = | |||||||||||||||||||||||||||||||||||||
| 616 | XML::Simple->new( 'ForceArray' => 1, 'KeyAttr' => 'id' )->XMLin($xml); | ||||||||||||||||||||||||||||||||||||||
| 617 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 618 | my $instance = WWW::Wookie::Widget::Instance->new( | ||||||||||||||||||||||||||||||||||||||
| 619 | $xml_obj->{'url'}[0], $guid, | ||||||||||||||||||||||||||||||||||||||
| 620 | $xml_obj->{'title'}[0], $xml_obj->{'height'}[0], | ||||||||||||||||||||||||||||||||||||||
| 621 | $xml_obj->{'width'}[0], | ||||||||||||||||||||||||||||||||||||||
| 622 | ) | ||||||||||||||||||||||||||||||||||||||
| 623 | ) | ||||||||||||||||||||||||||||||||||||||
| 624 | { | ||||||||||||||||||||||||||||||||||||||
| 625 | 0 | $self->WidgetInstances->put($instance); | |||||||||||||||||||||||||||||||||||||
| 626 | 0 | $self->addParticipant( $instance, $self->getUser ); | |||||||||||||||||||||||||||||||||||||
| 627 | 0 | return $instance; | |||||||||||||||||||||||||||||||||||||
| 628 | } | ||||||||||||||||||||||||||||||||||||||
| 629 | 0 | return; | |||||||||||||||||||||||||||||||||||||
| 630 | } | ||||||||||||||||||||||||||||||||||||||
| 631 | |||||||||||||||||||||||||||||||||||||||
| 632 | sub _parse_widget { | ||||||||||||||||||||||||||||||||||||||
| 633 | 0 | ▶ | my ( $self, $xml ) = @_; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
_parse_widget: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||
| 634 | 0 | my $title = $xml->{'name'}[0]->{'content'}; | |||||||||||||||||||||||||||||||||||||
| 635 | my $description = | ||||||||||||||||||||||||||||||||||||||
| 636 | ref $xml->{'description'}[0] | ||||||||||||||||||||||||||||||||||||||
| 637 | ? $xml->{'description'}[0]->{'content'} | ||||||||||||||||||||||||||||||||||||||
| 638 | 0 | ▶ | : $xml->{'description'}[0]; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 639 | my $icon = | ||||||||||||||||||||||||||||||||||||||
| 640 | ref $xml->{'icon'}[0] | ||||||||||||||||||||||||||||||||||||||
| 641 | ? $xml->{'icon'}[0]->{'content'} | ||||||||||||||||||||||||||||||||||||||
| 642 | 0 | ▶ | : $xml->{'icon'}[0]; | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 643 | 0 | ▶ | if ( !$icon ) { | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 644 | 0 | $icon = $DEFAULT_ICON; | |||||||||||||||||||||||||||||||||||||
| 645 | } | ||||||||||||||||||||||||||||||||||||||
| 646 | 0 | return ( $title, $description, $icon ); | |||||||||||||||||||||||||||||||||||||
| 647 | } | ||||||||||||||||||||||||||||||||||||||
| 648 | |||||||||||||||||||||||||||||||||||||||
| 649 | 5 | with 'WWW::Wookie::Connector::Service::Interface'; | |||||||||||||||||||||||||||||||||||||
| 650 | |||||||||||||||||||||||||||||||||||||||
| 651 | 5 | ▶ | no Moose; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 652 | |||||||||||||||||||||||||||||||||||||||
| 653 | 5 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||||||||
| 654 | |||||||||||||||||||||||||||||||||||||||
| 655 | 5 | 1; | |||||||||||||||||||||||||||||||||||||
| 656 | |||||||||||||||||||||||||||||||||||||||
| 657 | __END__ | ||||||||||||||||||||||||||||||||||||||
| 658 | |||||||||||||||||||||||||||||||||||||||
| 659 | =encoding utf8 | ||||||||||||||||||||||||||||||||||||||
| 660 | |||||||||||||||||||||||||||||||||||||||
| 661 | =for stopwords API Readonly Wookie guid Ipenburg login MERCHANTABILITY | ||||||||||||||||||||||||||||||||||||||
| 662 | |||||||||||||||||||||||||||||||||||||||
| 663 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||
| 664 | |||||||||||||||||||||||||||||||||||||||
| 665 | WWW::Wookie::Connector::Service - Wookie connector service, handles all the | ||||||||||||||||||||||||||||||||||||||
| 666 | data requests and responses | ||||||||||||||||||||||||||||||||||||||
| 667 | |||||||||||||||||||||||||||||||||||||||
| 668 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||
| 669 | |||||||||||||||||||||||||||||||||||||||
| 670 | This document describes WWW::Wookie::Connector::Service version v1.1.1 | ||||||||||||||||||||||||||||||||||||||
| 671 | |||||||||||||||||||||||||||||||||||||||
| 672 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||||||||
| 673 | |||||||||||||||||||||||||||||||||||||||
| 674 | use WWW::Wookie::Connector::Service; | ||||||||||||||||||||||||||||||||||||||
| 675 | |||||||||||||||||||||||||||||||||||||||
| 676 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||
| 677 | |||||||||||||||||||||||||||||||||||||||
| 678 | =head1 SUBROUTINES/METHODS | ||||||||||||||||||||||||||||||||||||||
| 679 | |||||||||||||||||||||||||||||||||||||||
| 680 | This module is an implementation of the | ||||||||||||||||||||||||||||||||||||||
| 681 | L<WWW::Wookie::Connector::Service::Interface | ||||||||||||||||||||||||||||||||||||||
| 682 | |WWW::Wookie::Connector::Service::Interface/"SUBROUTINES/METHODS">. | ||||||||||||||||||||||||||||||||||||||
| 683 | |||||||||||||||||||||||||||||||||||||||
| 684 | =head2 C<new> | ||||||||||||||||||||||||||||||||||||||
| 685 | |||||||||||||||||||||||||||||||||||||||
| 686 | Create a new connector | ||||||||||||||||||||||||||||||||||||||
| 687 | |||||||||||||||||||||||||||||||||||||||
| 688 | =over | ||||||||||||||||||||||||||||||||||||||
| 689 | |||||||||||||||||||||||||||||||||||||||
| 690 | =item 1. URL to Wookie host as string | ||||||||||||||||||||||||||||||||||||||
| 691 | |||||||||||||||||||||||||||||||||||||||
| 692 | =item 2. Wookie API key as string | ||||||||||||||||||||||||||||||||||||||
| 693 | |||||||||||||||||||||||||||||||||||||||
| 694 | =item 3. Shared data key to use as string | ||||||||||||||||||||||||||||||||||||||
| 695 | |||||||||||||||||||||||||||||||||||||||
| 696 | =item 4. User login name | ||||||||||||||||||||||||||||||||||||||
| 697 | |||||||||||||||||||||||||||||||||||||||
| 698 | =item 5. User display name | ||||||||||||||||||||||||||||||||||||||
| 699 | |||||||||||||||||||||||||||||||||||||||
| 700 | =back | ||||||||||||||||||||||||||||||||||||||
| 701 | |||||||||||||||||||||||||||||||||||||||
| 702 | =head2 C<getAvailableServices> | ||||||||||||||||||||||||||||||||||||||
| 703 | |||||||||||||||||||||||||||||||||||||||
| 704 | Get a all available service categories in the server. Returns an array of | ||||||||||||||||||||||||||||||||||||||
| 705 | L<WWWW::Wookie::Widget::Category|WW::Wookie::Widget::Category> objects. | ||||||||||||||||||||||||||||||||||||||
| 706 | Throws a C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 707 | |||||||||||||||||||||||||||||||||||||||
| 708 | =head2 C<getAvailableWidgets> | ||||||||||||||||||||||||||||||||||||||
| 709 | |||||||||||||||||||||||||||||||||||||||
| 710 | Get all available widgets in the server, or only the available widgets in the | ||||||||||||||||||||||||||||||||||||||
| 711 | specified service category. Returns an array of | ||||||||||||||||||||||||||||||||||||||
| 712 | L<WWW::Wookie::Widget|WWW::Wookie::Widget> objects, otherwise false. Throws a | ||||||||||||||||||||||||||||||||||||||
| 713 | C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 714 | |||||||||||||||||||||||||||||||||||||||
| 715 | =over | ||||||||||||||||||||||||||||||||||||||
| 716 | |||||||||||||||||||||||||||||||||||||||
| 717 | =item 1. Service category name as string | ||||||||||||||||||||||||||||||||||||||
| 718 | |||||||||||||||||||||||||||||||||||||||
| 719 | =back | ||||||||||||||||||||||||||||||||||||||
| 720 | |||||||||||||||||||||||||||||||||||||||
| 721 | =head2 C<getWidget> | ||||||||||||||||||||||||||||||||||||||
| 722 | |||||||||||||||||||||||||||||||||||||||
| 723 | Get the details of the widget specified by it's identifier. Returns a | ||||||||||||||||||||||||||||||||||||||
| 724 | L<WWW::Wookie::Widget|WWW::Wookie::Widget> object. | ||||||||||||||||||||||||||||||||||||||
| 725 | |||||||||||||||||||||||||||||||||||||||
| 726 | =over | ||||||||||||||||||||||||||||||||||||||
| 727 | |||||||||||||||||||||||||||||||||||||||
| 728 | =item 1. The identifier of an available widget | ||||||||||||||||||||||||||||||||||||||
| 729 | |||||||||||||||||||||||||||||||||||||||
| 730 | =back | ||||||||||||||||||||||||||||||||||||||
| 731 | |||||||||||||||||||||||||||||||||||||||
| 732 | =head2 C<getConnection> | ||||||||||||||||||||||||||||||||||||||
| 733 | |||||||||||||||||||||||||||||||||||||||
| 734 | Get the currently active connection to the Wookie server. Returns a | ||||||||||||||||||||||||||||||||||||||
| 735 | L<WWW::Wookie::Server::Connection|WWW::Wookie::Server::Connection> object. | ||||||||||||||||||||||||||||||||||||||
| 736 | |||||||||||||||||||||||||||||||||||||||
| 737 | =head2 C<setUser> | ||||||||||||||||||||||||||||||||||||||
| 738 | |||||||||||||||||||||||||||||||||||||||
| 739 | Set the current user. | ||||||||||||||||||||||||||||||||||||||
| 740 | |||||||||||||||||||||||||||||||||||||||
| 741 | =over | ||||||||||||||||||||||||||||||||||||||
| 742 | |||||||||||||||||||||||||||||||||||||||
| 743 | =item 1. User name for the current Wookie connection | ||||||||||||||||||||||||||||||||||||||
| 744 | |||||||||||||||||||||||||||||||||||||||
| 745 | =item 2. Screen name for the current Wookie connection | ||||||||||||||||||||||||||||||||||||||
| 746 | |||||||||||||||||||||||||||||||||||||||
| 747 | =back | ||||||||||||||||||||||||||||||||||||||
| 748 | |||||||||||||||||||||||||||||||||||||||
| 749 | =head2 C<getUser> | ||||||||||||||||||||||||||||||||||||||
| 750 | |||||||||||||||||||||||||||||||||||||||
| 751 | Retrieve the details of the current user. Returns an instance of the user as a | ||||||||||||||||||||||||||||||||||||||
| 752 | L<WWW::Wookie::User|WWW::Wookie::User> object. | ||||||||||||||||||||||||||||||||||||||
| 753 | |||||||||||||||||||||||||||||||||||||||
| 754 | =head2 C<getOrCreateInstance> | ||||||||||||||||||||||||||||||||||||||
| 755 | |||||||||||||||||||||||||||||||||||||||
| 756 | Get or create a new instance of a widget. The current user will be added as a | ||||||||||||||||||||||||||||||||||||||
| 757 | participant. Returns a | ||||||||||||||||||||||||||||||||||||||
| 758 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object if | ||||||||||||||||||||||||||||||||||||||
| 759 | successful, otherwise false. Throws a C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 760 | |||||||||||||||||||||||||||||||||||||||
| 761 | =over | ||||||||||||||||||||||||||||||||||||||
| 762 | |||||||||||||||||||||||||||||||||||||||
| 763 | =item 1. Widget as guid string or a L<WWW::Wookie::Widget|WWW::Wookie::Widget> | ||||||||||||||||||||||||||||||||||||||
| 764 | object | ||||||||||||||||||||||||||||||||||||||
| 765 | |||||||||||||||||||||||||||||||||||||||
| 766 | =back | ||||||||||||||||||||||||||||||||||||||
| 767 | |||||||||||||||||||||||||||||||||||||||
| 768 | =head2 C<addParticipant> | ||||||||||||||||||||||||||||||||||||||
| 769 | |||||||||||||||||||||||||||||||||||||||
| 770 | Add a participant to a widget. Returns true if successful, otherwise false. | ||||||||||||||||||||||||||||||||||||||
| 771 | Throws a C<WookieWidgetInstanceException> or a C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 772 | |||||||||||||||||||||||||||||||||||||||
| 773 | =over | ||||||||||||||||||||||||||||||||||||||
| 774 | |||||||||||||||||||||||||||||||||||||||
| 775 | =item 1. Instance of widget as | ||||||||||||||||||||||||||||||||||||||
| 776 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||||||||||||||||||||||||||||||||||||||
| 777 | |||||||||||||||||||||||||||||||||||||||
| 778 | =item 2. Instance of user as L<WWW::Wookie::User|WWW::Wookie::User> object | ||||||||||||||||||||||||||||||||||||||
| 779 | |||||||||||||||||||||||||||||||||||||||
| 780 | =back | ||||||||||||||||||||||||||||||||||||||
| 781 | |||||||||||||||||||||||||||||||||||||||
| 782 | =head2 C<deleteParticipant> | ||||||||||||||||||||||||||||||||||||||
| 783 | |||||||||||||||||||||||||||||||||||||||
| 784 | Delete a participant. Returns true if successful, otherwise false. Throws a | ||||||||||||||||||||||||||||||||||||||
| 785 | C<WookieWidgetInstanceException> or a C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 786 | |||||||||||||||||||||||||||||||||||||||
| 787 | =over | ||||||||||||||||||||||||||||||||||||||
| 788 | |||||||||||||||||||||||||||||||||||||||
| 789 | =item 1. Instance of widget as | ||||||||||||||||||||||||||||||||||||||
| 790 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||||||||||||||||||||||||||||||||||||||
| 791 | |||||||||||||||||||||||||||||||||||||||
| 792 | =item 2. Instance of user as L<WWW::Wookie::User|WWW::Wookie::User> object | ||||||||||||||||||||||||||||||||||||||
| 793 | |||||||||||||||||||||||||||||||||||||||
| 794 | =back | ||||||||||||||||||||||||||||||||||||||
| 795 | |||||||||||||||||||||||||||||||||||||||
| 796 | =head2 C<getUsers> | ||||||||||||||||||||||||||||||||||||||
| 797 | |||||||||||||||||||||||||||||||||||||||
| 798 | Get all participants of the current widget. Returns an array of | ||||||||||||||||||||||||||||||||||||||
| 799 | L<WWW::Wookie::User|WWW::Wookie::User> instances. Throws a | ||||||||||||||||||||||||||||||||||||||
| 800 | C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 801 | |||||||||||||||||||||||||||||||||||||||
| 802 | =over | ||||||||||||||||||||||||||||||||||||||
| 803 | |||||||||||||||||||||||||||||||||||||||
| 804 | =item 1. Instance of widget as | ||||||||||||||||||||||||||||||||||||||
| 805 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||||||||||||||||||||||||||||||||||||||
| 806 | |||||||||||||||||||||||||||||||||||||||
| 807 | =back | ||||||||||||||||||||||||||||||||||||||
| 808 | |||||||||||||||||||||||||||||||||||||||
| 809 | =head2 C<addProperty> | ||||||||||||||||||||||||||||||||||||||
| 810 | |||||||||||||||||||||||||||||||||||||||
| 811 | Adds a new property. Returns true if successful, otherwise false. Throws a | ||||||||||||||||||||||||||||||||||||||
| 812 | C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 813 | |||||||||||||||||||||||||||||||||||||||
| 814 | =over | ||||||||||||||||||||||||||||||||||||||
| 815 | |||||||||||||||||||||||||||||||||||||||
| 816 | =item 1. Instance of widget as | ||||||||||||||||||||||||||||||||||||||
| 817 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||||||||||||||||||||||||||||||||||||||
| 818 | |||||||||||||||||||||||||||||||||||||||
| 819 | =item 2. Instance of property as | ||||||||||||||||||||||||||||||||||||||
| 820 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> object | ||||||||||||||||||||||||||||||||||||||
| 821 | |||||||||||||||||||||||||||||||||||||||
| 822 | =back | ||||||||||||||||||||||||||||||||||||||
| 823 | |||||||||||||||||||||||||||||||||||||||
| 824 | =head2 C<setProperty> | ||||||||||||||||||||||||||||||||||||||
| 825 | |||||||||||||||||||||||||||||||||||||||
| 826 | Set a new property. Returns the property as | ||||||||||||||||||||||||||||||||||||||
| 827 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> if successful, | ||||||||||||||||||||||||||||||||||||||
| 828 | otherwise false. Throws a C<WookieWidgetInstanceException> or a | ||||||||||||||||||||||||||||||||||||||
| 829 | C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 830 | |||||||||||||||||||||||||||||||||||||||
| 831 | =over | ||||||||||||||||||||||||||||||||||||||
| 832 | |||||||||||||||||||||||||||||||||||||||
| 833 | =item 1. Instance of widget as | ||||||||||||||||||||||||||||||||||||||
| 834 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||||||||||||||||||||||||||||||||||||||
| 835 | |||||||||||||||||||||||||||||||||||||||
| 836 | =item 2. Instance of property as | ||||||||||||||||||||||||||||||||||||||
| 837 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> object | ||||||||||||||||||||||||||||||||||||||
| 838 | |||||||||||||||||||||||||||||||||||||||
| 839 | =back | ||||||||||||||||||||||||||||||||||||||
| 840 | |||||||||||||||||||||||||||||||||||||||
| 841 | =head2 C<getProperty> | ||||||||||||||||||||||||||||||||||||||
| 842 | |||||||||||||||||||||||||||||||||||||||
| 843 | Get a property. Returns the property as | ||||||||||||||||||||||||||||||||||||||
| 844 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> if successful, | ||||||||||||||||||||||||||||||||||||||
| 845 | otherwise false. Throws a C<WookieWidgetInstanceException> or a | ||||||||||||||||||||||||||||||||||||||
| 846 | C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 847 | |||||||||||||||||||||||||||||||||||||||
| 848 | =over | ||||||||||||||||||||||||||||||||||||||
| 849 | |||||||||||||||||||||||||||||||||||||||
| 850 | =item 1. Instance of widget as | ||||||||||||||||||||||||||||||||||||||
| 851 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||||||||||||||||||||||||||||||||||||||
| 852 | |||||||||||||||||||||||||||||||||||||||
| 853 | =item 2. Instance of property as | ||||||||||||||||||||||||||||||||||||||
| 854 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> object | ||||||||||||||||||||||||||||||||||||||
| 855 | |||||||||||||||||||||||||||||||||||||||
| 856 | =back | ||||||||||||||||||||||||||||||||||||||
| 857 | |||||||||||||||||||||||||||||||||||||||
| 858 | =head2 C<deleteProperty> | ||||||||||||||||||||||||||||||||||||||
| 859 | |||||||||||||||||||||||||||||||||||||||
| 860 | Delete a property. Returns true if successful, otherwise false. Throws a | ||||||||||||||||||||||||||||||||||||||
| 861 | C<WookieWidgetInstanceException> or a C<WookieConnectorException>. | ||||||||||||||||||||||||||||||||||||||
| 862 | |||||||||||||||||||||||||||||||||||||||
| 863 | =over | ||||||||||||||||||||||||||||||||||||||
| 864 | |||||||||||||||||||||||||||||||||||||||
| 865 | =item 1. Instance of widget as | ||||||||||||||||||||||||||||||||||||||
| 866 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||||||||||||||||||||||||||||||||||||||
| 867 | |||||||||||||||||||||||||||||||||||||||
| 868 | =item 2. Instance of property as | ||||||||||||||||||||||||||||||||||||||
| 869 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> object | ||||||||||||||||||||||||||||||||||||||
| 870 | |||||||||||||||||||||||||||||||||||||||
| 871 | =back | ||||||||||||||||||||||||||||||||||||||
| 872 | |||||||||||||||||||||||||||||||||||||||
| 873 | =head2 C<setLocale> | ||||||||||||||||||||||||||||||||||||||
| 874 | |||||||||||||||||||||||||||||||||||||||
| 875 | Set a locale. | ||||||||||||||||||||||||||||||||||||||
| 876 | |||||||||||||||||||||||||||||||||||||||
| 877 | =over | ||||||||||||||||||||||||||||||||||||||
| 878 | |||||||||||||||||||||||||||||||||||||||
| 879 | =item 1. Locale as string | ||||||||||||||||||||||||||||||||||||||
| 880 | |||||||||||||||||||||||||||||||||||||||
| 881 | =back | ||||||||||||||||||||||||||||||||||||||
| 882 | |||||||||||||||||||||||||||||||||||||||
| 883 | =head2 C<getLocale> | ||||||||||||||||||||||||||||||||||||||
| 884 | |||||||||||||||||||||||||||||||||||||||
| 885 | Get the current locale setting. Returns current locale as string. | ||||||||||||||||||||||||||||||||||||||
| 886 | |||||||||||||||||||||||||||||||||||||||
| 887 | =head1 CONFIGURATION AND ENVIRONMENT | ||||||||||||||||||||||||||||||||||||||
| 888 | |||||||||||||||||||||||||||||||||||||||
| 889 | =head1 DEPENDENCIES | ||||||||||||||||||||||||||||||||||||||
| 890 | |||||||||||||||||||||||||||||||||||||||
| 891 | =over 4 | ||||||||||||||||||||||||||||||||||||||
| 892 | |||||||||||||||||||||||||||||||||||||||
| 893 | =item * L<HTTP::Headers|HTTP::Headers> | ||||||||||||||||||||||||||||||||||||||
| 894 | |||||||||||||||||||||||||||||||||||||||
| 895 | =item * L<HTTP::Request|HTTP::Request> | ||||||||||||||||||||||||||||||||||||||
| 896 | |||||||||||||||||||||||||||||||||||||||
| 897 | =item * L<HTTP::Request::Common|HTTP::Request::Common> | ||||||||||||||||||||||||||||||||||||||
| 898 | |||||||||||||||||||||||||||||||||||||||
| 899 | =item * L<HTTP::Status|HTTP::Status> | ||||||||||||||||||||||||||||||||||||||
| 900 | |||||||||||||||||||||||||||||||||||||||
| 901 | =item * L<LWP::UserAgent|LWP::UserAgent> | ||||||||||||||||||||||||||||||||||||||
| 902 | |||||||||||||||||||||||||||||||||||||||
| 903 | =item * L<Log::Log4perl|Log::Log4perl> | ||||||||||||||||||||||||||||||||||||||
| 904 | |||||||||||||||||||||||||||||||||||||||
| 905 | =item * L<Moose|Moose> | ||||||||||||||||||||||||||||||||||||||
| 906 | |||||||||||||||||||||||||||||||||||||||
| 907 | =item * L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints> | ||||||||||||||||||||||||||||||||||||||
| 908 | |||||||||||||||||||||||||||||||||||||||
| 909 | =item * L<Readonly|Readonly> | ||||||||||||||||||||||||||||||||||||||
| 910 | |||||||||||||||||||||||||||||||||||||||
| 911 | =item * L<Regexp::Common|Regexp::Common> | ||||||||||||||||||||||||||||||||||||||
| 912 | |||||||||||||||||||||||||||||||||||||||
| 913 | =item * L<WWW::Wookie::Connector::Exceptions|WWW::Wookie::Connector::Exceptions> | ||||||||||||||||||||||||||||||||||||||
| 914 | |||||||||||||||||||||||||||||||||||||||
| 915 | =item * L<WWW::Wookie::Server::Connection|WWW::Wookie::Server::Connection> | ||||||||||||||||||||||||||||||||||||||
| 916 | |||||||||||||||||||||||||||||||||||||||
| 917 | =item * L<WWW::Wookie::User|WWW::Wookie::User> | ||||||||||||||||||||||||||||||||||||||
| 918 | |||||||||||||||||||||||||||||||||||||||
| 919 | =item * L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> | ||||||||||||||||||||||||||||||||||||||
| 920 | |||||||||||||||||||||||||||||||||||||||
| 921 | =item * L<WWW::Wookie::Widget::Instances|WWW::Wookie::Widget::Instances> | ||||||||||||||||||||||||||||||||||||||
| 922 | |||||||||||||||||||||||||||||||||||||||
| 923 | =item * L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> | ||||||||||||||||||||||||||||||||||||||
| 924 | |||||||||||||||||||||||||||||||||||||||
| 925 | =item * L<WWW::Wookie::Widget|WWW::Wookie::Widget> | ||||||||||||||||||||||||||||||||||||||
| 926 | |||||||||||||||||||||||||||||||||||||||
| 927 | =item * L<XML::Simple|XML::Simple> | ||||||||||||||||||||||||||||||||||||||
| 928 | |||||||||||||||||||||||||||||||||||||||
| 929 | =item * L<namespace::autoclean|namespace::autoclean> | ||||||||||||||||||||||||||||||||||||||
| 930 | |||||||||||||||||||||||||||||||||||||||
| 931 | =back | ||||||||||||||||||||||||||||||||||||||
| 932 | |||||||||||||||||||||||||||||||||||||||
| 933 | =head1 INCOMPATIBILITIES | ||||||||||||||||||||||||||||||||||||||
| 934 | |||||||||||||||||||||||||||||||||||||||
| 935 | =head1 DIAGNOSTICS | ||||||||||||||||||||||||||||||||||||||
| 936 | |||||||||||||||||||||||||||||||||||||||
| 937 | =head1 BUGS AND LIMITATIONS | ||||||||||||||||||||||||||||||||||||||
| 938 | |||||||||||||||||||||||||||||||||||||||
| 939 | Please report any bugs or feature requests at L<RT for | ||||||||||||||||||||||||||||||||||||||
| 940 | rt.cpan.org|https://rt.cpan.org/Dist/Display.html?Queue=WWW-Wookie>. | ||||||||||||||||||||||||||||||||||||||
| 941 | |||||||||||||||||||||||||||||||||||||||
| 942 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||
| 943 | |||||||||||||||||||||||||||||||||||||||
| 944 | Roland van Ipenburg, E<lt>ipenburg@xs4all.nlE<gt> | ||||||||||||||||||||||||||||||||||||||
| 945 | |||||||||||||||||||||||||||||||||||||||
| 946 | =head1 LICENSE AND COPYRIGHT | ||||||||||||||||||||||||||||||||||||||
| 947 | |||||||||||||||||||||||||||||||||||||||
| 948 | Copyright 2017 by Roland van Ipenburg | ||||||||||||||||||||||||||||||||||||||
| 949 | |||||||||||||||||||||||||||||||||||||||
| 950 | This library is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||
| 951 | it under the same terms as Perl itself, either Perl version 5.14.0 or, | ||||||||||||||||||||||||||||||||||||||
| 952 | at your option, any later version of Perl 5 you may have available. | ||||||||||||||||||||||||||||||||||||||
| 953 | |||||||||||||||||||||||||||||||||||||||
| 954 | =head1 DISCLAIMER OF WARRANTY | ||||||||||||||||||||||||||||||||||||||
| 955 | |||||||||||||||||||||||||||||||||||||||
| 956 | BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | ||||||||||||||||||||||||||||||||||||||
| 957 | FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | ||||||||||||||||||||||||||||||||||||||
| 958 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | ||||||||||||||||||||||||||||||||||||||
| 959 | PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER | ||||||||||||||||||||||||||||||||||||||
| 960 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||||||||||||||||||||||||||||||||||||||
| 961 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE | ||||||||||||||||||||||||||||||||||||||
| 962 | ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH | ||||||||||||||||||||||||||||||||||||||
| 963 | YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL | ||||||||||||||||||||||||||||||||||||||
| 964 | NECESSARY SERVICING, REPAIR, OR CORRECTION. | ||||||||||||||||||||||||||||||||||||||
| 965 | |||||||||||||||||||||||||||||||||||||||
| 966 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||||||||||||||||||||||||||||||||||||||
| 967 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | ||||||||||||||||||||||||||||||||||||||
| 968 | REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE | ||||||||||||||||||||||||||||||||||||||
| 969 | LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, | ||||||||||||||||||||||||||||||||||||||
| 970 | OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE | ||||||||||||||||||||||||||||||||||||||
| 971 | THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | ||||||||||||||||||||||||||||||||||||||
| 972 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | ||||||||||||||||||||||||||||||||||||||
| 973 | FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | ||||||||||||||||||||||||||||||||||||||
| 974 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | ||||||||||||||||||||||||||||||||||||||
| 975 | SUCH DAMAGES. | ||||||||||||||||||||||||||||||||||||||
| 976 | |||||||||||||||||||||||||||||||||||||||
| 977 | =cut | ||||||||||||||||||||||||||||||||||||||