groupdocs 1.5.7 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +51 -0
- data/examples/api-samples/Gemfile +1 -1
- data/examples/api-samples/Gemfile.lock +43 -0
- data/examples/api-samples/public/docs/{sample2.html → sample01.html} +39 -19
- data/examples/api-samples/public/docs/{sample3.html → sample02.html} +28 -22
- data/examples/api-samples/public/docs/sample03.html +285 -0
- data/examples/api-samples/public/docs/{sample4.html → sample04.html} +30 -36
- data/examples/api-samples/public/docs/{sample5.html → sample05.html} +68 -31
- data/examples/api-samples/public/docs/sample06.html +299 -0
- data/examples/api-samples/public/docs/{sample7.html → sample07.html} +53 -18
- data/examples/api-samples/public/docs/{sample8.html → sample08.html} +64 -41
- data/examples/api-samples/public/docs/sample09.html +260 -0
- data/examples/api-samples/public/docs/sample10.html +67 -28
- data/examples/api-samples/public/docs/sample11.html +171 -55
- data/examples/api-samples/public/docs/sample12.html +53 -17
- data/examples/api-samples/public/docs/sample13.html +52 -16
- data/examples/api-samples/public/docs/sample14.html +51 -8
- data/examples/api-samples/public/docs/sample15.html +46 -10
- data/examples/api-samples/public/docs/sample16.html +81 -7
- data/examples/api-samples/public/docs/sample17.html +103 -15
- data/examples/api-samples/public/docs/sample18.html +117 -41
- data/examples/api-samples/public/docs/sample19.html +410 -36
- data/examples/api-samples/public/docs/sample20.html +46 -10
- data/examples/api-samples/public/docs/sample21.html +504 -45
- data/examples/api-samples/public/docs/sample22.html +166 -28
- data/examples/api-samples/public/docs/sample23.html +61 -25
- data/examples/api-samples/public/docs/sample24.html +100 -12
- data/examples/api-samples/public/docs/sample25.html +123 -49
- data/examples/api-samples/public/docs/sample26.html +41 -8
- data/examples/api-samples/public/docs/sample27.html +125 -50
- data/examples/api-samples/public/docs/sample28.html +27 -9
- data/examples/api-samples/public/docs/sample29.html +10 -10
- data/examples/api-samples/public/docs/sample30.html +70 -14
- data/examples/api-samples/public/docs/sample31.html +108 -67
- data/examples/api-samples/public/docs/sample32.html +71 -99
- data/examples/api-samples/public/docs/sample33.html +107 -32
- data/examples/api-samples/public/docs/{sample1.html → sample34.html} +58 -18
- data/examples/api-samples/public/docs/sample35.html +666 -0
- data/examples/api-samples/public/docs/{sample6.html → sample36.html} +56 -37
- data/examples/api-samples/public/docs/sample37.html +815 -0
- data/examples/api-samples/public/docs/sample38.html +508 -0
- data/examples/api-samples/public/docs/sample39.html +921 -0
- data/examples/api-samples/public/docs/sample40.html +510 -0
- data/examples/api-samples/public/docs/sample41.html +452 -0
- data/examples/api-samples/public/docs/sample42.html +311 -0
- data/examples/api-samples/public/templates/test_all_fields2.pdf +0 -0
- data/examples/api-samples/samples/sample01.rb +37 -0
- data/examples/api-samples/samples/sample02.rb +41 -0
- data/examples/api-samples/samples/sample03.rb +73 -0
- data/examples/api-samples/samples/sample04.rb +47 -0
- data/examples/api-samples/samples/{sample5.rb → sample05.rb} +26 -14
- data/examples/api-samples/samples/sample06.rb +80 -0
- data/examples/api-samples/samples/sample07.rb +52 -0
- data/examples/api-samples/samples/sample08.rb +69 -0
- data/examples/api-samples/samples/sample09.rb +83 -0
- data/examples/api-samples/samples/sample10.rb +29 -15
- data/examples/api-samples/samples/sample11.rb +89 -37
- data/examples/api-samples/samples/sample12.rb +22 -11
- data/examples/api-samples/samples/sample13.rb +22 -10
- data/examples/api-samples/samples/sample14.rb +23 -5
- data/examples/api-samples/samples/sample15.rb +18 -7
- data/examples/api-samples/samples/sample16.rb +28 -4
- data/examples/api-samples/samples/sample17.rb +31 -5
- data/examples/api-samples/samples/sample18.rb +36 -8
- data/examples/api-samples/samples/sample19.rb +138 -18
- data/examples/api-samples/samples/sample20.rb +14 -3
- data/examples/api-samples/samples/sample21.rb +162 -23
- data/examples/api-samples/samples/sample22.rb +73 -22
- data/examples/api-samples/samples/sample23.rb +17 -6
- data/examples/api-samples/samples/sample24.rb +34 -7
- data/examples/api-samples/samples/sample25.rb +37 -12
- data/examples/api-samples/samples/sample26.rb +12 -5
- data/examples/api-samples/samples/sample27.rb +38 -12
- data/examples/api-samples/samples/sample28.rb +25 -6
- data/examples/api-samples/samples/sample29.rb +12 -12
- data/examples/api-samples/samples/sample30.rb +27 -15
- data/examples/api-samples/samples/sample31.rb +44 -33
- data/examples/api-samples/samples/sample32.rb +43 -41
- data/examples/api-samples/samples/sample33.rb +42 -14
- data/examples/api-samples/samples/sample34.rb +40 -0
- data/examples/api-samples/samples/sample35.rb +224 -0
- data/examples/api-samples/samples/sample36.rb +58 -0
- data/examples/api-samples/samples/sample37.rb +229 -0
- data/examples/api-samples/samples/sample38.rb +128 -0
- data/examples/api-samples/samples/sample39.rb +252 -0
- data/examples/api-samples/samples/sample40.rb +164 -0
- data/examples/api-samples/samples/sample41.rb +118 -0
- data/examples/api-samples/samples/sample42.rb +97 -0
- data/examples/api-samples/views/_others_samples.haml +25 -11
- data/examples/api-samples/views/index.haml +23 -11
- data/examples/api-samples/views/popup.haml +32 -0
- data/examples/api-samples/views/{sample1.haml → sample01.haml} +12 -7
- data/examples/api-samples/views/{sample2.haml → sample02.haml} +20 -15
- data/examples/api-samples/views/sample03.haml +83 -0
- data/examples/api-samples/views/sample04.haml +49 -0
- data/examples/api-samples/views/{sample5.haml → sample05.haml} +19 -14
- data/examples/api-samples/views/sample06.haml +53 -0
- data/examples/api-samples/views/sample07.haml +47 -0
- data/examples/api-samples/views/{sample8.haml → sample08.haml} +17 -12
- data/examples/api-samples/views/{sample9.haml → sample09.haml} +19 -4
- data/examples/api-samples/views/sample10.haml +18 -13
- data/examples/api-samples/views/sample11.haml +48 -19
- data/examples/api-samples/views/sample12.haml +26 -21
- data/examples/api-samples/views/sample13.haml +18 -12
- data/examples/api-samples/views/sample14.haml +21 -15
- data/examples/api-samples/views/sample15.haml +16 -9
- data/examples/api-samples/views/sample16.haml +18 -5
- data/examples/api-samples/views/sample17.haml +14 -9
- data/examples/api-samples/views/sample18.haml +13 -7
- data/examples/api-samples/views/sample19.haml +37 -8
- data/examples/api-samples/views/sample20.haml +13 -8
- data/examples/api-samples/views/sample21.haml +71 -13
- data/examples/api-samples/views/sample22.haml +53 -16
- data/examples/api-samples/views/sample23.haml +9 -4
- data/examples/api-samples/views/sample24.haml +9 -4
- data/examples/api-samples/views/sample25.haml +18 -13
- data/examples/api-samples/views/sample26.haml +8 -3
- data/examples/api-samples/views/sample27.haml +20 -14
- data/examples/api-samples/views/sample28.haml +16 -10
- data/examples/api-samples/views/sample29.haml +4 -4
- data/examples/api-samples/views/sample30.haml +16 -10
- data/examples/api-samples/views/sample31.haml +39 -32
- data/examples/api-samples/views/sample32.haml +25 -36
- data/examples/api-samples/views/sample33.haml +14 -17
- data/examples/api-samples/views/sample34.haml +48 -0
- data/examples/api-samples/views/sample35.haml +95 -0
- data/examples/api-samples/views/sample36.haml +64 -0
- data/examples/api-samples/views/sample37.haml +124 -0
- data/examples/api-samples/views/sample38.haml +115 -0
- data/examples/api-samples/views/sample39.haml +236 -0
- data/examples/api-samples/views/sample40.haml +95 -0
- data/examples/api-samples/views/{sample4.haml → sample41.haml} +90 -72
- data/examples/api-samples/views/sample42.haml +59 -0
- data/lib/groupdocs/api/helpers/rest_helper.rb +13 -1
- data/lib/groupdocs/datasource.rb +2 -1
- data/lib/groupdocs/document.rb +101 -13
- data/lib/groupdocs/document/annotation.rb +28 -13
- data/lib/groupdocs/document/annotation/marker.rb +18 -0
- data/lib/groupdocs/document/annotation/reply.rb +9 -2
- data/lib/groupdocs/document/field.rb +5 -1
- data/lib/groupdocs/job.rb +12 -2
- data/lib/groupdocs/questionnaire.rb +174 -4
- data/lib/groupdocs/questionnaire/collector.rb +21 -0
- data/lib/groupdocs/questionnaire/question.rb +19 -0
- data/lib/groupdocs/questionnaire/question/answer.rb +5 -0
- data/lib/groupdocs/questionnaire/question/conditions.rb +20 -0
- data/lib/groupdocs/signature.rb +36 -308
- data/lib/groupdocs/signature/envelope.rb +146 -4
- data/lib/groupdocs/signature/field.rb +20 -1
- data/lib/groupdocs/signature/field/location.rb +18 -7
- data/lib/groupdocs/signature/form.rb +199 -10
- data/lib/groupdocs/signature/shared/document_methods.rb +38 -0
- data/lib/groupdocs/signature/shared/entity_methods.rb +0 -1
- data/lib/groupdocs/signature/shared/field_methods.rb +13 -38
- data/lib/groupdocs/signature/shared/recipient_methods.rb +8 -0
- data/lib/groupdocs/signature/template.rb +3 -1
- data/lib/groupdocs/storage.rb +4 -1
- data/lib/groupdocs/storage/file.rb +18 -1
- data/lib/groupdocs/subscription.rb +8 -3
- data/lib/groupdocs/user.rb +8 -0
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/document/annotation_spec.rb +1 -14
- data/spec/groupdocs/subscription_spec.rb +2 -2
- metadata +86 -32
- checksums.yaml +0 -15
- data/examples/api-samples/public/docs/sample9.html +0 -200
- data/examples/api-samples/samples/sample1.rb +0 -25
- data/examples/api-samples/samples/sample2.rb +0 -29
- data/examples/api-samples/samples/sample3.rb +0 -33
- data/examples/api-samples/samples/sample4.rb +0 -51
- data/examples/api-samples/samples/sample6.rb +0 -49
- data/examples/api-samples/samples/sample7.rb +0 -42
- data/examples/api-samples/samples/sample8.rb +0 -61
- data/examples/api-samples/samples/sample9.rb +0 -48
- data/examples/api-samples/views/sample3.haml +0 -44
- data/examples/api-samples/views/sample6.haml +0 -49
- data/examples/api-samples/views/sample7.haml +0 -42
@@ -59,16 +59,20 @@
|
|
59
59
|
<div class="pilwrap ">
|
60
60
|
<a class="pilcrow" href="#section-3">¶</a>
|
61
61
|
</div>
|
62
|
-
<p>
|
62
|
+
<p>Set variables</p>
|
63
63
|
|
64
64
|
</div>
|
65
65
|
|
66
|
-
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:
|
67
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:
|
66
|
+
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
|
67
|
+
set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
|
68
68
|
set <span class="symbol">:fileId</span>, params[<span class="symbol">:fileId</span>]
|
69
69
|
set <span class="symbol">:email</span>, params[<span class="symbol">:email</span>]
|
70
|
-
set <span class="symbol">:first_name</span>, params[<span class="symbol">:
|
71
|
-
set <span class="symbol">:last_name</span>, params[<span class="symbol">:
|
70
|
+
set <span class="symbol">:first_name</span>, params[<span class="symbol">:firstName</span>]
|
71
|
+
set <span class="symbol">:last_name</span>, params[<span class="symbol">:lastName</span>]
|
72
|
+
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
|
73
|
+
set <span class="symbol">:url</span>, params[<span class="symbol">:url</span>]
|
74
|
+
set <span class="symbol">:source</span>, params[<span class="symbol">:source</span>]
|
75
|
+
|
72
76
|
|
73
77
|
<span class="keyword">begin</span></pre></div></div>
|
74
78
|
|
@@ -81,11 +85,13 @@
|
|
81
85
|
<div class="pilwrap ">
|
82
86
|
<a class="pilcrow" href="#section-4">¶</a>
|
83
87
|
</div>
|
84
|
-
<p>
|
88
|
+
<p>Check required variables</p>
|
85
89
|
|
86
90
|
</div>
|
87
91
|
|
88
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.
|
92
|
+
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.email.empty? <span class="keyword">or</span> settings.first_name.empty? <span class="keyword">or</span> settings.last_name.empty?
|
93
|
+
|
94
|
+
<span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div>
|
89
95
|
|
90
96
|
</li>
|
91
97
|
|
@@ -96,15 +102,13 @@
|
|
96
102
|
<div class="pilwrap ">
|
97
103
|
<a class="pilcrow" href="#section-5">¶</a>
|
98
104
|
</div>
|
99
|
-
<p>
|
105
|
+
<p>Configure your access to API server</p>
|
100
106
|
|
101
107
|
</div>
|
102
108
|
|
103
|
-
<div class="content"><div class='highlight'><pre>
|
104
|
-
|
105
|
-
|
106
|
-
user.first_name = settings.first_name
|
107
|
-
user.last_name = settings.last_name</pre></div></div>
|
109
|
+
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
110
|
+
groupdocs.client_id = settings.client_id
|
111
|
+
groupdocs.private_key = settings.private_key</pre></div></div>
|
108
112
|
|
109
113
|
</li>
|
110
114
|
|
@@ -115,11 +119,13 @@
|
|
115
119
|
<div class="pilwrap ">
|
116
120
|
<a class="pilcrow" href="#section-6">¶</a>
|
117
121
|
</div>
|
118
|
-
<p>
|
122
|
+
<p>Optionally specify API server and version</p>
|
119
123
|
|
120
124
|
</div>
|
121
125
|
|
122
|
-
<div class="content"><div class='highlight'><pre>
|
126
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
127
|
+
<span class="keyword">end</span>
|
128
|
+
file = <span class="keyword">nil</span></pre></div></div>
|
123
129
|
|
124
130
|
</li>
|
125
131
|
|
@@ -130,11 +136,12 @@
|
|
130
136
|
<div class="pilwrap ">
|
131
137
|
<a class="pilcrow" href="#section-7">¶</a>
|
132
138
|
</div>
|
133
|
-
<p>
|
139
|
+
<p>get document by file GUID</p>
|
134
140
|
|
135
141
|
</div>
|
136
142
|
|
137
|
-
<div class="content"><div class='highlight'><pre>
|
143
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.source
|
144
|
+
<span class="keyword">when</span> <span class="string">'guid'</span></pre></div></div>
|
138
145
|
|
139
146
|
</li>
|
140
147
|
|
@@ -145,11 +152,13 @@
|
|
145
152
|
<div class="pilwrap ">
|
146
153
|
<a class="pilcrow" href="#section-8">¶</a>
|
147
154
|
</div>
|
148
|
-
<p>
|
155
|
+
<p>Create instance of File</p>
|
149
156
|
|
150
157
|
</div>
|
151
158
|
|
152
|
-
<div class="content"><div class='highlight'><pre>
|
159
|
+
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.new({<span class="symbol">:guid</span> => settings.fileId})
|
160
|
+
<span class="keyword">when</span> <span class="string">'local'</span>
|
161
|
+
filepath = <span class="string">"<span class="subst">#{<span class="constant">Dir</span>.tmpdir}</span>/<span class="subst">#{params[<span class="symbol">:file</span>][<span class="symbol">:filename</span>]}</span>"</span></pre></div></div>
|
153
162
|
|
154
163
|
</li>
|
155
164
|
|
@@ -160,11 +169,11 @@
|
|
160
169
|
<div class="pilwrap ">
|
161
170
|
<a class="pilcrow" href="#section-9">¶</a>
|
162
171
|
</div>
|
163
|
-
<p>
|
172
|
+
<p>Open file</p>
|
164
173
|
|
165
174
|
</div>
|
166
175
|
|
167
|
-
<div class="content"><div class='highlight'><pre>
|
176
|
+
<div class="content"><div class='highlight'><pre> <span class="constant">File</span>.open(filepath, <span class="string">'wb'</span>) { |f| f.write(params[<span class="symbol">:file</span>][<span class="symbol">:tempfile</span>].read) }</pre></div></div>
|
168
177
|
|
169
178
|
</li>
|
170
179
|
|
@@ -175,11 +184,12 @@
|
|
175
184
|
<div class="pilwrap ">
|
176
185
|
<a class="pilcrow" href="#section-10">¶</a>
|
177
186
|
</div>
|
178
|
-
<p>
|
187
|
+
<p>Make a request to API using client_id and private_key</p>
|
179
188
|
|
180
189
|
</div>
|
181
190
|
|
182
|
-
<div class="content"><div class='highlight'><pre>
|
191
|
+
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(filepath, {})
|
192
|
+
<span class="keyword">when</span> <span class="string">'url'</span></pre></div></div>
|
183
193
|
|
184
194
|
</li>
|
185
195
|
|
@@ -190,11 +200,139 @@
|
|
190
200
|
<div class="pilwrap ">
|
191
201
|
<a class="pilcrow" href="#section-11">¶</a>
|
192
202
|
</div>
|
193
|
-
<p>
|
203
|
+
<p>Upload file from defined url</p>
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload_web!(settings.url)
|
208
|
+
<span class="keyword">else</span>
|
209
|
+
raise <span class="string">'Wrong GUID source.'</span>
|
210
|
+
<span class="keyword">end</span>
|
211
|
+
|
212
|
+
|
213
|
+
file = file.to_document</pre></div></div>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
|
218
|
+
<li id="section-12">
|
219
|
+
<div class="annotation">
|
220
|
+
|
221
|
+
<div class="pilwrap ">
|
222
|
+
<a class="pilcrow" href="#section-12">¶</a>
|
223
|
+
</div>
|
224
|
+
<p>Create new user</p>
|
225
|
+
|
226
|
+
</div>
|
227
|
+
|
228
|
+
<div class="content"><div class='highlight'><pre> user = <span class="constant">GroupDocs::User</span>.new
|
229
|
+
|
230
|
+
user.primary_email = settings.email
|
231
|
+
user.nickname = settings.email
|
232
|
+
user.first_name = settings.first_name
|
233
|
+
user.last_name = settings.last_name
|
234
|
+
|
235
|
+
user.roles = [{<span class="symbol">:id</span> => <span class="string">'3'</span>, <span class="symbol">:name</span> => <span class="string">'User'</span>}]</pre></div></div>
|
236
|
+
|
237
|
+
</li>
|
238
|
+
|
239
|
+
|
240
|
+
<li id="section-13">
|
241
|
+
<div class="annotation">
|
242
|
+
|
243
|
+
<div class="pilwrap ">
|
244
|
+
<a class="pilcrow" href="#section-13">¶</a>
|
245
|
+
</div>
|
246
|
+
<p>Update account</p>
|
194
247
|
|
195
248
|
</div>
|
196
249
|
|
197
|
-
<div class="content"><div class='highlight'><pre>
|
250
|
+
<div class="content"><div class='highlight'><pre> new_user = <span class="constant">GroupDocs::User</span>.update_account!(user)</pre></div></div>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
<li id="section-14">
|
256
|
+
<div class="annotation">
|
257
|
+
|
258
|
+
<div class="pilwrap ">
|
259
|
+
<a class="pilcrow" href="#section-14">¶</a>
|
260
|
+
</div>
|
261
|
+
<p>Set new collaboration</p>
|
262
|
+
|
263
|
+
</div>
|
264
|
+
|
265
|
+
<div class="content"><div class='highlight'><pre> file.set_collaborators!([settings.email], <span class="number">2</span>)</pre></div></div>
|
266
|
+
|
267
|
+
</li>
|
268
|
+
|
269
|
+
|
270
|
+
<li id="section-15">
|
271
|
+
<div class="annotation">
|
272
|
+
|
273
|
+
<div class="pilwrap ">
|
274
|
+
<a class="pilcrow" href="#section-15">¶</a>
|
275
|
+
</div>
|
276
|
+
<p>Get all collaborations</p>
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<div class="content"><div class='highlight'><pre> collaborations = file.collaborators!()</pre></div></div>
|
281
|
+
|
282
|
+
</li>
|
283
|
+
|
284
|
+
|
285
|
+
<li id="section-16">
|
286
|
+
<div class="annotation">
|
287
|
+
|
288
|
+
<div class="pilwrap ">
|
289
|
+
<a class="pilcrow" href="#section-16">¶</a>
|
290
|
+
</div>
|
291
|
+
<p>Set document reviewers</p>
|
292
|
+
|
293
|
+
</div>
|
294
|
+
|
295
|
+
<div class="content"><div class='highlight'><pre> file.set_reviewers!(collaborations)</pre></div></div>
|
296
|
+
|
297
|
+
</li>
|
298
|
+
|
299
|
+
|
300
|
+
<li id="section-17">
|
301
|
+
<div class="annotation">
|
302
|
+
|
303
|
+
<div class="pilwrap ">
|
304
|
+
<a class="pilcrow" href="#section-17">¶</a>
|
305
|
+
</div>
|
306
|
+
<p>Get url from request</p>
|
307
|
+
|
308
|
+
</div>
|
309
|
+
|
310
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.base_path
|
311
|
+
|
312
|
+
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
313
|
+
url = <span class="string">"http://stage-apps-groupdocs.dynabic.com/document-annotation2/embed/<span class="subst">#{file.file.guid}</span>?uid = <span class="subst">#{new_user.guid}</span>&download=true"</span>
|
314
|
+
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
315
|
+
url = <span class="string">"http://dev-apps-groupdocs.dynabic.com/document-annotation2/embed/<span class="subst">#{file.file.guid}</span>?uid = <span class="subst">#{new_user.guid}</span>&download=true"</span>
|
316
|
+
<span class="keyword">else</span>
|
317
|
+
url = <span class="string">"https://apps.groupdocs.com/document-annotation2/embed/<span class="subst">#{file.file.guid}</span>?uid = <span class="subst">#{new_user.guid}</span>&download=true"</span>
|
318
|
+
<span class="keyword">end</span></pre></div></div>
|
319
|
+
|
320
|
+
</li>
|
321
|
+
|
322
|
+
|
323
|
+
<li id="section-18">
|
324
|
+
<div class="annotation">
|
325
|
+
|
326
|
+
<div class="pilwrap ">
|
327
|
+
<a class="pilcrow" href="#section-18">¶</a>
|
328
|
+
</div>
|
329
|
+
<p>Add the signature to url the request</p>
|
330
|
+
|
331
|
+
</div>
|
332
|
+
|
333
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> => url).prepare_and_sign_url
|
334
|
+
|
335
|
+
iframe = <span class="string">"<iframe src='<span class="subst">#{iframe}</span>' frameborder='0' width='720' height='600'></iframe>"</span>
|
198
336
|
|
199
337
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
200
338
|
err = e.message
|
@@ -203,17 +341,17 @@
|
|
203
341
|
</li>
|
204
342
|
|
205
343
|
|
206
|
-
<li id="section-
|
344
|
+
<li id="section-19">
|
207
345
|
<div class="annotation">
|
208
346
|
|
209
347
|
<div class="pilwrap ">
|
210
|
-
<a class="pilcrow" href="#section-
|
348
|
+
<a class="pilcrow" href="#section-19">¶</a>
|
211
349
|
</div>
|
212
350
|
<p>set variables for template</p>
|
213
351
|
|
214
352
|
</div>
|
215
353
|
|
216
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample22</span>, <span class="symbol">:locals</span> => {<span class="symbol">:userId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:fileId</span> => settings.fileId, <span class="symbol">:email</span> => settings.email, <span class="symbol">:
|
354
|
+
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample22</span>, <span class="symbol">:locals</span> => {<span class="symbol">:userId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:fileId</span> => settings.fileId, <span class="symbol">:email</span> => settings.email, <span class="symbol">:firstName</span> => settings.first_name, <span class="symbol">:lastName</span> => settings.last_name, <span class="symbol">:iframe</span> => iframe, <span class="symbol">:err</span> => err}
|
217
355
|
<span class="keyword">end</span></pre></div></div>
|
218
356
|
|
219
357
|
</li>
|
@@ -64,11 +64,12 @@
|
|
64
64
|
</div>
|
65
65
|
|
66
66
|
<div class="content"><div class='highlight'><pre>
|
67
|
-
set <span class="symbol">:client_id</span>, params[<span class="symbol">:
|
68
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:
|
67
|
+
set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
|
68
|
+
set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
|
69
69
|
set <span class="symbol">:source</span>, params[<span class="symbol">:source</span>]
|
70
70
|
set <span class="symbol">:file_id</span>, params[<span class="symbol">:fileId</span>]
|
71
71
|
set <span class="symbol">:url</span>, params[<span class="symbol">:url</span>]
|
72
|
+
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
|
72
73
|
|
73
74
|
<span class="keyword">begin</span></pre></div></div>
|
74
75
|
|
@@ -85,7 +86,9 @@
|
|
85
86
|
|
86
87
|
</div>
|
87
88
|
|
88
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty
|
89
|
+
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty?
|
90
|
+
|
91
|
+
<span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div>
|
89
92
|
|
90
93
|
</li>
|
91
94
|
|
@@ -96,6 +99,39 @@
|
|
96
99
|
<div class="pilwrap ">
|
97
100
|
<a class="pilcrow" href="#section-5">¶</a>
|
98
101
|
</div>
|
102
|
+
<p>Configure your access to API server</p>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
107
|
+
groupdocs.client_id = settings.client_id
|
108
|
+
groupdocs.private_key = settings.private_key</pre></div></div>
|
109
|
+
|
110
|
+
</li>
|
111
|
+
|
112
|
+
|
113
|
+
<li id="section-6">
|
114
|
+
<div class="annotation">
|
115
|
+
|
116
|
+
<div class="pilwrap ">
|
117
|
+
<a class="pilcrow" href="#section-6">¶</a>
|
118
|
+
</div>
|
119
|
+
<p>Optionally specify API server and version</p>
|
120
|
+
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
124
|
+
<span class="keyword">end</span></pre></div></div>
|
125
|
+
|
126
|
+
</li>
|
127
|
+
|
128
|
+
|
129
|
+
<li id="section-7">
|
130
|
+
<div class="annotation">
|
131
|
+
|
132
|
+
<div class="pilwrap ">
|
133
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
134
|
+
</div>
|
99
135
|
<p>get document by file GUID</p>
|
100
136
|
|
101
137
|
</div>
|
@@ -106,11 +142,11 @@
|
|
106
142
|
</li>
|
107
143
|
|
108
144
|
|
109
|
-
<li id="section-
|
145
|
+
<li id="section-8">
|
110
146
|
<div class="annotation">
|
111
147
|
|
112
148
|
<div class="pilwrap ">
|
113
|
-
<a class="pilcrow" href="#section-
|
149
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
114
150
|
</div>
|
115
151
|
<p>Create instance of File</p>
|
116
152
|
|
@@ -122,11 +158,11 @@
|
|
122
158
|
</li>
|
123
159
|
|
124
160
|
|
125
|
-
<li id="section-
|
161
|
+
<li id="section-9">
|
126
162
|
<div class="annotation">
|
127
163
|
|
128
164
|
<div class="pilwrap ">
|
129
|
-
<a class="pilcrow" href="#section-
|
165
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
130
166
|
</div>
|
131
167
|
<p>Construct path</p>
|
132
168
|
|
@@ -137,11 +173,11 @@
|
|
137
173
|
</li>
|
138
174
|
|
139
175
|
|
140
|
-
<li id="section-
|
176
|
+
<li id="section-10">
|
141
177
|
<div class="annotation">
|
142
178
|
|
143
179
|
<div class="pilwrap ">
|
144
|
-
<a class="pilcrow" href="#section-
|
180
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
145
181
|
</div>
|
146
182
|
<p>Open file</p>
|
147
183
|
|
@@ -152,33 +188,33 @@
|
|
152
188
|
</li>
|
153
189
|
|
154
190
|
|
155
|
-
<li id="section-
|
191
|
+
<li id="section-11">
|
156
192
|
<div class="annotation">
|
157
193
|
|
158
194
|
<div class="pilwrap ">
|
159
|
-
<a class="pilcrow" href="#section-
|
195
|
+
<a class="pilcrow" href="#section-11">¶</a>
|
160
196
|
</div>
|
161
197
|
<p>Make a request to API using client_id and private_key</p>
|
162
198
|
|
163
199
|
</div>
|
164
200
|
|
165
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(file_path, {}
|
201
|
+
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(file_path, {})
|
166
202
|
<span class="keyword">when</span> <span class="string">'url'</span></pre></div></div>
|
167
203
|
|
168
204
|
</li>
|
169
205
|
|
170
206
|
|
171
|
-
<li id="section-
|
207
|
+
<li id="section-12">
|
172
208
|
<div class="annotation">
|
173
209
|
|
174
210
|
<div class="pilwrap ">
|
175
|
-
<a class="pilcrow" href="#section-
|
211
|
+
<a class="pilcrow" href="#section-12">¶</a>
|
176
212
|
</div>
|
177
213
|
<p>Upload file from defined url</p>
|
178
214
|
|
179
215
|
</div>
|
180
216
|
|
181
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload_web!(settings.url
|
217
|
+
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload_web!(settings.url)
|
182
218
|
<span class="keyword">else</span>
|
183
219
|
raise <span class="string">'Wrong GUID source.'</span>
|
184
220
|
<span class="keyword">end</span></pre></div></div>
|
@@ -186,11 +222,11 @@
|
|
186
222
|
</li>
|
187
223
|
|
188
224
|
|
189
|
-
<li id="section-
|
225
|
+
<li id="section-13">
|
190
226
|
<div class="annotation">
|
191
227
|
|
192
228
|
<div class="pilwrap ">
|
193
|
-
<a class="pilcrow" href="#section-
|
229
|
+
<a class="pilcrow" href="#section-13">¶</a>
|
194
230
|
</div>
|
195
231
|
<p>Raise exception if something went wrong</p>
|
196
232
|
|
@@ -201,11 +237,11 @@
|
|
201
237
|
</li>
|
202
238
|
|
203
239
|
|
204
|
-
<li id="section-
|
240
|
+
<li id="section-14">
|
205
241
|
<div class="annotation">
|
206
242
|
|
207
243
|
<div class="pilwrap ">
|
208
|
-
<a class="pilcrow" href="#section-
|
244
|
+
<a class="pilcrow" href="#section-14">¶</a>
|
209
245
|
</div>
|
210
246
|
<p>Make GroupDocs::Storage::Document instance</p>
|
211
247
|
|
@@ -216,18 +252,18 @@
|
|
216
252
|
</li>
|
217
253
|
|
218
254
|
|
219
|
-
<li id="section-
|
255
|
+
<li id="section-15">
|
220
256
|
<div class="annotation">
|
221
257
|
|
222
258
|
<div class="pilwrap ">
|
223
|
-
<a class="pilcrow" href="#section-
|
259
|
+
<a class="pilcrow" href="#section-15">¶</a>
|
224
260
|
</div>
|
225
261
|
<p>Create new page</p>
|
226
262
|
|
227
263
|
</div>
|
228
264
|
|
229
|
-
<div class="content"><div class='highlight'><pre> page_image = document.page_images!(<span class="number">700</span>, <span class="number">700</span>, {
|
230
|
-
|
265
|
+
<div class="content"><div class='highlight'><pre> page_image = document.page_images!(<span class="number">700</span>, <span class="number">700</span>, {})
|
266
|
+
|
231
267
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
232
268
|
err = e.message
|
233
269
|
<span class="keyword">end</span></pre></div></div>
|
@@ -235,11 +271,11 @@
|
|
235
271
|
</li>
|
236
272
|
|
237
273
|
|
238
|
-
<li id="section-
|
274
|
+
<li id="section-16">
|
239
275
|
<div class="annotation">
|
240
276
|
|
241
277
|
<div class="pilwrap ">
|
242
|
-
<a class="pilcrow" href="#section-
|
278
|
+
<a class="pilcrow" href="#section-16">¶</a>
|
243
279
|
</div>
|
244
280
|
<p>set variables for template</p>
|
245
281
|
|