bigbluebutton_rails 1.4.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +7 -0
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +10 -1
  4. data/CHANGELOG.md +259 -0
  5. data/Gemfile +14 -19
  6. data/Gemfile.lock +194 -188
  7. data/README.md +416 -0
  8. data/Rakefile +12 -12
  9. data/TODO.md +13 -0
  10. data/app/controllers/bigbluebutton/playback_types_controller.rb +44 -0
  11. data/app/controllers/bigbluebutton/recordings_controller.rb +17 -10
  12. data/app/controllers/bigbluebutton/rooms_controller.rb +65 -36
  13. data/app/controllers/bigbluebutton/servers_controller.rb +12 -8
  14. data/app/models/bigbluebutton_metadata.rb +1 -1
  15. data/app/models/bigbluebutton_playback_format.rb +22 -1
  16. data/app/models/bigbluebutton_playback_type.rb +29 -0
  17. data/app/models/bigbluebutton_recording.rb +38 -19
  18. data/app/models/bigbluebutton_room.rb +150 -73
  19. data/app/models/bigbluebutton_room_options.rb +10 -7
  20. data/app/models/bigbluebutton_server.rb +69 -13
  21. data/app/models/bigbluebutton_server_config.rb +49 -0
  22. data/app/views/bigbluebutton/recordings/_form.html.erb +4 -0
  23. data/app/views/bigbluebutton/recordings/_recordings.html.erb +10 -3
  24. data/app/views/bigbluebutton/rooms/_form.html.erb +18 -6
  25. data/app/views/bigbluebutton/rooms/_rooms.html.erb +6 -3
  26. data/app/views/bigbluebutton/rooms/invite.html.erb +5 -5
  27. data/app/views/bigbluebutton/rooms/show.html.erb +18 -6
  28. data/app/views/bigbluebutton/servers/_form.html.erb +1 -1
  29. data/app/views/bigbluebutton/servers/show.html.erb +5 -0
  30. data/app/workers/bigbluebutton_finish_meetings.rb +11 -0
  31. data/app/workers/bigbluebutton_update_recordings.rb +11 -0
  32. data/app/workers/bigbluebutton_update_server_configs.rb +18 -0
  33. data/bigbluebutton_rails.gemspec +8 -7
  34. data/config/locales/en.yml +52 -7
  35. data/config/locales/pt-br.yml +162 -0
  36. data/config/resque/resque.rake +27 -0
  37. data/config/resque/workers_schedule.yml +17 -0
  38. data/lib/bigbluebutton_rails.rb +30 -2
  39. data/lib/bigbluebutton_rails/background_tasks.rb +31 -0
  40. data/lib/bigbluebutton_rails/controller_methods.rb +12 -8
  41. data/lib/bigbluebutton_rails/dial_number.rb +48 -0
  42. data/lib/bigbluebutton_rails/rails/routes.rb +9 -2
  43. data/lib/bigbluebutton_rails/utils.rb +9 -2
  44. data/lib/bigbluebutton_rails/version.rb +1 -1
  45. data/lib/generators/bigbluebutton_rails/install_generator.rb +0 -8
  46. data/lib/generators/bigbluebutton_rails/templates/migration.rb +28 -6
  47. data/lib/generators/bigbluebutton_rails/templates/migration_2_0_0.rb +56 -0
  48. data/lib/tasks/bigbluebutton_rails/meetings.rake +1 -13
  49. data/lib/tasks/bigbluebutton_rails/recordings.rake +1 -12
  50. data/lib/tasks/bigbluebutton_rails/server_configs.rake +10 -0
  51. data/spec/bigbluebutton_rails_spec.rb +0 -13
  52. data/spec/controllers/bigbluebutton/playback_types_controller_spec.rb +76 -0
  53. data/spec/controllers/bigbluebutton/recordings_controller_spec.rb +109 -37
  54. data/spec/controllers/bigbluebutton/rooms_controller_exception_handling_spec.rb +1 -0
  55. data/spec/controllers/bigbluebutton/rooms_controller_json_responses_spec.rb +27 -3
  56. data/spec/controllers/bigbluebutton/rooms_controller_spec.rb +338 -77
  57. data/spec/controllers/bigbluebutton/servers_controller_json_responses_spec.rb +8 -0
  58. data/spec/controllers/bigbluebutton/servers_controller_spec.rb +182 -47
  59. data/spec/factories/bigbluebutton_meeting.rb +2 -2
  60. data/spec/factories/bigbluebutton_playback_format.rb +2 -2
  61. data/spec/factories/bigbluebutton_playback_type.rb +7 -0
  62. data/spec/factories/bigbluebutton_recording.rb +8 -0
  63. data/spec/factories/bigbluebutton_room.rb +10 -3
  64. data/spec/factories/bigbluebutton_server.rb +6 -1
  65. data/spec/factories/bigbluebutton_server_config.rb +6 -0
  66. data/spec/generators/install_generator_spec.rb +0 -16
  67. data/spec/lib/bigbluebutton_rails/background_tasks_spec.rb +61 -0
  68. data/spec/lib/bigbluebutton_rails/dial_number_spec.rb +78 -0
  69. data/spec/lib/bigbluebutton_rails/utils_spec.rb +56 -0
  70. data/spec/lib/tasks/meetings_rake_spec.rb +14 -1
  71. data/spec/lib/tasks/recordings_rake_spec.rb +14 -1
  72. data/spec/models/bigbluebutton_meeting_db_spec.rb +3 -3
  73. data/spec/models/bigbluebutton_meeting_spec.rb +4 -4
  74. data/spec/models/bigbluebutton_playback_format_db_spec.rb +0 -1
  75. data/spec/models/bigbluebutton_playback_format_spec.rb +75 -4
  76. data/spec/models/bigbluebutton_playback_type_db_spec.rb +14 -0
  77. data/spec/models/bigbluebutton_playback_type_spec.rb +76 -0
  78. data/spec/models/bigbluebutton_recording_db_spec.rb +3 -1
  79. data/spec/models/bigbluebutton_recording_spec.rb +234 -58
  80. data/spec/models/bigbluebutton_room_db_spec.rb +8 -6
  81. data/spec/models/bigbluebutton_room_options_db_spec.rb +1 -0
  82. data/spec/models/bigbluebutton_room_options_spec.rb +137 -38
  83. data/spec/models/bigbluebutton_room_spec.rb +540 -153
  84. data/spec/models/bigbluebutton_server_config_spec.rb +115 -0
  85. data/spec/models/bigbluebutton_server_spec.rb +180 -23
  86. data/spec/rails_app/app/controllers/my_playback_types_controller.rb +7 -0
  87. data/spec/rails_app/app/views/frontpage/show.html.erb +1 -0
  88. data/spec/rails_app/app/views/my_playback_types/index.html.erb +33 -0
  89. data/spec/rails_app/config/application.rb +0 -3
  90. data/spec/rails_app/config/database.yml.travis +10 -0
  91. data/spec/rails_app/config/environments/development.rb +1 -6
  92. data/spec/rails_app/config/environments/production.rb +2 -0
  93. data/spec/rails_app/config/environments/test.rb +2 -0
  94. data/spec/rails_app/config/routes.rb +5 -2
  95. data/spec/rails_app/db/seeds.rb +1 -1
  96. data/spec/rails_app/features/config.yml.example +3 -4
  97. data/spec/rails_app/features/join_rooms.feature +14 -14
  98. data/spec/rails_app/features/step_definitions/activity_monitor_servers_step.rb +2 -2
  99. data/spec/rails_app/features/step_definitions/create_rooms_steps.rb +4 -4
  100. data/spec/rails_app/features/step_definitions/destroy_rooms_steps.rb +2 -2
  101. data/spec/rails_app/features/step_definitions/join_rooms_steps.rb +10 -10
  102. data/spec/rails_app/features/step_definitions/web_steps.rb +2 -2
  103. data/spec/rails_app/features/support/configurations.rb +1 -1
  104. data/spec/rails_app/features/support/templates.rb +12 -12
  105. data/spec/rails_app/lib/tasks/db/populate.rake +19 -6
  106. data/spec/routing/bigbluebutton/custom_controllers_routing_spec.rb +1 -1
  107. data/spec/routing/bigbluebutton/recordings_only_routing_spec.rb +2 -2
  108. data/spec/routing/bigbluebutton/recordings_routing_spec.rb +2 -2
  109. data/spec/routing/bigbluebutton/rooms_only_routing_spec.rb +1 -1
  110. data/spec/routing/bigbluebutton/rooms_routing_spec.rb +15 -1
  111. data/spec/routing/bigbluebutton/servers_only_routing_spec.rb +1 -1
  112. data/spec/routing/bigbluebutton/servers_routing_spec.rb +1 -1
  113. data/spec/spec_helper.rb +23 -31
  114. data/spec/support/matchers/delegate_matcher.rb +8 -1
  115. data/spec/support/matchers/shoulda/respond_with_json_matcher.rb +2 -2
  116. data/spec/support/mocked_server.rb +2 -0
  117. data/spec/support/shared_contexts/rake.rb +23 -0
  118. data/spec/workers/bigbluebutton_finish_meetings_spec.rb +14 -0
  119. data/spec/workers/bigbluebutton_update_recordings_spec.rb +14 -0
  120. data/spec/workers/bigbluebutton_update_server_configs_spec.rb +47 -0
  121. metadata +70 -59
  122. data/CHANGELOG.rdoc +0 -111
  123. data/README.rdoc +0 -319
  124. data/TODO.rdoc +0 -16
  125. data/config/schedule.rb +0 -7
