adobe_connect_api 0.0.14.alpha → 0.0.15.alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- # A filter defeinition can be added to some actions to filter the results
1
+ # A filter definition can be added to some actions to filter the results
2
2
  # server-side. Example:
3
3
  # filter = AdobeConnectAPI::FilterDefinition.new
4
4
  # filter["sco-id"].greater_than 25
@@ -1,3 +1,3 @@
1
1
  module AdobeConnectApi
2
- VERSION = "0.0.14.alpha"
2
+ VERSION = "0.0.15.alpha"
3
3
  end
@@ -126,7 +126,8 @@ class AdobeConnectAPI
126
126
 
127
127
  # TODO KG: add host
128
128
  # create a new meeting in Adobe Connect
129
- def create_meeting(name, folder_id, url_path)
129
+ # e.g. "https://collab-test.switch.ch/api/xml?action=sco-update&type=meeting&name=API-Test&folder-id=12578070&date-begin=2012-06-15T17:00&date-end=2012-06-15T23:00&url-path=apitest"
130
+ def create_meeting(name, folder_id, url_path, host)
130
131
 
131
132
  if folder_id == nil
132
133
  folder_id = 12578070
@@ -140,18 +141,44 @@ class AdobeConnectAPI
140
141
  "folder-id" => folder_id,
141
142
  "url_path" => url_path)
142
143
 
143
- puts query
144
-
145
144
  puts "ACS: meeting created"
146
145
  puts response.body
147
146
  data = XmlSimple.xml_in(response.body)
148
- scos = []
149
- if data["sco-search-by-field-info"]
150
- results = data["sco-search-by-field-info"][0]
151
- scos = results["sco"]
147
+ sco_id = data.first.attr('sco-id')
148
+
149
+ #get principal id
150
+ principal_id = get_principal_id(host)
151
+ puts "ACS: add principal " + principal_id + " as host to new created meeting " + sco_id
152
+
153
+ # TODO: aktuellen Benutzer als Host hinzufügen:
154
+ # https://collab-test.switch.ch/api/xml?action=permissions-update&principal-id=12578066&acl-id=13112626&permission-id=host
155
+ # Als acl-id wird die sco-id der Antwort des "Meeting anlegen"-Requests verwendet.
156
+ end
157
+
158
+ # searches the user with the given email address and returns the principal id
159
+ # e.g. "https://collab-test.switch.ch/api/xml?action=principal-list&filter-email=rfurter@ethz.ch"
160
+ def get_principal_id(email)
161
+
162
+ filter = AdobeConnectAPI::FilterDefinition.new
163
+ filter["email"] == email
164
+
165
+ res = query("principal-list", filter)
166
+ puts query
167
+
168
+ data = XmlSimple.xml_in(res.body)
169
+ rows = []
170
+ if data["principal-list"]
171
+ data["principal-list"].each do |trans|
172
+ rows = trans["principal"]
173
+ end
152
174
  end
153
- return AdobeConnectAPI::Result.new(data["status"][0]["code"], scos)
154
- # https://collab-test.switch.ch/api/xml?action=sco-update&type=meeting&name=API-Test&folder-id=12578070&date-begin=2012-06-15T17:00&date-end=2012-06-15T23:00&url-path=apitest
175
+ result = AdobeConnectAPI::Result.new(data["status"][0]["code"], rows)
176
+
177
+ puts result
178
+
179
+ principal_id = result.first.attr('principal-id')
180
+ puts principal-id
181
+ return principal-id
155
182
  end
156
183
 
157
184
  #Returns all defined quotas (untested)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adobe_connect_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14.alpha
4
+ version: 0.0.15.alpha
5
5
  prerelease: 7
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-09-25 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: xml-simple
16
- requirement: &2161463000 !ruby/object:Gem::Requirement
16
+ requirement: &2153211760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2161463000
24
+ version_requirements: *2153211760
25
25
  description: Wrapper to the Adobe Connect API
26
26
  email:
27
27
  - christian.rohrer@switch.ch