groupdocs 1.5.8 → 1.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/CHANGELOG.md +9 -0
  2. data/examples/api-samples/public/docs/sample01.html +34 -15
  3. data/examples/api-samples/public/docs/sample02.html +36 -15
  4. data/examples/api-samples/public/docs/sample03.html +55 -34
  5. data/examples/api-samples/public/docs/sample04.html +33 -14
  6. data/examples/api-samples/public/docs/sample05.html +51 -33
  7. data/examples/api-samples/public/docs/sample06.html +86 -40
  8. data/examples/api-samples/public/docs/sample07.html +32 -13
  9. data/examples/api-samples/public/docs/sample08.html +39 -20
  10. data/examples/api-samples/public/docs/sample09.html +93 -39
  11. data/examples/api-samples/public/docs/sample10.html +39 -21
  12. data/examples/api-samples/public/docs/sample11.html +133 -88
  13. data/examples/api-samples/public/docs/sample12.html +33 -14
  14. data/examples/api-samples/public/docs/sample13.html +14 -7
  15. data/examples/api-samples/public/docs/sample14.html +37 -18
  16. data/examples/api-samples/public/docs/sample15.html +29 -10
  17. data/examples/api-samples/public/docs/sample16.html +58 -25
  18. data/examples/api-samples/public/docs/sample17.html +71 -38
  19. data/examples/api-samples/public/docs/sample18.html +98 -71
  20. data/examples/api-samples/public/docs/sample19.html +74 -42
  21. data/examples/api-samples/public/docs/sample20.html +39 -21
  22. data/examples/api-samples/public/docs/sample21.html +113 -69
  23. data/examples/api-samples/public/docs/sample22.html +89 -43
  24. data/examples/api-samples/public/docs/sample23.html +50 -32
  25. data/examples/api-samples/public/docs/sample24.html +64 -31
  26. data/examples/api-samples/public/docs/sample25.html +107 -60
  27. data/examples/api-samples/public/docs/sample26.html +29 -10
  28. data/examples/api-samples/public/docs/sample27.html +107 -61
  29. data/examples/api-samples/public/docs/sample28.html +158 -9
  30. data/examples/api-samples/public/docs/sample29.html +13 -8
  31. data/examples/api-samples/public/docs/sample30.html +34 -15
  32. data/examples/api-samples/public/docs/sample31.html +107 -76
  33. data/examples/api-samples/public/docs/sample32.html +104 -40
  34. data/examples/api-samples/public/docs/sample33.html +85 -36
  35. data/examples/api-samples/public/docs/sample34.html +30 -11
  36. data/examples/api-samples/public/docs/sample35.html +90 -27
  37. data/examples/api-samples/public/docs/sample36.html +36 -16
  38. data/examples/api-samples/public/docs/sample37.html +144 -265
  39. data/examples/api-samples/public/docs/sample38.html +113 -64
  40. data/examples/api-samples/public/docs/sample39.html +118 -45
  41. data/examples/api-samples/public/docs/sample40.html +81 -46
  42. data/examples/api-samples/public/docs/sample41.html +562 -90
  43. data/examples/api-samples/public/docs/sample42.html +94 -39
  44. data/examples/api-samples/public/docs/sample43.html +669 -0
  45. data/examples/api-samples/samples/sample01.rb +17 -10
  46. data/examples/api-samples/samples/sample02.rb +21 -12
  47. data/examples/api-samples/samples/sample03.rb +35 -29
  48. data/examples/api-samples/samples/sample04.rb +19 -12
  49. data/examples/api-samples/samples/sample05.rb +24 -17
  50. data/examples/api-samples/samples/sample06.rb +38 -32
  51. data/examples/api-samples/samples/sample07.rb +19 -12
  52. data/examples/api-samples/samples/sample08.rb +22 -15
  53. data/examples/api-samples/samples/sample09.rb +31 -29
  54. data/examples/api-samples/samples/sample10.rb +22 -15
  55. data/examples/api-samples/samples/sample11.rb +78 -81
  56. data/examples/api-samples/samples/sample12.rb +19 -21
  57. data/examples/api-samples/samples/sample13.rb +19 -21
  58. data/examples/api-samples/samples/sample14.rb +18 -12
  59. data/examples/api-samples/samples/sample15.rb +17 -10
  60. data/examples/api-samples/samples/sample16.rb +25 -17
  61. data/examples/api-samples/samples/sample17.rb +31 -23
  62. data/examples/api-samples/samples/sample18.rb +60 -55
  63. data/examples/api-samples/samples/sample19.rb +48 -42
  64. data/examples/api-samples/samples/sample20.rb +20 -13
  65. data/examples/api-samples/samples/sample21.rb +62 -54
  66. data/examples/api-samples/samples/sample22.rb +37 -31
  67. data/examples/api-samples/samples/sample23.rb +24 -17
  68. data/examples/api-samples/samples/sample24.rb +29 -22
  69. data/examples/api-samples/samples/sample25.rb +47 -40
  70. data/examples/api-samples/samples/sample26.rb +16 -9
  71. data/examples/api-samples/samples/sample27.rb +46 -39
  72. data/examples/api-samples/samples/sample28.rb +42 -11
  73. data/examples/api-samples/samples/sample29.rb +13 -8
  74. data/examples/api-samples/samples/sample30.rb +19 -12
  75. data/examples/api-samples/samples/sample31.rb +63 -58
  76. data/examples/api-samples/samples/sample32.rb +45 -42
  77. data/examples/api-samples/samples/sample33.rb +36 -25
  78. data/examples/api-samples/samples/sample34.rb +16 -9
  79. data/examples/api-samples/samples/sample35.rb +66 -53
  80. data/examples/api-samples/samples/sample36.rb +19 -15
  81. data/examples/api-samples/samples/sample37.rb +61 -99
  82. data/examples/api-samples/samples/sample38.rb +51 -43
  83. data/examples/api-samples/samples/sample39.rb +78 -62
  84. data/examples/api-samples/samples/sample40.rb +48 -38
  85. data/examples/api-samples/samples/sample41.rb +189 -67
  86. data/examples/api-samples/samples/sample42.rb +37 -29
  87. data/examples/api-samples/samples/sample43.rb +127 -0
  88. data/examples/api-samples/views/_others_samples.haml +4 -2
  89. data/examples/api-samples/views/index.haml +4 -2
  90. data/examples/api-samples/views/sample11.haml +1 -1
  91. data/examples/api-samples/views/sample28.haml +8 -0
  92. data/examples/api-samples/views/sample31.haml +1 -6
  93. data/examples/api-samples/views/sample39.haml +7 -2
  94. data/examples/api-samples/views/sample41.haml +78 -33
  95. data/examples/api-samples/views/sample42.haml +0 -1
  96. data/examples/api-samples/views/sample43.haml +91 -0
  97. data/lib/groupdocs/api/helpers/access_rights_helper.rb +6 -5
  98. data/lib/groupdocs/api/helpers/url_helper.rb +2 -1
  99. data/lib/groupdocs/document.rb +3 -3
  100. data/lib/groupdocs/version.rb +1 -1
  101. metadata +5 -2