@@ -0,0 +1,115 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ describe BigbluebuttonServerConfig do
5
+
6
+ before { mock_server_and_api }
7
+
8
+ it { should belong_to(:server) }
9
+ it { should validate_presence_of(:server_id) }
10
+ it { should serialize(:available_layouts).as(Array) }
11
+
12
+ describe "serializes #available_layouts as an Array" do
13
+ let(:config) { FactoryGirl.create(:bigbluebutton_server_config) }
14
+ let(:layouts) { ["layout1", "layout2"] }
15
+
16
+ it {
17
+ config.update_attributes(available_layouts: layouts)
18
+ config.available_layouts.should eq(layouts)
19
+ }
20
+ end
21
+
22
+ describe "#update_config" do
23
+ let(:config) { FactoryGirl.create(:bigbluebutton_server_config, server: mocked_server) }
24
+ let(:layouts) { ["layout1", "layout2"] }
25
+ let(:new_layouts) { ["layout3", "layout4"] }
26
+
27
+ before {
28
+ mocked_api.should_receive(:get_default_config_xml).and_return("<config></config>")
29
+ config.update_attributes(available_layouts: layouts)
30
+ }
31
+
32
+ context "when there are new layouts in the server" do
33
+ before {
34
+ mocked_api.should_receive(:get_available_layouts).and_return(new_layouts)
35
+ config.update_config
36
+ }
37
+ it { config.available_layouts.should eql new_layouts }
38
+ end
39
+
40
+ context "when there are no new layouts" do
41
+ before {
42
+ mocked_api.should_receive(:get_available_layouts).once.and_return(nil)
43
+ expect(config).not_to receive(:update_attributes)
44
+ config.update_config
45
+ }
46
+ it { config.available_layouts.should eql layouts }
47
+ end
48
+
49
+ context "rescues from BigBlueButton::BigBlueButtonException" do
50
+ before {
51
+ mocked_api.stub(:get_available_layouts) { raise BigBlueButton::BigBlueButtonException.new }
52
+ expect(config).not_to receive(:update_attributes)
53
+ }
54
+ it {
55
+ expect { config.update_config }.not_to raise_error
56
+ }
57
+ end
58
+ end
59
+
60
+ describe "#available_layouts_names" do
61
+ let(:layouts) { ["layout1", "bbb.test.layout2", "Wëird Chárs"] }
62
+ let(:expected) { ["layout1", "layout2", "Wëird Chárs"] }
63
+ let(:config) { FactoryGirl.create(:bigbluebutton_server_config, available_layouts: layouts) }
64
+
65
+ before {
66
+ I18n.stub(:t) { |value|
67
+ case value
68
+ when "bigbluebutton_rails.server_configs.layouts.layout1"
69
+ "Layout1 Localized"
70
+ when "bigbluebutton_rails.server_configs.layouts.layout2"
71
+ "Layout2 Localized"
72
+ when "bigbluebutton_rails.server_configs.layouts.weird_chars"
73
+ "Weird Localized"
74
+ else
75
+ nil
76
+ end
77
+ }
78
+ }
79
+
80
+ it {
81
+ config.available_layouts_names.should eql(['Layout1 Localized', 'Layout2 Localized', 'Weird Localized'])
82
+ }
83
+ end
84
+
85
+ describe "#available_layouts_for_select" do
86
+ let(:layouts) { ["layout1", "bbb.test.layout2", "Wëird Chárs"] }
87
+ let(:expected) { ["layout1", "layout2", "Wëird Chárs"] }
88
+ let(:config) { FactoryGirl.create(:bigbluebutton_server_config, available_layouts: layouts) }
89
+
90
+ before {
91
+ I18n.stub(:t) { |value|
92
+ case value
93
+ when "bigbluebutton_rails.server_configs.layouts.layout1"
94
+ "Layout1 Localized"
95
+ when "bigbluebutton_rails.server_configs.layouts.layout2"
96
+ "Layout2 Localized"
97
+ when "bigbluebutton_rails.server_configs.layouts.weird_chars"
98
+ "Weird Localized"
99
+ else
100
+ nil
101
+ end
102
+ }
103
+ }
104
+
105
+ it {
106
+ config.available_layouts_for_select.should eql(
107
+ [
108
+ ['Layout1 Localized', 'layout1'],
109
+ ['Layout2 Localized', 'bbb.test.layout2'],
110
+ ['Weird Localized', 'Wëird Chárs']
111
+ ]
112
+ )
113
+ }
114
+ end
115
+ end
@@ -10,10 +10,16 @@ describe BigbluebuttonServer do
10
10
 
