granicus-platform-api 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/granicus-platform-api/client.rb +19 -0
- data/lib/granicus-platform-api/version.rb +1 -1
- data/spec/granicus-platform-api_spec.rb +32 -0
- metadata +14 -14
data/Gemfile.lock
CHANGED
@@ -229,6 +229,15 @@ module GranicusPlatformAPI
|
|
229
229
|
call_soap_method(:get_event_meta_data,'//ns5:GetEventMetaDataResponse/metadata',{ 'EventID' => event_id })
|
230
230
|
end
|
231
231
|
|
232
|
+
# import metadata for an event
|
233
|
+
def import_event_meta_data(event_id,meta_data,clear_existing=true,as_tree=true)
|
234
|
+
call_soap_method(:import_event_meta_data,'//ns5:ImportEventMetaDataResponse/KeyTable',{
|
235
|
+
'EventID' => event_id,
|
236
|
+
'MetaData' => meta_data,
|
237
|
+
'ClearExisting' => clear_existing,
|
238
|
+
'AsTree' => as_tree})
|
239
|
+
end
|
240
|
+
|
232
241
|
# set the event agenda url
|
233
242
|
def set_event_agenda_url(event_id,url)
|
234
243
|
call_soap_method(:set_event_agenda_url,'//ns4:SetEventAgendaURLResponse',{ 'EventID' => event_id, 'URL' => url })
|
@@ -239,6 +248,16 @@ module GranicusPlatformAPI
|
|
239
248
|
call_soap_method(:get_clip_meta_data,'//ns5:GetClipMetaDataResponse/metadata',{ 'ClipID' => clip_id })
|
240
249
|
end
|
241
250
|
|
251
|
+
# import metadata for a clip
|
252
|
+
# ImportClipMetaData Method (ClipID, MetaData, ClearExisting, AsTree)
|
253
|
+
def import_clip_meta_data(clip_id,meta_data,clear_existing=true,as_tree=true)
|
254
|
+
call_soap_method(:import_clip_meta_data,'//ns5:ImportClipMetaDataResponse/KeyTable',{
|
255
|
+
'ClipID' => clip_id,
|
256
|
+
'MetaData' => meta_data,
|
257
|
+
'ClearExisting' => clear_existing,
|
258
|
+
'AsTree' => as_tree})
|
259
|
+
end
|
260
|
+
|
242
261
|
# get meta data by id
|
243
262
|
def get_meta_data(meta_id)
|
244
263
|
call_soap_method(:get_meta_data,'//ns5:GetMetaDataResponse/MetaData', { 'MetaDataID' => meta_id })
|
@@ -6,9 +6,11 @@ GRANICUS_PASSWORD = ENV['PASSWORD']
|
|
6
6
|
CAMERA_ID = 3
|
7
7
|
FOLDER_ID = 7
|
8
8
|
EVENT_ID = 30
|
9
|
+
IMPORT_EVENT_ID = 26
|
9
10
|
UPDATE_EVENT_ID = 35
|
10
11
|
EVENT_META_ID = 1775
|
11
12
|
CLIP_ID = 246
|
13
|
+
IMPORT_CLIP_ID = 375
|
12
14
|
CLIP_UID = 'fe2a4b4b-0a69-1029-bc86-1bdd06848612'
|
13
15
|
EVENT_UID = '5fa327b8-906b-102b-b291-2f582cd39e9e'
|
14
16
|
CLIP_META_ID = 574
|
@@ -72,6 +74,20 @@ describe GranicusPlatformAPI, "::Client Event Methods" do
|
|
72
74
|
event3.Name.should == 'test my new event'
|
73
75
|
client.delete_event new_event_id
|
74
76
|
end
|
77
|
+
it "should import metadata" do
|
78
|
+
meta_arr = []
|
79
|
+
meta1 = GranicusPlatformAPI::MetaDataData.new
|
80
|
+
meta1.Name = 'test'
|
81
|
+
meta1.ForeignID = 1
|
82
|
+
meta2 = GranicusPlatformAPI::MetaDataData.new
|
83
|
+
meta2.Name = 'test 2'
|
84
|
+
meta2.ForeignID = 2
|
85
|
+
meta_arr << meta1
|
86
|
+
meta_arr << meta2
|
87
|
+
keytable = client.import_event_meta_data IMPORT_EVENT_ID, meta_arr
|
88
|
+
keytable[0].ForeignID.should == 1
|
89
|
+
keytable[1].ForeignID.should == 2
|
90
|
+
end
|
75
91
|
it "should get all events with matching foreign id" do
|
76
92
|
events = client.get_events_by_foreign_id EVENT_FOREIGN_ID
|
77
93
|
events.each do |event|
|
@@ -137,6 +153,22 @@ describe GranicusPlatformAPI, "::Client Clip Methods" do
|
|
137
153
|
clip = client.get_clip_by_uid CLIP_UID
|
138
154
|
clip.UID.should == CLIP_UID
|
139
155
|
end
|
156
|
+
it "should import metadata" do
|
157
|
+
meta_arr = []
|
158
|
+
meta1 = GranicusPlatformAPI::MetaDataData.new
|
159
|
+
meta1.Name = 'test'
|
160
|
+
meta1.TimeStamp = 0
|
161
|
+
meta1.ForeignID = 1
|
162
|
+
meta2 = GranicusPlatformAPI::MetaDataData.new
|
163
|
+
meta2.Name = 'test 2'
|
164
|
+
meta2.TimeStamp = 30
|
165
|
+
meta2.ForeignID = 2
|
166
|
+
meta_arr << meta1
|
167
|
+
meta_arr << meta2
|
168
|
+
keytable = client.import_clip_meta_data IMPORT_CLIP_ID, meta_arr
|
169
|
+
keytable[0].ForeignID.should == 1
|
170
|
+
keytable[1].ForeignID.should == 2
|
171
|
+
end
|
140
172
|
end
|
141
173
|
|
142
174
|
describe GranicusPlatformAPI, "::Client MetaData Methods" do
|
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.7
|
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-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156479600 !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: *2156479600
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: simplecov
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156479100 !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: *2156479100
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: hashie
|
38
|
-
requirement: &
|
38
|
+
requirement: &2156478640 !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: *2156478640
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: savon
|
49
|
-
requirement: &
|
49
|
+
requirement: &2156478180 !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: *2156478180
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: savon
|
60
|
-
requirement: &
|
60
|
+
requirement: &2156477720 !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: *2156477720
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: hashie
|
71
|
-
requirement: &
|
71
|
+
requirement: &2156477260 !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: *2156477260
|
80
80
|
description: Wrapper for the Granicus Open Platform API v1.x
|
81
81
|
email: javier@granicus.com
|
82
82
|
executables: []
|