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">:sample12</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-12-how-to-list-all-annotations-from-document'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample12</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-12-how-to-list-all-annotations-from-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">:file_id</span>, params[<span class="symbol">:fileId</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">:file_id</span>, params[<span class="hljs-symbol">:fileId</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.file_id.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.file_id.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
|
|
@@ -148,12 +148,12 @@
|
|
148
148
|
<div class="pilwrap ">
|
149
149
|
<a class="pilcrow" href="#section-8">¶</a>
|
150
150
|
</div>
|
151
|
-
<p>
|
151
|
+
<p>Create document object</p>
|
152
152
|
|
153
153
|
</div>
|
154
154
|
|
155
|
-
<div class="content"><div class='highlight'><pre>
|
156
|
-
|
155
|
+
<div class="content"><div class='highlight'><pre> document = <span class="hljs-constant">GroupDocs::Storage::File</span>.new(<span class="hljs-symbol">guid:</span> settings.file_id)
|
156
|
+
<span class="hljs-keyword">unless</span> document.instance_of? <span class="hljs-constant">String</span></pre></div></div>
|
157
157
|
|
158
158
|
</li>
|
159
159
|
|
@@ -164,53 +164,32 @@
|
|
164
164
|
<div class="pilwrap ">
|
165
165
|
<a class="pilcrow" href="#section-9">¶</a>
|
166
166
|
</div>
|
167
|
-
<p>Get document by file ID</p>
|
168
|
-
|
169
|
-
</div>
|
170
|
-
|
171
|
-
<div class="content"><div class='highlight'><pre> files_list.each <span class="keyword">do</span> |element|
|
172
|
-
<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.file_id
|
173
|
-
document = element
|
174
|
-
<span class="keyword">end</span>
|
175
|
-
<span class="keyword">end</span>
|
176
|
-
|
177
|
-
<span class="keyword">unless</span> document.instance_of? <span class="constant">String</span></pre></div></div>
|
178
|
-
|
179
|
-
</li>
|
180
|
-
|
181
|
-
|
182
|
-
<li id="section-10">
|
183
|
-
<div class="annotation">
|
184
|
-
|
185
|
-
<div class="pilwrap ">
|
186
|
-
<a class="pilcrow" href="#section-10">¶</a>
|
187
|
-
</div>
|
188
167
|
<p>Get list of annotations</p>
|
189
168
|
|
190
169
|
</div>
|
191
170
|
|
192
171
|
<div class="content"><div class='highlight'><pre> annotations = document.to_document.annotations!()
|
193
|
-
<span class="keyword">end</span>
|
172
|
+
<span class="hljs-keyword">end</span>
|
194
173
|
|
195
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
174
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
196
175
|
err = e.message
|
197
|
-
<span class="keyword">end</span></pre></div></div>
|
176
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
198
177
|
|
199
178
|
</li>
|
200
179
|
|
201
180
|
|
202
|
-
<li id="section-
|
181
|
+
<li id="section-10">
|
203
182
|
<div class="annotation">
|
204
183
|
|
205
184
|
<div class="pilwrap ">
|
206
|
-
<a class="pilcrow" href="#section-
|
185
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
207
186
|
</div>
|
208
187
|
<p>Set variables for template</p>
|
209
188
|
|
210
189
|
</div>
|
211
190
|
|
212
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample12</span>, <span class="symbol">:locals</span> => {<span class="symbol">:clientId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:annotations</span> => annotations, <span class="symbol">:fileId</span> => settings.file_id, <span class="symbol">:err</span> => err}
|
213
|
-
<span class="keyword">end</span></pre></div></div>
|
191
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample12</span>, <span class="hljs-symbol">:locals</span> => {<span class="hljs-symbol">:clientId</span> => settings.client_id, <span class="hljs-symbol">:privateKey</span> => settings.private_key, <span class="hljs-symbol">:annotations</span> => annotations, <span class="hljs-symbol">:fileId</span> => settings.file_id, <span class="hljs-symbol">:err</span> => err}
|
192
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
214
193
|
|
215
194
|
</li>
|
216
195
|
|
@@ -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">:sample13</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-13-how-to-add-collaborator-to-doc-with-annotations'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample13</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-13-how-to-add-collaborator-to-doc-with-annotations'</span> <span class="hljs-keyword">do</span></pre></div></div>
|
52
52
|
|
53
53
|
</li>
|
54
54
|
|
@@ -63,15 +63,13 @@
|
|
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">:email</span>, params[<span class="symbol">:email</span>]
|
70
|
-
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">:file_id</span>, params[<span class="hljs-symbol">:fileId</span>]
|
69
|
+
set <span class="hljs-symbol">:email</span>, params[<span class="hljs-symbol">:email</span>]
|
70
|
+
set <span class="hljs-symbol">:base_path</span>, params[<span class="hljs-symbol">:basePath</span>]
|
71
71
|
|
72
|
-
<span class="keyword">begin</span>
|
73
|
-
<span class="constant">Check</span> required variables
|
74
|
-
raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.file_id.empty? <span class="keyword">or</span> settings.email.empty?</pre></div></div>
|
72
|
+
<span class="hljs-keyword">begin</span></pre></div></div>
|
75
73
|
|
76
74
|
</li>
|
77
75
|
|
@@ -82,17 +80,11 @@
|
|
82
80
|
<div class="pilwrap ">
|
83
81
|
<a class="pilcrow" href="#section-4">¶</a>
|
84
82
|
</div>
|
85
|
-
<p>
|
83
|
+
<p>Check required variables</p>
|
86
84
|
|
87
85
|
</div>
|
88
86
|
|
89
|
-
<div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.
|
90
|
-
base_path = <span class="string">'https://api.groupdocs.com'</span>
|
91
|
-
<span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
|
92
|
-
base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
|
93
|
-
<span class="keyword">else</span>
|
94
|
-
base_path = settings.base_path
|
95
|
-
<span class="keyword">end</span></pre></div></div>
|
87
|
+
<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.file_id.empty? <span class="hljs-keyword">or</span> settings.email.empty?</pre></div></div>
|
96
88
|
|
97
89
|
</li>
|
98
90
|
|
@@ -103,13 +95,17 @@
|
|
103
95
|
<div class="pilwrap ">
|
104
96
|
<a class="pilcrow" href="#section-5">¶</a>
|
105
97
|
</div>
|
106
|
-
<p>
|
98
|
+
<p>Prepare base path</p>
|
107
99
|
|
108
100
|
</div>
|
109
101
|
|
110
|
-
<div class="content"><div class='highlight'><pre> <span class="
|
111
|
-
|
112
|
-
|
102
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> settings.base_path.empty?
|
103
|
+
base_path = <span class="hljs-string">'https://api.groupdocs.com'</span>
|
104
|
+
<span class="hljs-keyword">elsif</span> settings.base_path.match(<span class="hljs-string">'/v2.0'</span>)
|
105
|
+
base_path = settings.base_path.split(<span class="hljs-string">'/v2.0'</span>)[<span class="hljs-number">0</span>]
|
106
|
+
<span class="hljs-keyword">else</span>
|
107
|
+
base_path = settings.base_path
|
108
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
113
109
|
|
114
110
|
</li>
|
115
111
|
|
@@ -120,12 +116,13 @@
|
|
120
116
|
<div class="pilwrap ">
|
121
117
|
<a class="pilcrow" href="#section-6">¶</a>
|
122
118
|
</div>
|
123
|
-
<p>
|
119
|
+
<p>Configure your access to API server</p>
|
124
120
|
|
125
121
|
</div>
|
126
122
|
|
127
|
-
<div class="content"><div class='highlight'><pre>
|
128
|
-
|
123
|
+
<div class="content"><div class='highlight'><pre> <span class="hljs-constant">GroupDocs</span>.configure <span class="hljs-keyword">do</span> |groupdocs|
|
124
|
+
groupdocs.client_id = settings.client_id
|
125
|
+
groupdocs.private_key = settings.private_key</pre></div></div>
|
129
126
|
|
130
127
|
</li>
|
131
128
|
|
@@ -136,12 +133,12 @@
|
|
136
133
|
<div class="pilwrap ">
|
137
134
|
<a class="pilcrow" href="#section-7">¶</a>
|
138
135
|
</div>
|
139
|
-
<p>
|
136
|
+
<p>Optionally specify API server and version</p>
|
140
137
|
|
141
138
|
</div>
|
142
139
|
|
143
|
-
<div class="content"><div class='highlight'><pre>
|
144
|
-
|
140
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="hljs-comment"># default is 'https://api.groupdocs.com'</span>
|
141
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
145
142
|
|
146
143
|
</li>
|
147
144
|
|
@@ -152,17 +149,12 @@
|
|
152
149
|
<div class="pilwrap ">
|
153
150
|
<a class="pilcrow" href="#section-8">¶</a>
|
154
151
|
</div>
|
155
|
-
<p>
|
152
|
+
<p>Create document object</p>
|
156
153
|
|
157
154
|
</div>
|
158
155
|
|
159
|
-
<div class="content"><div class='highlight'><pre>
|
160
|
-
|
161
|
-
document = element
|
162
|
-
<span class="keyword">end</span>
|
163
|
-
<span class="keyword">end</span>
|
164
|
-
|
165
|
-
<span class="keyword">unless</span> document.instance_of? <span class="constant">String</span></pre></div></div>
|
156
|
+
<div class="content"><div class='highlight'><pre> document = <span class="hljs-constant">GroupDocs::Storage::File</span>.new(<span class="hljs-symbol">guid:</span> settings.file_id)
|
157
|
+
<span class="hljs-keyword">unless</span> document.instance_of? <span class="hljs-constant">String</span></pre></div></div>
|
166
158
|
|
167
159
|
</li>
|
168
160
|
|
@@ -177,13 +169,13 @@
|
|
177
169
|
|
178
170
|
</div>
|
179
171
|
|
180
|
-
<div class="content"><div class='highlight'><pre> result = document.to_document.set_collaborators!(settings.email.split(<span class="string">' '</span>), <span class="number">1</span>)
|
181
|
-
<span class="keyword">end</span>
|
172
|
+
<div class="content"><div class='highlight'><pre> result = document.to_document.set_collaborators!(settings.email.split(<span class="hljs-string">' '</span>), <span class="hljs-number">1</span>)
|
173
|
+
<span class="hljs-keyword">end</span>
|
182
174
|
|
183
175
|
|
184
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
176
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
185
177
|
err = e.message
|
186
|
-
<span class="keyword">end</span></pre></div></div>
|
178
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
187
179
|
|
188
180
|
</li>
|
189
181
|
|
@@ -198,8 +190,8 @@
|
|
198
190
|
|
199
191
|
</div>
|
200
192
|
|
201
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample13</span>, <span class="symbol">:locals</span> => {<span class="symbol">:clientId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:fileId</span> => settings.file_id, <span class="symbol">:email</span> => settings.email, <span class="symbol">:result</span> => result, <span class="symbol">:err</span> => err}
|
202
|
-
<span class="keyword">end</span></pre></div></div>
|
193
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample13</span>, <span class="hljs-symbol">:locals</span> => {<span class="hljs-symbol">:clientId</span> => settings.client_id, <span class="hljs-symbol">:privateKey</span> => settings.private_key, <span class="hljs-symbol">:fileId</span> => settings.file_id, <span class="hljs-symbol">:email</span> => settings.email, <span class="hljs-symbol">:result</span> => result, <span class="hljs-symbol">:err</span> => err}
|
194
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
203
195
|
|
204
196
|
</li>
|
205
197
|
|
@@ -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">:sample14</span>
|
36
|
-
<span class="keyword">end</span></pre></div></div>
|
34
|
+
<div class="content"><div class='highlight'><pre>get <span class="hljs-string">'/sample-14-how-to-check-the-list-of-shares-for-a-folder'</span> <span class="hljs-keyword">do</span>
|
35
|
+
haml <span class="hljs-symbol">:sample14</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-14-how-to-check-the-list-of-shares-for-a-folder'</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">:folder</span>, params[<span class="symbol">:path</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">:folder</span>, params[<span class="hljs-symbol">:path</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.folder.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.folder.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,9 +136,9 @@
|
|
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>
|
141
|
-
folder = <span class="keyword">nil</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>
|
141
|
+
folder = <span class="hljs-keyword">nil</span></pre></div></div>
|
142
142
|
|
143
143
|
</li>
|
144
144
|
|
@@ -153,13 +153,13 @@
|
|
153
153
|
|
154
154
|
</div>
|
155
155
|
|
156
|
-
<div class="content"><div class='highlight'><pre> files_list = <span class="constant">GroupDocs::Storage::Folder</span>.list!()
|
156
|
+
<div class="content"><div class='highlight'><pre> files_list = <span class="hljs-constant">GroupDocs::Storage::Folder</span>.list!()
|
157
157
|
|
158
|
-
files_list.map <span class="keyword">do</span> |e|
|
159
|
-
<span class="keyword">if</span> e.name == settings.folder
|
158
|
+
files_list.map <span class="hljs-keyword">do</span> |e|
|
159
|
+
<span class="hljs-keyword">if</span> e.name == settings.folder
|
160
160
|
folder = e
|
161
|
-
<span class="keyword">end</span>
|
162
|
-
<span class="keyword">end</span></pre></div></div>
|
161
|
+
<span class="hljs-keyword">end</span>
|
162
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
163
163
|
|
164
164
|
</li>
|
165
165
|
|
@@ -176,9 +176,9 @@
|
|
176
176
|
|
177
177
|
<div class="content"><div class='highlight'><pre> shares = folder.sharers!()
|
178
178
|
|
179
|
-
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
179
|
+
<span class="hljs-keyword">rescue</span> <span class="hljs-constant">Exception</span> => e
|
180
180
|
err = e.message
|
181
|
-
<span class="keyword">end</span></pre></div></div>
|
181
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
182
182
|
|
183
183
|
</li>
|
184
184
|
|
@@ -193,8 +193,8 @@
|
|
193
193
|
|
194
194
|
</div>
|
195
195
|
|
196
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample14</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">:folder</span> => settings.folder, <span class="symbol">:shares</span> => shares, <span class="symbol">:err</span> => err}
|
197
|
-
<span class="keyword">end</span></pre></div></div>
|
196
|
+
<div class="content"><div class='highlight'><pre> haml <span class="hljs-symbol">:sample14</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">:folder</span> => settings.folder, <span class="hljs-symbol">:shares</span> => shares, <span class="hljs-symbol">:err</span> => err}
|
197
|
+
<span class="hljs-keyword">end</span></pre></div></div>
|
198
198
|
|
199
199
|
</li>
|
200
200
|
|