11
11
  it { should have_many(:recordings).dependent(:nullify) }
12
12
 
13
+ it { should have_one(:config).dependent(:destroy) }
14
+ it { should delegate(:update_config).to(:config) }
15
+
16
+ it { should delegate(:available_layouts).to(:config) }
17
+ it { should delegate(:available_layouts_names).to(:config) }
18
+ it { should delegate(:available_layouts_for_select).to(:config) }
19
+
13
20
  it { should validate_presence_of(:name) }
14
21
  it { should validate_presence_of(:url) }
15
22
  it { should validate_presence_of(:salt) }
16
- it { should validate_presence_of(:version) }
17
23
  it { should validate_presence_of(:param) }
18
24
 
19
25
  context "uniqueness of" do
@@ -62,11 +68,14 @@ describe BigbluebuttonServer do
62
68
  end
63
69
 
64
70
  context "supported versions" do
65
- it { should allow_value('0.7').for(:version) }
66
71
  it { should allow_value('0.8').for(:version) }
67
- it { should_not allow_value('').for(:version) }
72
+ it { should allow_value('0.81').for(:version) }
73
+ it { should allow_value('0.9').for(:version) }
74
+ it { should allow_value('').for(:version) }
75
+ it { should allow_value(nil).for(:version) }
68
76
  it { should_not allow_value('0.64').for(:version) }
