V3/Recording.pm

filter: Statementstmt 45.7% 32 / 70 Branchbran 0.0% 0 / 20 Conditioncond 0.0% 0 / 33 MC/DCmcdc 0.0% 0 / 21 Subroutinesub 60.0% 6 / 10 Podpod 100% 4 / 4 totaltotal 26.5% 42 / 158 CC 23 SCAR 41.1
CC
23
Cov
26%
set_secure_sign_on
110.0
recording_url
72.0
convert
42.0
CRAP 60.8
« V3/_Content.pm ↑ Summary V3/Recording/File.pm »
1 package Bb::Collaborate::V3::Recording;
2 6 ▶use warnings; use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 6 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 extends 'Bb::Collaborate::V3';
7  
8 6 ▶use Scalar::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 6 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 6 ▶use Elive::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 =head1 NAME
14  
15 Bb::Collaborate::V3::Recording - Collaborate Recording instance class
16  
17 =head1 DESCRIPTION
18  
19 This class is used to locate and access Collaborate recordings.
20  
21 =cut
22  
23 6 __PACKAGE__->entity_name('RecordingLong');
24  
25 =head1 PROPERTIES
26  
27 =head2 recordingId (Long)
28  
29 The ELM-generated recordingId for the Collaborate session recording.
30  
31 =cut
32  
33 6 has 'recordingId' => (is => 'rw', isa => 'Int', required => 1);
34 6 __PACKAGE__->primary_key('recordingId');
35 6 __PACKAGE__->params(startTime => 'HiResDate',
36 endTime => 'HiResDate',
37 sessionName => 'Str'
38 );
39  
40 =head2 roomStartDate (HiResDate)
41  
42 The actual start date and time of the session when the recording was made.
43  
44 =cut
45  
46 6 has 'roomStartDate' => (is => 'rw', isa => 'HiResDate',);
47  
48 =head2 roomEndDate (HiResDate)
49  
50 The actual end date and time of the session when the recording was made.
51  
52 =cut
53  
54 6 has 'roomEndDate' => (is => 'rw', isa => 'HiResDate',);
55  
56 =head2 recordingURL (Str)
57  
58 The URL used to access the recording. This would be the result of calling the buildRecordingUrl command with the recordingId.
59  
60 =cut
61  
62 6 has 'recordingURL' => (is => 'rw', isa => 'Str',);
63  
64 =head2 secureSignOn (Bool)
65  
66 Flag indicating whether extended validation is required for access
67 to the object specified by the recordingId
68  
69 =cut
70  
71 6 has 'secureSignOn' => (is => 'rw', isa => 'Str',);
72  
73 =head2 creationDate (HiResDate)
74  
75 The date time in milliseconds UTC that the recording file was created. This is the time when the last attendee leaves and the session stops running, not necessarily the session's scheduled end time.
76  
77 =cut
78  
79 6 has 'creationDate' => (is => 'rw', isa => 'HiResDate',);
80  
81 =head2 recordingSize (Int)
82  
83 The size of the recording file in bytes.
84  
85 =cut
86  
87 6 has 'recordingSize' => (is => 'rw', isa => 'Int',);
88  
89  
90 =head2 roomName (Str)
91  
92 The scheduled session's name at the time that the session was held.
93 Case insensitive. 1 - 255 characters.
94  
95 =cut
96  
97 6 has 'roomName' => (is => 'rw', isa => 'Str',);
98  
99 =head2 sessionId (Int)
100  
101 The ELM-generated sessionId for the scheduled session. This will be 0 if the scheduled session has been deleted but the corresponding recording has not.
102  
103 =cut
104  
105 6 has 'sessionId' => (is => 'rw', isa => 'Int',);
106  
107 =head1 METHODS
108  
109 =cut
110  
111 =head2 recording_url
112  
113 my $recording_url = $recording->recording_url();
114  
115 Returns a URL for recording playback.
116  
117 =cut
118  
119 0 ▶sub recording_url {
Subroutine recording_url: not called CC=8 SCAR=42.8
Pod documented
120 0 my ($class, %opt) = @_;
121  
122 0 ▶ my $connection = $opt{connection} || $class->connection
Branch: 1 branch
BranchTrueFalseTotal
my $connection = $opt{"connection"} || $class->connection or croak("Not connected") 0 0 0
Condition0%0/3
$opt{'connection'} || $class->connection
l!l&&r!l&&!r
000
MC/DC0%0/2
$opt{'connection'} || $class->connection
$opt{'connection'} $class->connection
Truth table0%0/3
A || B
A= $opt{'connection'}B= $class->connection
ABresult
1X1
011
000
123 or croak "Not connected";
124  
125 0 my %params;
126  
127 0 ▶ my $recording_id = $opt{recording_id} || $opt{recordingId};
Condition0%0/3
$opt{'recording_id'} || $opt{'recordingId'}
l!l&&r!l&&!r
000
MC/DC0%0/2
$opt{'recording_id'} || $opt{'recordingId'}
$opt{'recording_id'} $opt{'recordingId'}
Truth table0%0/3
A || B
A= $opt{'recording_id'}B= $opt{'recordingId'}
ABresult
1X1
011
000
128  
129 0 ▶ $recording_id ||= $class->recordingId
Branch: 1 branch
BranchTrueFalseTotal
if ref $class 0 0 0
Condition0%0/3
$recording_id ||= $class->recordingId
l!l&&r!l&&!r
000
MC/DC0%0/2
$recording_id ||= $class->recordingId
$recording_id $class->recordingId
Truth table0%0/3
A ||= B
A= $recording_idB= $class->recordingId
ABresult
1X1
011
000
130 if ref($class);
131  
132 0 ▶ croak "unable to determine recording_id"
Branch: 1 branch
BranchTrueFalseTotal
unless $recording_id 0 0 0
133 unless $recording_id;
134  
135 0 my $params = $class->_freeze({recordingId => $recording_id});
136  
137 0 my $som = $connection->call('BuildRecordingUrl' => %$params);
138  
139 0 my $results = $class->_get_results( $som, $connection );
140  
141 0 ▶ my $url = @$results && $results->[0];
Condition0%0/3
@$results && $results->[0]
!ll&&!rl&&r
000
MC/DC0%0/2
@$results && $results->[0]
@$results $results->[0]
Truth table0%0/3
A && B
A= @$resultsB= $results->[0]
ABresult
0X0
100
111
142  
143 0 return $url;
144 }
145  
146 =head2 list
147  
148 my $bobs_recordings = Bb::Collaborate::V3::Recordings->(filter => {userId => 'bob'});
149  
150 Returns an array of recording objects. You may filter on:
151  
152 =over 4
153  
154 =item C<userId> - Matched against C<chairList> and C<nonChairList>
155  
156 =item C<groupingId> - An Element from the C<groupingList>
157  
158 =item C<sessionId> - Session identifier
159  
160 =item C<creatorId> - Session creator
161  
162 =item C<startTime> - Start of the search date/time range in milliseconds.
163  
164 =item C<endTime> - End of the search date/time range in milliseconds.
165  
166 =item C<sessionName> - The session name
167  
168 =cut
169  
170 =back
171  
172 =cut
173  
174 =head2 set_secure_sign_on
175  
176 $recording->set_secure_sign_on(1)
177  
178 Sets or unsets the recording's secure sign-on flag.
179  
180 =cut
181  
182 0 ▶sub set_secure_sign_on {
Subroutine set_secure_sign_on: not called CC=10 SCAR=47.0
Pod documented
183 0 my $self = shift;
184 0 ▶ die 'usage: $obj->set_secure_sign_on($flag, ...)'
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 0 0 0
185 unless @_;
186 0 my $secure_sign_on = shift;
187 0 my %opt = @_;
188  
189 0 my $recording_id = $opt{recording_id};
190 0 ▶ $recording_id ||= $self->recordingId
Branch: 1 branch
BranchTrueFalseTotal
if ref $self 0 0 0
Condition0%0/3
$recording_id ||= $self->recordingId
l!l&&r!l&&!r
000
MC/DC0%0/2
$recording_id ||= $self->recordingId
$recording_id $self->recordingId
Truth table0%0/3
A ||= B
A= $recording_idB= $self->recordingId
ABresult
1X1
011
000
191 if ref($self);
192 0 ▶ die "unable to determine recordingId"
Branch: 1 branch
BranchTrueFalseTotal
unless $recording_id 0 0 0
193 unless $recording_id;
194  
195 0 my $connection = $opt{connection};
196 0 ▶ $connection ||= $self->connection
Branch: 1 branch
BranchTrueFalseTotal
if ref $self 0 0 0
Condition0%0/3
$connection ||= $self->connection
l!l&&r!l&&!r
000
MC/DC0%0/2
$connection ||= $self->connection
$connection $self->connection
Truth table0%0/3
A ||= B
A= $connectionB= $self->connection
ABresult
1X1
011
000
197 if ref($self);
198  
199 0 ▶ die "not connected"
Branch: 1 branch
BranchTrueFalseTotal
unless $connection 0 0 0
200 unless $connection;
201  
202 0 my $params = $self->_freeze({
203 recordingId => $recording_id,
204 secureSignOn => $secure_sign_on,
205 });
206  
207 0 ▶ my $command = $opt{command} || 'SetRecordingSecureSignOn';
Condition0%0/2
$opt{'command'} || 'SetRecordingSecureSignOn'
l!l
00
MC/DC0%0/1
$opt{'command'} || 'SetRecordingSecureSignOn'
$opt{'command'}
Truth table0%0/2
A
A= $opt{'command'}
Aresult
11
00
208  
209 0 my $som = $connection->call($command => %$params);
210  
211 0 my $results = $self->_get_results( $som, $connection );
212  
213 0 ▶ my $flag = @$results && $results->[0];
Condition0%0/3
@$results && $results->[0]
!ll&&!rl&&r
000
MC/DC0%0/2
@$results && $results->[0]
@$results $results->[0]
Truth table0%0/3
A && B
A= @$resultsB= $results->[0]
ABresult
0X0
100
111
214  
215 0 return $flag;
216 }
217  
218  
219 =head2 convert
220  
221 $recording->convert(format => 'mp3');
222  
223 Convert the recording to C<mp3> (default) or C<mp4>.
224  
225 =cut
226  
227 0 ▶sub convert {
Subroutine convert: not called CC=6 SCAR=37.4
Pod documented
228 0 my $self = shift;
229 0 my %opts = @_;
230  
231 0 ▶ $opts{recordingId} ||= $self->recordingId
Branch: 1 branch
BranchTrueFalseTotal
if ref $self 0 0 0
Condition0%0/3
$opts{"recordingId"} ||= $self->recordingId
l!l&&r!l&&!r
000
MC/DC0%0/2
$opts{"recordingId"} ||= $self->recordingId
$opts{"recordingId"} $self->recordingId
Truth table0%0/3
A ||= B
A= $opts{"recordingId"}B= $self->recordingId
ABresult
1X1
011
000
232 if ref($self);
233 0 ▶ $opts{format} ||= 'mp3';
Condition0%0/2
$opts{"format"} ||= "mp3"
l!l
00
MC/DC0%0/1
$opts{"format"} ||= "mp3"
$opts{"format"}
Truth table0%0/2
A
A= $opts{"format"}
Aresult
11
00
234 0 ▶ $opts{connection} ||= $self->connection
Branch: 1 branch
BranchTrueFalseTotal
$opts{"connection"} ||= $self->connection or die "not connected" 0 0 0
Condition0%0/3
$opts{"connection"} ||= $self->connection
l!l&&r!l&&!r
000
MC/DC0%0/2
$opts{"connection"} ||= $self->connection
$opts{"connection"} $self->connection
Truth table0%0/3
A ||= B
A= $opts{"connection"}B= $self->connection
ABresult
1X1
011
000
235 or die "not connected";
236  
237 0 require Bb::Collaborate::V3::Recording::File;
238 0 return Bb::Collaborate::V3::Recording::File->convert_recording( %opts );
239 }
240  
241 =head2 delete
242  
243 $recording->delete;
244  
245 Deletes recording content from the server and removes it from any associated sessions.
246  
247 =cut
248  
249 0 ▶sub delete {
Subroutine delete: not called CC=2 SCAR=17.9
Pod documented
250 0 my $self = shift;
251 0 my %opts = @_;
252 0 ▶ $opts{command} ||= 'RemoveRecording';
Condition0%0/2
$opts{"command"} ||= "RemoveRecording"
l!l
00
MC/DC0%0/1
$opts{"command"} ||= "RemoveRecording"
$opts{"command"}
Truth table0%0/2
A
A= $opts{"command"}
Aresult
11
00
253 0 $self->SUPER::delete(%opts)
254 }
255  
256 6 1;
« V3/_Content.pm ↑ Summary V3/Recording/File.pm »