groupdocs 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +34 -0
- data/LICENSE.txt +21 -0
- data/README.md +3 -0
- data/examples/api-samples/public/docs/sample01.html +23 -23
- data/examples/api-samples/public/docs/sample02.html +27 -27
- data/examples/api-samples/public/docs/sample03.html +81 -69
- data/examples/api-samples/public/docs/sample04.html +29 -29
- data/examples/api-samples/public/docs/sample05.html +48 -48
- data/examples/api-samples/public/docs/sample06.html +47 -46
- data/examples/api-samples/public/docs/sample07.html +35 -35
- data/examples/api-samples/public/docs/sample08.html +45 -45
- data/examples/api-samples/public/docs/sample09.html +57 -57
- data/examples/api-samples/public/docs/sample10.html +41 -41
- data/examples/api-samples/public/docs/sample11.html +96 -118
- data/examples/api-samples/public/docs/sample12.html +29 -50
- data/examples/api-samples/public/docs/sample13.html +36 -44
- data/examples/api-samples/public/docs/sample14.html +29 -29
- data/examples/api-samples/public/docs/sample15.html +24 -24
- data/examples/api-samples/public/docs/sample16.html +32 -32
- data/examples/api-samples/public/docs/sample17.html +38 -38
- data/examples/api-samples/public/docs/sample18.html +105 -101
- data/examples/api-samples/public/docs/sample19.html +101 -101
- data/examples/api-samples/public/docs/sample20.html +42 -42
- data/examples/api-samples/public/docs/sample21.html +109 -109
- data/examples/api-samples/public/docs/sample22.html +56 -56
- data/examples/api-samples/public/docs/sample23.html +39 -39
- data/examples/api-samples/public/docs/sample24.html +36 -36
- data/examples/api-samples/public/docs/sample25.html +67 -67
- data/examples/api-samples/public/docs/sample26.html +23 -23
- data/examples/api-samples/public/docs/sample27.html +72 -72
- data/examples/api-samples/public/docs/sample28.html +46 -45
- data/examples/api-samples/public/docs/sample29.html +30 -30
- data/examples/api-samples/public/docs/sample30.html +30 -30
- data/examples/api-samples/public/docs/sample31.html +114 -114
- data/examples/api-samples/public/docs/sample32.html +96 -96
- data/examples/api-samples/public/docs/sample33.html +56 -56
- data/examples/api-samples/public/docs/sample34.html +27 -27
- data/examples/api-samples/public/docs/sample35.html +134 -135
- data/examples/api-samples/public/docs/sample36.html +32 -32
- data/examples/api-samples/public/docs/sample37.html +103 -103
- data/examples/api-samples/public/docs/sample38.html +76 -76
- data/examples/api-samples/public/docs/sample39.html +136 -136
- data/examples/api-samples/public/docs/sample40.html +104 -104
- data/examples/api-samples/public/docs/sample41.html +137 -137
- data/examples/api-samples/public/docs/sample42.html +61 -61
- data/examples/api-samples/public/docs/sample43.html +72 -72
- data/examples/api-samples/public/docs/sample44.html +751 -0
- data/examples/api-samples/public/docs/sample45.html +236 -0
- data/examples/api-samples/public/templates/merge_field3_doc.docx +0 -0
- data/examples/api-samples/samples/sample01.rb +2 -2
- data/examples/api-samples/samples/sample02.rb +2 -2
- data/examples/api-samples/samples/sample03.rb +2 -2
- data/examples/api-samples/samples/sample04.rb +2 -2
- data/examples/api-samples/samples/sample05.rb +2 -2
- data/examples/api-samples/samples/sample06.rb +2 -2
- data/examples/api-samples/samples/sample07.rb +2 -2
- data/examples/api-samples/samples/sample08.rb +2 -2
- data/examples/api-samples/samples/sample09.rb +2 -2
- data/examples/api-samples/samples/sample10.rb +2 -2
- data/examples/api-samples/samples/sample11.rb +2 -2
- data/examples/api-samples/samples/sample12.rb +2 -2
- data/examples/api-samples/samples/sample13.rb +2 -2
- data/examples/api-samples/samples/sample14.rb +2 -2
- data/examples/api-samples/samples/sample15.rb +2 -2
- data/examples/api-samples/samples/sample16.rb +2 -2
- data/examples/api-samples/samples/sample17.rb +2 -2
- data/examples/api-samples/samples/sample18.rb +2 -2
- data/examples/api-samples/samples/sample19.rb +2 -2
- data/examples/api-samples/samples/sample20.rb +2 -2
- data/examples/api-samples/samples/sample21.rb +2 -2
- data/examples/api-samples/samples/sample22.rb +2 -2
- data/examples/api-samples/samples/sample23.rb +2 -2
- data/examples/api-samples/samples/sample24.rb +2 -2
- data/examples/api-samples/samples/sample25.rb +2 -2
- data/examples/api-samples/samples/sample26.rb +2 -2
- data/examples/api-samples/samples/sample27.rb +2 -2
- data/examples/api-samples/samples/sample28.rb +2 -2
- data/examples/api-samples/samples/sample29.rb +2 -2
- data/examples/api-samples/samples/sample30.rb +2 -2
- data/examples/api-samples/samples/sample31.rb +2 -2
- data/examples/api-samples/samples/sample32.rb +2 -2
- data/examples/api-samples/samples/sample33.rb +2 -2
- data/examples/api-samples/samples/sample34.rb +2 -2
- data/examples/api-samples/samples/sample35.rb +4 -4
- data/examples/api-samples/samples/sample36.rb +2 -2
- data/examples/api-samples/samples/sample37.rb +2 -2
- data/examples/api-samples/samples/sample38.rb +2 -2
- data/examples/api-samples/samples/sample39.rb +2 -2
- data/examples/api-samples/samples/sample40.rb +2 -2
- data/examples/api-samples/samples/sample41.rb +2 -2
- data/examples/api-samples/samples/sample42.rb +2 -2
- data/examples/api-samples/samples/sample43.rb +2 -2
- data/examples/api-samples/samples/sample44.rb +188 -0
- data/examples/api-samples/samples/sample45.rb +74 -0
- data/examples/api-samples/views/_others_samples.haml +47 -43
- data/examples/api-samples/views/index.haml +55 -44
- data/examples/api-samples/views/layout.haml +1 -6
- data/examples/api-samples/views/sample01.haml +62 -57
- data/examples/api-samples/views/sample02.haml +52 -46
- data/examples/api-samples/views/sample03.haml +78 -73
- data/examples/api-samples/views/sample04.haml +51 -45
- data/examples/api-samples/views/sample05.haml +77 -71
- data/examples/api-samples/views/sample06.haml +58 -52
- data/examples/api-samples/views/sample07.haml +51 -45
- data/examples/api-samples/views/sample08.haml +90 -84
- data/examples/api-samples/views/sample09.haml +86 -80
- data/examples/api-samples/views/sample10.haml +83 -77
- data/examples/api-samples/views/sample11.haml +124 -120
- data/examples/api-samples/views/sample12.haml +65 -59
- data/examples/api-samples/views/sample13.haml +62 -56
- data/examples/api-samples/views/sample14.haml +57 -51
- data/examples/api-samples/views/sample15.haml +49 -43
- data/examples/api-samples/views/sample16.haml +49 -43
- data/examples/api-samples/views/sample17.haml +53 -47
- data/examples/api-samples/views/sample18.haml +140 -134
- data/examples/api-samples/views/sample19.haml +87 -81
- data/examples/api-samples/views/sample20.haml +53 -47
- data/examples/api-samples/views/sample21.haml +115 -111
- data/examples/api-samples/views/sample22.haml +94 -88
- data/examples/api-samples/views/sample23.haml +83 -78
- data/examples/api-samples/views/sample24.haml +54 -48
- data/examples/api-samples/views/sample25.haml +89 -83
- data/examples/api-samples/views/sample26.haml +62 -57
- data/examples/api-samples/views/sample27.haml +114 -109
- data/examples/api-samples/views/sample28.haml +55 -49
- data/examples/api-samples/views/sample29.haml +67 -69
- data/examples/api-samples/views/sample30.haml +54 -48
- data/examples/api-samples/views/sample31.haml +106 -100
- data/examples/api-samples/views/sample32.haml +90 -84
- data/examples/api-samples/views/sample33.haml +60 -54
- data/examples/api-samples/views/sample34.haml +51 -46
- data/examples/api-samples/views/sample35.haml +84 -78
- data/examples/api-samples/views/sample36.haml +63 -58
- data/examples/api-samples/views/sample37.haml +122 -116
- data/examples/api-samples/views/sample38.haml +104 -98
- data/examples/api-samples/views/sample39.haml +6 -2
- data/examples/api-samples/views/sample40.haml +94 -89
- data/examples/api-samples/views/sample41.haml +127 -123
- data/examples/api-samples/views/sample42.haml +60 -54
- data/examples/api-samples/views/sample43.haml +81 -77
- data/examples/api-samples/views/sample44.haml +85 -0
- data/examples/api-samples/views/sample45.haml +85 -0
- data/groupdocs.gemspec +2 -0
- data/lib/groupdocs/datasource/field.rb +9 -0
- data/lib/groupdocs/document.rb +66 -4
- data/lib/groupdocs/document/annotation.rb +11 -6
- data/lib/groupdocs/document/editor.rb +53 -0
- data/lib/groupdocs/document/field.rb +16 -0
- data/lib/groupdocs/document/style.rb +30 -0
- data/lib/groupdocs/job.rb +24 -0
- data/lib/groupdocs/questionnaire.rb +2 -0
- data/lib/groupdocs/questionnaire/collector.rb +52 -0
- data/lib/groupdocs/questionnaire/collector_style.rb +54 -0
- data/lib/groupdocs/questionnaire/question.rb +9 -0
- data/lib/groupdocs/questionnaire/style/base_font.rb +17 -0
- data/lib/groupdocs/questionnaire/style/question_title.rb +17 -0
- data/lib/groupdocs/questionnaire/style/title.rb +17 -0
- data/lib/groupdocs/signature/envelope.rb +43 -8
- data/lib/groupdocs/signature/form.rb +113 -12
- data/lib/groupdocs/signature/recipient.rb +38 -3
- data/lib/groupdocs/signature/shared/field_methods.rb +4 -2
- data/lib/groupdocs/signature/template.rb +20 -1
- data/lib/groupdocs/storage/file.rb +3 -2
- data/lib/groupdocs/user.rb +148 -0
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/api/helpers/access_rights_helper_spec.rb +5 -5
- data/spec/groupdocs/document/annotation_spec.rb +1 -1
- data/spec/groupdocs/signature/envelope_spec.rb +1 -1
- data/spec/groupdocs/user_spec.rb +4 -4
- data/spec/support/shared_examples/signature/shared/field_methods.rb +5 -4
- metadata +18 -3
@@ -31,9 +31,9 @@
|
|
31
31
|
|
32
32
|
</div>
|
33
33
|
|
34
|
-
<div class="content"><div class='highlight'><pre>get <span class="string">'/
|
35
|
-
haml <span class="symbol">:sample25</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-25-how-to-merge-assemble-and-convert-document'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample25</span>
|
36
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
37
37
|
|
38
38
|
</li>
|
39
39
|
|
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
</div>
|
50
50
|
|
51
|
-
<div class="content"><div class='highlight'><pre>post <span class="string">'/
|
51
|
+
<div class="content"><div class='highlight'><pre>post <span class="hljs-string">'/sample-25-how-to-merge-assemble-and-convert-document'</span> <span class="hljs-keyword">do</span></pre></div></div>
|
52
52
|
|
53
53
|
</li>
|
54
54
|
|
@@ -63,12 +63,12 @@
|
|
63
63
|
|
64
64
|
</div>
|
65
65
|
|
66
|
-
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
|
67
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
|
68
|
-
set <span class="symbol">:source</span>, params[<span class="symbol">:source</span>]
|
69
|
-
set <span class="symbol">:file_id</span>, params[<span class="symbol">:fileId</span>]
|
70
|
-
set <span class="symbol">:url</span>, params[<span class="symbol">:url</span>]
|
71
|
-
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]</pre></div></div>
|
66
|
+
<div class="content"><div class='highlight'><pre> set <span class="hljs-symbol">:client_id</span>, params[<span class="hljs-symbol">:clientId</span>]
|
67
|
+
set <span class="hljs-symbol">:private_key</span>, params[<span class="hljs-symbol">:privateKey</span>]
|
68
|
+
set <span class="hljs-symbol">:source</span>, params[<span class="hljs-symbol">:source</span>]
|
69
|
+
set <span class="hljs-symbol">:file_id</span>, params[<span class="hljs-symbol">:fileId</span>]
|
70
|
+
set <span class="hljs-symbol">:url</span>, params[<span class="hljs-symbol">:url</span>]
|
71
|
+
set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>]</pre></div></div>
|
72
72
|
|
73
73
|
</li>
|
74
74
|
|
@@ -83,7 +83,7 @@
|
|
83
83
|
|
84
84
|
</div>
|
85
85
|
|
86
|
-
<div class="content"><div class='highlight'><pre> downloads_path = <span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span></pre></div></div>
|
86
|
+
<div class="content"><div class='highlight'><pre> downloads_path = <span class="hljs-string">"<span class="hljs-subst">#{<span class="hljs-constant">File</span>.dirname(__FILE_<span class="hljs-number">_</span>)}</span>/../public/downloads"</span></pre></div></div>
|
87
87
|
|
88
88
|
</li>
|
89
89
|
|
@@ -98,13 +98,13 @@
|
|
98
98
|
|
99
99
|
</div>
|
100
100
|
|
101
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> <span class="constant">File</span>.directory?(downloads_path)
|
102
|
-
<span class="constant">Dir</span>.foreach(downloads_path) { |f| fn = <span class="constant">File</span>.join(downloads_path, f); <span class="constant">File</span>.delete(fn) <span class="keyword">if</span> f != <span class="string">'.'</span> && f != <span class="string">'..'</span> }
|
103
|
-
<span class="keyword">else</span>
|
104
|
-
<span class="constant">Dir::</span>mkdir(downloads_path)
|
105
|
-
<span class="keyword">end</span>
|
101
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-constant">File</span>.directory?(downloads_path)
|
102
|
+
<span class="hljs-constant">Dir</span>.foreach(downloads_path) { |f| fn = <span class="hljs-constant">File</span>.join(downloads_path, f); <span class="hljs-constant">File</span>.delete(fn) <span class="hljs-keyword">if</span> f != <span class="hljs-string">'.'</span> && f != <span class="hljs-string">'..'</span> }
|
103
|
+
<span class="hljs-keyword">else</span>
|
104
|
+
<span class="hljs-constant">Dir::</span>mkdir(downloads_path)
|
105
|
+
<span class="hljs-keyword">end</span>
|
106
106
|
|
107
|
-
<span class="keyword">begin</span></pre></div></div>
|
107
|
+
<span class="hljs-keyword">begin</span></pre></div></div>
|
108
108
|
|
109
109
|
</li>
|
110
110
|
|
@@ -119,7 +119,7 @@
|
|
119
119
|
|
120
120
|
</div>
|
121
121
|
|
122
|
-
<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>
|
122
|
+
<div class="content"><div class='highlight'><pre> raise <span class="hljs-string">'Please enter all required parameters'</span> <span class="hljs-keyword">if</span> settings.client_id.empty? <span class="hljs-keyword">or</span> settings.private_key.empty?</pre></div></div>
|
123
123
|
|
124
124
|
</li>
|
125
125
|
|
@@ -134,13 +134,13 @@
|
|
134
134
|
|
135
135
|
</div>
|
136
136
|
|
137
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
138
|
-
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
139
|
-
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
140
|
-
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
141
|
-
<span class="keyword">else</span>
|
137
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty?
|
138
|
+
base_path = <span class="hljs-string">'https://api.groupdocs.com'</span>
|
139
|
+
<span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>)
|
140
|
+
base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>]
|
141
|
+
<span class="hljs-keyword">else</span>
|
142
142
|
base_path = settings.base_path
|
143
|
-
<span class="keyword">end</span></pre></div></div>
|
143
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
144
144
|
|
145
145
|
</li>
|
146
146
|
|
@@ -155,7 +155,7 @@
|
|
155
155
|
|
156
156
|
</div>
|
157
157
|
|
158
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
158
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs|
|
159
159
|
groupdocs.client_id = settings.client_id
|
160
160
|
groupdocs.private_key = settings.private_key</pre></div></div>
|
161
161
|
|
@@ -172,8 +172,8 @@
|
|
172
172
|
|
173
173
|
</div>
|
174
174
|
|
175
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
176
|
-
<span class="keyword">end</span></pre></div></div>
|
175
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment"># default is 'https://api.groupdocs.com'</span>
|
176
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
177
177
|
|
178
178
|
</li>
|
179
179
|
|
@@ -188,8 +188,8 @@
|
|
188
188
|
|
189
189
|
</div>
|
190
190
|
|
191
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.source
|
192
|
-
<span class="keyword">when</span> <span class="string">'guid'</span></pre></div></div>
|
191
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">case</span> settings.source
|
192
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'guid'</span></pre></div></div>
|
193
193
|
|
194
194
|
</li>
|
195
195
|
|
@@ -204,8 +204,8 @@
|
|
204
204
|
|
205
205
|
</div>
|
206
206
|
|
207
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.new({<span class="symbol">:guid</span> => settings.file_id})
|
208
|
-
<span class="keyword">when</span> <span class="string">'local'</span></pre></div></div>
|
207
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.new({<span class="hljs-symbol">:guid</span> => settings.file_id})
|
208
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'local'</span></pre></div></div>
|
209
209
|
|
210
210
|
</li>
|
211
211
|
|
@@ -220,7 +220,7 @@
|
|
220
220
|
|
221
221
|
</div>
|
222
222
|
|
223
|
-
<div class="content"><div class='highlight'><pre> file_path = <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>
|
223
|
+
<div class="content"><div class='highlight'><pre> file_path = <span class="hljs-string">"<span class="hljs-subst">#{<span class="hljs-constant">Dir</span>.tmpdir}</span>/<span class="hljs-subst">#{params[<span class="hljs-symbol">:file</span>][<span class="hljs-symbol">:filename</span>]}</span>"</span></pre></div></div>
|
224
224
|
|
225
225
|
</li>
|
226
226
|
|
@@ -235,7 +235,7 @@
|
|
235
235
|
|
236
236
|
</div>
|
237
237
|
|
238
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">File</span>.open(file_path, <span class="string">'wb'</span>) { |f| f.write(params[<span class="symbol">:file</span>][<span class="symbol">:tempfile</span>].read) }</pre></div></div>
|
238
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">File</span>.open(file_path, <span class="hljs-string">'wb'</span>) { |f| f.write(params[<span class="hljs-symbol">:file</span>][<span class="hljs-symbol">:tempfile</span>].read) }</pre></div></div>
|
239
239
|
|
240
240
|
</li>
|
241
241
|
|
@@ -250,8 +250,8 @@
|
|
250
250
|
|
251
251
|
</div>
|
252
252
|
|
253
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(file_path, {})
|
254
|
-
<span class="keyword">when</span> <span class="string">'url'</span></pre></div></div>
|
253
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.upload!(file_path, {})
|
254
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'url'</span></pre></div></div>
|
255
255
|
|
256
256
|
</li>
|
257
257
|
|
@@ -266,10 +266,10 @@
|
|
266
266
|
|
267
267
|
</div>
|
268
268
|
|
269
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload_web!(settings.url)
|
270
|
-
<span class="keyword">else</span>
|
271
|
-
raise <span class="string">'Wrong GUID source.'</span>
|
272
|
-
<span class="keyword">end</span></pre></div></div>
|
269
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.upload_web!(settings.url)
|
270
|
+
<span class="hljs-keyword">else</span>
|
271
|
+
raise <span class="hljs-string">'Wrong GUID source.'</span>
|
272
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
273
273
|
|
274
274
|
</li>
|
275
275
|
|
@@ -284,7 +284,7 @@
|
|
284
284
|
|
285
285
|
</div>
|
286
286
|
|
287
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'No such file'</span> <span class="keyword">unless</span> file.is_a?(<span class="constant">GroupDocs::Storage::File</span>)</pre></div></div>
|
287
|
+
<div class="content"><div class='highlight'><pre> raise <span class="hljs-string">'No such file'</span> <span class="hljs-keyword">unless</span> file.is_a?(<span class="hljs-constant">GroupDocs::Storage::File</span>)</pre></div></div>
|
288
288
|
|
289
289
|
</li>
|
290
290
|
|
@@ -314,7 +314,7 @@
|
|
314
314
|
|
315
315
|
</div>
|
316
316
|
|
317
|
-
<div class="content"><div class='highlight'><pre> datasource = <span class="constant">GroupDocs::DataSource</span>.new</pre></div></div>
|
317
|
+
<div class="content"><div class='highlight'><pre> datasource = <span class="hljs-constant">GroupDocs::DataSource</span>.new</pre></div></div>
|
318
318
|
|
319
319
|
</li>
|
320
320
|
|
@@ -325,7 +325,7 @@
|
|
325
325
|
<div class="pilwrap ">
|
326
326
|
<a class="pilcrow" href="#section-19">¶</a>
|
327
327
|
</div>
|
328
|
-
<p>Get arry of document
|
328
|
+
<p>Get arry of document’s fields</p>
|
329
329
|
|
330
330
|
</div>
|
331
331
|
|
@@ -344,7 +344,7 @@
|
|
344
344
|
|
345
345
|
</div>
|
346
346
|
|
347
|
-
<div class="content"><div class='highlight'><pre> datasource.fields = fields.map { |field| <span class="constant">GroupDocs::DataSource::Field</span>.new(<span class="symbol">name:</span> field.name, <span class="symbol">type:</span> <span class="symbol">:text</span>, <span class="symbol">values:</span> <span class="string">%w(value1 value2)</span>) }</pre></div></div>
|
347
|
+
<div class="content"><div class='highlight'><pre> datasource.fields = fields.map { |field| <span class="hljs-constant">GroupDocs::DataSource::Field</span>.new(<span class="hljs-symbol">name:</span> field.name, <span class="hljs-symbol">type:</span> <span class="hljs-symbol">:text</span>, <span class="hljs-symbol">values:</span> <span class="hljs-string">%w(value1 value2)</span>) }</pre></div></div>
|
348
348
|
|
349
349
|
</li>
|
350
350
|
|
@@ -374,8 +374,8 @@
|
|
374
374
|
|
375
375
|
</div>
|
376
376
|
|
377
|
-
<div class="content"><div class='highlight'><pre> job = document.datasource!(datasource, {<span class="symbol">:new_type</span> => <span class="string">'pdf'</span>})
|
378
|
-
sleep <span class="number">10</span> <span class="comment"># wait for merge and convert</span></pre></div></div>
|
377
|
+
<div class="content"><div class='highlight'><pre> job = document.datasource!(datasource, {<span class="hljs-symbol">:new_type</span> => <span class="hljs-string">'pdf'</span>})
|
378
|
+
sleep <span class="hljs-number">10</span> <span class="hljs-comment"># wait for merge and convert</span></pre></div></div>
|
379
379
|
|
380
380
|
</li>
|
381
381
|
|
@@ -405,7 +405,7 @@
|
|
405
405
|
|
406
406
|
</div>
|
407
407
|
|
408
|
-
<div class="content"><div class='highlight'><pre> document[<span class="symbol">:inputs</span>][<span class="number">0</span>].outputs[<span class="number">0</span>].download!(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span>)</pre></div></div>
|
408
|
+
<div class="content"><div class='highlight'><pre> document[<span class="hljs-symbol">:inputs</span>][<span class="hljs-number">0</span>].outputs[<span class="hljs-number">0</span>].download!(<span class="hljs-string">"<span class="hljs-subst">#{<span class="hljs-constant">File</span>.dirname(__FILE_<span class="hljs-number">_</span>)}</span>/../public/downloads"</span>)</pre></div></div>
|
409
409
|
|
410
410
|
</li>
|
411
411
|
|
@@ -420,7 +420,7 @@
|
|
420
420
|
|
421
421
|
</div>
|
422
422
|
|
423
|
-
<div class="content"><div class='highlight'><pre> guid = document[<span class="symbol">:inputs</span>][<span class="number">0</span>].outputs[<span class="number">0</span>].guid</pre></div></div>
|
423
|
+
<div class="content"><div class='highlight'><pre> guid = document[<span class="hljs-symbol">:inputs</span>][<span class="hljs-number">0</span>].outputs[<span class="hljs-number">0</span>].guid</pre></div></div>
|
424
424
|
|
425
425
|
</li>
|
426
426
|
|
@@ -435,7 +435,7 @@
|
|
435
435
|
|
436
436
|
</div>
|
437
437
|
|
438
|
-
<div class="content"><div class='highlight'><pre> file_name = document[<span class="symbol">:inputs</span>][<span class="number">0</span>].outputs[<span class="number">0</span>].name</pre></div></div>
|
438
|
+
<div class="content"><div class='highlight'><pre> file_name = document[<span class="hljs-symbol">:inputs</span>][<span class="hljs-number">0</span>].outputs[<span class="hljs-number">0</span>].name</pre></div></div>
|
439
439
|
|
440
440
|
</li>
|
441
441
|
|
@@ -450,7 +450,7 @@
|
|
450
450
|
|
451
451
|
</div>
|
452
452
|
|
453
|
-
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"/document-viewer/embed/<span class="subst">#{guid}</span>"</span></pre></div></div>
|
453
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="hljs-string">"/document-viewer/embed/<span class="hljs-subst">#{guid}</span>"</span></pre></div></div>
|
454
454
|
|
455
455
|
</li>
|
456
456
|
|
@@ -465,7 +465,7 @@
|
|
465
465
|
|
466
466
|
</div>
|
467
467
|
|
468
|
-
<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>
|
468
|
+
<div class="content"><div class='highlight'><pre> url = <span class="hljs-constant">GroupDocs::Api::Request</span>.new(<span class="hljs-symbol">:path</span> => iframe).prepare_and_sign_url</pre></div></div>
|
469
469
|
|
470
470
|
</li>
|
471
471
|
|
@@ -480,14 +480,14 @@
|
|
480
480
|
|
481
481
|
</div>
|
482
482
|
|
483
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> base_path
|
484
|
-
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
485
|
-
iframe = <span class="string">"https://stage-api-groupdocs.dynabic.com<span class="subst">#{url}</span>"</span>
|
486
|
-
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
487
|
-
iframe = <span class="string">"https://dev-apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
488
|
-
<span class="keyword">else</span>
|
489
|
-
iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
490
|
-
<span class="keyword">end</span></pre></div></div>
|
483
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">case</span> base_path
|
484
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'https://stage-api-groupdocs.dynabic.com'</span>
|
485
|
+
iframe = <span class="hljs-string">"https://stage-api-groupdocs.dynabic.com<span class="hljs-subst">#{url}</span>"</span>
|
486
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'https://dev-api-groupdocs.dynabic.com'</span>
|
487
|
+
iframe = <span class="hljs-string">"https://dev-apps.groupdocs.com<span class="hljs-subst">#{url}</span>"</span>
|
488
|
+
<span class="hljs-keyword">else</span>
|
489
|
+
iframe = <span class="hljs-string">"https://apps.groupdocs.com<span class="hljs-subst">#{url}</span>"</span>
|
490
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
491
491
|
|
492
492
|
</li>
|
493
493
|
|
@@ -502,7 +502,7 @@
|
|
502
502
|
|
503
503
|
</div>
|
504
504
|
|
505
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> guid</pre></div></div>
|
505
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> guid</pre></div></div>
|
506
506
|
|
507
507
|
</li>
|
508
508
|
|
@@ -517,14 +517,14 @@
|
|
517
517
|
|
518
518
|
</div>
|
519
519
|
|
520
|
-
<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>
|
521
|
-
<span class="keyword">else</span>
|
522
|
-
raise <span class="string">'File was not converted'</span>
|
523
|
-
<span class="keyword">end</span>
|
520
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="hljs-string">"<iframe id='downloadframe' src='<span class="hljs-subst">#{iframe}</span>' width='800' height='1000'></iframe>"</span>
|
521
|
+
<span class="hljs-keyword">else</span>
|
522
|
+
raise <span class="hljs-string">'File was not converted'</span>
|
523
|
+
<span class="hljs-keyword">end</span>
|
524
524
|
|
525
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
525
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
526
526
|
err = e.message
|
527
|
-
<span class="keyword">end</span></pre></div></div>
|
527
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
528
528
|
|
529
529
|
</li>
|
530
530
|
|
@@ -539,8 +539,8 @@
|
|
539
539
|
|
540
540
|
</div>
|
541
541
|
|
542
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample25</span>, <span class="symbol">:locals</span> => {<span class="symbol">:userId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:iframe</span> => iframe, <span class="symbol">:fileName</span> => file_name, <span class="symbol">:err</span> => err}
|
543
|
-
<span class="keyword">end</span></pre></div></div>
|
542
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample25</span>, <span class="hljs-symbol">:locals</span> => {<span class="hljs-symbol">:userId</span> => settings.client_id, <span class="hljs-symbol">:privateKey</span> => settings.private_key, <span class="hljs-symbol">:iframe</span> => iframe, <span class="hljs-symbol">:fileName</span> => file_name, <span class="hljs-symbol">:err</span> => err}
|
543
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
544
544
|
|
545
545
|
</li>
|
546
546
|
|
@@ -31,9 +31,9 @@
|
|
31
31
|
|
32
32
|
</div>
|
33
33
|
|
34
|
-
<div class="content"><div class='highlight'><pre>get <span class="string">'/
|
35
|
-
haml <span class="symbol">:sample26</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-26-how-to-use-login-method-in-the-api'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample26</span>
|
36
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
37
37
|
|
38
38
|
</li>
|
39
39
|
|
@@ -48,12 +48,12 @@
|
|
48
48
|
|
49
49
|
</div>
|
50
50
|
|
51
|
-
<div class="content"><div class='highlight'><pre>post <span class="string">'/
|
52
|
-
set <span class="symbol">:email</span>, params[<span class="symbol">:login</span>]
|
53
|
-
set <span class="symbol">:password</span>, params[<span class="symbol">:password</span>]
|
54
|
-
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
|
51
|
+
<div class="content"><div class='highlight'><pre>post <span class="hljs-string">'/sample-26-how-to-use-login-method-in-the-api'</span> <span class="hljs-keyword">do</span>
|
52
|
+
set <span class="hljs-symbol">:email</span>, params[<span class="hljs-symbol">:login</span>]
|
53
|
+
set <span class="hljs-symbol">:password</span>, params[<span class="hljs-symbol">:password</span>]
|
54
|
+
set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>]
|
55
55
|
|
56
|
-
<span class="keyword">begin</span></pre></div></div>
|
56
|
+
<span class="hljs-keyword">begin</span></pre></div></div>
|
57
57
|
|
58
58
|
</li>
|
59
59
|
|
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
</div>
|
70
70
|
|
71
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.email.empty? <span class="keyword">or</span> settings.password.empty?</pre></div></div>
|
71
|
+
<div class="content"><div class='highlight'><pre> raise <span class="hljs-string">'Please enter all required parameters'</span> <span class="hljs-keyword">if</span> settings.email.empty? <span class="hljs-keyword">or</span> settings.password.empty?</pre></div></div>
|
72
72
|
|
73
73
|
</li>
|
74
74
|
|
@@ -83,13 +83,13 @@
|
|
83
83
|
|
84
84
|
</div>
|
85
85
|
|
86
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
87
|
-
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
88
|
-
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
89
|
-
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
90
|
-
<span class="keyword">else</span>
|
86
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty?
|
87
|
+
base_path = <span class="hljs-string">'https://api.groupdocs.com'</span>
|
88
|
+
<span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>)
|
89
|
+
base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>]
|
90
|
+
<span class="hljs-keyword">else</span>
|
91
91
|
base_path = settings.base_path
|
92
|
-
<span class="keyword">end</span></pre></div></div>
|
92
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
93
93
|
|
94
94
|
</li>
|
95
95
|
|
@@ -104,7 +104,7 @@
|
|
104
104
|
|
105
105
|
</div>
|
106
106
|
|
107
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|</pre></div></div>
|
107
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs|</pre></div></div>
|
108
108
|
|
109
109
|
</li>
|
110
110
|
|
@@ -119,8 +119,8 @@
|
|
119
119
|
|
120
120
|
</div>
|
121
121
|
|
122
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment">#Default is 'https://api.groupdocs.com'</span>
|
123
|
-
<span class="keyword">end</span></pre></div></div>
|
122
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment">#Default is 'https://api.groupdocs.com'</span>
|
123
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
124
124
|
|
125
125
|
</li>
|
126
126
|
|
@@ -135,11 +135,11 @@
|
|
135
135
|
|
136
136
|
</div>
|
137
137
|
|
138
|
-
<div class="content"><div class='highlight'><pre> user = <span class="constant">GroupDocs::User</span>.login!(settings.email, settings.password)
|
138
|
+
<div class="content"><div class='highlight'><pre> user = <span class="hljs-constant">GroupDocs::User</span>.login!(settings.email, settings.password)
|
139
139
|
|
140
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
140
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
141
141
|
err = e.message
|
142
|
-
<span class="keyword">end</span></pre></div></div>
|
142
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
143
143
|
|
144
144
|
</li>
|
145
145
|
|
@@ -154,8 +154,8 @@
|
|
154
154
|
|
155
155
|
</div>
|
156
156
|
|
157
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample26</span>, <span class="symbol">:locals</span> => {<span class="symbol">:user</span> => user, <span class="symbol">:err</span> => err}
|
158
|
-
<span class="keyword">end</span></pre></div></div>
|
157
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample26</span>, <span class="hljs-symbol">:locals</span> => {<span class="hljs-symbol">:user</span> => user, <span class="hljs-symbol">:err</span> => err}
|
158
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
159
159
|
|
160
160
|
</li>
|
161
161
|
|
@@ -31,9 +31,9 @@
|
|
31
31
|
|
32
32
|
</div>
|
33
33
|
|
34
|
-
<div class="content"><div class='highlight'><pre>get <span class="string">'/
|
35
|
-
haml <span class="symbol">:sample27</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-27-how-to-create-your-own-questionnaire-using-forms-and-show-the-result-document'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample27</span>
|
36
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
37
37
|
|
38
38
|
</li>
|
39
39
|
|
@@ -48,7 +48,7 @@
|
|
48
48
|
|
49
49
|
</div>
|
50
50
|
|
51
|
-
<div class="content"><div class='highlight'><pre>post <span class="string">'/
|
51
|
+
<div class="content"><div class='highlight'><pre>post <span class="hljs-string">'/sample-27-how-to-create-your-own-questionnaire-using-forms-and-show-the-result-document'</span> <span class="hljs-keyword">do</span></pre></div></div>
|
52
52
|
|
53
53
|
</li>
|
54
54
|
|
@@ -63,16 +63,16 @@
|
|
63
63
|
|
64
64
|
</div>
|
65
65
|
|
66
|
-
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
|
67
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
|
68
|
-
set <span class="symbol">:file_id</span>, params[<span class="symbol">:fileId</span>]
|
69
|
-
set <span class="symbol">:source</span>, params[<span class="symbol">:source</span>]
|
70
|
-
set <span class="symbol">:sex</span>, params[<span class="symbol">:sex</span>]
|
71
|
-
set <span class="symbol">:age</span>, params[<span class="symbol">:age</span>]
|
72
|
-
set <span class="symbol">:sunrise</span>, params[<span class="symbol">:sunrise</span>]
|
73
|
-
set <span class="symbol">:name</span>, params[<span class="symbol">:name</span>]
|
74
|
-
set <span class="symbol">:type</span>, params[<span class="symbol">:type</span>]
|
75
|
-
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]</pre></div></div>
|
66
|
+
<div class="content"><div class='highlight'><pre> set <span class="hljs-symbol">:client_id</span>, params[<span class="hljs-symbol">:clientId</span>]
|
67
|
+
set <span class="hljs-symbol">:private_key</span>, params[<span class="hljs-symbol">:privateKey</span>]
|
68
|
+
set <span class="hljs-symbol">:file_id</span>, params[<span class="hljs-symbol">:fileId</span>]
|
69
|
+
set <span class="hljs-symbol">:source</span>, params[<span class="hljs-symbol">:source</span>]
|
70
|
+
set <span class="hljs-symbol">:sex</span>, params[<span class="hljs-symbol">:sex</span>]
|
71
|
+
set <span class="hljs-symbol">:age</span>, params[<span class="hljs-symbol">:age</span>]
|
72
|
+
set <span class="hljs-symbol">:sunrise</span>, params[<span class="hljs-symbol">:sunrise</span>]
|
73
|
+
set <span class="hljs-symbol">:name</span>, params[<span class="hljs-symbol">:name</span>]
|
74
|
+
set <span class="hljs-symbol">:type</span>, params[<span class="hljs-symbol">:type</span>]
|
75
|
+
set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>]</pre></div></div>
|
76
76
|
|
77
77
|
</li>
|
78
78
|
|
@@ -87,7 +87,7 @@
|
|
87
87
|
|
88
88
|
</div>
|
89
89
|
|
90
|
-
<div class="content"><div class='highlight'><pre> downloads_path = <span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span></pre></div></div>
|
90
|
+
<div class="content"><div class='highlight'><pre> downloads_path = <span class="hljs-string">"<span class="hljs-subst">#{<span class="hljs-constant">File</span>.dirname(__FILE_<span class="hljs-number">_</span>)}</span>/../public/downloads"</span></pre></div></div>
|
91
91
|
|
92
92
|
</li>
|
93
93
|
|
@@ -102,13 +102,13 @@
|
|
102
102
|
|
103
103
|
</div>
|
104
104
|
|
105
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> <span class="constant">File</span>.directory?(downloads_path)
|
106
|
-
<span class="constant">Dir</span>.foreach(downloads_path) { |f| fn = <span class="constant">File</span>.join(downloads_path, f); <span class="constant">File</span>.delete(fn) <span class="keyword">if</span> f != <span class="string">'.'</span> && f != <span class="string">'..'</span> }
|
107
|
-
<span class="keyword">else</span>
|
108
|
-
<span class="constant">Dir::</span>mkdir(downloads_path)
|
109
|
-
<span class="keyword">end</span>
|
105
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-constant">File</span>.directory?(downloads_path)
|
106
|
+
<span class="hljs-constant">Dir</span>.foreach(downloads_path) { |f| fn = <span class="hljs-constant">File</span>.join(downloads_path, f); <span class="hljs-constant">File</span>.delete(fn) <span class="hljs-keyword">if</span> f != <span class="hljs-string">'.'</span> && f != <span class="hljs-string">'..'</span> }
|
107
|
+
<span class="hljs-keyword">else</span>
|
108
|
+
<span class="hljs-constant">Dir::</span>mkdir(downloads_path)
|
109
|
+
<span class="hljs-keyword">end</span>
|
110
110
|
|
111
|
-
<span class="keyword">begin</span></pre></div></div>
|
111
|
+
<span class="hljs-keyword">begin</span></pre></div></div>
|
112
112
|
|
113
113
|
</li>
|
114
114
|
|
@@ -123,7 +123,7 @@
|
|
123
123
|
|
124
124
|
</div>
|
125
125
|
|
126
|
-
<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>
|
126
|
+
<div class="content"><div class='highlight'><pre> raise <span class="hljs-string">'Please enter all required parameters'</span> <span class="hljs-keyword">if</span> settings.client_id.empty? <span class="hljs-keyword">or</span> settings.private_key.empty?</pre></div></div>
|
127
127
|
|
128
128
|
</li>
|
129
129
|
|
@@ -138,13 +138,13 @@
|
|
138
138
|
|
139
139
|
</div>
|
140
140
|
|
141
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
142
|
-
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
143
|
-
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
144
|
-
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
145
|
-
<span class="keyword">else</span>
|
141
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty?
|
142
|
+
base_path = <span class="hljs-string">'https://api.groupdocs.com'</span>
|
143
|
+
<span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>)
|
144
|
+
base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>]
|
145
|
+
<span class="hljs-keyword">else</span>
|
146
146
|
base_path = settings.base_path
|
147
|
-
<span class="keyword">end</span></pre></div></div>
|
147
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
148
148
|
|
149
149
|
</li>
|
150
150
|
|
@@ -159,7 +159,7 @@
|
|
159
159
|
|
160
160
|
</div>
|
161
161
|
|
162
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
162
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs|
|
163
163
|
groupdocs.client_id = settings.client_id
|
164
164
|
groupdocs.private_key = settings.private_key</pre></div></div>
|
165
165
|
|
@@ -176,8 +176,8 @@
|
|
176
176
|
|
177
177
|
</div>
|
178
178
|
|
179
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
180
|
-
<span class="keyword">end</span></pre></div></div>
|
179
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment"># default is 'https://api.groupdocs.com'</span>
|
180
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
181
181
|
|
182
182
|
</li>
|
183
183
|
|
@@ -192,8 +192,8 @@
|
|
192
192
|
|
193
193
|
</div>
|
194
194
|
|
195
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.source
|
196
|
-
<span class="keyword">when</span> <span class="string">'guid'</span></pre></div></div>
|
195
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">case</span> settings.source
|
196
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'guid'</span></pre></div></div>
|
197
197
|
|
198
198
|
</li>
|
199
199
|
|
@@ -208,8 +208,8 @@
|
|
208
208
|
|
209
209
|
</div>
|
210
210
|
|
211
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.new({<span class="symbol">:guid</span> => settings.file_id})
|
212
|
-
<span class="keyword">when</span> <span class="string">'local'</span></pre></div></div>
|
211
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.new({<span class="hljs-symbol">:guid</span> => settings.file_id})
|
212
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'local'</span></pre></div></div>
|
213
213
|
|
214
214
|
</li>
|
215
215
|
|
@@ -224,7 +224,7 @@
|
|
224
224
|
|
225
225
|
</div>
|
226
226
|
|
227
|
-
<div class="content"><div class='highlight'><pre> file_path = <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>
|
227
|
+
<div class="content"><div class='highlight'><pre> file_path = <span class="hljs-string">"<span class="hljs-subst">#{<span class="hljs-constant">Dir</span>.tmpdir}</span>/<span class="hljs-subst">#{params[<span class="hljs-symbol">:file</span>][<span class="hljs-symbol">:filename</span>]}</span>"</span></pre></div></div>
|
228
228
|
|
229
229
|
</li>
|
230
230
|
|
@@ -239,7 +239,7 @@
|
|
239
239
|
|
240
240
|
</div>
|
241
241
|
|
242
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">File</span>.open(file_path, <span class="string">'wb'</span>) { |f| f.write(params[<span class="symbol">:file</span>][<span class="symbol">:tempfile</span>].read) }</pre></div></div>
|
242
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">File</span>.open(file_path, <span class="hljs-string">'wb'</span>) { |f| f.write(params[<span class="hljs-symbol">:file</span>][<span class="hljs-symbol">:tempfile</span>].read) }</pre></div></div>
|
243
243
|
|
244
244
|
</li>
|
245
245
|
|
@@ -254,8 +254,8 @@
|
|
254
254
|
|
255
255
|
</div>
|
256
256
|
|
257
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload!(file_path, {})
|
258
|
-
<span class="keyword">when</span> <span class="string">'url'</span></pre></div></div>
|
257
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.upload!(file_path, {})
|
258
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'url'</span></pre></div></div>
|
259
259
|
|
260
260
|
</li>
|
261
261
|
|
@@ -270,10 +270,10 @@
|
|
270
270
|
|
271
271
|
</div>
|
272
272
|
|
273
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.upload_web!(settings.url)
|
274
|
-
<span class="keyword">else</span>
|
275
|
-
raise <span class="string">'Wrong GUID source.'</span>
|
276
|
-
<span class="keyword">end</span></pre></div></div>
|
273
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.upload_web!(settings.url)
|
274
|
+
<span class="hljs-keyword">else</span>
|
275
|
+
raise <span class="hljs-string">'Wrong GUID source.'</span>
|
276
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
277
277
|
|
278
278
|
</li>
|
279
279
|
|
@@ -288,7 +288,7 @@
|
|
288
288
|
|
289
289
|
</div>
|
290
290
|
|
291
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'No such file'</span> <span class="keyword">unless</span> file.is_a?(<span class="constant">GroupDocs::Storage::File</span>)</pre></div></div>
|
291
|
+
<div class="content"><div class='highlight'><pre> raise <span class="hljs-string">'No such file'</span> <span class="hljs-keyword">unless</span> file.is_a?(<span class="hljs-constant">GroupDocs::Storage::File</span>)</pre></div></div>
|
292
292
|
|
293
293
|
</li>
|
294
294
|
|
@@ -318,7 +318,7 @@
|
|
318
318
|
|
319
319
|
</div>
|
320
320
|
|
321
|
-
<div class="content"><div class='highlight'><pre> datasource = <span class="constant">GroupDocs::DataSource</span>.new</pre></div></div>
|
321
|
+
<div class="content"><div class='highlight'><pre> datasource = <span class="hljs-constant">GroupDocs::DataSource</span>.new</pre></div></div>
|
322
322
|
|
323
323
|
</li>
|
324
324
|
|
@@ -329,11 +329,11 @@
|
|
329
329
|
<div class="pilwrap ">
|
330
330
|
<a class="pilcrow" href="#section-19">¶</a>
|
331
331
|
</div>
|
332
|
-
<p>Get arry of document
|
332
|
+
<p>Get arry of document’s fields</p>
|
333
333
|
|
334
334
|
</div>
|
335
335
|
|
336
|
-
<div class="content"><div class='highlight'><pre> enteredData = {<span class="string">"sex"</span> => settings.sex, <span class="string">"name"</span> => settings.name, <span class="string">"age"</span>=> settings.age, <span class="string">"sunrise"</span> => settings.sunrise}</pre></div></div>
|
336
|
+
<div class="content"><div class='highlight'><pre> enteredData = {<span class="hljs-string">"sex"</span> => settings.sex, <span class="hljs-string">"name"</span> => settings.name, <span class="hljs-string">"age"</span>=> settings.age, <span class="hljs-string">"sunrise"</span> => settings.sunrise}</pre></div></div>
|
337
337
|
|
338
338
|
</li>
|
339
339
|
|
@@ -348,7 +348,7 @@
|
|
348
348
|
|
349
349
|
</div>
|
350
350
|
|
351
|
-
<div class="content"><div class='highlight'><pre> datasource.fields = enteredData.map { |key, value| <span class="constant">GroupDocs::DataSource::Field</span>.new(<span class="symbol">name:</span> key, <span class="symbol">type:</span> <span class="symbol">:text</span>, <span class="symbol">values:</span> <span class="constant">Array</span>.new() << value) }</pre></div></div>
|
351
|
+
<div class="content"><div class='highlight'><pre> datasource.fields = enteredData.map { |key, value| <span class="hljs-constant">GroupDocs::DataSource::Field</span>.new(<span class="hljs-symbol">name:</span> key, <span class="hljs-symbol">type:</span> <span class="hljs-symbol">:text</span>, <span class="hljs-symbol">values:</span> <span class="hljs-constant">Array</span>.new() << value) }</pre></div></div>
|
352
352
|
|
353
353
|
</li>
|
354
354
|
|
@@ -378,8 +378,8 @@
|
|
378
378
|
|
379
379
|
</div>
|
380
380
|
|
381
|
-
<div class="content"><div class='highlight'><pre> job = document.datasource!(datasource, {<span class="symbol">:new_type</span> => settings.type})
|
382
|
-
sleep <span class="number">10</span> <span class="comment">#Wait for merge and convert</span></pre></div></div>
|
381
|
+
<div class="content"><div class='highlight'><pre> job = document.datasource!(datasource, {<span class="hljs-symbol">:new_type</span> => settings.type})
|
382
|
+
sleep <span class="hljs-number">10</span> <span class="hljs-comment">#Wait for merge and convert</span></pre></div></div>
|
383
383
|
|
384
384
|
</li>
|
385
385
|
|
@@ -409,7 +409,7 @@
|
|
409
409
|
|
410
410
|
</div>
|
411
411
|
|
412
|
-
<div class="content"><div class='highlight'><pre> document[<span class="symbol">:inputs</span>][<span class="number">0</span>].outputs[<span class="number">0</span>].download!(downloads_path)</pre></div></div>
|
412
|
+
<div class="content"><div class='highlight'><pre> document[<span class="hljs-symbol">:inputs</span>][<span class="hljs-number">0</span>].outputs[<span class="hljs-number">0</span>].download!(downloads_path)</pre></div></div>
|
413
413
|
|
414
414
|
</li>
|
415
415
|
|
@@ -424,7 +424,7 @@
|
|
424
424
|
|
425
425
|
</div>
|
426
426
|
|
427
|
-
<div class="content"><div class='highlight'><pre> guid = document[<span class="symbol">:inputs</span>][<span class="number">0</span>].outputs[<span class="number">0</span>].guid</pre></div></div>
|
427
|
+
<div class="content"><div class='highlight'><pre> guid = document[<span class="hljs-symbol">:inputs</span>][<span class="hljs-number">0</span>].outputs[<span class="hljs-number">0</span>].guid</pre></div></div>
|
428
428
|
|
429
429
|
</li>
|
430
430
|
|
@@ -439,7 +439,7 @@
|
|
439
439
|
|
440
440
|
</div>
|
441
441
|
|
442
|
-
<div class="content"><div class='highlight'><pre> file_name = document[<span class="symbol">:inputs</span>][<span class="number">0</span>].outputs[<span class="number">0</span>].name</pre></div></div>
|
442
|
+
<div class="content"><div class='highlight'><pre> file_name = document[<span class="hljs-symbol">:inputs</span>][<span class="hljs-number">0</span>].outputs[<span class="hljs-number">0</span>].name</pre></div></div>
|
443
443
|
|
444
444
|
</li>
|
445
445
|
|
@@ -454,7 +454,7 @@
|
|
454
454
|
|
455
455
|
</div>
|
456
456
|
|
457
|
-
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"/document-viewer/embed/<span class="subst">#{guid}</span>"</span></pre></div></div>
|
457
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="hljs-string">"/document-viewer/embed/<span class="hljs-subst">#{guid}</span>"</span></pre></div></div>
|
458
458
|
|
459
459
|
</li>
|
460
460
|
|
@@ -469,7 +469,7 @@
|
|
469
469
|
|
470
470
|
</div>
|
471
471
|
|
472
|
-
<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>
|
472
|
+
<div class="content"><div class='highlight'><pre> url = <span class="hljs-constant">GroupDocs::Api::Request</span>.new(<span class="hljs-symbol">:path</span> => iframe).prepare_and_sign_url</pre></div></div>
|
473
473
|
|
474
474
|
</li>
|
475
475
|
|
@@ -484,14 +484,14 @@
|
|
484
484
|
|
485
485
|
</div>
|
486
486
|
|
487
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> base_path
|
488
|
-
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
489
|
-
iframe = <span class="string">"https://stage-api-groupdocs.dynabic.com<span class="subst">#{url}</span>"</span>
|
490
|
-
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
491
|
-
iframe = <span class="string">"https://dev-apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
492
|
-
<span class="keyword">else</span>
|
493
|
-
iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
494
|
-
<span class="keyword">end</span></pre></div></div>
|
487
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">case</span> base_path
|
488
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'https://stage-api-groupdocs.dynabic.com'</span>
|
489
|
+
iframe = <span class="hljs-string">"https://stage-api-groupdocs.dynabic.com<span class="hljs-subst">#{url}</span>"</span>
|
490
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'https://dev-api-groupdocs.dynabic.com'</span>
|
491
|
+
iframe = <span class="hljs-string">"https://dev-apps.groupdocs.com<span class="hljs-subst">#{url}</span>"</span>
|
492
|
+
<span class="hljs-keyword">else</span>
|
493
|
+
iframe = <span class="hljs-string">"https://apps.groupdocs.com<span class="hljs-subst">#{url}</span>"</span>
|
494
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
495
495
|
|
496
496
|
</li>
|
497
497
|
|
@@ -506,7 +506,7 @@
|
|
506
506
|
|
507
507
|
</div>
|
508
508
|
|
509
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> guid</pre></div></div>
|
509
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> guid</pre></div></div>
|
510
510
|
|
511
511
|
</li>
|
512
512
|
|
@@ -521,14 +521,14 @@
|
|
521
521
|
|
522
522
|
</div>
|
523
523
|
|
524
|
-
<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>
|
525
|
-
<span class="keyword">else</span>
|
526
|
-
raise <span class="string">'File was not converted'</span>
|
527
|
-
<span class="keyword">end</span>
|
524
|
+
<div class="content"><div class='highlight'><pre> iframe = <span class="hljs-string">"<iframe id='downloadframe' src='<span class="hljs-subst">#{iframe}</span>' width='800' height='1000'></iframe>"</span>
|
525
|
+
<span class="hljs-keyword">else</span>
|
526
|
+
raise <span class="hljs-string">'File was not converted'</span>
|
527
|
+
<span class="hljs-keyword">end</span>
|
528
528
|
|
529
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
529
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
530
530
|
err = e.message
|
531
|
-
<span class="keyword">end</span></pre></div></div>
|
531
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
532
532
|
|
533
533
|
</li>
|
534
534
|
|
@@ -543,8 +543,8 @@
|
|
543
543
|
|
544
544
|
</div>
|
545
545
|
|
546
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample27</span>, <span class="symbol">:locals</span> => {<span class="symbol">:userId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:sex</span> => settings.sex, <span class="symbol">:age</span> => settings.age, <span class="symbol">:sunrise</span> => settings.sunrise, <span class="symbol">:name</span> => settings.name, <span class="symbol">:type</span> => settings.type, <span class="symbol">:iframe</span> => iframe, <span class="symbol">:file_name</span> => file_name, <span class="symbol">:err</span> => err}
|
547
|
-
<span class="keyword">end</span></pre></div></div>
|
546
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample27</span>, <span class="hljs-symbol">:locals</span> => {<span class="hljs-symbol">:userId</span> => settings.client_id, <span class="hljs-symbol">:privateKey</span> => settings.private_key, <span class="hljs-symbol">:sex</span> => settings.sex, <span class="hljs-symbol">:age</span> => settings.age, <span class="hljs-symbol">:sunrise</span> => settings.sunrise, <span class="hljs-symbol">:name</span> => settings.name, <span class="hljs-symbol">:type</span> => settings.type, <span class="hljs-symbol">:iframe</span> => iframe, <span class="hljs-symbol">:file_name</span> => file_name, <span class="hljs-symbol">:err</span> => err}
|
547
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
548
548
|
|
549
549
|
</li>
|
550
550
|
|