69
77
  it { should_not allow_value('0.6').for(:version) }
78
+ it { should_not allow_value('0.7').for(:version) }
70
79
  end
71
80
 
72
81
  context "param format" do
@@ -90,7 +99,7 @@ describe BigbluebuttonServer do
90
99
 
91
100
  context "sets param as the downcased parameterized name if param is" do
92
101
  after :each do
93
- @server.save.should be_true
102
+ @server.save.should be(true)
94
103
  @server.param.should == @server.name.downcase.parameterize
95
104
  end
96
105
  it "nil" do
@@ -103,28 +112,45 @@ describe BigbluebuttonServer do
103
112
  end
104
113
  end
105
114
 
106
- context "has an api object" do
107
- let(:server) { server = FactoryGirl.build(:bigbluebutton_server) }
115
+ context "#api" do
116
+ let(:server) { FactoryGirl.build(:bigbluebutton_server) }
108
117
  it { should respond_to(:api) }
109
118
  it { server.api.should_not be_nil }
110
- it {
111
- server.save
112
- server.api.should_not be_nil
113
- }
119
+
114
120
  context "with the correct attributes" do
115
- let(:api) { api = BigBlueButton::BigBlueButtonApi.new(server.url, server.salt,
116
- server.version, false) }
121
+ let(:api) { BigBlueButton::BigBlueButtonApi.new(server.url, server.salt, server.version, false) }
117
122
  it { server.api.should == api }
