| 1 | package Bb::Collaborate::Ultra::LaunchContext; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use warnings; use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use Mouse; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | extends 'Bb::Collaborate::Ultra::DAO'; | |||||||||||||||||||||||||||
| 5 | 2 | ▶ | use Bb::Collaborate::Ultra::User; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | has 'user' => (isa => 'Bb::Collaborate::Ultra::User', is => 'rw', coerce => 1); | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | =head1 NAME | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | Bb::Collaborate::Ultra::LaunchContext - Session Launch Context | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | This class is used to construct details for joining a session, | ||||||||||||||||||||||||||||
| 15 | including user identification and permissions. | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | my $user = Bb::Collaborate::Ultra::User->new({ | ||||||||||||||||||||||||||||
| 18 | extId => 'testLaunchUser', | ||||||||||||||||||||||||||||
| 19 | displayName => 'David Warring', | ||||||||||||||||||||||||||||
| 20 | email => 'david.warring@gmail.com', | ||||||||||||||||||||||||||||
| 21 | firstName => 'David', | ||||||||||||||||||||||||||||
| 22 | lastName => 'Warring', | ||||||||||||||||||||||||||||
| 23 | }); | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | my $launch_context = Bb::Collaborate::Ultra::LaunchContext->new({ launchingRole => 'moderator', | ||||||||||||||||||||||||||||
| 26 | editingPermission => 'writer', | ||||||||||||||||||||||||||||
| 27 | user => $user, | ||||||||||||||||||||||||||||
| 28 | }); | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | =head1 METHODS | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | See L<https://xx-csa.bbcollab.com/documentation#Launch-context>. | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | =cut | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | =head2 join_session | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | my $join_url = $launch_context->join_session($session); | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | Obtain a url to join a particular session. | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | =cut | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | sub join_session { | ||||||||||||||||||||||||||||
| 46 | 0 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
join_session: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 47 | 0 | my $session = shift; | |||||||||||||||||||||||||||
| 48 | 0 | ▶ | my $connection = shift || $session->connection | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
shift() || $session->connection
MC/DC0%0/2
shift() || $session->connection
shift()
$session->connection
Truth table0%0/3
A || B
A= shift()B= $session->connection
| |||||||||||||||||||||||||||||
| 49 | or die "not connected"; | ||||||||||||||||||||||||||||
| 50 | 0 | my $session_path = $session->path.'/url'; | |||||||||||||||||||||||||||
| 51 | 0 | my $data = $self->_freeze; | |||||||||||||||||||||||||||
| 52 | 0 | my $response = $connection->POST($session_path, $data); | |||||||||||||||||||||||||||
| 53 | 0 | my $msg = $response; | |||||||||||||||||||||||||||
| 54 | 0 | $msg->{url}; | |||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | 2 | __PACKAGE__->load_schema(<DATA>); | |||||||||||||||||||||||||||
| 58 | 2 | 1; | |||||||||||||||||||||||||||
| 59 | # downloaded from https://xx-csa.bbcollab.com/documentation | ||||||||||||||||||||||||||||
| 60 | __DATA__ | ||||||||||||||||||||||||||||