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
@@ -83,9 +83,7 @@
|
|
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_id.empty
|
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_id.empty?</pre></div></div>
|
89
87
|
|
90
88
|
</li>
|
91
89
|
|
@@ -96,6 +94,27 @@
|
|
96
94
|
<div class="pilwrap ">
|
97
95
|
<a class="pilcrow" href="#section-5">¶</a>
|
98
96
|
</div>
|
97
|
+
<p>Prepare base path</p>
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
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>
|
108
|
+
|
109
|
+
</li>
|
110
|
+
|
111
|
+
|
112
|
+
<li id="section-6">
|
113
|
+
<div class="annotation">
|
114
|
+
|
115
|
+
<div class="pilwrap ">
|
116
|
+
<a class="pilcrow" href="#section-6">¶</a>
|
117
|
+
</div>
|
99
118
|
<p>Configure your access to API server</p>
|
100
119
|
|
101
120
|
</div>
|
@@ -107,27 +126,27 @@
|
|
107
126
|
</li>
|
108
127
|
|
109
128
|
|
110
|
-
<li id="section-
|
129
|
+
<li id="section-7">
|
111
130
|
<div class="annotation">
|
112
131
|
|
113
132
|
<div class="pilwrap ">
|
114
|
-
<a class="pilcrow" href="#section-
|
133
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
115
134
|
</div>
|
116
135
|
<p>Optionally specify API server and version</p>
|
117
136
|
|
118
137
|
</div>
|
119
138
|
|
120
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server =
|
139
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
121
140
|
<span class="keyword">end</span></pre></div></div>
|
122
141
|
|
123
142
|
</li>
|
124
143
|
|
125
144
|
|
126
|
-
<li id="section-
|
145
|
+
<li id="section-8">
|
127
146
|
<div class="annotation">
|
128
147
|
|
129
148
|
<div class="pilwrap ">
|
130
|
-
<a class="pilcrow" href="#section-
|
149
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
131
150
|
</div>
|
132
151
|
<p>Make a request to API using client_id and private_key</p>
|
133
152
|
|
@@ -139,11 +158,11 @@
|
|
139
158
|
</li>
|
140
159
|
|
141
160
|
|
142
|
-
<li id="section-
|
161
|
+
<li id="section-9">
|
143
162
|
<div class="annotation">
|
144
163
|
|
145
164
|
<div class="pilwrap ">
|
146
|
-
<a class="pilcrow" href="#section-
|
165
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
147
166
|
</div>
|
148
167
|
<p>Get document by file ID</p>
|
149
168
|
|
@@ -160,11 +179,11 @@
|
|
160
179
|
</li>
|
161
180
|
|
162
181
|
|
163
|
-
<li id="section-
|
182
|
+
<li id="section-10">
|
164
183
|
<div class="annotation">
|
165
184
|
|
166
185
|
<div class="pilwrap ">
|
167
|
-
<a class="pilcrow" href="#section-
|
186
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
168
187
|
</div>
|
169
188
|
<p>Get list of annotations</p>
|
170
189
|
|
@@ -180,11 +199,11 @@
|
|
180
199
|
</li>
|
181
200
|
|
182
201
|
|
183
|
-
<li id="section-
|
202
|
+
<li id="section-11">
|
184
203
|
<div class="annotation">
|
185
204
|
|
186
205
|
<div class="pilwrap ">
|
187
|
-
<a class="pilcrow" href="#section-
|
206
|
+
<a class="pilcrow" href="#section-11">¶</a>
|
188
207
|
</div>
|
189
208
|
<p>Set variables for template</p>
|
190
209
|
|
@@ -69,7 +69,9 @@
|
|
69
69
|
set <span class="symbol">:email</span>, params[<span class="symbol">:email</span>]
|
70
70
|
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
|
71
71
|
|
72
|
-
<span class="keyword">begin</span
|
72
|
+
<span class="keyword">begin</span>
|
73
|
+
<span class="constant">Check</span> required variables
|
74
|
+
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_id.empty? <span class="keyword">or</span> settings.email.empty?</pre></div></div>
|
73
75
|
|
74
76
|
</li>
|
75
77
|
|
@@ -80,13 +82,17 @@
|
|
80
82
|
<div class="pilwrap ">
|
81
83
|
<a class="pilcrow" href="#section-4">¶</a>
|
82
84
|
</div>
|
83
|
-
<p>
|
85
|
+
<p>Prepare base path</p>
|
84
86
|
|
85
87
|
</div>
|
86
88
|
|
87
|
-
<div class="content"><div class='highlight'><pre>
|
88
|
-
|
89
|
-
<span class="keyword">
|
89
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
90
|
+
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
91
|
+
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
92
|
+
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
93
|
+
<span class="keyword">else</span>
|
94
|
+
base_path = settings.base_path
|
95
|
+
<span class="keyword">end</span></pre></div></div>
|
90
96
|
|
91
97
|
</li>
|
92
98
|
|
@@ -118,7 +124,7 @@
|
|
118
124
|
|
119
125
|
</div>
|
120
126
|
|
121
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server =
|
127
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
122
128
|
<span class="keyword">end</span></pre></div></div>
|
123
129
|
|
124
130
|
</li>
|
@@ -174,6 +180,7 @@
|
|
174
180
|
<div class="content"><div class='highlight'><pre> result = document.to_document.set_collaborators!(settings.email.split(<span class="string">' '</span>), <span class="number">1</span>)
|
175
181
|
<span class="keyword">end</span>
|
176
182
|
|
183
|
+
|
177
184
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
178
185
|
err = e.message
|
179
186
|
<span class="keyword">end</span></pre></div></div>
|
@@ -187,7 +194,7 @@
|
|
187
194
|
<div class="pilwrap ">
|
188
195
|
<a class="pilcrow" href="#section-10">¶</a>
|
189
196
|
</div>
|
190
|
-
<p>
|
197
|
+
<p>Set variables for template</p>
|
191
198
|
|
192
199
|
</div>
|
193
200
|
|
@@ -59,13 +59,13 @@
|
|
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
66
|
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
|
67
67
|
set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
|
68
|
-
set <span class="symbol">:folder</span>, params[<span class="symbol">:
|
68
|
+
set <span class="symbol">:folder</span>, params[<span class="symbol">:path</span>]
|
69
69
|
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
|
70
70
|
|
71
71
|
<span class="keyword">begin</span></pre></div></div>
|
@@ -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.folder.empty
|
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.folder.empty?</pre></div></div>
|
89
87
|
|
90
88
|
</li>
|
91
89
|
|
@@ -96,6 +94,27 @@
|
|
96
94
|
<div class="pilwrap ">
|
97
95
|
<a class="pilcrow" href="#section-5">¶</a>
|
98
96
|
</div>
|
97
|
+
<p>Prepare base path</p>
|
98
|
+
|
99
|
+
</div>
|
100
|
+
|
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>
|
108
|
+
|
109
|
+
</li>
|
110
|
+
|
111
|
+
|
112
|
+
<li id="section-6">
|
113
|
+
<div class="annotation">
|
114
|
+
|
115
|
+
<div class="pilwrap ">
|
116
|
+
<a class="pilcrow" href="#section-6">¶</a>
|
117
|
+
</div>
|
99
118
|
<p>Configure your access to API server</p>
|
100
119
|
|
101
120
|
</div>
|
@@ -107,30 +126,30 @@
|
|
107
126
|
</li>
|
108
127
|
|
109
128
|
|
110
|
-
<li id="section-
|
129
|
+
<li id="section-7">
|
111
130
|
<div class="annotation">
|
112
131
|
|
113
132
|
<div class="pilwrap ">
|
114
|
-
<a class="pilcrow" href="#section-
|
133
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
115
134
|
</div>
|
116
135
|
<p>Optionally specify API server and version</p>
|
117
136
|
|
118
137
|
</div>
|
119
138
|
|
120
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server =
|
139
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
121
140
|
<span class="keyword">end</span>
|
122
141
|
folder = <span class="keyword">nil</span></pre></div></div>
|
123
142
|
|
124
143
|
</li>
|
125
144
|
|
126
145
|
|
127
|
-
<li id="section-
|
146
|
+
<li id="section-8">
|
128
147
|
<div class="annotation">
|
129
148
|
|
130
149
|
<div class="pilwrap ">
|
131
|
-
<a class="pilcrow" href="#section-
|
150
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
132
151
|
</div>
|
133
|
-
<p>
|
152
|
+
<p>Make a request to API using client_id and private_key</p>
|
134
153
|
|
135
154
|
</div>
|
136
155
|
|
@@ -145,13 +164,13 @@
|
|
145
164
|
</li>
|
146
165
|
|
147
166
|
|
148
|
-
<li id="section-
|
167
|
+
<li id="section-9">
|
149
168
|
<div class="annotation">
|
150
169
|
|
151
170
|
<div class="pilwrap ">
|
152
|
-
<a class="pilcrow" href="#section-
|
171
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
153
172
|
</div>
|
154
|
-
<p>
|
173
|
+
<p>Get list of shares for a folder</p>
|
155
174
|
|
156
175
|
</div>
|
157
176
|
|
@@ -164,13 +183,13 @@
|
|
164
183
|
</li>
|
165
184
|
|
166
185
|
|
167
|
-
<li id="section-
|
186
|
+
<li id="section-10">
|
168
187
|
<div class="annotation">
|
169
188
|
|
170
189
|
<div class="pilwrap ">
|
171
|
-
<a class="pilcrow" href="#section-
|
190
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
172
191
|
</div>
|
173
|
-
<p>
|
192
|
+
<p>Set variables for template</p>
|
174
193
|
|
175
194
|
</div>
|
176
195
|
|
@@ -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>Check the number of document's views. Make a request to API using client_id and private_key</p>
|
132
151
|
|
@@ -142,11 +161,11 @@
|
|
142
161
|
</li>
|
143
162
|
|
144
163
|
|
145
|
-
<li id="section-
|
164
|
+
<li id="section-9">
|
146
165
|
<div class="annotation">
|
147
166
|
|
148
167
|
<div class="pilwrap ">
|
149
|
-
<a class="pilcrow" href="#section-
|
168
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
150
169
|
</div>
|
151
170
|
<p>Set variables for template</p>
|
152
171
|
|
@@ -81,9 +81,7 @@
|
|
81
81
|
|
82
82
|
</div>
|
83
83
|
|
84
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.fileId.empty
|
85
|
-
|
86
|
-
<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>
|
84
|
+
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.fileId.empty?</pre></div></div>
|
87
85
|
|
88
86
|
</li>
|
89
87
|
|
@@ -94,13 +92,17 @@
|
|
94
92
|
<div class="pilwrap ">
|
95
93
|
<a class="pilcrow" href="#section-5">¶</a>
|
96
94
|
</div>
|
97
|
-
<p>
|
95
|
+
<p>Prepare base path</p>
|
98
96
|
|
99
97
|
</div>
|
100
98
|
|
101
|
-
<div class="content"><div class='highlight'><pre> <span class="
|
102
|
-
|
103
|
-
|
99
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
100
|
+
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
101
|
+
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
102
|
+
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
103
|
+
<span class="keyword">else</span>
|
104
|
+
base_path = settings.base_path
|
105
|
+
<span class="keyword">end</span></pre></div></div>
|
104
106
|
|
105
107
|
</li>
|
106
108
|
|
@@ -111,12 +113,13 @@
|
|
111
113
|
<div class="pilwrap ">
|
112
114
|
<a class="pilcrow" href="#section-6">¶</a>
|
113
115
|
</div>
|
114
|
-
<p>
|
116
|
+
<p>Configure your access to API server</p>
|
115
117
|
|
116
118
|
</div>
|
117
119
|
|
118
|
-
<div class="content"><div class='highlight'><pre>
|
119
|
-
|
120
|
+
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
121
|
+
groupdocs.client_id = settings.client_id
|
122
|
+
groupdocs.private_key = settings.private_key</pre></div></div>
|
120
123
|
|
121
124
|
</li>
|
122
125
|
|
@@ -127,18 +130,11 @@
|
|
127
130
|
<div class="pilwrap ">
|
128
131
|
<a class="pilcrow" href="#section-7">¶</a>
|
129
132
|
</div>
|
130
|
-
<p>
|
133
|
+
<p>Optionally specify API server and version</p>
|
131
134
|
|
132
135
|
</div>
|
133
136
|
|
134
|
-
<div class="content"><div class='highlight'><pre>
|
135
|
-
|
136
|
-
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
137
|
-
url = <span class="string">"http://stage-apps-groupdocs.dynabic.com/assembly2/questionnaire-assembly/<span class="subst">#{settings.fileId}</span>"</span>
|
138
|
-
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
139
|
-
url = <span class="string">"http://dev-apps-groupdocs.dynabic.com/assembly2/questionnaire-assembly/<span class="subst">#{settings.fileId}</span>"</span>
|
140
|
-
<span class="keyword">else</span>
|
141
|
-
url = <span class="string">"https://apps.groupdocs.com/assembly2/questionnaire-assembly/<span class="subst">#{settings.fileId}</span>"</span>
|
137
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
142
138
|
<span class="keyword">end</span></pre></div></div>
|
143
139
|
|
144
140
|
</li>
|
@@ -150,11 +146,11 @@
|
|
150
146
|
<div class="pilwrap ">
|
151
147
|
<a class="pilcrow" href="#section-8">¶</a>
|
152
148
|
</div>
|
153
|
-
<p>
|
149
|
+
<p>Prepare to sign url</p>
|
154
150
|
|
155
151
|
</div>
|
156
152
|
|
157
|
-
<div class="content"><div class='highlight'><pre> iframe = <span class="
|
153
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"/assembly2/questionnaire-assembly/<span class="subst">#{settings.fileId}</span>"</span></pre></div></div>
|
158
154
|
|
159
155
|
</li>
|
160
156
|
|
@@ -165,11 +161,48 @@
|
|
165
161
|
<div class="pilwrap ">
|
166
162
|
<a class="pilcrow" href="#section-9">¶</a>
|
167
163
|
</div>
|
168
|
-
<p>Construct result
|
164
|
+
<p>Construct result string</p>
|
169
165
|
|
170
166
|
</div>
|
171
167
|
|
172
|
-
<div class="content"><div class='highlight'><pre>
|
168
|
+
<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>
|
169
|
+
|
170
|
+
</li>
|
171
|
+
|
172
|
+
|
173
|
+
<li id="section-10">
|
174
|
+
<div class="annotation">
|
175
|
+
|
176
|
+
<div class="pilwrap ">
|
177
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
178
|
+
</div>
|
179
|
+
<p>Generate iframe URL</p>
|
180
|
+
|
181
|
+
</div>
|
182
|
+
|
183
|
+
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.base_path
|
184
|
+
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
185
|
+
iframe = <span class="string">"https://stage-api-groupdocs.dynabic.com<span class="subst">#{url}</span>"</span>
|
186
|
+
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
187
|
+
iframe = <span class="string">"https://dev-apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
188
|
+
<span class="keyword">else</span>
|
189
|
+
iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
190
|
+
<span class="keyword">end</span></pre></div></div>
|
191
|
+
|
192
|
+
</li>
|
193
|
+
|
194
|
+
|
195
|
+
<li id="section-11">
|
196
|
+
<div class="annotation">
|
197
|
+
|
198
|
+
<div class="pilwrap ">
|
199
|
+
<a class="pilcrow" href="#section-11">¶</a>
|
200
|
+
</div>
|
201
|
+
<p>Make iframe</p>
|
202
|
+
|
203
|
+
</div>
|
204
|
+
|
205
|
+
<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>
|
173
206
|
|
174
207
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
175
208
|
err = e.message
|
@@ -178,11 +211,11 @@
|
|
178
211
|
</li>
|
179
212
|
|
180
213
|
|
181
|
-
<li id="section-
|
214
|
+
<li id="section-12">
|
182
215
|
<div class="annotation">
|
183
216
|
|
184
217
|
<div class="pilwrap ">
|
185
|
-
<a class="pilcrow" href="#section-
|
218
|
+
<a class="pilcrow" href="#section-12">¶</a>
|
186
219
|
</div>
|
187
220
|
<p>set variables for template</p>
|
188
221
|
|