| 1 | package Bb::Collaborate::V3::Presentation; | ||
| 2 | 7 | ▶ | use warnings; use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 7 | ▶ | use Mouse; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 7 | extends 'Bb::Collaborate::V3::_Content'; | |
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | Bb::Collaborate::V3::Presentation - Presentation entity class | ||
| 11 | |||
| 12 | =head1 DESCRIPTION | ||
| 13 | |||
| 14 | This command uploads presentation files, such as Collaborate whiteboard files or I<Plan!> files for use by your Collaborate sessions. | ||
| 15 | |||
| 16 | Once uploaded, you will need to "attach" the file to one or more Collaborate | ||
| 17 | sessions using the L<Bb::Collaborate::V3::Session> C<set_presentation()> method. | ||
| 18 | |||
| 19 | =cut | ||
| 20 | |||
| 21 | 7 | __PACKAGE__->entity_name('Presentation'); | |
| 22 | |||
| 23 | =head1 PROPERTIES | ||
| 24 | |||
| 25 | =head2 presentationId (Int) | ||
| 26 | |||
| 27 | Identifier of the presentation file in the ELM repository. | ||
| 28 | |||
| 29 | =cut | ||
| 30 | |||
| 31 | 7 | has 'presentationId' => (is => 'rw', isa => 'Int', required => 1); | |
| 32 | 7 | __PACKAGE__->primary_key('presentationId'); | |
| 33 | 7 | __PACKAGE__->params( | |
| 34 | content => 'Str', | ||
| 35 | filename => 'Str', | ||
| 36 | sessionId => 'Int', | ||
| 37 | ); | ||
| 38 | |||
| 39 | =head2 description (Str) | ||
| 40 | |||
| 41 | A description of the presentation content. | ||
| 42 | |||
| 43 | =cut | ||
| 44 | |||
| 45 | 7 | has 'description' => (is => 'rw', isa => 'Str'); | |
| 46 | |||
| 47 | =head2 size (Int) | ||
| 48 | |||
| 49 | The size of the presentation file (bytes), once uploaded to the ELM repository. | ||
| 50 | |||
| 51 | =cut | ||
| 52 | |||
| 53 | 7 | has 'size' => (is => 'rw', isa => 'Int'); | |
| 54 | |||
| 55 | =head2 creatorId (Str) | ||
| 56 | |||
| 57 | The identifier of the owner of the presentation file. | ||
| 58 | |||
| 59 | =cut | ||
| 60 | |||
| 61 | 7 | has 'creatorId' => (is => 'rw', isa => 'Str'); | |
| 62 | |||
| 63 | =head2 filename (Str) | ||
| 64 | |||
| 65 | The name of the presentation file including the file extension. | ||
| 66 | |||
| 67 | Collaborate supports the following presentation file types: | ||
| 68 | |||
| 69 | =over 4 | ||
| 70 | |||
| 71 | =item * Collaborate Whiteboard files: C<.wbd>, C<.wbp> | ||
| 72 | |||
| 73 | =item * Collaborate Plan! files: C<.elp>, C<.elpx>. | ||
| 74 | |||
| 75 | =back | ||
| 76 | |||
| 77 | Note: The filename must be less than 64 characters (including any file extensions) | ||
| 78 | |||
| 79 | =cut | ||
| 80 | |||
| 81 | =head1 METHODS | ||
| 82 | |||
| 83 | =cut | ||
| 84 | |||
| 85 | =head2 upload | ||
| 86 | |||
| 87 | Uploads content and creates a new presentation resource. | ||
| 88 | |||
| 89 | You can either upload a file: | ||
| 90 | |||
| 91 | # 1. upload a local file | ||
| 92 | my $presentation = Bb::Collaborate::V3::Presentation->upload('c:\\Documents\intro.wbd'); | ||
| 93 | $some_session->set_presentation( $presentation ); | ||
| 94 | |||
| 95 | or source binary data for the presentation. | ||
| 96 | |||
| 97 | # 2. source our own binary content | ||
| 98 | open (my $fh, '<', $presentation_path) | ||
| 99 | or die "unable to open $presentation_path: $!"; | ||
| 100 | $fh->binmode; | ||
| 101 | |||
| 102 | my $content = do {local $/ = undef; <$fh>}; | ||
| 103 | die "no presentation data: $presentation_path" | ||
| 104 | unless ($content); | ||
| 105 | |||
| 106 | my $presentation = Bb::Collaborate::V3::Presentation->upload( | ||
| 107 | { | ||
| 108 | filename => 'myplan.elpx', | ||
| 109 | creatorId => 'bob', | ||
| 110 | content => $content, | ||
| 111 | }, | ||
| 112 | ); | ||
| 113 | |||
| 114 | $some_session->set_presentation( $presentation ); | ||
| 115 | |||
| 116 | =cut | ||
| 117 | |||
| 118 | =head2 list | ||
| 119 | |||
| 120 | my $session_presentations = Bb::Collaborate::V3::Presentation->list( | ||
| 121 | filter => {sessionId => $my_session} | ||
| 122 | ); | ||
| 123 | |||
| 124 | Lists sessions. You will need to provide a filter that contains at least one | ||
| 125 | of: C<creatorId>, C<presentationId>, C<description> or C<sessionId>. | ||
| 126 | |||
| 127 | =cut | ||
| 128 | |||
| 129 | =head2 delete | ||
| 130 | |||
| 131 | $presentation->delete; | ||
| 132 | |||
| 133 | Deletes presentation content from the server and removes it from any associated sessions. | ||
| 134 | |||
| 135 | =cut | ||
| 136 | |||
| 137 | |||
| 138 | 7 | 1; | |