Class: Bigbluebutton::RoomsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Bigbluebutton::RoomsController
- Defined in:
- app/controllers/bigbluebutton/rooms_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #end ⇒ Object
- #fetch_recordings ⇒ Object
- #generate_dial_number ⇒ Object
- #index ⇒ Object
-
#invite ⇒ Object
Used to join private rooms or to invite anonymous users (not logged).
-
#join ⇒ Object
Used to join users into a meeting.
- #join_mobile ⇒ Object
- #new ⇒ Object
- #recordings ⇒ Object
- #running ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods included from BigbluebuttonRails::InternalControllerMethods
Instance Method Details
#create ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 38 def create @room ||= BigbluebuttonRoom.new(room_params) if params[:bigbluebutton_room] and (not params[:bigbluebutton_room].has_key?(:meetingid) or params[:bigbluebutton_room][:meetingid].blank?) @room.meetingid = @room.name end respond_with @room do |format| if @room.save = t('bigbluebutton_rails.rooms.notice.create.success') format.html { redirect_to_using_params (@room), :notice => } else format.html { = t('bigbluebutton_rails.rooms.notice.create.failure') redirect_to_params_or_render :new, :error => } end end end |
#destroy ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 78 def destroy error = false begin @room.fetch_is_running? @room.send_end if @room.is_running? = t('bigbluebutton_rails.rooms.notice.destroy.success') rescue BigBlueButton::BigBlueButtonException => e error = true = t('bigbluebutton_rails.rooms.notice.destroy.success_with_bbb_error', :error => e.to_s[0..200]) end # TODO: what if it fails? @room.destroy respond_with do |format| format.html { flash[:error] = if error redirect_to_using_params } end end |
#edit ⇒ Object
34 35 36 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 34 def edit respond_with(@room) end |
#end ⇒ Object
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 132 def end error = false begin @room.fetch_is_running? if @room.is_running? @room.send_end = t('bigbluebutton_rails.rooms.notice.end.success') else error = true = t('bigbluebutton_rails.rooms.notice.end.not_running') end rescue BigBlueButton::BigBlueButtonException => e error = true = e.to_s[0..200] end if error respond_with do |format| format.html { flash[:error] = redirect_to_using_params :back } end else respond_with do |format| format.html { redirect_to_using_params (@room), :notice => } end end end |
#fetch_recordings ⇒ Object
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 171 def fetch_recordings error = false begin result = @room.fetch_recordings if result = t('bigbluebutton_rails.rooms.notice.fetch_recordings.success') else error = true = t('bigbluebutton_rails.rooms.errors.fetch_recordings.no_server') end rescue BigBlueButton::BigBlueButtonException => e error = true = e.to_s[0..200] end respond_with do |format| format.html { flash[error ? :error : :notice] = redirect_to_using_params (@room) } format.json { if error render :json => { :message => }, :status => :error else render :json => true, :status => :ok end } end end |
#generate_dial_number ⇒ Object
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 207 def generate_dial_number pattern = params[:pattern].blank? ? nil : params[:pattern] if @room.generate_dial_number!(pattern) = t('bigbluebutton_rails.rooms.notice.generate_dial_number.success') respond_with do |format| format.html { redirect_to_using_params :back, notice: } end else = t('bigbluebutton_rails.rooms.errors.generate_dial_number.not_unique') respond_with do |format| format.html { flash[:error] = redirect_to_using_params :back } end end end |
#index ⇒ Object
20 21 22 23 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 20 def index @rooms ||= BigbluebuttonRoom.all respond_with(@rooms) end |
#invite ⇒ Object
Used to join private rooms or to invite anonymous users (not logged)
107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 107 def invite respond_with @room do |format| @user_role = (@room) if @user_role.nil? raise BigbluebuttonRails::RoomAccessDenied.new else format.html end end end |
#join ⇒ Object
Used to join users into a meeting. Most of the work is done in before filters. Can be called via GET or POST and accepts parameters both in the POST data and URL.
102 103 104 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 102 def join join_internal(@user_name, @user_role, @user_id) end |
#join_mobile ⇒ Object
165 166 167 168 169 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 165 def join_mobile filtered_params = select_params_for_join_mobile(params.clone) @join_mobile = (@room, filtered_params.merge({:auto_join => '1' })) @join_desktop = (@room, filtered_params.merge({:desktop => '1' })) end |
#new ⇒ Object
29 30 31 32 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 29 def new @room ||= BigbluebuttonRoom.new respond_with(@room) end |
#recordings ⇒ Object
202 203 204 205 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 202 def recordings @recordings ||= @room.recordings respond_with(@recordings) end |
#running ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 120 def running begin @room.fetch_is_running? rescue BigBlueButton::BigBlueButtonException => e flash[:error] = e.to_s[0..200] render :json => { :running => "false", :error => "#{e.to_s[0..200]}" } else info = @room.fetch_meeting_info render :json => { :running => "#{@room.is_running?}", :participants_qty => info} end end |
#show ⇒ Object
25 26 27 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 25 def show respond_with(@room) end |
#update ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'app/controllers/bigbluebutton/rooms_controller.rb', line 62 def update respond_with @room do |format| if @room.update_attributes(room_params) = t('bigbluebutton_rails.rooms.notice.update.success') format.html { redirect_to_using_params (@room), :notice => } else format.html { = t('bigbluebutton_rails.rooms.notice.update.failure') redirect_to_params_or_render :edit, :error => } end end end |