Elive.pm

filter: Statementstmt 95.1% 39 / 41 Branchbran 50.0% 3 / 6 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 92.8% 13 / 14 Podpod 100% 6 / 6 totaltotal 81.8% 63 / 77 CC 6 SCAR 8.0
CC
6
Cov
83%
server_details
4.8
login
3.3
connect
2.0
CRAP 2.2
« Elive/Util/Type.pm ↑ Summary Elive/DAO/_Base.pm »
1 package Elive;
2 35 ▶use warnings; use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 =head1 NAME
5  
6 Elive - Elluminate Live! Manager (ELM) Command Toolkit bindings
7  
8 =head1 VERSION
9  
10 Version 1.36
11  
12 =cut
13  
14 35 our $VERSION = '1.36';
15  
16 35 ▶use 5.008003;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 35 ▶use parent qw{Class::Data::Inheritable};
Subroutine BEGIN: called CC=1 SCAR=0.0
19 35 ▶use Scalar::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 35 ▶use YAML::Syck;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 35 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 35 ▶use Elive::Entity;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 =head1 EXAMPLE
26  
27 The following (somewhat contrived) example sets up a meeting of selected
28 participants:
29  
30 use Elive;
31 use Elive::Entity::User;
32 use Elive::Entity::Preload;
33 use Elive::Entity::Session;
34  
35 my $meeting_name = 'Meeting of the Smiths';
36  
37 Elive->connect('https://someEllumServer.com/my_instance',
38 'serversupport', 'mypass');
39  
40 my $users = Elive::Entity::User->list(filter => "(lastName = 'Smith')");
41 die "smithless" unless @$users;
42  
43 my $start = time() + 15 * 60; # starts in 15 minutes
44 my $end = $start + 30 * 60; # runs for half an hour
45  
46 my $whiteboard_preload = Elive::Entity::Preload->upload('welcome.wbd');
47  
48 my $session = Elive::Entity::Session->insert({
49 name => $meeting_name,
50 start => $start . '000',
51 end => $end . '000',
52 restricted => 1,
53 participants => $users,
54 add_preload => $whiteboard_preload,
55 });
56  
57 print "Session address: ".$session->web_url;
58  
59 Elive->disconnect;
60  
61 =head1 DESCRIPTION
62  
63 Elive is a set of Perl bindings and entity definitions for quick and easy
64 integration with the Elluminate I<Live!> Manager (ELM) application. It can
65 be used to automate a range of tasks including setting up meetings and
66 participants, as well as managing users and user groups.
67  
68 =head1 BACKGROUND
69  
70 Elluminate I<Live!> is software for virtual online classrooms. It is suitable
71 for meetings, demonstrations, web conferences, seminars, training and support.
72  
73 Most management functions that can be performed via the web interface can
74 also be achieved via SOAP web services. This is known as the
75 I<Command Toolkit> and is detailed in chapter 4 of the Elluminate I<Live!>
76 Software Developers Kit (SDK).
77  
78 Users, Meetings and other resources are stored in the Elluminate I<Live!>
79 Manager (ELM) database. These can be entered, accessed and manipulated via
80 the Entity Commands in the Command Toolkit.
81  
82 =cut
83  
84 =head1 METHODS
85  
86 =head2 connect
87  
88 Elive->connect('https://myServer.com/test', some_user => 'some_pass');
89 my $connection = Elive->connection;
90  
91 Connects to an Elluminate server instance. Dies if the connection could not
92 be established. If, for example, the SOAP connection or user login failed.
93  
94 The login user must either be an Elluminate I<Live!> system administrator
95 account, or a user that has been configured to access the Command Toolkit
96 via web services.
97  
98 See also: the Elive C<README> file, L<Elive::Connection::SDK>.
99  
100 =cut
101  
102 sub connect {
103 0 ▶ my $class = shift;
Subroutine connect: not called CC=1 SCAR=6.9
Pod documented
104 0 return Elive::Entity->connect(@_);
105 }
106  
107 =head2 connection
108  
109 $e1 = Elive->connection
110 or warn 'no elive connection active';
111  
112 Returns the current L<Elive::Connection::SDK> connection.
113  
114 =cut
115  
116 sub connection {
117 24 ▶ my $class = shift;
Subroutine connection: called CC=1 SCAR=0.0
Pod documented
118 24 return Elive::Entity->connection(@_);
119 }
120  
121 =head2 login
122  
123 Returns the login user for the default connection.
124  
125 my $login = Elive->login;
126 say "logged in as: ".$login->loginName;
127  
128 See L<Elive::Entity::User>.
129  
130 =cut
131  
132 sub login {
133 5 ▶ my ($class, %opt) = @_;
Subroutine login: called CC=3 SCAR=12.0
Pod documented
134  
135 5 ▶ my $connection = $opt{connection} || $class->connection;
Condition33%1/3
$opt{'connection'} || $class->connection
l!l&&r!l&&!r
050
MC/DC0%0/2
$opt{'connection'} || $class->connection
$opt{'connection'} $class->connection
Truth table33%1/3
A || B
A= $opt{'connection'}B= $class->connection
ABresult
1X1
011
000
136  
137 5 ▶ die "not connected"
Branch: 1 branch
BranchTrueFalseTotal
unless $connection 0 5 5
138 unless $connection;
139  
140 5 return $connection->login;
141 }
142  
143 =head2 server_details
144  
145 Returns the server details for the current connection. See L<Elive::Entity::ServerDetails>.
146  
147 my $server = Elive->server_details;
148 printf("server %s is running Elluminate Live! version %s\n", $server->name, $server->version);
149  
150 There can potentially be multiple servers:
151  
152 my @servers = Elive->server_details;
153 foreach my $server (@servers) {
154 printf("server %s is running Elluminate Live! version %s\n", $server->name, $server->version);
155 }
156  
157 =cut
158  
159 sub server_details {
160 3 ▶ my ($class, %opt) = @_;
Subroutine server_details: called CC=4 SCAR=15.6
Pod documented
161  
162 3 ▶ my $connection = $opt{connection} || $class->connection
Branch: 1 branch
BranchTrueFalseTotal
my $connection = $opt{"connection"} || $class->connection or die "not connected" 0 3 3
Condition33%1/3
$opt{'connection'} || $class->connection
l!l&&r!l&&!r
030
MC/DC0%0/2
$opt{'connection'} || $class->connection
$opt{'connection'} $class->connection
Truth table33%1/3
A || B
A= $opt{'connection'}B= $class->connection
ABresult
1X1
011
000
163 or die "not connected";
164  
165 3 my @server_details = $connection->server_details;
166 3 ▶ return wantarray ? @server_details : $server_details[0]
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 3 3
167 }
168
169 =head2 disconnect
170  
171 Disconnects the default Elluminate connection. It is recommended that you
172 do this prior to exiting your program.
173  
174 Elive->disconnect;
175 exit(0);
176  
177 =cut
178  
179 sub disconnect {
180 18 ▶ my $self = shift;
Subroutine disconnect: called CC=1 SCAR=0.0
Pod documented
181 18 return Elive::Entity->disconnect;
182 }
183  
184 =head2 debug
185  
186 Elive->debug(1)
187  
188 Sets or gets the debug level.
189  
190 =over 4
191  
192 =item 0 = no debugging
193  
194 =item 1 = dump object and class information
195  
196 =item 2 = also enable SOAP::Lite tracing
197  
198 =item 3 = very detailed
199  
200 =back
201  
202 =cut
203  
204 sub debug {
205 159 ▶ my $class = shift;
Subroutine debug: called CC=1 SCAR=0.0
Pod documented
206 159 Elive::DAO::_Base->debug(@_);
207 }
208  
209 =head1 ERROR MESSAGES
210  
211 Elluminate Services Errors:
212  
213 =over 4
214  
215 =item "Unable to determine a command for the key : Xxxx"
216  
217 This may indicate that the particular command is is not available for your
218 site instance. Please follow the instructions in the README file for
219 detecting and repairing missing adapters.
220  
221 =item "User [<username>], not permitted to access the command {<command>]"
222  
223 Please ensure that the user is a system administrator account and/or the
224 user has been configured to access commands via web services. See also the
225 L<README> file.
226  
227 =back
228  
229 =cut
230  
231 =head1 SCRIPTS
232  
233 =head2 elive_query - simple query shell
234  
235 elive_query is a script for issuing basic sql-like queries on entities. It serves as a simple demonstration script, and can be used to confirm connectivity and operation of Elive.
236  
237 % perl elive_query https://myserver.com/test -user sdk_user
238 Password: connecting to https://myserver.com/test...ok
239 Elive query 1.xx - type 'help' for help
240  
241 elive> select address,version from serverDetails
242 address |version
243 ------------|-------
244 myserver.com|10.0.1
245 elive> ^D
246  
247 It serves a secondary function of querying entity metadata. For example,
248 to show the C<meeting> entity:
249  
250 % elive_query
251 Elive query 1.xx - type 'help' for help
252  
253 elive> show
254 usage: show group|meeting|...|serverParameters|session|users
255  
256 elive> show meeting
257 meeting: Elive::Entity::Meeting:
258 meetingId : pkey Int
259 adapter : Str -- adapter used to create the meeting
260 allModerators : Bool -- all participants can moderate
261 deleted : Bool
262 end : HiResDate -- meeting end time
263 facilitatorId : Str -- userId of facilitator
264 name : Str -- meeting name
265 password : Str -- meeting password
266 privateMeeting : Bool -- don't display meeting in public schedule
267 restrictedMeeting : Bool -- Restricted meeting
268 start : HiResDate -- meeting start time
269  
270 for more information, please see L<elive_query>, or or type the command: C<elive_query --help>
271  
272 =head2 elive_raise_meeting - meeting creation
273  
274 This is a demonstration script for creating meetings. This includes the setting
275 of meeting options, assigning participants and uploading of preloads (whiteboard, plan and media files).
276  
277 For more information, see L<elive_raise_meeting> or type the command: C<elive_raise_meeting --help>
278  
279 =head2 elive_lint_config - configuration file checker
280  
281 A utility script that checks your Elluminate server configuration. This
282 is more likely to be of use for Elluminate I<Live!> prior to 10.0. Please
283 see the README file.
284  
285 =head1 SEE ALSO
286  
287 =head2 Modules in the Elive distribution
288  
289 =over 4
290  
291 =item L<Elive::Entity::Session> - Sessions (or meetings)
292  
293 =item L<Elive::Entity::Group> - Groups of Users
294  
295 =item L<Elive::Entity::Preload> - Preload Content (whiteboard, multimedia and plans)
296  
297 =item L<Elive::Entity::Recording> - Session Recordings
298  
299 =item L<Elive::Entity::Report> - Management Reports
300  
301 =item L<Elive::Entity::User> - Users/Logins
302  
303 =item L<Elive::Connection::SDK> - Elluminate SOAP connections
304  
305 =back
306  
307 =head2 Scripts in the Elive Distribution
308  
309 =over 4
310  
311 =item L<elive_query> - simple interactive queries on Elive entities
312  
313 =item L<elive_raise_meeting> - command-line meeting creation
314  
315 =item L<elive_lint_config> - Elluminate Live! configuration checker
316  
317 =back
318  
319 =head2 Related CPAN Modules
320  
321 L<Bb::Collaborate::V3> - this module implements the Blackboard Collaborate Standard Integration API (v3) for C<SAS> servers.
322  
323 =head2 Elluminate Documentation
324  
325 This following documents were used in the construction of this module:
326  
327 =over 4
328  
329 =item ELM2.5_SDK.pdf
330  
331 General Description of SDK development for Elluminate I<Live!>. In particular
332 see section 4 - the SOAP Command Toolkit. This module concentrates on
333 implementing the Entity Commands described in section 4.1.8.
334  
335 =item Undocumented ELM 3.x SDK Calls.pdf
336  
337 This describes the C<createSession> and C<updateSession> commands, as
338 implemented by the L<Elive::Entity::Session> C<insert()> and C<update()>
339 methods.
340  
341 =item DatabaseSchema.pdf
342  
343 Elluminate Database Schema Documentation.
344  
345 =back
346  
347 =head1 AUTHOR
348  
349 David Warring, C<< <david.warring at gmail.com> >>
350  
351 =head1 BUGS AND LIMITATIONS
352  
353 =over 4
354  
355 =item * Elive does not support hosted (SAS) systems
356  
357 The Elive distribution only supports the ELM (Elluminate I<Live!> Manager) SDK.
358 The SAS (Session Administration System) is not supported.
359  
360 =back
361  
362 =head1 SUPPORT
363  
364 Please report any bugs or feature requests to C<bug-elive at rt.cpan.org>,
365 or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Elive>.
366 I will be notified, and then you'll automatically be notified of progress on
367 your bug as I make changes.
368  
369 You can find documentation for this module with the perldoc command.
370  
371 perldoc Elive
372  
373 You can also look for information at:
374  
375 =over 4
376  
377 =item * RT: CPAN's request tracker
378  
379 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Elive>
380  
381 =item * AnnoCPAN: Annotated CPAN documentation
382  
383 L<http://annocpan.org/dist/Elive>
384  
385 =item * CPAN Ratings
386  
387 L<http://cpanratings.perl.org/d/Elive>
388  
389 =item * Search CPAN
390  
391 L<http://search.cpan.org/dist/Elive/>
392  
393 =back
394  
395 =head1 ACKNOWLEDGEMENTS
396  
397 Thanks to Lex Lucas and Simon Haidley for their ongoing support and
398 assistance with the development of this module.
399  
400 =head1 COPYRIGHT & LICENSE
401  
402 Copyright 2009-2015 David Warring, all rights reserved.
403  
404 This program is free software; you can redistribute it and/or modify it
405 under the same terms as Perl itself.
406  
407 =cut
408  
409 35 1; # End of Elive
« Elive/Util/Type.pm ↑ Summary Elive/DAO/_Base.pm »