groupdocs 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- 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">:sample19</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-19-how-to-compare-documents'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample19</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">'/sample19/compere_callback'</span> <span class="keyword">do</span></pre></div></div>
|
51
|
+
<div class="content"><div class='highlight'><pre>post <span class="hljs-string">'/sample19/compere_callback'</span> <span class="hljs-keyword">do</span></pre></div></div>
|
52
52
|
|
53
53
|
</li>
|
54
54
|
|
@@ -63,7 +63,7 @@
|
|
63
63
|
|
64
64
|
</div>
|
65
65
|
|
66
|
-
<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>
|
66
|
+
<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>
|
67
67
|
|
68
68
|
</li>
|
69
69
|
|
@@ -78,12 +78,12 @@
|
|
78
78
|
|
79
79
|
</div>
|
80
80
|
|
81
|
-
<div class="content"><div class='highlight'><pre> data = <span class="constant">JSON</span>.parse(request.body.read)
|
82
|
-
<span class="keyword">begin</span>
|
83
|
-
raise <span class="string">'Empty params!'</span> <span class="keyword">if</span> data.empty?
|
84
|
-
source_id = <span class="keyword">nil</span>
|
85
|
-
client_id = <span class="keyword">nil</span>
|
86
|
-
private_key = <span class="keyword">nil</span></pre></div></div>
|
81
|
+
<div class="content"><div class='highlight'><pre> data = <span class="hljs-constant">JSON</span>.parse(request.body.read)
|
82
|
+
<span class="hljs-keyword">begin</span>
|
83
|
+
raise <span class="hljs-string">'Empty params!'</span> <span class="hljs-keyword">if</span> data.empty?
|
84
|
+
source_id = <span class="hljs-keyword">nil</span>
|
85
|
+
client_id = <span class="hljs-keyword">nil</span>
|
86
|
+
private_key = <span class="hljs-keyword">nil</span></pre></div></div>
|
87
87
|
|
88
88
|
</li>
|
89
89
|
|
@@ -98,11 +98,11 @@
|
|
98
98
|
|
99
99
|
</div>
|
100
100
|
|
101
|
-
<div class="content"><div class='highlight'><pre> data.each <span class="keyword">do</span> |key, value|
|
102
|
-
<span class="keyword">if</span> key == <span class="string">'SourceId'</span>
|
101
|
+
<div class="content"><div class='highlight'><pre> data.each <span class="hljs-keyword">do</span> |key, value|
|
102
|
+
<span class="hljs-keyword">if</span> key == <span class="hljs-string">'SourceId'</span>
|
103
103
|
source_id = value
|
104
|
-
<span class="keyword">end</span>
|
105
|
-
<span class="keyword">end</span></pre></div></div>
|
104
|
+
<span class="hljs-keyword">end</span>
|
105
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
106
106
|
|
107
107
|
</li>
|
108
108
|
|
@@ -117,12 +117,12 @@
|
|
117
117
|
|
118
118
|
</div>
|
119
119
|
|
120
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> <span class="constant">File</span>.exist?(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/user_info.txt"</span>)
|
121
|
-
contents = <span class="constant">File</span>.read(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/user_info.txt"</span>)
|
122
|
-
contents = contents.split(<span class="string">' '</span>)
|
120
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-constant">File</span>.exist?(<span class="hljs-string">"<span class="hljs-subst">#{<span class="hljs-constant">File</span>.dirname(__FILE_<span class="hljs-number">_</span>)}</span>/../public/user_info.txt"</span>)
|
121
|
+
contents = <span class="hljs-constant">File</span>.read(<span class="hljs-string">"<span class="hljs-subst">#{<span class="hljs-constant">File</span>.dirname(__FILE_<span class="hljs-number">_</span>)}</span>/../public/user_info.txt"</span>)
|
122
|
+
contents = contents.split(<span class="hljs-string">' '</span>)
|
123
123
|
client_id = contents.first
|
124
124
|
private_key = contents.last
|
125
|
-
<span class="keyword">end</span></pre></div></div>
|
125
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
126
126
|
|
127
127
|
</li>
|
128
128
|
|
@@ -137,7 +137,7 @@
|
|
137
137
|
|
138
138
|
</div>
|
139
139
|
|
140
|
-
<div class="content"><div class='highlight'><pre> job = <span class="constant">GroupDocs::Job</span>.new({<span class="symbol">:id</span> => source_id})</pre></div></div>
|
140
|
+
<div class="content"><div class='highlight'><pre> job = <span class="hljs-constant">GroupDocs::Job</span>.new({<span class="hljs-symbol">:id</span> => source_id})</pre></div></div>
|
141
141
|
|
142
142
|
</li>
|
143
143
|
|
@@ -152,7 +152,7 @@
|
|
152
152
|
|
153
153
|
</div>
|
154
154
|
|
155
|
-
<div class="content"><div class='highlight'><pre> documents = job.documents!({<span class="symbol">:client_id</span> => client_id, <span class="symbol">:private_key</span> => private_key})</pre></div></div>
|
155
|
+
<div class="content"><div class='highlight'><pre> documents = job.documents!({<span class="hljs-symbol">:client_id</span> => client_id, <span class="hljs-symbol">:private_key</span> => private_key})</pre></div></div>
|
156
156
|
|
157
157
|
</li>
|
158
158
|
|
@@ -167,12 +167,12 @@
|
|
167
167
|
|
168
168
|
</div>
|
169
169
|
|
170
|
-
<div class="content"><div class='highlight'><pre> documents[<span class="symbol">:inputs</span>].first.outputs.first.download!(downloads_path, {<span class="symbol">:client_id</span> => client_id, <span class="symbol">:private_key</span> => private_key})
|
170
|
+
<div class="content"><div class='highlight'><pre> documents[<span class="hljs-symbol">:inputs</span>].first.outputs.first.download!(downloads_path, {<span class="hljs-symbol">:client_id</span> => client_id, <span class="hljs-symbol">:private_key</span> => private_key})
|
171
171
|
|
172
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
172
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
173
173
|
err = e.message
|
174
|
-
<span class="keyword">end</span>
|
175
|
-
<span class="keyword">end</span></pre></div></div>
|
174
|
+
<span class="hljs-keyword">end</span>
|
175
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
176
176
|
|
177
177
|
</li>
|
178
178
|
|
@@ -187,7 +187,7 @@
|
|
187
187
|
|
188
188
|
</div>
|
189
189
|
|
190
|
-
<div class="content"><div class='highlight'><pre>get <span class="string">'/sample19/check'</span> <span class="keyword">do</span></pre></div></div>
|
190
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample19/check'</span> <span class="hljs-keyword">do</span></pre></div></div>
|
191
191
|
|
192
192
|
</li>
|
193
193
|
|
@@ -202,9 +202,9 @@
|
|
202
202
|
|
203
203
|
</div>
|
204
204
|
|
205
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">unless</span> <span class="constant">File</span>.directory?(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span>)
|
206
|
-
<span class="keyword">return</span> <span class="string">'Directory was not found.'</span>
|
207
|
-
<span class="keyword">end</span></pre></div></div>
|
205
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">unless</span> <span class="hljs-constant">File</span>.directory?(<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>)
|
206
|
+
<span class="hljs-keyword">return</span> <span class="hljs-string">'Directory was not found.'</span>
|
207
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
208
208
|
|
209
209
|
</li>
|
210
210
|
|
@@ -219,13 +219,13 @@
|
|
219
219
|
|
220
220
|
</div>
|
221
221
|
|
222
|
-
<div class="content"><div class='highlight'><pre> name = <span class="keyword">nil</span>
|
223
|
-
<span class="constant">Dir</span>.entries(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads"</span>).each <span class="keyword">do</span> |file|
|
224
|
-
name = file <span class="keyword">if</span> file != <span class="string">'.'</span> && file != <span class="string">'..'</span>
|
225
|
-
<span class="keyword">end</span>
|
222
|
+
<div class="content"><div class='highlight'><pre> name = <span class="hljs-keyword">nil</span>
|
223
|
+
<span class="hljs-constant">Dir</span>.entries(<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>).each <span class="hljs-keyword">do</span> |file|
|
224
|
+
name = file <span class="hljs-keyword">if</span> file != <span class="hljs-string">'.'</span> && file != <span class="hljs-string">'..'</span>
|
225
|
+
<span class="hljs-keyword">end</span>
|
226
226
|
|
227
227
|
name
|
228
|
-
<span class="keyword">end</span></pre></div></div>
|
228
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
229
229
|
|
230
230
|
</li>
|
231
231
|
|
@@ -240,7 +240,7 @@
|
|
240
240
|
|
241
241
|
</div>
|
242
242
|
|
243
|
-
<div class="content"><div class='highlight'><pre>get <span class="string">'/sample19/downloads/:filename'</span> <span class="keyword">do</span> |filename|</pre></div></div>
|
243
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample19/downloads/:filename'</span> <span class="hljs-keyword">do</span> |filename|</pre></div></div>
|
244
244
|
|
245
245
|
</li>
|
246
246
|
|
@@ -255,8 +255,8 @@
|
|
255
255
|
|
256
256
|
</div>
|
257
257
|
|
258
|
-
<div class="content"><div class='highlight'><pre> send_file <span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/downloads/<span class="subst">#{filename}</span>"</span>, <span class="symbol">:filename</span> => filename, <span class="symbol">:type</span> => <span class="string">'Application/octet-stream'</span>
|
259
|
-
<span class="keyword">end</span></pre></div></div>
|
258
|
+
<div class="content"><div class='highlight'><pre> send_file <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 class="hljs-subst">#{filename}</span>"</span>, <span class="hljs-symbol">:filename</span> => filename, <span class="hljs-symbol">:type</span> => <span class="hljs-string">'Application/octet-stream'</span>
|
259
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
260
260
|
|
261
261
|
</li>
|
262
262
|
|
@@ -271,7 +271,7 @@
|
|
271
271
|
|
272
272
|
</div>
|
273
273
|
|
274
|
-
<div class="content"><div class='highlight'><pre>post <span class="string">'/
|
274
|
+
<div class="content"><div class='highlight'><pre>post <span class="hljs-string">'/sample-19-how-to-compare-documents'</span> <span class="hljs-keyword">do</span></pre></div></div>
|
275
275
|
|
276
276
|
</li>
|
277
277
|
|
@@ -286,12 +286,12 @@
|
|
286
286
|
|
287
287
|
</div>
|
288
288
|
|
289
|
-
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
|
290
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
|
291
|
-
set <span class="symbol">:sourceFileId</span>, params[<span class="symbol">:sourceFileId</span>]
|
292
|
-
set <span class="symbol">:targetFileId</span>, params[<span class="symbol">:targetFileId</span>]
|
293
|
-
set <span class="symbol">:callback</span>, params[<span class="symbol">:callback</span>]
|
294
|
-
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]</pre></div></div>
|
289
|
+
<div class="content"><div class='highlight'><pre> set <span class="hljs-symbol">:client_id</span>, params[<span class="hljs-symbol">:clientId</span>]
|
290
|
+
set <span class="hljs-symbol">:private_key</span>, params[<span class="hljs-symbol">:privateKey</span>]
|
291
|
+
set <span class="hljs-symbol">:sourceFileId</span>, params[<span class="hljs-symbol">:sourceFileId</span>]
|
292
|
+
set <span class="hljs-symbol">:targetFileId</span>, params[<span class="hljs-symbol">:targetFileId</span>]
|
293
|
+
set <span class="hljs-symbol">:callback</span>, params[<span class="hljs-symbol">:callback</span>]
|
294
|
+
set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>]</pre></div></div>
|
295
295
|
|
296
296
|
</li>
|
297
297
|
|
@@ -306,7 +306,7 @@
|
|
306
306
|
|
307
307
|
</div>
|
308
308
|
|
309
|
-
<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>
|
309
|
+
<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>
|
310
310
|
|
311
311
|
</li>
|
312
312
|
|
@@ -321,13 +321,13 @@
|
|
321
321
|
|
322
322
|
</div>
|
323
323
|
|
324
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> <span class="constant">File</span>.directory?(downloads_path)
|
325
|
-
<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> }
|
326
|
-
<span class="keyword">else</span>
|
327
|
-
<span class="constant">Dir::</span>mkdir(downloads_path)
|
328
|
-
<span class="keyword">end</span>
|
324
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> <span class="hljs-constant">File</span>.directory?(downloads_path)
|
325
|
+
<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> }
|
326
|
+
<span class="hljs-keyword">else</span>
|
327
|
+
<span class="hljs-constant">Dir::</span>mkdir(downloads_path)
|
328
|
+
<span class="hljs-keyword">end</span>
|
329
329
|
|
330
|
-
<span class="keyword">begin</span></pre></div></div>
|
330
|
+
<span class="hljs-keyword">begin</span></pre></div></div>
|
331
331
|
|
332
332
|
</li>
|
333
333
|
|
@@ -342,7 +342,7 @@
|
|
342
342
|
|
343
343
|
</div>
|
344
344
|
|
345
|
-
<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.sourceFileId.empty? <span class="keyword">or</span> settings.targetFileId.empty?</pre></div></div>
|
345
|
+
<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? <span class="hljs-keyword">or</span> settings.sourceFileId.empty? <span class="hljs-keyword">or</span> settings.targetFileId.empty?</pre></div></div>
|
346
346
|
|
347
347
|
</li>
|
348
348
|
|
@@ -357,13 +357,13 @@
|
|
357
357
|
|
358
358
|
</div>
|
359
359
|
|
360
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
|
361
|
-
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
362
|
-
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
363
|
-
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
364
|
-
<span class="keyword">else</span>
|
360
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty?
|
361
|
+
base_path = <span class="hljs-string">'https://api.groupdocs.com'</span>
|
362
|
+
<span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>)
|
363
|
+
base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>]
|
364
|
+
<span class="hljs-keyword">else</span>
|
365
365
|
base_path = settings.base_path
|
366
|
-
<span class="keyword">end</span></pre></div></div>
|
366
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
367
367
|
|
368
368
|
</li>
|
369
369
|
|
@@ -378,7 +378,7 @@
|
|
378
378
|
|
379
379
|
</div>
|
380
380
|
|
381
|
-
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
381
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs|
|
382
382
|
groupdocs.client_id = settings.client_id
|
383
383
|
groupdocs.private_key = settings.private_key</pre></div></div>
|
384
384
|
|
@@ -395,8 +395,8 @@
|
|
395
395
|
|
396
396
|
</div>
|
397
397
|
|
398
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
399
|
-
<span class="keyword">end</span></pre></div></div>
|
398
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment"># default is 'https://api.groupdocs.com'</span>
|
399
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
400
400
|
|
401
401
|
</li>
|
402
402
|
|
@@ -411,8 +411,8 @@
|
|
411
411
|
|
412
412
|
</div>
|
413
413
|
|
414
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.callback
|
415
|
-
out_file = <span class="constant">File</span>.new(<span class="string">"<span class="subst">#{<span class="constant">File</span>.dirname(__FILE_<span class="number">_</span>)}</span>/../public/user_info.txt"</span>, <span class="string">'w'</span>)</pre></div></div>
|
414
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.callback
|
415
|
+
out_file = <span class="hljs-constant">File</span>.new(<span class="hljs-string">"<span class="hljs-subst">#{<span class="hljs-constant">File</span>.dirname(__FILE_<span class="hljs-number">_</span>)}</span>/../public/user_info.txt"</span>, <span class="hljs-string">'w'</span>)</pre></div></div>
|
416
416
|
|
417
417
|
</li>
|
418
418
|
|
@@ -427,10 +427,10 @@
|
|
427
427
|
|
428
428
|
</div>
|
429
429
|
|
430
|
-
<div class="content"><div class='highlight'><pre> out_file.write(<span class="string">"<span class="subst">#{settings.client_id}</span> "</span>)
|
431
|
-
out_file.write(<span class="string">"<span class="subst">#{settings.private_key}</span>"</span>)
|
430
|
+
<div class="content"><div class='highlight'><pre> out_file.write(<span class="hljs-string">"<span class="hljs-subst">#{settings.client_id}</span> "</span>)
|
431
|
+
out_file.write(<span class="hljs-string">"<span class="hljs-subst">#{settings.private_key}</span>"</span>)
|
432
432
|
out_file.close
|
433
|
-
<span class="keyword">end</span></pre></div></div>
|
433
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
434
434
|
|
435
435
|
</li>
|
436
436
|
|
@@ -445,10 +445,10 @@
|
|
445
445
|
|
446
446
|
</div>
|
447
447
|
|
448
|
-
<div class="content"><div class='highlight'><pre> files_list = <span class="constant">GroupDocs::Storage::Folder</span>.list!(<span class="string">'/'</span>, {})
|
448
|
+
<div class="content"><div class='highlight'><pre> files_list = <span class="hljs-constant">GroupDocs::Storage::Folder</span>.list!(<span class="hljs-string">'/'</span>, {})
|
449
449
|
|
450
|
-
source_document = <span class="string">''</span>
|
451
|
-
target_document = <span class="string">''</span></pre></div></div>
|
450
|
+
source_document = <span class="hljs-string">''</span>
|
451
|
+
target_document = <span class="hljs-string">''</span></pre></div></div>
|
452
452
|
|
453
453
|
</li>
|
454
454
|
|
@@ -463,28 +463,28 @@
|
|
463
463
|
|
464
464
|
</div>
|
465
465
|
|
466
|
-
<div class="content"><div class='highlight'><pre> files_list.each <span class="keyword">do</span> |element|
|
467
|
-
<span class="keyword">if</span> element.respond_to?(<span class="string">'guid'</span>) == <span class="keyword">true</span> <span class="keyword">and</span> element.guid == settings.sourceFileId
|
466
|
+
<div class="content"><div class='highlight'><pre> files_list.each <span class="hljs-keyword">do</span> |element|
|
467
|
+
<span class="hljs-keyword">if</span> element.respond_to?(<span class="hljs-string">'guid'</span>) == <span class="hljs-keyword">true</span> <span class="hljs-keyword">and</span> element.guid == settings.sourceFileId
|
468
468
|
source_document = element
|
469
|
-
<span class="keyword">end</span>
|
470
|
-
<span class="keyword">if</span> element.respond_to?(<span class="string">'guid'</span>) == <span class="keyword">true</span> <span class="keyword">and</span> element.guid == settings.targetFileId
|
469
|
+
<span class="hljs-keyword">end</span>
|
470
|
+
<span class="hljs-keyword">if</span> element.respond_to?(<span class="hljs-string">'guid'</span>) == <span class="hljs-keyword">true</span> <span class="hljs-keyword">and</span> element.guid == settings.targetFileId
|
471
471
|
target_document = element
|
472
|
-
<span class="keyword">end</span>
|
473
|
-
<span class="keyword">end</span>
|
472
|
+
<span class="hljs-keyword">end</span>
|
473
|
+
<span class="hljs-keyword">end</span>
|
474
474
|
|
475
475
|
|
476
|
-
<span class="keyword">unless</span> source_document.instance_of? <span class="constant">String</span> <span class="keyword">and</span> target_document.instance_of? <span class="constant">String</span>
|
476
|
+
<span class="hljs-keyword">unless</span> source_document.instance_of? <span class="hljs-constant">String</span> <span class="hljs-keyword">and</span> target_document.instance_of? <span class="hljs-constant">String</span>
|
477
477
|
|
478
478
|
info = source_document.to_document.compare!(target_document.to_document, settings.callback)
|
479
479
|
|
480
|
-
i = <span class="number">0</span>
|
480
|
+
i = <span class="hljs-number">0</span>
|
481
481
|
|
482
|
-
<span class="keyword">while</span> i<<span class="number">5</span> <span class="keyword">do</span>
|
483
|
-
sleep(<span class="number">5</span>)
|
484
|
-
job = <span class="constant">GroupDocs::Job</span>.get!(info.id)
|
485
|
-
<span class="keyword">break</span> <span class="keyword">if</span> job.status == <span class="symbol">:archived</span>
|
486
|
-
i += <span class="number">1</span>
|
487
|
-
<span class="keyword">end</span></pre></div></div>
|
482
|
+
<span class="hljs-keyword">while</span> i<<span class="hljs-number">5</span> <span class="hljs-keyword">do</span>
|
483
|
+
sleep(<span class="hljs-number">5</span>)
|
484
|
+
job = <span class="hljs-constant">GroupDocs::Job</span>.get!(info.id)
|
485
|
+
<span class="hljs-keyword">break</span> <span class="hljs-keyword">if</span> job.status == <span class="hljs-symbol">:archived</span>
|
486
|
+
i += <span class="hljs-number">1</span>
|
487
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
488
488
|
|
489
489
|
</li>
|
490
490
|
|
@@ -499,7 +499,7 @@
|
|
499
499
|
|
500
500
|
</div>
|
501
501
|
|
502
|
-
<div class="content"><div class='highlight'><pre> job = <span class="constant">GroupDocs::Job</span>.new(<span class="symbol">id:</span> info.id)</pre></div></div>
|
502
|
+
<div class="content"><div class='highlight'><pre> job = <span class="hljs-constant">GroupDocs::Job</span>.new(<span class="hljs-symbol">id:</span> info.id)</pre></div></div>
|
503
503
|
|
504
504
|
</li>
|
505
505
|
|
@@ -529,7 +529,7 @@
|
|
529
529
|
|
530
530
|
</div>
|
531
531
|
|
532
|
-
<div class="content"><div class='highlight'><pre> guid = documents[<span class="symbol">:outputs</span>].first.file.guid</pre></div></div>
|
532
|
+
<div class="content"><div class='highlight'><pre> guid = documents[<span class="hljs-symbol">:outputs</span>].first.file.guid</pre></div></div>
|
533
533
|
|
534
534
|
</li>
|
535
535
|
|
@@ -544,7 +544,7 @@
|
|
544
544
|
|
545
545
|
</div>
|
546
546
|
|
547
|
-
<div class="content"><div class='highlight'><pre> iframe = <span class="string">"/document-viewer/embed/<span class="subst">#{guid}</span>"</span></pre></div></div>
|
547
|
+
<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>
|
548
548
|
|
549
549
|
</li>
|
550
550
|
|
@@ -559,7 +559,7 @@
|
|
559
559
|
|
560
560
|
</div>
|
561
561
|
|
562
|
-
<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>
|
562
|
+
<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>
|
563
563
|
|
564
564
|
</li>
|
565
565
|
|
@@ -574,14 +574,14 @@
|
|
574
574
|
|
575
575
|
</div>
|
576
576
|
|
577
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.base_path
|
578
|
-
<span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
|
579
|
-
iframe = <span class="string">"https://stage-api-groupdocs.dynabic.com<span class="subst">#{url}</span>"</span>
|
580
|
-
<span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
|
581
|
-
iframe = <span class="string">"https://dev-apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
582
|
-
<span class="keyword">else</span>
|
583
|
-
iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span>
|
584
|
-
<span class="keyword">end</span></pre></div></div>
|
577
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">case</span> settings.base_path
|
578
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'https://stage-api-groupdocs.dynabic.com'</span>
|
579
|
+
iframe = <span class="hljs-string">"https://stage-api-groupdocs.dynabic.com<span class="hljs-subst">#{url}</span>"</span>
|
580
|
+
<span class="hljs-keyword">when</span> <span class="hljs-string">'https://dev-api-groupdocs.dynabic.com'</span>
|
581
|
+
iframe = <span class="hljs-string">"https://dev-apps.groupdocs.com<span class="hljs-subst">#{url}</span>"</span>
|
582
|
+
<span class="hljs-keyword">else</span>
|
583
|
+
iframe = <span class="hljs-string">"https://apps.groupdocs.com<span class="hljs-subst">#{url}</span>"</span>
|
584
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
585
585
|
|
586
586
|
</li>
|
587
587
|
|
@@ -596,12 +596,12 @@
|
|
596
596
|
|
597
597
|
</div>
|
598
598
|
|
599
|
-
<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>
|
600
|
-
<span class="keyword">end</span>
|
599
|
+
<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>
|
600
|
+
<span class="hljs-keyword">end</span>
|
601
601
|
|
602
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
602
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
603
603
|
err = e.message
|
604
|
-
<span class="keyword">end</span></pre></div></div>
|
604
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
605
605
|
|
606
606
|
</li>
|
607
607
|
|
@@ -616,8 +616,8 @@
|
|
616
616
|
|
617
617
|
</div>
|
618
618
|
|
619
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample19</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">:sourceFileId</span> => settings.sourceFileId, <span class="symbol">:targetFileId</span> => settings.targetFileId, <span class="symbol">:callback</span> => settings.callback, <span class="symbol">:iframe</span> => iframe, <span class="symbol">:err</span> => err}
|
620
|
-
<span class="keyword">end</span></pre></div></div>
|
619
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample19</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">:sourceFileId</span> => settings.sourceFileId, <span class="hljs-symbol">:targetFileId</span> => settings.targetFileId, <span class="hljs-symbol">:callback</span> => settings.callback, <span class="hljs-symbol">:iframe</span> => iframe, <span class="hljs-symbol">:err</span> => err}
|
620
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
621
621
|
|
622
622
|
</li>
|
623
623
|
|
@@ -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">:sample20</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-20-how-to-get-compare-change-list-for-document'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample20</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-20-how-to-get-compare-change-list-for-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">:resultFileId</span>, params[<span class="symbol">:resultFileId</span>]
|
69
|
-
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
|
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">:resultFileId</span>, params[<span class="hljs-symbol">:resultFileId</span>]
|
69
|
+
set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>]
|
70
70
|
|
71
|
-
<span class="keyword">begin</span></pre></div></div>
|
71
|
+
<span class="hljs-keyword">begin</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> 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.resultFileId.empty?</pre></div></div>
|
86
|
+
<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? <span class="hljs-keyword">or</span> settings.resultFileId.empty?</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> 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>
|
101
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty?
|
102
|
+
base_path = <span class="hljs-string">'https://api.groupdocs.com'</span>
|
103
|
+
<span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>)
|
104
|
+
base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>]
|
105
|
+
<span class="hljs-keyword">else</span>
|
106
106
|
base_path = settings.base_path
|
107
|
-
<span class="keyword">end</span></pre></div></div>
|
107
|
+
<span class="hljs-keyword">end</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> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
122
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs|
|
123
123
|
groupdocs.client_id = settings.client_id
|
124
124
|
groupdocs.private_key = settings.private_key</pre></div></div>
|
125
125
|
|
@@ -136,8 +136,8 @@
|
|
136
136
|
|
137
137
|
</div>
|
138
138
|
|
139
|
-
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
140
|
-
<span class="keyword">end</span></pre></div></div>
|
139
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment"># default is 'https://api.groupdocs.com'</span>
|
140
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
141
141
|
|
142
142
|
</li>
|
143
143
|
|
@@ -152,7 +152,7 @@
|
|
152
152
|
|
153
153
|
</div>
|
154
154
|
|
155
|
-
<div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.new(<span class="symbol">guid:</span> settings.resultFileId)</pre></div></div>
|
155
|
+
<div class="content"><div class='highlight'><pre> file = <span class="hljs-constant">GroupDocs::Storage::File</span>.new(<span class="hljs-symbol">guid:</span> settings.resultFileId)</pre></div></div>
|
156
156
|
|
157
157
|
</li>
|
158
158
|
|
@@ -167,7 +167,7 @@
|
|
167
167
|
|
168
168
|
</div>
|
169
169
|
|
170
|
-
<div class="content"><div class='highlight'><pre> document = <span class="constant">GroupDocs::Document</span>.new(<span class="symbol">file:</span> file)</pre></div></div>
|
170
|
+
<div class="content"><div class='highlight'><pre> document = <span class="hljs-constant">GroupDocs::Document</span>.new(<span class="hljs-symbol">file:</span> file)</pre></div></div>
|
171
171
|
|
172
172
|
</li>
|
173
173
|
|
@@ -183,28 +183,28 @@
|
|
183
183
|
</div>
|
184
184
|
|
185
185
|
<div class="content"><div class='highlight'><pre> changes = document.changes!()
|
186
|
-
result = <span class="string">''</span>
|
187
|
-
result += <span class="string">"<table class='border'>"</span>
|
188
|
-
result += <span class="string">"<tr><td><font color='green'>Change Name</font></td><td><font color='green'>Change</font></td></tr>"</span>
|
189
|
-
changes.each <span class="keyword">do</span> |change|
|
190
|
-
result += <span class="string">"<tr><td>id</td><td><span class="subst">#{change.id}</span></td></tr>"</span>
|
191
|
-
result += <span class="string">"<tr><td>type</td><td><span class="subst">#{change.type}</span></td></tr>"</span>
|
192
|
-
result += <span class="string">"<tr><td>text</td><td><span class="subst">#{change.text}</span></td></tr>"</span>
|
193
|
-
result += <span class="string">"<tr><td>page id</td><td><span class="subst">#{change.page[<span class="symbol">:Id</span>]}</span></td></tr>"</span>
|
194
|
-
result += <span class="string">"<tr><td>page weight</td><td><span class="subst">#{change.page[<span class="symbol">:Width</span>]}</span></td></tr>"</span>
|
195
|
-
result += <span class="string">"<tr><td>page height</td><td><span class="subst">#{change.page[<span class="symbol">:Height</span>]}</span></td></tr>"</span>
|
196
|
-
result += <span class="string">"<tr><td>box x</td><td><span class="subst">#{change.box.x}</span></td></tr>"</span>
|
197
|
-
result += <span class="string">"<tr><td>box y</td><td><span class="subst">#{change.box.y}</span></td></tr>"</span>
|
198
|
-
result += <span class="string">"<tr><td>box weight</td><td><span class="subst">#{change.box.width}</span></td></tr>"</span>
|
199
|
-
result += <span class="string">"<tr><td>box height</td><td><span class="subst">#{change.box.height}</span></td></tr>"</span>
|
200
|
-
result += <span class="string">"<tr bgcolor='#808080'><td></td><td></td></tr>"</span>
|
201
|
-
<span class="keyword">end</span>
|
186
|
+
result = <span class="hljs-string">''</span>
|
187
|
+
result += <span class="hljs-string">"<table class='border'>"</span>
|
188
|
+
result += <span class="hljs-string">"<tr><td><font color='green'>Change Name</font></td><td><font color='green'>Change</font></td></tr>"</span>
|
189
|
+
changes.each <span class="hljs-keyword">do</span> |change|
|
190
|
+
result += <span class="hljs-string">"<tr><td>id</td><td><span class="hljs-subst">#{change.id}</span></td></tr>"</span>
|
191
|
+
result += <span class="hljs-string">"<tr><td>type</td><td><span class="hljs-subst">#{change.type}</span></td></tr>"</span>
|
192
|
+
result += <span class="hljs-string">"<tr><td>text</td><td><span class="hljs-subst">#{change.text}</span></td></tr>"</span>
|
193
|
+
result += <span class="hljs-string">"<tr><td>page id</td><td><span class="hljs-subst">#{change.page[<span class="hljs-symbol">:Id</span>]}</span></td></tr>"</span>
|
194
|
+
result += <span class="hljs-string">"<tr><td>page weight</td><td><span class="hljs-subst">#{change.page[<span class="hljs-symbol">:Width</span>]}</span></td></tr>"</span>
|
195
|
+
result += <span class="hljs-string">"<tr><td>page height</td><td><span class="hljs-subst">#{change.page[<span class="hljs-symbol">:Height</span>]}</span></td></tr>"</span>
|
196
|
+
result += <span class="hljs-string">"<tr><td>box x</td><td><span class="hljs-subst">#{change.box.x}</span></td></tr>"</span>
|
197
|
+
result += <span class="hljs-string">"<tr><td>box y</td><td><span class="hljs-subst">#{change.box.y}</span></td></tr>"</span>
|
198
|
+
result += <span class="hljs-string">"<tr><td>box weight</td><td><span class="hljs-subst">#{change.box.width}</span></td></tr>"</span>
|
199
|
+
result += <span class="hljs-string">"<tr><td>box height</td><td><span class="hljs-subst">#{change.box.height}</span></td></tr>"</span>
|
200
|
+
result += <span class="hljs-string">"<tr bgcolor='#808080'><td></td><td></td></tr>"</span>
|
201
|
+
<span class="hljs-keyword">end</span>
|
202
202
|
|
203
|
-
result += <span class="string">'</table>'</span>
|
203
|
+
result += <span class="hljs-string">'</table>'</span>
|
204
204
|
|
205
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
205
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
206
206
|
err = e.message
|
207
|
-
<span class="keyword">end</span></pre></div></div>
|
207
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
208
208
|
|
209
209
|
</li>
|
210
210
|
|
@@ -219,8 +219,8 @@
|
|
219
219
|
|
220
220
|
</div>
|
221
221
|
|
222
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample20</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">:resultFileId</span> => settings.resultFileId, <span class="symbol">:result</span> => result, <span class="symbol">:err</span> => err}
|
223
|
-
<span class="keyword">end</span></pre></div></div>
|
222
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample20</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">:resultFileId</span> => settings.resultFileId, <span class="hljs-symbol">:result</span> => result, <span class="hljs-symbol">:err</span> => err}
|
223
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
224
224
|
|
225
225
|
</li>
|
226
226
|
|