|
8 | 8 | require 'bigbluebutton_exception' |
9 | 9 | require 'bigbluebutton_formatter' |
10 | 10 | require 'bigbluebutton_modules' |
11 | | -require 'bigbluebutton_config_xml' |
12 | | -require 'bigbluebutton_config_layout' |
13 | 11 | require 'logger' |
14 | 12 |
|
15 | 13 | module BigBlueButton |
@@ -550,88 +548,10 @@ def delete_recordings(recordIDs, options={}) |
550 | 548 | send_api_request(:deleteRecordings, params) |
551 | 549 | end |
552 | 550 |
|
553 | | - |
554 | | - # |
555 | | - # API calls since 0.81 |
556 | | - # |
557 | | - |
558 | | - # Retrieves the default config.xml file from the server. |
559 | | - # Returns the XML as a string by default, but if `asObject` is set to true, returns the XML |
560 | | - # parsed as an XmlSimple object (). |
561 | | - # asObject (Hash):: If true, returns the XML parsed as an XmlSimple object, using: |
562 | | - # data = XmlSimple.xml_in(response, { 'ForceArray' => false, 'KeepRoot' => true }) |
563 | | - # You can then parse it back into an XML string using: |
564 | | - # XmlSimple.xml_out(data, { 'RootName' => nil, 'XmlDeclaration' => true }) |
565 | | - # If set to false, returns the XML as a string. |
566 | | - # options (Hash):: Hash with additional parameters. This method doesn't accept additional |
567 | | - # parameters, but if you have a custom API with more parameters, you |
568 | | - # can simply pass them in this hash and they will be added to the API call. |
569 | | - def get_default_config_xml(asObject=false, options={}) |
570 | | - response = send_api_request(:getDefaultConfigXML, options, nil, true) |
571 | | - if asObject |
572 | | - XmlSimple.xml_in(response, { 'ForceArray' => false, 'KeepRoot' => true }) |
573 | | - else |
574 | | - response |
575 | | - end |
576 | | - end |
577 | | - |
578 | | - # Sets a config.xml file in the server. |
579 | | - # Returns the token returned by the server (that can be later used in a 'join' call) in case |
580 | | - # of success. |
581 | | - # meeting_id (string):: The ID of the meeting where this config.xml will be used. |
582 | | - # xml (string|BigBlueButtonConfigXml):: The XML that should be sent as a config.xml. |
583 | | - # It will usually be an edited output of the default config.xml: |
584 | | - # xml = api.get_default_config_xml |
585 | | - # Or you can use directly a BigBlueButtonConfigXml object: |
586 | | - # BigBlueButtonConfigXml.new(xml) |
587 | | - # options (Hash):: Hash with additional parameters. This method doesn't accept additional |
588 | | - # parameters, but if you have a custom API with more parameters, you |
589 | | - # can simply pass them in this hash and they will be added to the API call. |
590 | | - # TODO: Right now we are sending the configXML parameters in the URL and in the body of the POST |
591 | | - # request. It works if left only in the URL, but the documentation of the API claims that it has |
592 | | - # to be in the body of the request. So it's no clear yet and this might change in the future. |
593 | | - def set_config_xml(meeting_id, xml, options={}) |
594 | | - if xml.instance_of?(BigBlueButton::BigBlueButtonConfigXml) |
595 | | - data = xml.as_string |
596 | | - else |
597 | | - data = xml |
598 | | - end |
599 | | - params = { :meetingID => meeting_id, :configXML => data }.merge(options) |
600 | | - response = send_api_request(:setConfigXML, params, data) |
601 | | - response[:configToken] |
602 | | - end |
603 | | - |
604 | | - |
605 | 551 | # |
606 | 552 | # Helper functions |
607 | 553 | # |
608 | 554 |
|
609 | | - # Returns an array with the name of all layouts available in the server. |
610 | | - # Will fetch the config.xml file (unless passed in the arguments), fetch the |
611 | | - # layout definition file, and return the layouts. |
612 | | - # If something goes wrong, returns nil. Otherwise returns the list of layout |
613 | | - # names or an empty array if there's no layout defined. |
614 | | - def get_available_layouts(config_xml=nil) |
615 | | - config_xml = get_default_config_xml if config_xml.nil? |
616 | | - config_xml = BigBlueButton::BigBlueButtonConfigXml.new(config_xml) |
617 | | - layout_config = config_xml.get_attribute("LayoutModule", "layoutConfig", true) |
618 | | - unless layout_config.nil? |
619 | | - response = send_request(layout_config) |
620 | | - layout_config = BigBlueButton::BigBlueButtonConfigLayout.new(response.body) |
621 | | - layout_config.get_available_layouts |
622 | | - else |
623 | | - nil |
624 | | - end |
625 | | - end |
626 | | - |
627 | | - # Returns an array with the layouts that exist by default in a BigBlueButton |
628 | | - # server. If you want to query the server to get a real list of layouts, use |
629 | | - # <tt>get_available_layouts</tt>. |
630 | | - def get_default_layouts |
631 | | - # this is the list for BigBlueButton 0.81 |
632 | | - ["Default", "Video Chat", "Meeting", "Webinar", "Lecture assistant", "Lecture"] |
633 | | - end |
634 | | - |
635 | 555 | # Make a simple request to the server to test the connection. |
636 | 556 | def test_connection |
637 | 557 | response = send_api_request(:index) |
@@ -687,15 +607,10 @@ def get_url(method, params={}) |
687 | 607 | checksum_param = method.to_s + checksum_param |
688 | 608 | checksum = @sha256 ? Digest::SHA256.hexdigest(checksum_param) : Digest::SHA1.hexdigest(checksum_param) |
689 | 609 |
|
690 | | - if method == :setConfigXML |
691 | | - params_string = "checksum=#{checksum}&#{params_string}" |
692 | | - return "#{@url}/#{method}", params_string |
693 | | - else |
694 | | - url = "#{@url}/#{method}?" |
695 | | - url += "#{params_string}&" unless params_string.empty? |
696 | | - url += "checksum=#{checksum}" |
697 | | - return url, nil |
698 | | - end |
| 610 | + url = "#{@url}/#{method}?" |
| 611 | + url += "#{params_string}&" unless params_string.empty? |
| 612 | + url += "checksum=#{checksum}" |
| 613 | + return url, nil |
699 | 614 | end |
700 | 615 |
|
701 | 616 | # Performs an API call. |
|
0 commit comments