groupdocs 1.5.8 → 1.5.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +9 -0
- data/examples/api-samples/public/docs/sample01.html +34 -15
- data/examples/api-samples/public/docs/sample02.html +36 -15
- data/examples/api-samples/public/docs/sample03.html +55 -34
- data/examples/api-samples/public/docs/sample04.html +33 -14
- data/examples/api-samples/public/docs/sample05.html +51 -33
- data/examples/api-samples/public/docs/sample06.html +86 -40
- data/examples/api-samples/public/docs/sample07.html +32 -13
- data/examples/api-samples/public/docs/sample08.html +39 -20
- data/examples/api-samples/public/docs/sample09.html +93 -39
- data/examples/api-samples/public/docs/sample10.html +39 -21
- data/examples/api-samples/public/docs/sample11.html +133 -88
- data/examples/api-samples/public/docs/sample12.html +33 -14
- data/examples/api-samples/public/docs/sample13.html +14 -7
- data/examples/api-samples/public/docs/sample14.html +37 -18
- data/examples/api-samples/public/docs/sample15.html +29 -10
- data/examples/api-samples/public/docs/sample16.html +58 -25
- data/examples/api-samples/public/docs/sample17.html +71 -38
- data/examples/api-samples/public/docs/sample18.html +98 -71
- data/examples/api-samples/public/docs/sample19.html +74 -42
- data/examples/api-samples/public/docs/sample20.html +39 -21
- data/examples/api-samples/public/docs/sample21.html +113 -69
- data/examples/api-samples/public/docs/sample22.html +89 -43
- data/examples/api-samples/public/docs/sample23.html +50 -32
- data/examples/api-samples/public/docs/sample24.html +64 -31
- data/examples/api-samples/public/docs/sample25.html +107 -60
- data/examples/api-samples/public/docs/sample26.html +29 -10
- data/examples/api-samples/public/docs/sample27.html +107 -61
- data/examples/api-samples/public/docs/sample28.html +158 -9
- data/examples/api-samples/public/docs/sample29.html +13 -8
- data/examples/api-samples/public/docs/sample30.html +34 -15
- data/examples/api-samples/public/docs/sample31.html +107 -76
- data/examples/api-samples/public/docs/sample32.html +104 -40
- data/examples/api-samples/public/docs/sample33.html +85 -36
- data/examples/api-samples/public/docs/sample34.html +30 -11
- data/examples/api-samples/public/docs/sample35.html +90 -27
- data/examples/api-samples/public/docs/sample36.html +36 -16
- data/examples/api-samples/public/docs/sample37.html +144 -265
- data/examples/api-samples/public/docs/sample38.html +113 -64
- data/examples/api-samples/public/docs/sample39.html +118 -45
- data/examples/api-samples/public/docs/sample40.html +81 -46
- data/examples/api-samples/public/docs/sample41.html +562 -90
- data/examples/api-samples/public/docs/sample42.html +94 -39
- data/examples/api-samples/public/docs/sample43.html +669 -0
- data/examples/api-samples/samples/sample01.rb +17 -10
- data/examples/api-samples/samples/sample02.rb +21 -12
- data/examples/api-samples/samples/sample03.rb +35 -29
- data/examples/api-samples/samples/sample04.rb +19 -12
- data/examples/api-samples/samples/sample05.rb +24 -17
- data/examples/api-samples/samples/sample06.rb +38 -32
- data/examples/api-samples/samples/sample07.rb +19 -12
- data/examples/api-samples/samples/sample08.rb +22 -15
- data/examples/api-samples/samples/sample09.rb +31 -29
- data/examples/api-samples/samples/sample10.rb +22 -15
- data/examples/api-samples/samples/sample11.rb +78 -81
- data/examples/api-samples/samples/sample12.rb +19 -21
- data/examples/api-samples/samples/sample13.rb +19 -21
- data/examples/api-samples/samples/sample14.rb +18 -12
- data/examples/api-samples/samples/sample15.rb +17 -10
- data/examples/api-samples/samples/sample16.rb +25 -17
- data/examples/api-samples/samples/sample17.rb +31 -23
- data/examples/api-samples/samples/sample18.rb +60 -55
- data/examples/api-samples/samples/sample19.rb +48 -42
- data/examples/api-samples/samples/sample20.rb +20 -13
- data/examples/api-samples/samples/sample21.rb +62 -54
- data/examples/api-samples/samples/sample22.rb +37 -31
- data/examples/api-samples/samples/sample23.rb +24 -17
- data/examples/api-samples/samples/sample24.rb +29 -22
- data/examples/api-samples/samples/sample25.rb +47 -40
- data/examples/api-samples/samples/sample26.rb +16 -9
- data/examples/api-samples/samples/sample27.rb +46 -39
- data/examples/api-samples/samples/sample28.rb +42 -11
- data/examples/api-samples/samples/sample29.rb +13 -8
- data/examples/api-samples/samples/sample30.rb +19 -12
- data/examples/api-samples/samples/sample31.rb +63 -58
- data/examples/api-samples/samples/sample32.rb +45 -42
- data/examples/api-samples/samples/sample33.rb +36 -25
- data/examples/api-samples/samples/sample34.rb +16 -9
- data/examples/api-samples/samples/sample35.rb +66 -53
- data/examples/api-samples/samples/sample36.rb +19 -15
- data/examples/api-samples/samples/sample37.rb +61 -99
- data/examples/api-samples/samples/sample38.rb +51 -43
- data/examples/api-samples/samples/sample39.rb +78 -62
- data/examples/api-samples/samples/sample40.rb +48 -38
- data/examples/api-samples/samples/sample41.rb +189 -67
- data/examples/api-samples/samples/sample42.rb +37 -29
- data/examples/api-samples/samples/sample43.rb +127 -0
- data/examples/api-samples/views/_others_samples.haml +4 -2
- data/examples/api-samples/views/index.haml +4 -2
- data/examples/api-samples/views/sample11.haml +1 -1
- data/examples/api-samples/views/sample28.haml +8 -0
- data/examples/api-samples/views/sample31.haml +1 -6
- data/examples/api-samples/views/sample39.haml +7 -2
- data/examples/api-samples/views/sample41.haml +78 -33
- data/examples/api-samples/views/sample42.haml +0 -1
- data/examples/api-samples/views/sample43.haml +91 -0
- data/lib/groupdocs/api/helpers/access_rights_helper.rb +6 -5
- data/lib/groupdocs/api/helpers/url_helper.rb +2 -1
- data/lib/groupdocs/document.rb +3 -3
- data/lib/groupdocs/version.rb +1 -1
- metadata +5 -2
@@ -59,7 +59,7 @@
|
|
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
|
|
@@ -79,13 +79,11 @@
|
|
79
79
|
<div class="pilwrap ">
|
80
80
|
<a class="pilcrow" href="#section-4">¶</a>
|
81
81
|
</div>
|
82
|
-
<p>
|
82
|
+
<p>Check required variables</p>
|
83
83
|
|
84
84
|
</div>
|
85
85
|
|
86
|
-
<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.file.<span class="keyword">nil</span
|
87
|
-
|
88
|
-
<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>
|
86
|
+
<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.file.<span class="keyword">nil</span>?</pre></div></div>
|
89
87
|
|
90
88
|
</li>
|
91
89
|
|
@@ -96,13 +94,17 @@
|
|
96
94
|
<div class="pilwrap ">
|
97
95
|
<a class="pilcrow" href="#section-5">¶</a>
|
98
96
|
</div>
|
99
|
-
<p>
|
97
|
+
<p>Prepare base path</p>
|
100
98
|
|
101
99
|
</div>
|
102
100
|
|
103
|
-
<div class="content"><div class='highlight'><pre> <span class="
|
104
|
-
|
105
|
-
|
101
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
102
|
+
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
103
|
+
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
104
|
+
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
105
|
+
<span class="keyword">else</span>
|
106
|
+
base_path = settings.base_path
|
107
|
+
<span class="keyword">end</span></pre></div></div>
|
106
108
|
|
107
109
|
</li>
|
108
110
|
|
@@ -113,12 +115,13 @@
|
|
113
115
|
<div class="pilwrap ">
|
114
116
|
<a class="pilcrow" href="#section-6">¶</a>
|
115
117
|
</div>
|
116
|
-
<p>
|
118
|
+
<p>Configure your access to API server</p>
|
117
119
|
|
118
120
|
</div>
|
119
121
|
|
120
|
-
<div class="content"><div class='highlight'><pre>
|
121
|
-
|
122
|
+
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
123
|
+
groupdocs.client_id = settings.client_id
|
124
|
+
groupdocs.private_key = settings.private_key</pre></div></div>
|
122
125
|
|
123
126
|
</li>
|
124
127
|
|
@@ -129,11 +132,12 @@
|
|
129
132
|
<div class="pilwrap ">
|
130
133
|
<a class="pilcrow" href="#section-7">¶</a>
|
131
134
|
</div>
|
132
|
-
<p>
|
135
|
+
<p>Optionally specify API server and version</p>
|
133
136
|
|
134
137
|
</div>
|
135
138
|
|
136
|
-
<div class="content"><div class='highlight'><pre>
|
139
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
140
|
+
<span class="keyword">end</span></pre></div></div>
|
137
141
|
|
138
142
|
</li>
|
139
143
|
|
@@ -144,11 +148,11 @@
|
|
144
148
|
<div class="pilwrap ">
|
145
149
|
<a class="pilcrow" href="#section-8">¶</a>
|
146
150
|
</div>
|
147
|
-
<p>
|
151
|
+
<p>Construct path</p>
|
148
152
|
|
149
153
|
</div>
|
150
154
|
|
151
|
-
<div class="content"><div class='highlight'><pre> <span class="
|
155
|
+
<div class="content"><div class='highlight'><pre> 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>
|
152
156
|
|
153
157
|
</li>
|
154
158
|
|
@@ -159,11 +163,11 @@
|
|
159
163
|
<div class="pilwrap ">
|
160
164
|
<a class="pilcrow" href="#section-9">¶</a>
|
161
165
|
</div>
|
162
|
-
<p>
|
166
|
+
<p>Open file</p>
|
163
167
|
|
164
168
|
</div>
|
165
169
|
|
166
|
-
<div class="content"><div class='highlight'><pre>
|
170
|
+
<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>
|
167
171
|
|
168
172
|
</li>
|
169
173
|
|
@@ -174,11 +178,11 @@
|
|
174
178
|
<div class="pilwrap ">
|
175
179
|
<a class="pilcrow" href="#section-10">¶</a>
|
176
180
|
</div>
|
177
|
-
<p>
|
181
|
+
<p>Upload file</p>
|
178
182
|
|
179
183
|
</div>
|
180
184
|
|
181
|
-
<div class="content"><div class='highlight'><pre> file
|
185
|
+
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(filepath, {})</pre></div></div>
|
182
186
|
|
183
187
|
</li>
|
184
188
|
|
@@ -189,11 +193,11 @@
|
|
189
193
|
<div class="pilwrap ">
|
190
194
|
<a class="pilcrow" href="#section-11">¶</a>
|
191
195
|
</div>
|
192
|
-
<p>
|
196
|
+
<p>Compress file</p>
|
193
197
|
|
194
198
|
</div>
|
195
199
|
|
196
|
-
<div class="content"><div class='highlight'><pre>
|
200
|
+
<div class="content"><div class='highlight'><pre> file.compress!()</pre></div></div>
|
197
201
|
|
198
202
|
</li>
|
199
203
|
|
@@ -204,19 +208,11 @@
|
|
204
208
|
<div class="pilwrap ">
|
205
209
|
<a class="pilcrow" href="#section-12">¶</a>
|
206
210
|
</div>
|
207
|
-
<p>
|
211
|
+
<p>Construct result messages</p>
|
208
212
|
|
209
213
|
</div>
|
210
214
|
|
211
|
-
<div class="content"><div class='highlight'><pre> <span class="
|
212
|
-
|
213
|
-
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
214
|
-
url = <span class="string">"http://stage-apps-groupdocs.dynabic.com/document-viewer/embed/<span class="subst">#{file.guid}</span>"</span>
|
215
|
-
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
216
|
-
url = <span class="string">"http://dev-apps-groupdocs.dynabic.com/document-viewer/embed/<span class="subst">#{file.guid}</span>"</span>
|
217
|
-
<span class="keyword">else</span>
|
218
|
-
url = <span class="string">"https://apps.groupdocs.com/document-viewer/embed/<span class="subst">#{file.guid}</span>"</span>
|
219
|
-
<span class="keyword">end</span></pre></div></div>
|
215
|
+
<div class="content"><div class='highlight'><pre> massage = <span class="string">"<p>Archive created and saved successfully. Here you can see your <strong><span class="subst">#{params[<span class="symbol">:file</span>][<span class="symbol">:filename</span>]}</span></strong> file in the GroupDocs Embedded Viewer.</p>"</span></pre></div></div>
|
220
216
|
|
221
217
|
</li>
|
222
218
|
|
@@ -227,11 +223,11 @@
|
|
227
223
|
<div class="pilwrap ">
|
228
224
|
<a class="pilcrow" href="#section-13">¶</a>
|
229
225
|
</div>
|
230
|
-
<p>
|
226
|
+
<p>Prepare to sign url</p>
|
231
227
|
|
232
228
|
</div>
|
233
229
|
|
234
|
-
<div class="content"><div class='highlight'><pre> iframe = <span class="
|
230
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"/document-viewer/embed/<span class="subst">#{file.guid}</span>"</span></pre></div></div>
|
235
231
|
|
236
232
|
</li>
|
237
233
|
|
@@ -242,11 +238,48 @@
|
|
242
238
|
<div class="pilwrap ">
|
243
239
|
<a class="pilcrow" href="#section-14">¶</a>
|
244
240
|
</div>
|
245
|
-
<p>Construct result
|
241
|
+
<p>Construct result string</p>
|
246
242
|
|
247
243
|
</div>
|
248
244
|
|
249
|
-
<div class="content"><div class='highlight'><pre>
|
245
|
+
<div class="content"><div class='highlight'><pre> url = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> => iframe).prepare_and_sign_url</pre></div></div>
|
246
|
+
|
247
|
+
</li>
|
248
|
+
|
249
|
+
|
250
|
+
<li id="section-15">
|
251
|
+
<div class="annotation">
|
252
|
+
|
253
|
+
<div class="pilwrap ">
|
254
|
+
<a class="pilcrow" href="#section-15">¶</a>
|
255
|
+
</div>
|
256
|
+
<p>Generate iframe URL</p>
|
257
|
+
|
258
|
+
</div>
|
259
|
+
|
260
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> base_path
|
261
|
+
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
262
|
+
iframe = <span class="string">"https://stage-api-groupdocs.dynabic.com<span class="subst">#{url}</span>"</span>
|
263
|
+
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
264
|
+
iframe = <span class="string">"https://dev-apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
265
|
+
<span class="keyword">else</span>
|
266
|
+
iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
267
|
+
<span class="keyword">end</span></pre></div></div>
|
268
|
+
|
269
|
+
</li>
|
270
|
+
|
271
|
+
|
272
|
+
<li id="section-16">
|
273
|
+
<div class="annotation">
|
274
|
+
|
275
|
+
<div class="pilwrap ">
|
276
|
+
<a class="pilcrow" href="#section-16">¶</a>
|
277
|
+
</div>
|
278
|
+
<p>Make iframe</p>
|
279
|
+
|
280
|
+
</div>
|
281
|
+
|
282
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"<iframe id='downloadframe' src='<span class="subst">#{iframe}</span>' width='800' height='1000'></iframe>"</span>
|
250
283
|
|
251
284
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
252
285
|
err = e.message
|
@@ -255,11 +288,11 @@
|
|
255
288
|
</li>
|
256
289
|
|
257
290
|
|
258
|
-
<li id="section-
|
291
|
+
<li id="section-17">
|
259
292
|
<div class="annotation">
|
260
293
|
|
261
294
|
<div class="pilwrap ">
|
262
|
-
<a class="pilcrow" href="#section-
|
295
|
+
<a class="pilcrow" href="#section-17">¶</a>
|
263
296
|
</div>
|
264
297
|
<p>set variables for template</p>
|
265
298
|
|
@@ -282,7 +282,7 @@
|
|
282
282
|
<div class="pilwrap ">
|
283
283
|
<a class="pilcrow" href="#section-16">¶</a>
|
284
284
|
</div>
|
285
|
-
<p>
|
285
|
+
<p>Set variables</p>
|
286
286
|
|
287
287
|
</div>
|
288
288
|
|
@@ -340,15 +340,11 @@
|
|
340
340
|
<div class="pilwrap ">
|
341
341
|
<a class="pilcrow" href="#section-19">¶</a>
|
342
342
|
</div>
|
343
|
-
<p>
|
343
|
+
<p>Check required variables</p>
|
344
344
|
|
345
345
|
</div>
|
346
346
|
|
347
|
-
<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
|
348
|
-
|
349
|
-
<span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span>
|
350
|
-
settings.base_path = <span class="string">'https://api.groupdocs.com'</span>
|
351
|
-
<span class="keyword">end</span></pre></div></div>
|
347
|
+
<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?</pre></div></div>
|
352
348
|
|
353
349
|
</li>
|
354
350
|
|
@@ -359,6 +355,27 @@
|
|
359
355
|
<div class="pilwrap ">
|
360
356
|
<a class="pilcrow" href="#section-20">¶</a>
|
361
357
|
</div>
|
358
|
+
<p>Prepare base path</p>
|
359
|
+
|
360
|
+
</div>
|
361
|
+
|
362
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
363
|
+
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
364
|
+
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
365
|
+
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
366
|
+
<span class="keyword">else</span>
|
367
|
+
base_path = settings.base_path
|
368
|
+
<span class="keyword">end</span></pre></div></div>
|
369
|
+
|
370
|
+
</li>
|
371
|
+
|
372
|
+
|
373
|
+
<li id="section-21">
|
374
|
+
<div class="annotation">
|
375
|
+
|
376
|
+
<div class="pilwrap ">
|
377
|
+
<a class="pilcrow" href="#section-21">¶</a>
|
378
|
+
</div>
|
362
379
|
<p>Configure your access to API server</p>
|
363
380
|
|
364
381
|
</div>
|
@@ -370,27 +387,27 @@
|
|
370
387
|
</li>
|
371
388
|
|
372
389
|
|
373
|
-
<li id="section-
|
390
|
+
<li id="section-22">
|
374
391
|
<div class="annotation">
|
375
392
|
|
376
393
|
<div class="pilwrap ">
|
377
|
-
<a class="pilcrow" href="#section-
|
394
|
+
<a class="pilcrow" href="#section-22">¶</a>
|
378
395
|
</div>
|
379
396
|
<p>Optionally specify API server and version</p>
|
380
397
|
|
381
398
|
</div>
|
382
399
|
|
383
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server =
|
400
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
384
401
|
<span class="keyword">end</span></pre></div></div>
|
385
402
|
|
386
403
|
</li>
|
387
404
|
|
388
405
|
|
389
|
-
<li id="section-
|
406
|
+
<li id="section-23">
|
390
407
|
<div class="annotation">
|
391
408
|
|
392
409
|
<div class="pilwrap ">
|
393
|
-
<a class="pilcrow" href="#section-
|
410
|
+
<a class="pilcrow" href="#section-23">¶</a>
|
394
411
|
</div>
|
395
412
|
<p>Write client and private key to the file for callback job</p>
|
396
413
|
|
@@ -402,13 +419,13 @@
|
|
402
419
|
</li>
|
403
420
|
|
404
421
|
|
405
|
-
<li id="section-
|
422
|
+
<li id="section-24">
|
406
423
|
<div class="annotation">
|
407
424
|
|
408
425
|
<div class="pilwrap ">
|
409
|
-
<a class="pilcrow" href="#section-
|
426
|
+
<a class="pilcrow" href="#section-24">¶</a>
|
410
427
|
</div>
|
411
|
-
<p>
|
428
|
+
<p>White space is required</p>
|
412
429
|
|
413
430
|
</div>
|
414
431
|
|
@@ -422,13 +439,13 @@
|
|
422
439
|
</li>
|
423
440
|
|
424
441
|
|
425
|
-
<li id="section-
|
442
|
+
<li id="section-25">
|
426
443
|
<div class="annotation">
|
427
444
|
|
428
445
|
<div class="pilwrap ">
|
429
|
-
<a class="pilcrow" href="#section-
|
446
|
+
<a class="pilcrow" href="#section-25">¶</a>
|
430
447
|
</div>
|
431
|
-
<p>
|
448
|
+
<p>Get document by file GUID</p>
|
432
449
|
|
433
450
|
</div>
|
434
451
|
|
@@ -438,11 +455,11 @@
|
|
438
455
|
</li>
|
439
456
|
|
440
457
|
|
441
|
-
<li id="section-
|
458
|
+
<li id="section-26">
|
442
459
|
<div class="annotation">
|
443
460
|
|
444
461
|
<div class="pilwrap ">
|
445
|
-
<a class="pilcrow" href="#section-
|
462
|
+
<a class="pilcrow" href="#section-26">¶</a>
|
446
463
|
</div>
|
447
464
|
<p>Create instance of File</p>
|
448
465
|
|
@@ -454,13 +471,13 @@
|
|
454
471
|
</li>
|
455
472
|
|
456
473
|
|
457
|
-
<li id="section-
|
474
|
+
<li id="section-27">
|
458
475
|
<div class="annotation">
|
459
476
|
|
460
477
|
<div class="pilwrap ">
|
461
|
-
<a class="pilcrow" href="#section-
|
478
|
+
<a class="pilcrow" href="#section-27">¶</a>
|
462
479
|
</div>
|
463
|
-
<p>
|
480
|
+
<p>Construct path</p>
|
464
481
|
|
465
482
|
</div>
|
466
483
|
|
@@ -469,13 +486,13 @@
|
|
469
486
|
</li>
|
470
487
|
|
471
488
|
|
472
|
-
<li id="section-
|
489
|
+
<li id="section-28">
|
473
490
|
<div class="annotation">
|
474
491
|
|
475
492
|
<div class="pilwrap ">
|
476
|
-
<a class="pilcrow" href="#section-
|
493
|
+
<a class="pilcrow" href="#section-28">¶</a>
|
477
494
|
</div>
|
478
|
-
<p>
|
495
|
+
<p>Open file</p>
|
479
496
|
|
480
497
|
</div>
|
481
498
|
|
@@ -484,13 +501,13 @@
|
|
484
501
|
</li>
|
485
502
|
|
486
503
|
|
487
|
-
<li id="section-
|
504
|
+
<li id="section-29">
|
488
505
|
<div class="annotation">
|
489
506
|
|
490
507
|
<div class="pilwrap ">
|
491
|
-
<a class="pilcrow" href="#section-
|
508
|
+
<a class="pilcrow" href="#section-29">¶</a>
|
492
509
|
</div>
|
493
|
-
<p>
|
510
|
+
<p>Make a request to API using client_id and private_key</p>
|
494
511
|
|
495
512
|
</div>
|
496
513
|
|
@@ -500,11 +517,11 @@
|
|
500
517
|
</li>
|
501
518
|
|
502
519
|
|
503
|
-
<li id="section-
|
520
|
+
<li id="section-30">
|
504
521
|
<div class="annotation">
|
505
522
|
|
506
523
|
<div class="pilwrap ">
|
507
|
-
<a class="pilcrow" href="#section-
|
524
|
+
<a class="pilcrow" href="#section-30">¶</a>
|
508
525
|
</div>
|
509
526
|
<p>Upload file from defined url</p>
|
510
527
|
|
@@ -518,11 +535,11 @@
|
|
518
535
|
</li>
|
519
536
|
|
520
537
|
|
521
|
-
<li id="section-
|
538
|
+
<li id="section-31">
|
522
539
|
<div class="annotation">
|
523
540
|
|
524
541
|
<div class="pilwrap ">
|
525
|
-
<a class="pilcrow" href="#section-
|
542
|
+
<a class="pilcrow" href="#section-31">¶</a>
|
526
543
|
</div>
|
527
544
|
<p>Raise exception if something went wrong</p>
|
528
545
|
|
@@ -533,11 +550,11 @@
|
|
533
550
|
</li>
|
534
551
|
|
535
552
|
|
536
|
-
<li id="section-
|
553
|
+
<li id="section-32">
|
537
554
|
<div class="annotation">
|
538
555
|
|
539
556
|
<div class="pilwrap ">
|
540
|
-
<a class="pilcrow" href="#section-
|
557
|
+
<a class="pilcrow" href="#section-32">¶</a>
|
541
558
|
</div>
|
542
559
|
<p>Make document from file</p>
|
543
560
|
|
@@ -548,13 +565,13 @@
|
|
548
565
|
</li>
|
549
566
|
|
550
567
|
|
551
|
-
<li id="section-
|
568
|
+
<li id="section-33">
|
552
569
|
<div class="annotation">
|
553
570
|
|
554
571
|
<div class="pilwrap ">
|
555
|
-
<a class="pilcrow" href="#section-
|
572
|
+
<a class="pilcrow" href="#section-33">¶</a>
|
556
573
|
</div>
|
557
|
-
<p>
|
574
|
+
<p>Convert document</p>
|
558
575
|
|
559
576
|
</div>
|
560
577
|
|
@@ -563,13 +580,13 @@
|
|
563
580
|
</li>
|
564
581
|
|
565
582
|
|
566
|
-
<li id="section-
|
583
|
+
<li id="section-34">
|
567
584
|
<div class="annotation">
|
568
585
|
|
569
586
|
<div class="pilwrap ">
|
570
|
-
<a class="pilcrow" href="#section-
|
587
|
+
<a class="pilcrow" href="#section-34">¶</a>
|
571
588
|
</div>
|
572
|
-
<p>
|
589
|
+
<p>Waite 10 seconds for while file converting</p>
|
573
590
|
|
574
591
|
</div>
|
575
592
|
|
@@ -578,11 +595,11 @@
|
|
578
595
|
</li>
|
579
596
|
|
580
597
|
|
581
|
-
<li id="section-
|
598
|
+
<li id="section-35">
|
582
599
|
<div class="annotation">
|
583
600
|
|
584
601
|
<div class="pilwrap ">
|
585
|
-
<a class="pilcrow" href="#section-
|
602
|
+
<a class="pilcrow" href="#section-35">¶</a>
|
586
603
|
</div>
|
587
604
|
<p>Get array of changes in document from job</p>
|
588
605
|
|
@@ -593,11 +610,11 @@
|
|
593
610
|
</li>
|
594
611
|
|
595
612
|
|
596
|
-
<li id="section-
|
613
|
+
<li id="section-36">
|
597
614
|
<div class="annotation">
|
598
615
|
|
599
616
|
<div class="pilwrap ">
|
600
|
-
<a class="pilcrow" href="#section-
|
617
|
+
<a class="pilcrow" href="#section-36">¶</a>
|
601
618
|
</div>
|
602
619
|
<p>Get converted document GUID</p>
|
603
620
|
|
@@ -608,59 +625,69 @@
|
|
608
625
|
</li>
|
609
626
|
|
610
627
|
|
611
|
-
<li id="section-
|
628
|
+
<li id="section-37">
|
612
629
|
<div class="annotation">
|
613
630
|
|
614
631
|
<div class="pilwrap ">
|
615
|
-
<a class="pilcrow" href="#section-
|
632
|
+
<a class="pilcrow" href="#section-37">¶</a>
|
616
633
|
</div>
|
617
|
-
<p>
|
634
|
+
<p>Prepare to sign url</p>
|
618
635
|
|
619
636
|
</div>
|
620
637
|
|
621
|
-
<div class="content"><div class='highlight'><pre> <span class="
|
638
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"/document-viewer/embed/<span class="subst">#{guid}</span>"</span></pre></div></div>
|
639
|
+
|
640
|
+
</li>
|
641
|
+
|
642
|
+
|
643
|
+
<li id="section-38">
|
644
|
+
<div class="annotation">
|
645
|
+
|
646
|
+
<div class="pilwrap ">
|
647
|
+
<a class="pilcrow" href="#section-38">¶</a>
|
648
|
+
</div>
|
649
|
+
<p>Construct result string</p>
|
622
650
|
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
url = <span class="string">"http://dev-apps-groupdocs.dynabic.com/document-viewer/embed/<span class="subst">#{guid}</span>"</span>
|
627
|
-
<span class="keyword">else</span>
|
628
|
-
url = <span class="string">"https://apps.groupdocs.com/document-viewer/embed/<span class="subst">#{guid}</span>"</span>
|
629
|
-
<span class="keyword">end</span></pre></div></div>
|
651
|
+
</div>
|
652
|
+
|
653
|
+
<div class="content"><div class='highlight'><pre> url = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> => iframe).prepare_and_sign_url</pre></div></div>
|
630
654
|
|
631
655
|
</li>
|
632
656
|
|
633
657
|
|
634
|
-
<li id="section-
|
658
|
+
<li id="section-39">
|
635
659
|
<div class="annotation">
|
636
660
|
|
637
661
|
<div class="pilwrap ">
|
638
|
-
<a class="pilcrow" href="#section-
|
662
|
+
<a class="pilcrow" href="#section-39">¶</a>
|
639
663
|
</div>
|
640
|
-
<p>
|
664
|
+
<p>Generate iframe URL</p>
|
641
665
|
|
642
666
|
</div>
|
643
667
|
|
644
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">
|
668
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> base_path
|
669
|
+
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
670
|
+
iframe = <span class="string">"https://stage-api-groupdocs.dynabic.com<span class="subst">#{url}</span>"</span>
|
671
|
+
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
672
|
+
iframe = <span class="string">"https://dev-apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
673
|
+
<span class="keyword">else</span>
|
674
|
+
iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
675
|
+
<span class="keyword">end</span></pre></div></div>
|
645
676
|
|
646
677
|
</li>
|
647
678
|
|
648
679
|
|
649
|
-
<li id="section-
|
680
|
+
<li id="section-40">
|
650
681
|
<div class="annotation">
|
651
682
|
|
652
683
|
<div class="pilwrap ">
|
653
|
-
<a class="pilcrow" href="#section-
|
684
|
+
<a class="pilcrow" href="#section-40">¶</a>
|
654
685
|
</div>
|
655
|
-
<p>
|
686
|
+
<p>Make iframe</p>
|
656
687
|
|
657
688
|
</div>
|
658
689
|
|
659
|
-
<div class="content"><div class='highlight'><pre>
|
660
|
-
iframe = <span class="string">"<iframe width='100%' height='600' frameborder='0' src='<span class="subst">#{iframe}</span>'></iframe>"</span>
|
661
|
-
<span class="keyword">else</span>
|
662
|
-
raise <span class="string">'File was not converted'</span>
|
663
|
-
<span class="keyword">end</span>
|
690
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"<iframe id='downloadframe' src='<span class="subst">#{iframe}</span>' width='800' height='1000'></iframe>"</span>
|
664
691
|
|
665
692
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
666
693
|
err = e.message
|
@@ -669,13 +696,13 @@
|
|
669
696
|
</li>
|
670
697
|
|
671
698
|
|
672
|
-
<li id="section-
|
699
|
+
<li id="section-41">
|
673
700
|
<div class="annotation">
|
674
701
|
|
675
702
|
<div class="pilwrap ">
|
676
|
-
<a class="pilcrow" href="#section-
|
703
|
+
<a class="pilcrow" href="#section-41">¶</a>
|
677
704
|
</div>
|
678
|
-
<p>
|
705
|
+
<p>Set variables for template</p>
|
679
706
|
|
680
707
|
</div>
|
681
708
|
|