Class: Bigbluebutton::ServersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Bigbluebutton::ServersController
- Defined in:
- app/controllers/bigbluebutton/servers_controller.rb
Instance Method Summary collapse
- #activity ⇒ Object
- #check ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
-
#fetch_recordings ⇒ Object
- Accepts the following parameters in URL: meetings
-
A list of meetingIDs to be used as filter.
- #index ⇒ Object
- #new ⇒ Object
- #publish_recordings ⇒ Object
- #recordings ⇒ Object
- #show ⇒ Object
- #unpublish_recordings ⇒ Object
- #update ⇒ Object
Methods included from BigbluebuttonRails::InternalControllerMethods
Instance Method Details
#activity ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 25 def activity error = false begin @server.fetch_meetings @server.meetings.each do |meeting| meeting.fetch_meeting_info end rescue BigBlueButton::BigBlueButtonException => e error = true = e.to_s[0..200] end # update_list works only for html if params[:update_list] && (params[:format].nil? || params[:format].to_s == "html") render :partial => 'activity_list', :locals => { :server => @server } return end respond_with @server.meetings do |format| # we return/render the fetched meetings even in case of error # but we set the error message in the response if error flash[:error] = format.html { render :activity } else format.html end end end |
#check ⇒ Object
143 144 145 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 143 def check redirect_to @server.check_url end |
#create ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 55 def create @server ||= BigbluebuttonServer.new(server_params) respond_with @server do |format| if @server.save format.html { = t('bigbluebutton_rails.servers.notice.create.success') redirect_to_using_params @server, :notice => } else format.html { redirect_to_params_or_render :new } end end end |
#destroy ⇒ Object
83 84 85 86 87 88 89 90 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 83 def destroy # TODO: what if it fails? @server.destroy respond_with do |format| format.html { redirect_to_using_params } end end |
#edit ⇒ Object
21 22 23 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 21 def edit respond_with(@server) end |
#fetch_recordings ⇒ Object
Accepts the following parameters in URL:
- meetings
-
A list of meetingIDs to be used as filter.
- meta_*
-
To filter by metadata, where “*” can be anything.
For example: fetch_recordings?meetings=meeting1,meeting2&meta_name=value
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 110 def fetch_recordings error = false begin # accept meetingID and meta_* filters filter = {} filter.merge!({ :meetingID => params[:meetings] }) if params[:meetings] params.each do |key, value| filter.merge!({ key.to_sym => value }) if key.match(/^meta_/) end @server.fetch_recordings(filter) = t('bigbluebutton_rails.servers.notice.fetch_recordings.success') rescue BigBlueButton::BigBlueButtonException => e error = true = e.to_s[0..200] end respond_with do |format| format.html { flash[error ? :error : :notice] = redirect_to (@server) } format.json { if error render :json => { :message => }, :status => :error else render :json => true, :status => :ok end } end end |
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 7 def index @servers ||= BigbluebuttonServer.all respond_with(@servers) end |
#new ⇒ Object
16 17 18 19 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 16 def new @server ||= BigbluebuttonServer.new respond_with(@server) end |
#publish_recordings ⇒ Object
97 98 99 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 97 def publish_recordings self.publish_unpublish(params[:recordings], true) end |
#recordings ⇒ Object
92 93 94 95 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 92 def recordings @recordings ||= @server.recordings respond_with(@recordings) end |
#show ⇒ Object
12 13 14 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 12 def show respond_with(@server) end |
#unpublish_recordings ⇒ Object
101 102 103 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 101 def unpublish_recordings self.publish_unpublish(params[:recordings], false) end |
#update ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'app/controllers/bigbluebutton/servers_controller.rb', line 70 def update respond_with @server do |format| if @server.update_attributes(server_params) format.html { = t('bigbluebutton_rails.servers.notice.update.success') redirect_to_using_params @server, :notice => } else format.html { redirect_to_params_or_render :edit } end end end |