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
@@ -82,9 +82,7 @@
|
|
82
82
|
|
83
83
|
</div>
|
84
84
|
|
85
|
-
<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
|
86
|
-
|
87
|
-
<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>
|
85
|
+
<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>
|
88
86
|
|
89
87
|
</li>
|
90
88
|
|
@@ -95,6 +93,27 @@
|
|
95
93
|
<div class="pilwrap ">
|
96
94
|
<a class="pilcrow" href="#section-5">¶</a>
|
97
95
|
</div>
|
96
|
+
<p>Prepare base path</p>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
101
|
+
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
102
|
+
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
103
|
+
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
104
|
+
<span class="keyword">else</span>
|
105
|
+
base_path = settings.base_path
|
106
|
+
<span class="keyword">end</span></pre></div></div>
|
107
|
+
|
108
|
+
</li>
|
109
|
+
|
110
|
+
|
111
|
+
<li id="section-6">
|
112
|
+
<div class="annotation">
|
113
|
+
|
114
|
+
<div class="pilwrap ">
|
115
|
+
<a class="pilcrow" href="#section-6">¶</a>
|
116
|
+
</div>
|
98
117
|
<p>Configure your access to API server</p>
|
99
118
|
|
100
119
|
</div>
|
@@ -106,27 +125,27 @@
|
|
106
125
|
</li>
|
107
126
|
|
108
127
|
|
109
|
-
<li id="section-
|
128
|
+
<li id="section-7">
|
110
129
|
<div class="annotation">
|
111
130
|
|
112
131
|
<div class="pilwrap ">
|
113
|
-
<a class="pilcrow" href="#section-
|
132
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
114
133
|
</div>
|
115
134
|
<p>Optionally specify API server and version</p>
|
116
135
|
|
117
136
|
</div>
|
118
137
|
|
119
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server =
|
138
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
120
139
|
<span class="keyword">end</span></pre></div></div>
|
121
140
|
|
122
141
|
</li>
|
123
142
|
|
124
143
|
|
125
|
-
<li id="section-
|
144
|
+
<li id="section-8">
|
126
145
|
<div class="annotation">
|
127
146
|
|
128
147
|
<div class="pilwrap ">
|
129
|
-
<a class="pilcrow" href="#section-
|
148
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
130
149
|
</div>
|
131
150
|
<p>Make a request to API using client_id and private_key</p>
|
132
151
|
|
@@ -137,11 +156,11 @@
|
|
137
156
|
</li>
|
138
157
|
|
139
158
|
|
140
|
-
<li id="section-
|
159
|
+
<li id="section-9">
|
141
160
|
<div class="annotation">
|
142
161
|
|
143
162
|
<div class="pilwrap ">
|
144
|
-
<a class="pilcrow" href="#section-
|
163
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
145
164
|
</div>
|
146
165
|
<p>Construct result string</p>
|
147
166
|
|
@@ -154,7 +173,7 @@
|
|
154
173
|
<span class="keyword">end</span>
|
155
174
|
<span class="keyword">if</span> element.thumbnail
|
156
175
|
name = element.name
|
157
|
-
thumbnails += <span class="string">"<
|
176
|
+
thumbnails += <span class="string">"<img src='data:image/png;base64,<span class="subst">#{element.thumbnail}</span>', width='40px', height='40px'> <span class="subst">#{name}</span>"</span>
|
158
177
|
<span class="keyword">end</span>
|
159
178
|
<span class="keyword">end</span>
|
160
179
|
|
@@ -169,11 +188,11 @@
|
|
169
188
|
</li>
|
170
189
|
|
171
190
|
|
172
|
-
<li id="section-
|
191
|
+
<li id="section-10">
|
173
192
|
<div class="annotation">
|
174
193
|
|
175
194
|
<div class="pilwrap ">
|
176
|
-
<a class="pilcrow" href="#section-
|
195
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
177
196
|
</div>
|
178
197
|
<p>Set variables for template</p>
|
179
198
|
|
@@ -86,9 +86,7 @@
|
|
86
86
|
|
87
87
|
</div>
|
88
88
|
|
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
|
+
<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>
|
92
90
|
|
93
91
|
</li>
|
94
92
|
|
@@ -99,6 +97,27 @@
|
|
99
97
|
<div class="pilwrap ">
|
100
98
|
<a class="pilcrow" href="#section-5">¶</a>
|
101
99
|
</div>
|
100
|
+
<p>Prepare base path</p>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
105
|
+
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
106
|
+
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
107
|
+
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
108
|
+
<span class="keyword">else</span>
|
109
|
+
base_path = settings.base_path
|
110
|
+
<span class="keyword">end</span></pre></div></div>
|
111
|
+
|
112
|
+
</li>
|
113
|
+
|
114
|
+
|
115
|
+
<li id="section-6">
|
116
|
+
<div class="annotation">
|
117
|
+
|
118
|
+
<div class="pilwrap ">
|
119
|
+
<a class="pilcrow" href="#section-6">¶</a>
|
120
|
+
</div>
|
102
121
|
<p>Configure your access to API server</p>
|
103
122
|
|
104
123
|
</div>
|
@@ -110,17 +129,17 @@
|
|
110
129
|
</li>
|
111
130
|
|
112
131
|
|
113
|
-
<li id="section-
|
132
|
+
<li id="section-7">
|
114
133
|
<div class="annotation">
|
115
134
|
|
116
135
|
<div class="pilwrap ">
|
117
|
-
<a class="pilcrow" href="#section-
|
136
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
118
137
|
</div>
|
119
138
|
<p>Optionally specify API server and version</p>
|
120
139
|
|
121
140
|
</div>
|
122
141
|
|
123
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server =
|
142
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
124
143
|
<span class="keyword">end</span>
|
125
144
|
|
126
145
|
file = <span class="keyword">nil</span>
|
@@ -130,11 +149,11 @@
|
|
130
149
|
</li>
|
131
150
|
|
132
151
|
|
133
|
-
<li id="section-
|
152
|
+
<li id="section-8">
|
134
153
|
<div class="annotation">
|
135
154
|
|
136
155
|
<div class="pilwrap ">
|
137
|
-
<a class="pilcrow" href="#section-
|
156
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
138
157
|
</div>
|
139
158
|
<p>Get document by file GUID</p>
|
140
159
|
|
@@ -148,11 +167,11 @@
|
|
148
167
|
</li>
|
149
168
|
|
150
169
|
|
151
|
-
<li id="section-
|
170
|
+
<li id="section-9">
|
152
171
|
<div class="annotation">
|
153
172
|
|
154
173
|
<div class="pilwrap ">
|
155
|
-
<a class="pilcrow" href="#section-
|
174
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
156
175
|
</div>
|
157
176
|
<p>Construct path</p>
|
158
177
|
|
@@ -163,11 +182,11 @@
|
|
163
182
|
</li>
|
164
183
|
|
165
184
|
|
166
|
-
<li id="section-
|
185
|
+
<li id="section-10">
|
167
186
|
<div class="annotation">
|
168
187
|
|
169
188
|
<div class="pilwrap ">
|
170
|
-
<a class="pilcrow" href="#section-
|
189
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
171
190
|
</div>
|
172
191
|
<p>Open file</p>
|
173
192
|
|
@@ -178,11 +197,11 @@
|
|
178
197
|
</li>
|
179
198
|
|
180
199
|
|
181
|
-
<li id="section-
|
200
|
+
<li id="section-11">
|
182
201
|
<div class="annotation">
|
183
202
|
|
184
203
|
<div class="pilwrap ">
|
185
|
-
<a class="pilcrow" href="#section-
|
204
|
+
<a class="pilcrow" href="#section-11">¶</a>
|
186
205
|
</div>
|
187
206
|
<p>Make a request to API using client_id and private_key</p>
|
188
207
|
|
@@ -201,11 +220,11 @@
|
|
201
220
|
</li>
|
202
221
|
|
203
222
|
|
204
|
-
<li id="section-
|
223
|
+
<li id="section-12">
|
205
224
|
<div class="annotation">
|
206
225
|
|
207
226
|
<div class="pilwrap ">
|
208
|
-
<a class="pilcrow" href="#section-
|
227
|
+
<a class="pilcrow" href="#section-12">¶</a>
|
209
228
|
</div>
|
210
229
|
<p>Get document page images</p>
|
211
230
|
|
@@ -216,11 +235,11 @@
|
|
216
235
|
</li>
|
217
236
|
|
218
237
|
|
219
|
-
<li id="section-
|
238
|
+
<li id="section-13">
|
220
239
|
<div class="annotation">
|
221
240
|
|
222
241
|
<div class="pilwrap ">
|
223
|
-
<a class="pilcrow" href="#section-
|
242
|
+
<a class="pilcrow" href="#section-13">¶</a>
|
224
243
|
</div>
|
225
244
|
<p>Result</p>
|
226
245
|
|
@@ -237,11 +256,11 @@
|
|
237
256
|
</li>
|
238
257
|
|
239
258
|
|
240
|
-
<li id="section-
|
259
|
+
<li id="section-14">
|
241
260
|
<div class="annotation">
|
242
261
|
|
243
262
|
<div class="pilwrap ">
|
244
|
-
<a class="pilcrow" href="#section-
|
263
|
+
<a class="pilcrow" href="#section-14">¶</a>
|
245
264
|
</div>
|
246
265
|
<p>Set variables for template</p>
|
247
266
|
|
@@ -88,9 +88,7 @@
|
|
88
88
|
|
89
89
|
</div>
|
90
90
|
|
91
|
-
<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.width.empty? <span class="keyword">or</span> settings.height.empty
|
92
|
-
|
93
|
-
<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>
|
91
|
+
<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.width.empty? <span class="keyword">or</span> settings.height.empty?</pre></div></div>
|
94
92
|
|
95
93
|
</li>
|
96
94
|
|
@@ -101,6 +99,27 @@
|
|
101
99
|
<div class="pilwrap ">
|
102
100
|
<a class="pilcrow" href="#section-5">¶</a>
|
103
101
|
</div>
|
102
|
+
<p>Prepare base path</p>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
107
|
+
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
108
|
+
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
109
|
+
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
110
|
+
<span class="keyword">else</span>
|
111
|
+
base_path = settings.base_path
|
112
|
+
<span class="keyword">end</span></pre></div></div>
|
113
|
+
|
114
|
+
</li>
|
115
|
+
|
116
|
+
|
117
|
+
<li id="section-6">
|
118
|
+
<div class="annotation">
|
119
|
+
|
120
|
+
<div class="pilwrap ">
|
121
|
+
<a class="pilcrow" href="#section-6">¶</a>
|
122
|
+
</div>
|
104
123
|
<p>Configure your access to API server</p>
|
105
124
|
|
106
125
|
</div>
|
@@ -112,27 +131,27 @@
|
|
112
131
|
</li>
|
113
132
|
|
114
133
|
|
115
|
-
<li id="section-
|
134
|
+
<li id="section-7">
|
116
135
|
<div class="annotation">
|
117
136
|
|
118
137
|
<div class="pilwrap ">
|
119
|
-
<a class="pilcrow" href="#section-
|
138
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
120
139
|
</div>
|
121
140
|
<p>Optionally specify API server and version</p>
|
122
141
|
|
123
142
|
</div>
|
124
143
|
|
125
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server =
|
144
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
126
145
|
<span class="keyword">end</span></pre></div></div>
|
127
146
|
|
128
147
|
</li>
|
129
148
|
|
130
149
|
|
131
|
-
<li id="section-
|
150
|
+
<li id="section-8">
|
132
151
|
<div class="annotation">
|
133
152
|
|
134
153
|
<div class="pilwrap ">
|
135
|
-
<a class="pilcrow" href="#section-
|
154
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
136
155
|
</div>
|
137
156
|
<p>Get document by file GUID</p>
|
138
157
|
|
@@ -147,11 +166,11 @@
|
|
147
166
|
</li>
|
148
167
|
|
149
168
|
|
150
|
-
<li id="section-
|
169
|
+
<li id="section-9">
|
151
170
|
<div class="annotation">
|
152
171
|
|
153
172
|
<div class="pilwrap ">
|
154
|
-
<a class="pilcrow" href="#section-
|
173
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
155
174
|
</div>
|
156
175
|
<p>Construct path</p>
|
157
176
|
|
@@ -162,11 +181,11 @@
|
|
162
181
|
</li>
|
163
182
|
|
164
183
|
|
165
|
-
<li id="section-
|
184
|
+
<li id="section-10">
|
166
185
|
<div class="annotation">
|
167
186
|
|
168
187
|
<div class="pilwrap ">
|
169
|
-
<a class="pilcrow" href="#section-
|
188
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
170
189
|
</div>
|
171
190
|
<p>Open file</p>
|
172
191
|
|
@@ -177,11 +196,11 @@
|
|
177
196
|
</li>
|
178
197
|
|
179
198
|
|
180
|
-
<li id="section-
|
199
|
+
<li id="section-11">
|
181
200
|
<div class="annotation">
|
182
201
|
|
183
202
|
<div class="pilwrap ">
|
184
|
-
<a class="pilcrow" href="#section-
|
203
|
+
<a class="pilcrow" href="#section-11">¶</a>
|
185
204
|
</div>
|
186
205
|
<p>Make a request to API using client_id and private_key</p>
|
187
206
|
|
@@ -196,41 +215,76 @@
|
|
196
215
|
url = <span class="keyword">nil</span>
|
197
216
|
|
198
217
|
<span class="keyword">case</span> settings.check
|
199
|
-
<span class="keyword">when</span> <span class="string">'viewer'</span>
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
218
|
+
<span class="keyword">when</span> <span class="string">'viewer'</span></pre></div></div>
|
219
|
+
|
220
|
+
</li>
|
221
|
+
|
222
|
+
|
223
|
+
<li id="section-12">
|
224
|
+
<div class="annotation">
|
225
|
+
|
226
|
+
<div class="pilwrap ">
|
227
|
+
<a class="pilcrow" href="#section-12">¶</a>
|
228
|
+
</div>
|
229
|
+
<p>Prepare to sign url</p>
|
208
230
|
|
209
|
-
|
210
|
-
|
211
|
-
<span class="
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
231
|
+
</div>
|
232
|
+
|
233
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"/document-viewer/embed/<span class="subst">#{file.guid}</span>?frameborder='0' width='<span class="subst">#{settings.width}</span>' height='<span class="subst">#{settings.height}</span>'"</span>
|
234
|
+
<span class="keyword">when</span> <span class="string">'annotation'</span></pre></div></div>
|
235
|
+
|
236
|
+
</li>
|
237
|
+
|
238
|
+
|
239
|
+
<li id="section-13">
|
240
|
+
<div class="annotation">
|
241
|
+
|
242
|
+
<div class="pilwrap ">
|
243
|
+
<a class="pilcrow" href="#section-13">¶</a>
|
244
|
+
</div>
|
245
|
+
<p>Prepare to sign url</p>
|
246
|
+
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"/document-annotation2/embed/<span class="subst">#{file.guid}</span>?frameborder='0' width='<span class="subst">#{settings.width}</span>' height='<span class="subst">#{settings.height}</span>'"</span>
|
218
250
|
<span class="keyword">end</span></pre></div></div>
|
219
251
|
|
220
252
|
</li>
|
221
253
|
|
222
254
|
|
223
|
-
<li id="section-
|
255
|
+
<li id="section-14">
|
224
256
|
<div class="annotation">
|
225
257
|
|
226
258
|
<div class="pilwrap ">
|
227
|
-
<a class="pilcrow" href="#section-
|
259
|
+
<a class="pilcrow" href="#section-14">¶</a>
|
228
260
|
</div>
|
229
|
-
<p>
|
261
|
+
<p>Sign url</p>
|
230
262
|
|
231
263
|
</div>
|
232
264
|
|
233
|
-
<div class="content"><div class='highlight'><pre> url = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> =>
|
265
|
+
<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>
|
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>Generate iframe URL</p>
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.base_path
|
281
|
+
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
282
|
+
iframe = <span class="string">"https://stage-api-groupdocs.dynabic.com<span class="subst">#{url}</span>"</span>
|
283
|
+
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
284
|
+
iframe = <span class="string">"https://dev-apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
285
|
+
<span class="keyword">else</span>
|
286
|
+
iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
287
|
+
<span class="keyword">end</span>
|
234
288
|
|
235
289
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
236
290
|
err = e.message
|
@@ -239,17 +293,17 @@
|
|
239
293
|
</li>
|
240
294
|
|
241
295
|
|
242
|
-
<li id="section-
|
296
|
+
<li id="section-16">
|
243
297
|
<div class="annotation">
|
244
298
|
|
245
299
|
<div class="pilwrap ">
|
246
|
-
<a class="pilcrow" href="#section-
|
300
|
+
<a class="pilcrow" href="#section-16">¶</a>
|
247
301
|
</div>
|
248
302
|
<p>Set variables for template</p>
|
249
303
|
|
250
304
|
</div>
|
251
305
|
|
252
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample09</span>, <span class="symbol">:locals</span> => {<span class="symbol">:guid</span> => file.guid, <span class="symbol">:width</span> => settings.width, <span class="symbol">:height</span> => settings.height, <span class="symbol">:v_url</span> =>
|
306
|
+
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample09</span>, <span class="symbol">:locals</span> => {<span class="symbol">:guid</span> => file.guid, <span class="symbol">:width</span> => settings.width, <span class="symbol">:height</span> => settings.height, <span class="symbol">:v_url</span> => iframe, <span class="symbol">:err</span> => err}
|
253
307
|
<span class="keyword">end</span></pre></div></div>
|
254
308
|
|
255
309
|
</li>
|