118
123
 
119
124
  # updating any of these attributes should update the api
120
125
  { :url => 'http://anotherurl.com/bigbluebutton/api',
121
- :salt => '12345-abcde-67890-fghijk', :version => '0.8' }.each do |k,v|
126
+ :salt => '12345-abcde-67890-fghijk', :version => '0.9' }.each do |k,v|
122
127
  it {
123
128
  server.send("#{k}=", v)
124
129
  server.api.send(k).should == v
125
130
  }
126
131
  end
127
132
  end
133
+
134
+ context "returns the cached API object, if any" do
135
+ it {
136
+ BigBlueButton::BigBlueButtonApi.should_receive(:new).once.and_return("fake api")
137
+ server.api
138
+ server.api
139
+ }
140
+ end
141
+
142
+ context "automatically fetches the API version if the version if not set" do
143
+ before(:each) {
144
+ server.update_attributes(version: nil)
145
+ BigBlueButton::BigBlueButtonApi.any_instance.stub(:get_api_version).and_return("0.9")
146
+ }
147
+ it { server.api.version.should eql("0.9") }
148
+ it {
149
+ server.api
150
+ server.version.should eql("0.9")
151
+ server.reload.version.should be_nil # doesn't save it
152
+ }
153
+ end
128
154
  end
129
155
 
130
156
  context "initializes" do
@@ -163,11 +189,11 @@ describe BigbluebuttonServer do
163
189
  @api_mock.should_receive(:get_meetings).and_return(hash)
164
190
  server.fetch_meetings
165
191
 
166
- # the passwords are updated during fetch_meetings
167
- room1.moderator_password = "mp"
168
- room1.attendee_password = "ap"
169
- room2.moderator_password = "pass"
170
- room2.attendee_password = "pass"
192
+ # the keys are updated during fetch_meetings
193
+ room1.moderator_api_password = "mp"
194
+ room1.attendee_api_password = "ap"
195
+ room2.moderator_api_password = "pass"
196
+ room2.attendee_api_password = "pass"
171
197
  }
172
198
 
173
199
  it { server.meetings.count.should be(3) }
@@ -176,12 +202,12 @@ describe BigbluebuttonServer do
176
202
  it { server.meetings[2].meetingid.should == "im not in the db" }
177
203
  it { server.meetings[2].name.should == "im not in the db" }
178
204
  it { server.meetings[2].server.should == server }
179
- it { server.meetings[2].attendee_password.should == "pass" }
180
- it { server.meetings[2].moderator_password.should == "pass" }
205
+ it { server.meetings[2].attendee_api_password.should == "pass" }
206
+ it { server.meetings[2].moderator_api_password.should == "pass" }
181
207
  it { server.meetings[2].running.should == true }
182
- it { server.meetings[2].new_record?.should be_true }
183
- it { server.meetings[2].external.should be_true }
184
- it { server.meetings[2].private.should be_true }
208
+ it { server.meetings[2].new_record?.should be_truthy }
209
+ it { server.meetings[2].external.should be_truthy }
210
+ it { server.meetings[2].private.should be_truthy }
185
211
 
186
212
  it "updates the meeting associated with this room"
187
213
  end
@@ -268,4 +294,135 @@ describe BigbluebuttonServer do
268
294
  end
269
295
  end
270
296
 