@@ -59,7 +59,7 @@
59
59
  <div class="pilwrap ">
60
60
  <a class="pilcrow" href="#section-3">&#182;</a>
61
61
  </div>
62
- <p>set variables</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">&#182;</a>
81
81
  </div>
82
- <p>check required variables</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">&#182;</a>
98
96
  </div>
99
- <p>Configure your access to API server</p>
97
+ <p>Prepare base path</p>
100
98
 
101
99
  </div>
102
100
 
103
- <div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
104
- groupdocs.client_id = settings.client_id
105
- groupdocs.private_key = settings.private_key</pre></div></div>
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">&#182;</a>
115
117
  </div>
116
- <p>Optionally specify API server and version</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> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
121
- <span class="keyword">end</span></pre></div></div>
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">&#182;</a>
131
134
  </div>
132
- <p>construct path</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> 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>
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">&#182;</a>
146
150
  </div>
147
- <p>open file</p>
151
+ <p>Construct path</p>
148
152
 
149
153
  </div>
150
154
 
151
- <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>
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">&#182;</a>
161
165
  </div>
162
- <p>upload file</p>
166
+ <p>Open file</p>
163
167
 
164
168
  </div>
165
169
 
166
- <div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(filepath, {})</pre></div></div>
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">&#182;</a>
176
180
  </div>
177
- <p>compress file</p>
181
+ <p>Upload file</p>
178
182
 
179
183
  </div>
180
184
 
181
- <div class="content"><div class='highlight'><pre> file.compress!()</pre></div></div>
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">&#182;</a>
191
195
  </div>
192
- <p>construct result messages</p>
196
+ <p>Compress file</p>
193
197
 
194
198
  </div>
195
199
 
196
- <div class="content"><div class='highlight'><pre> massage = <span class="string">"&lt;p&gt;Archive created and saved successfully. Here you can see your &lt;strong&gt;<span class="subst">#{params[<span class="symbol">:file</span>][<span class="symbol">:filename</span>]}</span>&lt;/strong&gt; file in the GroupDocs Embedded Viewer.&lt;/p&gt;"</span></pre></div></div>
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">&#182;</a>
206
210
  </div>
207
- <p>Get url from request</p>
211
+ <p>Construct result messages</p>
208
212
 
