granicus-platform-api 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +15 -11
- data/lib/granicus-platform-api/client.rb +19 -2
- data/lib/granicus-platform-api/version.rb +1 -1
- data/spec/granicus-platform-api_spec.rb +8 -2
- metadata +14 -14
data/Gemfile.lock
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
granicus-platform-api (0.1.
|
4
|
+
granicus-platform-api (0.1.8)
|
5
5
|
hashie (~> 1.0.0)
|
6
6
|
savon (~> 0.9.2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: http://rubygems.org/
|
10
10
|
specs:
|
11
|
-
|
11
|
+
akami (1.0.0)
|
12
|
+
gyoku (>= 0.4.0)
|
13
|
+
builder (3.0.0)
|
12
14
|
diff-lcs (1.1.2)
|
13
15
|
gyoku (0.4.4)
|
14
16
|
builder (>= 2.1.2)
|
15
17
|
hashie (1.0.0)
|
16
|
-
httpi (0.9.
|
17
|
-
pyu-ntlm-http (>= 0.1.3.1)
|
18
|
+
httpi (0.9.5)
|
18
19
|
rack
|
19
|
-
nokogiri (1.
|
20
|
-
nori (1.0.
|
21
|
-
pyu-ntlm-http (0.1.3.1)
|
20
|
+
nokogiri (1.5.0)
|
21
|
+
nori (1.0.2)
|
22
22
|
rack (1.3.0)
|
23
23
|
rspec (2.6.0)
|
24
24
|
rspec-core (~> 2.6.0)
|
@@ -28,15 +28,19 @@ GEM
|
|
28
28
|
rspec-expectations (2.6.0)
|
29
29
|
diff-lcs (~> 1.1.2)
|
30
30
|
rspec-mocks (2.6.0)
|
31
|
-
savon (0.9.
|
31
|
+
savon (0.9.5)
|
32
|
+
akami (~> 1.0)
|
32
33
|
builder (>= 2.1.2)
|
33
34
|
gyoku (>= 0.4.0)
|
34
|
-
httpi (
|
35
|
+
httpi (~> 0.9)
|
35
36
|
nokogiri (>= 1.4.0)
|
36
|
-
nori (
|
37
|
+
nori (~> 1.0)
|
38
|
+
wasabi (~> 1.0)
|
37
39
|
simplecov (0.4.2)
|
38
40
|
simplecov-html (~> 0.4.4)
|
39
|
-
simplecov-html (0.4.
|
41
|
+
simplecov-html (0.4.5)
|
42
|
+
wasabi (1.0.0)
|
43
|
+
nokogiri (>= 1.4.0)
|
40
44
|
|
41
45
|
PLATFORMS
|
42
46
|
ruby
|
@@ -226,7 +226,12 @@ module GranicusPlatformAPI
|
|
226
226
|
|
227
227
|
# return all of the event meta data
|
228
228
|
def get_event_meta_data(event_id)
|
229
|
-
call_soap_method(:get_event_meta_data,'//ns5:GetEventMetaDataResponse/metadata',{ 'EventID' => event_id })
|
229
|
+
build_meta_tree call_soap_method(:get_event_meta_data,'//ns5:GetEventMetaDataResponse/metadata',{ 'EventID' => event_id })
|
230
|
+
end
|
231
|
+
|
232
|
+
# return all of the event meta data by UID
|
233
|
+
def get_event_meta_data_by_uid(event_uid)
|
234
|
+
build_meta_tree call_soap_method(:get_event_meta_data_by_uid,'//ns5:GetEventMetaDataByUIDResponse/metadata',{ 'EventUID' => event_uid })
|
230
235
|
end
|
231
236
|
|
232
237
|
# import metadata for an event
|
@@ -245,7 +250,7 @@ module GranicusPlatformAPI
|
|
245
250
|
|
246
251
|
# return all of the clip meta data
|
247
252
|
def get_clip_meta_data(clip_id)
|
248
|
-
call_soap_method(:get_clip_meta_data,'//ns5:GetClipMetaDataResponse/metadata',{ 'ClipID' => clip_id })
|
253
|
+
build_meta_tree call_soap_method(:get_clip_meta_data,'//ns5:GetClipMetaDataResponse/metadata',{ 'ClipID' => clip_id })
|
249
254
|
end
|
250
255
|
|
251
256
|
# import metadata for a clip
|
@@ -424,6 +429,18 @@ module GranicusPlatformAPI
|
|
424
429
|
end
|
425
430
|
end
|
426
431
|
|
432
|
+
# translate metadata list returned by the get_event and get_clip meta data functions into a tree
|
433
|
+
def build_meta_tree(list,parent_id=0)
|
434
|
+
tree = []
|
435
|
+
list.each do |item|
|
436
|
+
if item.ParentID == parent_id
|
437
|
+
item.Children = build_meta_tree list, item.ID
|
438
|
+
tree << item
|
439
|
+
end
|
440
|
+
end
|
441
|
+
tree
|
442
|
+
end
|
443
|
+
|
427
444
|
# typecasts ripped from rubiii/nori, adapted for xsd types
|
428
445
|
def self.typecasts
|
429
446
|
@@typecasts
|
@@ -18,7 +18,7 @@ CLIP_FOREIGN_ID = 1
|
|
18
18
|
EVENT_FOREIGN_ID = 1
|
19
19
|
SERVER_ID = 2
|
20
20
|
|
21
|
-
client = GranicusPlatformAPI::Client.new GRANICUS_SITE, GRANICUS_LOGIN, GRANICUS_PASSWORD
|
21
|
+
client = GranicusPlatformAPI::Client.new GRANICUS_SITE, GRANICUS_LOGIN, GRANICUS_PASSWORD
|
22
22
|
|
23
23
|
# The projects method
|
24
24
|
describe GranicusPlatformAPI, "::Client.new" do
|
@@ -27,7 +27,7 @@ describe GranicusPlatformAPI, "::Client.new" do
|
|
27
27
|
logon.should == GRANICUS_LOGIN
|
28
28
|
end
|
29
29
|
it "should support impersonation" do
|
30
|
-
client2 = GranicusPlatformAPI::Client.new GRANICUS_SITE,nil,nil
|
30
|
+
client2 = GranicusPlatformAPI::Client.new GRANICUS_SITE,nil,nil
|
31
31
|
client2.impersonate client.impersonation_token
|
32
32
|
client2.get_current_user_logon.should == client.get_current_user_logon
|
33
33
|
end
|
@@ -185,6 +185,12 @@ end
|
|
185
185
|
describe GranicusPlatformAPI, "::Client MetaData Methods" do
|
186
186
|
it "should get an event's meta data" do
|
187
187
|
metadata = client.get_event_meta_data EVENT_ID
|
188
|
+
puts metadata
|
189
|
+
found = metadata.find {|m| m.ID == EVENT_META_ID }
|
190
|
+
found.should_not == nil
|
191
|
+
end
|
192
|
+
it "should get an event's meta data by UID" do
|
193
|
+
metadata = client.get_event_meta_data_by_uid EVENT_UID
|
188
194
|
found = metadata.find {|m| m.ID == EVENT_META_ID }
|
189
195
|
found.should_not == nil
|
190
196
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: granicus-platform-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-07-
|
12
|
+
date: 2011-07-12 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2153494980 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '2.6'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2153494980
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: simplecov
|
27
|
-
requirement: &
|
27
|
+
requirement: &2165109940 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.4.0
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2165109940
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: hashie
|
38
|
-
requirement: &
|
38
|
+
requirement: &2165109480 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.0.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2165109480
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: savon
|
49
|
-
requirement: &
|
49
|
+
requirement: &2165109020 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.9.2
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2165109020
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: savon
|
60
|
-
requirement: &
|
60
|
+
requirement: &2165108560 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.9.2
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2165108560
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: hashie
|
71
|
-
requirement: &
|
71
|
+
requirement: &2165108100 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: 1.0.0
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2165108100
|
80
80
|
description: Wrapper for the Granicus Open Platform API v1.x
|
81
81
|
email: javier@granicus.com
|
82
82
|
executables: []
|