297
+ describe "#config" do
298
+ it "is created when the server is created" do
299
+ server = FactoryGirl.create(:bigbluebutton_server)
300
+ server.config.should_not be_nil
301
+ server.config.should be_an_instance_of(BigbluebuttonServerConfig)
302
+ server.config.server.should eql(server)
303
+ end
304
+
305
+ context "if it was not created, is built when accessed" do
306
+ before(:each) {
307
+ @server = FactoryGirl.create(:bigbluebutton_server)
308
+ @server.config.destroy
309
+ @server.reload
310
+ @server.config # access it so the new obj is created
311
+ }
312
+ it { @server.config.should_not be_nil }
313
+ it("is not promptly saved") {
314
+ @server.config.new_record?.should be(true)
315
+ }
316
+ it("is saved when the server is saved") {
317
+ @server.save!
318
+ @server.reload
319
+ @server.config.new_record?.should be(false)
320
+ }
321
+ end
322
+ end
323
+
324
+ describe "triggers #update_config" do
325
+
326
+ context "on after create" do
327
+ it {
328
+ BigbluebuttonServerConfig.any_instance.should_receive(:update_config).once
329
+ FactoryGirl.create(:bigbluebutton_server)
330
+ }
331
+ end
332
+
333
+ context "on after save" do
334
+ let(:server) { FactoryGirl.create(:bigbluebutton_server, version: "0.8") }
335
+ before { server.stub(:set_api_version_from_server) }
336
+
337
+ context "if #url changed" do
338
+ before { server.should_receive(:update_config).once }
339
+ it { server.update_attributes(url: server.url + "-2") }
340
+ end
341
+
342
+ context "if #salt changed" do
343
+ before { server.should_receive(:update_config).once }
344
+ it { server.update_attributes(salt: server.salt + "-2") }
345
+ end
346
+
347
+ context "if #version changed" do
348
+ before { server.should_receive(:update_config).once }
349
+ it { server.update_attributes(version: "0.9") }
350
+ end
351
+
352
+ context "not if any other attribute changed" do
353
+ before { server.should_not_receive(:update_config) }
354
+ it { server.update_attributes(name: server.name + "-2") }
355
+ end
356
+ end
357
+ end
358
+
359
+ describe "triggers #set_api_version_from_server" do
360
+
361
+ context "on after save" do
362
+ let(:server) { FactoryGirl.create(:bigbluebutton_server, version: "0.8") }
363
+
364
+ context "when the model is created" do
365
+ it {
366
+ s = FactoryGirl.build(:bigbluebutton_server, version: nil)
367
+ s.should_receive(:set_api_version_from_server).once
368
+ s.save
369
+ }
370
+ end
371
+
372
+ context "if #url changed" do
373
+ before { server.should_receive(:set_api_version_from_server).once }
374
+ it { server.update_attributes(url: server.url + "-2") }
375
+ end
376
+
377
+ context "if #salt changed" do
378
+ before { server.should_receive(:set_api_version_from_server).once }
379
+ it { server.update_attributes(salt: server.salt + "-2") }
380
+ end
381
+
382
+ context "if #version changed" do
383
+ before { server.should_receive(:set_api_version_from_server).once }
384
+ it { server.update_attributes(version: "0.9") }
385
+ end
386
+
387
+ context "not if #name changed" do
388
+ before { server.should_not_receive(:set_api_version_from_server) }
389
+ it { server.update_attributes(name: server.name + "-2") }
390
+ end
391
+
392
+ # Specific test for when we have a version set in the server, set it to a blank value,
393
+ # and it ends up getting the same old version from the server.
394
+ # Depending on how the hooks to update the version are set up, this won't work.
395
+ context "checking the real value of #version" do
396
+ let(:version_from_api) { "0.9" }
397
+ let(:old_version) { "0.9" }
398
+ let(:server) { FactoryGirl.create(:bigbluebutton_server, version: version_from_api) }
399
+
400
+ context "if #version was set to empty" do
401
+ before {
402
+ api_mock = double(BigBlueButton::BigBlueButtonApi)
403
+ api_mock.stub(:version).and_return(version_from_api)
404
+ api_mock.stub(:get_default_config_xml)
405
+ api_mock.stub(:get_available_layouts)
406
+ BigBlueButton::BigBlueButtonApi.stub(:new).and_return(api_mock)
407
+ }
408
+ it {
409
+ server.update_attributes(version: "")
410
+ server.reload.version.should eql(version_from_api)
411
+ }
412
+ end
413
+
414
+ context "doesn't raise an exception if the server is offline" do
415
+ before {
416
+ BigBlueButton::BigBlueButtonApi.stub(:new) { raise BigBlueButton::BigBlueButtonException.new('test exception') }
417
+ }
418
+ it {
419
+ server.update_attributes(url: "http://insert-any-invalid-url.mconf.org/bigbluebutton/api")
420
+ server.reload.version.should be_nil
421
+ }
422
+ end
423
+
424
+ end
425
+ end
426
+ end
427
+
271
428
  end