209
213
  </div>
210
214
 
211
- <div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.base_path
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">"&lt;p&gt;Archive created and saved successfully. Here you can see your &lt;strong&gt;<span class="subst">#{params[<span class="symbol">:file</span>][<span class="symbol">:filename</span>]}</span>&lt;/strong&gt; file in the GroupDocs Embedded Viewer.&lt;/p&gt;"</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">&#182;</a>
229
225
  </div>
230
- <p>Add the signature to the url request</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="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> =&gt; url).prepare_and_sign_url</pre></div></div>
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">&#182;</a>
244
240
  </div>
245
- <p>Construct result iframe</p>
241
+ <p>Construct result string</p>
246
242
 
247
243
  </div>
248
244
 
249
- <div class="content"><div class='highlight'><pre> iframe = <span class="string">"&lt;iframe src='<span class="subst">#{iframe}</span>' frameborder='0' width='100%' height='600'&gt;&lt;/iframe&gt;"</span>
245
+ <div class="content"><div class='highlight'><pre> url = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> =&gt; 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">&#182;</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">&#182;</a>
277
+ </div>
278
+ <p>Make iframe</p>
279
+
280
+ </div>
281
+
282
+ <div class="content"><div class='highlight'><pre> iframe = <span class="string">"&lt;iframe id='downloadframe' src='<span class="subst">#{iframe}</span>' width='800' height='1000'&gt;&lt;/iframe&gt;"</span>
250
283
 
251
284
  <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e
252
285
  err = e.message
@@ -255,11 +288,11 @@
255
288
  </li>
256
289
 
257
290
 
258
- <li id="section-15">
291
+ <li id="section-17">
259
292
  <div class="annotation">
260
293
 
261
294
  <div class="pilwrap ">
262
- <a class="pilcrow" href="#section-15">&#182;</a>
295
+ <a class="pilcrow" href="#section-17">&#182;</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">&#182;</a>
284
284
  </div>
285
- <p>set variables</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">&#182;</a>
342
342
  </div>
343
- <p>check required variables</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">&#182;</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">&#182;</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-21">
390
+ <li id="section-22">
374
391
  <div class="annotation">
375
392
 
376
393
  <div class="pilwrap ">
377
- <a class="pilcrow" href="#section-21">&#182;</a>
394
+ <a class="pilcrow" href="#section-22">&#182;</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 = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
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-22">
406
+ <li id="section-23">
390
407
  <div class="annotation">
391
408
 
392
409
  <div class="pilwrap ">
393
- <a class="pilcrow" href="#section-22">&#182;</a>
410
+ <a class="pilcrow" href="#section-23">&#182;</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-23">
422
+ <li id="section-24">
406
423
  <div class="annotation">
407
424
 
408
425
  <div class="pilwrap ">
409
- <a class="pilcrow" href="#section-23">&#182;</a>
426
+ <a class="pilcrow" href="#section-24">&#182;</a>
410
427
  </div>
411
- <p>white space is required</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-24">
442
+ <li id="section-25">
426
443
  <div class="annotation">
427
444
 
428
445
  <div class="pilwrap ">
429
- <a class="pilcrow" href="#section-24">&#182;</a>
446
+ <a class="pilcrow" href="#section-25">&#182;</a>
430
447
  </div>
431
- <p>get document by file GUID</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-25">
458
+ <li id="section-26">
442
459
  <div class="annotation">
443
460
 
444
461
  <div class="pilwrap ">
445
- <a class="pilcrow" href="#section-25">&#182;</a>
462
+ <a class="pilcrow" href="#section-26">&#182;</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-26">
474
+ <li id="section-27">
458
475
  <div class="annotation">
459
476
 
460
477
  <div class="pilwrap ">
461
- <a class="pilcrow" href="#section-26">&#182;</a>
478
+ <a class="pilcrow" href="#section-27">&#182;</a>
462
479
  </div>
463
- <p>construct path</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-27">
489
+ <li id="section-28">
473
490
  <div class="annotation">
474
491
 
475
492
  <div class="pilwrap ">
476
- <a class="pilcrow" href="#section-27">&#182;</a>
493
+ <a class="pilcrow" href="#section-28">&#182;</a>
477
494
  </div>
478
- <p>open file</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-28">
504
+ <li id="section-29">
488
505
  <div class="annotation">
489
506
 
490
507
  <div class="pilwrap ">
491
- <a class="pilcrow" href="#section-28">&#182;</a>
508
+ <a class="pilcrow" href="#section-29">&#182;</a>
492
509
  </div>
493
- <p>make a request to API using client_id and private_key</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-29">
520
+ <li id="section-30">
504
521
  <div class="annotation">
505
522
 