@@ -0,0 +1,7 @@
1
+ class MyPlaybackTypesController < ApplicationController
2
+ respond_to :html
3
+
4
+ def index
5
+ respond_with(@playback_types = BigbluebuttonPlaybackType.all)
6
+ end
7
+ end
@@ -3,3 +3,4 @@
3
3
  <%= link_to('View server list', bigbluebutton_servers_path) %> (<%= @servers.count %> servers)<br/>
4
4
  <%= link_to('View room list', bigbluebutton_rooms_path) %> (<%= @rooms.count %> rooms)<br/>
5
5
  <%= link_to('View recording list', bigbluebutton_recordings_path) %> (<%= @recordings.count %> recordings)<br/>
6
+ <%= link_to('Show or hide playback types', my_playback_types_path) %>
@@ -0,0 +1,33 @@
1
+ <h1>Listing Playback Types:</h1>
2
+
3
+ <div id="bbbrails_servers_links">
4
+ <%= link_to('View server list', bigbluebutton_servers_path) %><br/>
5
+ <%= link_to('View room list', bigbluebutton_rooms_path) %><br/>
6
+ <%= link_to('View recording list', bigbluebutton_recordings_path) %>
7
+ </div>
8
+
9
+ </br></br>
10
+ The list of playback types will be automatically filled with the playback types available in your web conference server.
11
+ You can use this views to make them visible or invisible, a feature useful to dynamically hide playback types you don't
12
+ want the users to have access in your application.
13
+ </br></br>
14
+
15
+ <ul id="bbbrails_list">
16
+ <% @playback_types.each do |playback_type| %>
17
+ <li>
18
+ <%= form_for(playback_type) do |f| %>
19
+ <div><label><%= BigbluebuttonPlaybackType.human_attribute_name(:id) %></label> <%= playback_type.id %></div>
20
+ <div><label><%= BigbluebuttonPlaybackType.human_attribute_name(:identifier) %></label> <%= playback_type.identifier %></div>
21
+ <div><label><%= BigbluebuttonPlaybackType.human_attribute_name(:visible) %></label>
22
+ <%= f.check_box :visible %>
23
+ </div>
24
+ <div><label><%= BigbluebuttonPlaybackType.human_attribute_name(:default) %></label>
25
+ <%= f.check_box :default %>
26
+ </div>
27
+ <div><label>Access</label>
28
+ <%= f.submit %>
29
+ </div>
30
+ <% end %>
31
+ </li>
32
+ <% end %>
33
+ </ul>
@@ -54,8 +54,5 @@ module RailsApp
54
54
 
55
55
  # Version of your assets, change this if you want to expire all your assets
56
56
  config.assets.version = '1.0'
57
-
58
- # Disabled rails 3.2 attr_accessible in favor of strong_parameters
59
- config.active_record.whitelist_attributes = false
60
57
  end
61
58
  end
@@ -0,0 +1,10 @@
1
+ test:
2
+ adapter: mysql2
3
+ database: bigbluebutton_rails_test
4
+ username: travis
5
+ encoding: utf8
6
+ development:
7
+ adapter: mysql2
8
+ database: bigbluebutton_rails_dev
9
+ username: travis
10
+ encoding: utf8