506
523
  <div class="pilwrap ">
507
- <a class="pilcrow" href="#section-29">&#182;</a>
524
+ <a class="pilcrow" href="#section-30">&#182;</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-30">
538
+ <li id="section-31">
522
539
  <div class="annotation">
523
540
 
524
541
  <div class="pilwrap ">
525
- <a class="pilcrow" href="#section-30">&#182;</a>
542
+ <a class="pilcrow" href="#section-31">&#182;</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-31">
553
+ <li id="section-32">
537
554
  <div class="annotation">
538
555
 
539
556
  <div class="pilwrap ">
540
- <a class="pilcrow" href="#section-31">&#182;</a>
557
+ <a class="pilcrow" href="#section-32">&#182;</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-32">
568
+ <li id="section-33">
552
569
  <div class="annotation">
553
570
 
554
571
  <div class="pilwrap ">
555
- <a class="pilcrow" href="#section-32">&#182;</a>
572
+ <a class="pilcrow" href="#section-33">&#182;</a>
556
573
  </div>
557
- <p>convert document</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-33">
583
+ <li id="section-34">
567
584
  <div class="annotation">
568
585
 
569
586
  <div class="pilwrap ">
570
- <a class="pilcrow" href="#section-33">&#182;</a>
587
+ <a class="pilcrow" href="#section-34">&#182;</a>
571
588
  </div>
572
- <p>waite 10 seconds for while file converting</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-34">
598
+ <li id="section-35">
582
599
  <div class="annotation">
583
600
 
584
601
  <div class="pilwrap ">
585
- <a class="pilcrow" href="#section-34">&#182;</a>
602
+ <a class="pilcrow" href="#section-35">&#182;</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-35">
613
+ <li id="section-36">
597
614
  <div class="annotation">
598
615
 
599
616
  <div class="pilwrap ">
600
- <a class="pilcrow" href="#section-35">&#182;</a>
617
+ <a class="pilcrow" href="#section-36">&#182;</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-36">
628
+ <li id="section-37">
612
629
  <div class="annotation">
613
630
 
614
631
  <div class="pilwrap ">
615
- <a class="pilcrow" href="#section-36">&#182;</a>
632
+ <a class="pilcrow" href="#section-37">&#182;</a>
616
633
  </div>
617
- <p>Get url from request</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="keyword">case</span> settings.base_path
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">&#182;</a>
648
+ </div>
649
+ <p>Construct result string</p>
622
650
 
623
- <span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
624
- url = <span class="string">"http://stage-apps-groupdocs.dynabic.com/document-viewer/embed/<span class="subst">#{guid}</span>"</span>
625
- <span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
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> =&gt; iframe).prepare_and_sign_url</pre></div></div>
630
654
 
631
655
  </li>
632
656
 
633
657
 
634
- <li id="section-37">
658
+ <li id="section-39">
635
659
  <div class="annotation">
636
660
 
637
661
  <div class="pilwrap ">
638
- <a class="pilcrow" href="#section-37">&#182;</a>
662
+ <a class="pilcrow" href="#section-39">&#182;</a>
639
663
  </div>
640
- <p>Set iframe with document GUID or raise an error</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">if</span> guid</pre></div></div>
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-38">
680
+ <li id="section-40">
650
681
  <div class="annotation">
651
682
 
652
683
  <div class="pilwrap ">
653
- <a class="pilcrow" href="#section-38">&#182;</a>
684
+ <a class="pilcrow" href="#section-40">&#182;</a>
654
685
  </div>
655
- <p>Add the signature to url request</p>
686
+ <p>Make iframe</p>
656
687
 
657
688
  </div>
658
689
 
659
- <div class="content"><div class='highlight'><pre> iframe = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> =&gt; url).prepare_and_sign_url
660
- iframe = <span class="string">"&lt;iframe width='100%' height='600' frameborder='0' src='<span class="subst">#{iframe}</span>'&gt;&lt;/iframe&gt;"</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">"&lt;iframe id='downloadframe' src='<span class="subst">#{iframe}</span>' width='800' height='1000'&gt;&lt;/iframe&gt;"</span>
664
691
 
665
692
  <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e
666
693
  err = e.message
@@ -669,13 +696,13 @@
669
696
  </li>
670
697
 
671
698
 
672
- <li id="section-39">
699
+ <li id="section-41">
673
700
  <div class="annotation">
674
701
 
675
702
  <div class="pilwrap ">
676
- <a class="pilcrow" href="#section-39">&#182;</a>
703
+ <a class="pilcrow" href="#section-41">&#182;</a>
677
704
  </div>
678
- <p>set variables for template</p>
705
+ <p>Set variables for template</p>
679
706
 
680
707
  </div>
681
708