groupdocs 1.5.7 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +51 -0
- data/examples/api-samples/Gemfile +1 -1
- data/examples/api-samples/Gemfile.lock +43 -0
- data/examples/api-samples/public/docs/{sample2.html → sample01.html} +39 -19
- data/examples/api-samples/public/docs/{sample3.html → sample02.html} +28 -22
- data/examples/api-samples/public/docs/sample03.html +285 -0
- data/examples/api-samples/public/docs/{sample4.html → sample04.html} +30 -36
- data/examples/api-samples/public/docs/{sample5.html → sample05.html} +68 -31
- data/examples/api-samples/public/docs/sample06.html +299 -0
- data/examples/api-samples/public/docs/{sample7.html → sample07.html} +53 -18
- data/examples/api-samples/public/docs/{sample8.html → sample08.html} +64 -41
- data/examples/api-samples/public/docs/sample09.html +260 -0
- data/examples/api-samples/public/docs/sample10.html +67 -28
- data/examples/api-samples/public/docs/sample11.html +171 -55
- data/examples/api-samples/public/docs/sample12.html +53 -17
- data/examples/api-samples/public/docs/sample13.html +52 -16
- data/examples/api-samples/public/docs/sample14.html +51 -8
- data/examples/api-samples/public/docs/sample15.html +46 -10
- data/examples/api-samples/public/docs/sample16.html +81 -7
- data/examples/api-samples/public/docs/sample17.html +103 -15
- data/examples/api-samples/public/docs/sample18.html +117 -41
- data/examples/api-samples/public/docs/sample19.html +410 -36
- data/examples/api-samples/public/docs/sample20.html +46 -10
- data/examples/api-samples/public/docs/sample21.html +504 -45
- data/examples/api-samples/public/docs/sample22.html +166 -28
- data/examples/api-samples/public/docs/sample23.html +61 -25
- data/examples/api-samples/public/docs/sample24.html +100 -12
- data/examples/api-samples/public/docs/sample25.html +123 -49
- data/examples/api-samples/public/docs/sample26.html +41 -8
- data/examples/api-samples/public/docs/sample27.html +125 -50
- data/examples/api-samples/public/docs/sample28.html +27 -9
- data/examples/api-samples/public/docs/sample29.html +10 -10
- data/examples/api-samples/public/docs/sample30.html +70 -14
- data/examples/api-samples/public/docs/sample31.html +108 -67
- data/examples/api-samples/public/docs/sample32.html +71 -99
- data/examples/api-samples/public/docs/sample33.html +107 -32
- data/examples/api-samples/public/docs/{sample1.html → sample34.html} +58 -18
- data/examples/api-samples/public/docs/sample35.html +666 -0
- data/examples/api-samples/public/docs/{sample6.html → sample36.html} +56 -37
- data/examples/api-samples/public/docs/sample37.html +815 -0
- data/examples/api-samples/public/docs/sample38.html +508 -0
- data/examples/api-samples/public/docs/sample39.html +921 -0
- data/examples/api-samples/public/docs/sample40.html +510 -0
- data/examples/api-samples/public/docs/sample41.html +452 -0
- data/examples/api-samples/public/docs/sample42.html +311 -0
- data/examples/api-samples/public/templates/test_all_fields2.pdf +0 -0
- data/examples/api-samples/samples/sample01.rb +37 -0
- data/examples/api-samples/samples/sample02.rb +41 -0
- data/examples/api-samples/samples/sample03.rb +73 -0
- data/examples/api-samples/samples/sample04.rb +47 -0
- data/examples/api-samples/samples/{sample5.rb → sample05.rb} +26 -14
- data/examples/api-samples/samples/sample06.rb +80 -0
- data/examples/api-samples/samples/sample07.rb +52 -0
- data/examples/api-samples/samples/sample08.rb +69 -0
- data/examples/api-samples/samples/sample09.rb +83 -0
- data/examples/api-samples/samples/sample10.rb +29 -15
- data/examples/api-samples/samples/sample11.rb +89 -37
- data/examples/api-samples/samples/sample12.rb +22 -11
- data/examples/api-samples/samples/sample13.rb +22 -10
- data/examples/api-samples/samples/sample14.rb +23 -5
- data/examples/api-samples/samples/sample15.rb +18 -7
- data/examples/api-samples/samples/sample16.rb +28 -4
- data/examples/api-samples/samples/sample17.rb +31 -5
- data/examples/api-samples/samples/sample18.rb +36 -8
- data/examples/api-samples/samples/sample19.rb +138 -18
- data/examples/api-samples/samples/sample20.rb +14 -3
- data/examples/api-samples/samples/sample21.rb +162 -23
- data/examples/api-samples/samples/sample22.rb +73 -22
- data/examples/api-samples/samples/sample23.rb +17 -6
- data/examples/api-samples/samples/sample24.rb +34 -7
- data/examples/api-samples/samples/sample25.rb +37 -12
- data/examples/api-samples/samples/sample26.rb +12 -5
- data/examples/api-samples/samples/sample27.rb +38 -12
- data/examples/api-samples/samples/sample28.rb +25 -6
- data/examples/api-samples/samples/sample29.rb +12 -12
- data/examples/api-samples/samples/sample30.rb +27 -15
- data/examples/api-samples/samples/sample31.rb +44 -33
- data/examples/api-samples/samples/sample32.rb +43 -41
- data/examples/api-samples/samples/sample33.rb +42 -14
- data/examples/api-samples/samples/sample34.rb +40 -0
- data/examples/api-samples/samples/sample35.rb +224 -0
- data/examples/api-samples/samples/sample36.rb +58 -0
- data/examples/api-samples/samples/sample37.rb +229 -0
- data/examples/api-samples/samples/sample38.rb +128 -0
- data/examples/api-samples/samples/sample39.rb +252 -0
- data/examples/api-samples/samples/sample40.rb +164 -0
- data/examples/api-samples/samples/sample41.rb +118 -0
- data/examples/api-samples/samples/sample42.rb +97 -0
- data/examples/api-samples/views/_others_samples.haml +25 -11
- data/examples/api-samples/views/index.haml +23 -11
- data/examples/api-samples/views/popup.haml +32 -0
- data/examples/api-samples/views/{sample1.haml → sample01.haml} +12 -7
- data/examples/api-samples/views/{sample2.haml → sample02.haml} +20 -15
- data/examples/api-samples/views/sample03.haml +83 -0
- data/examples/api-samples/views/sample04.haml +49 -0
- data/examples/api-samples/views/{sample5.haml → sample05.haml} +19 -14
- data/examples/api-samples/views/sample06.haml +53 -0
- data/examples/api-samples/views/sample07.haml +47 -0
- data/examples/api-samples/views/{sample8.haml → sample08.haml} +17 -12
- data/examples/api-samples/views/{sample9.haml → sample09.haml} +19 -4
- data/examples/api-samples/views/sample10.haml +18 -13
- data/examples/api-samples/views/sample11.haml +48 -19
- data/examples/api-samples/views/sample12.haml +26 -21
- data/examples/api-samples/views/sample13.haml +18 -12
- data/examples/api-samples/views/sample14.haml +21 -15
- data/examples/api-samples/views/sample15.haml +16 -9
- data/examples/api-samples/views/sample16.haml +18 -5
- data/examples/api-samples/views/sample17.haml +14 -9
- data/examples/api-samples/views/sample18.haml +13 -7
- data/examples/api-samples/views/sample19.haml +37 -8
- data/examples/api-samples/views/sample20.haml +13 -8
- data/examples/api-samples/views/sample21.haml +71 -13
- data/examples/api-samples/views/sample22.haml +53 -16
- data/examples/api-samples/views/sample23.haml +9 -4
- data/examples/api-samples/views/sample24.haml +9 -4
- data/examples/api-samples/views/sample25.haml +18 -13
- data/examples/api-samples/views/sample26.haml +8 -3
- data/examples/api-samples/views/sample27.haml +20 -14
- data/examples/api-samples/views/sample28.haml +16 -10
- data/examples/api-samples/views/sample29.haml +4 -4
- data/examples/api-samples/views/sample30.haml +16 -10
- data/examples/api-samples/views/sample31.haml +39 -32
- data/examples/api-samples/views/sample32.haml +25 -36
- data/examples/api-samples/views/sample33.haml +14 -17
- data/examples/api-samples/views/sample34.haml +48 -0
- data/examples/api-samples/views/sample35.haml +95 -0
- data/examples/api-samples/views/sample36.haml +64 -0
- data/examples/api-samples/views/sample37.haml +124 -0
- data/examples/api-samples/views/sample38.haml +115 -0
- data/examples/api-samples/views/sample39.haml +236 -0
- data/examples/api-samples/views/sample40.haml +95 -0
- data/examples/api-samples/views/{sample4.haml → sample41.haml} +90 -72
- data/examples/api-samples/views/sample42.haml +59 -0
- data/lib/groupdocs/api/helpers/rest_helper.rb +13 -1
- data/lib/groupdocs/datasource.rb +2 -1
- data/lib/groupdocs/document.rb +101 -13
- data/lib/groupdocs/document/annotation.rb +28 -13
- data/lib/groupdocs/document/annotation/marker.rb +18 -0
- data/lib/groupdocs/document/annotation/reply.rb +9 -2
- data/lib/groupdocs/document/field.rb +5 -1
- data/lib/groupdocs/job.rb +12 -2
- data/lib/groupdocs/questionnaire.rb +174 -4
- data/lib/groupdocs/questionnaire/collector.rb +21 -0
- data/lib/groupdocs/questionnaire/question.rb +19 -0
- data/lib/groupdocs/questionnaire/question/answer.rb +5 -0
- data/lib/groupdocs/questionnaire/question/conditions.rb +20 -0
- data/lib/groupdocs/signature.rb +36 -308
- data/lib/groupdocs/signature/envelope.rb +146 -4
- data/lib/groupdocs/signature/field.rb +20 -1
- data/lib/groupdocs/signature/field/location.rb +18 -7
- data/lib/groupdocs/signature/form.rb +199 -10
- data/lib/groupdocs/signature/shared/document_methods.rb +38 -0
- data/lib/groupdocs/signature/shared/entity_methods.rb +0 -1
- data/lib/groupdocs/signature/shared/field_methods.rb +13 -38
- data/lib/groupdocs/signature/shared/recipient_methods.rb +8 -0
- data/lib/groupdocs/signature/template.rb +3 -1
- data/lib/groupdocs/storage.rb +4 -1
- data/lib/groupdocs/storage/file.rb +18 -1
- data/lib/groupdocs/subscription.rb +8 -3
- data/lib/groupdocs/user.rb +8 -0
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/document/annotation_spec.rb +1 -14
- data/spec/groupdocs/subscription_spec.rb +2 -2
- metadata +86 -32
- checksums.yaml +0 -15
- data/examples/api-samples/public/docs/sample9.html +0 -200
- data/examples/api-samples/samples/sample1.rb +0 -25
- data/examples/api-samples/samples/sample2.rb +0 -29
- data/examples/api-samples/samples/sample3.rb +0 -33
- data/examples/api-samples/samples/sample4.rb +0 -51
- data/examples/api-samples/samples/sample6.rb +0 -49
- data/examples/api-samples/samples/sample7.rb +0 -42
- data/examples/api-samples/samples/sample8.rb +0 -61
- data/examples/api-samples/samples/sample9.rb +0 -48
- data/examples/api-samples/views/sample3.haml +0 -44
- data/examples/api-samples/views/sample6.haml +0 -49
- data/examples/api-samples/views/sample7.haml +0 -42
@@ -59,13 +59,14 @@
|
|
59
59
|
<div class="pilwrap ">
|
60
60
|
<a class="pilcrow" href="#section-3">¶</a>
|
61
61
|
</div>
|
62
|
-
<p>
|
62
|
+
<p>Set variables</p>
|
63
63
|
|
64
64
|
</div>
|
65
65
|
|
66
|
-
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:
|
67
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:
|
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
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>]
|
69
70
|
|
70
71
|
<span class="keyword">begin</span></pre></div></div>
|
71
72
|
|
@@ -78,11 +79,13 @@
|
|
78
79
|
<div class="pilwrap ">
|
79
80
|
<a class="pilcrow" href="#section-4">¶</a>
|
80
81
|
</div>
|
81
|
-
<p>
|
82
|
+
<p>Check required variables</p>
|
82
83
|
|
83
84
|
</div>
|
84
85
|
|
85
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.file_id.empty
|
86
|
+
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.file_id.empty?
|
87
|
+
|
88
|
+
<span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div>
|
86
89
|
|
87
90
|
</li>
|
88
91
|
|
@@ -93,12 +96,13 @@
|
|
93
96
|
<div class="pilwrap ">
|
94
97
|
<a class="pilcrow" href="#section-5">¶</a>
|
95
98
|
</div>
|
96
|
-
<p>
|
99
|
+
<p>Configure your access to API server</p>
|
97
100
|
|
98
101
|
</div>
|
99
102
|
|
100
|
-
<div class="content"><div class='highlight'><pre>
|
101
|
-
|
103
|
+
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
104
|
+
groupdocs.client_id = settings.client_id
|
105
|
+
groupdocs.private_key = settings.private_key</pre></div></div>
|
102
106
|
|
103
107
|
</li>
|
104
108
|
|
@@ -109,7 +113,39 @@
|
|
109
113
|
<div class="pilwrap ">
|
110
114
|
<a class="pilcrow" href="#section-6">¶</a>
|
111
115
|
</div>
|
112
|
-
<p>
|
116
|
+
<p>Optionally specify API server and version</p>
|
117
|
+
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
121
|
+
<span class="keyword">end</span></pre></div></div>
|
122
|
+
|
123
|
+
</li>
|
124
|
+
|
125
|
+
|
126
|
+
<li id="section-7">
|
127
|
+
<div class="annotation">
|
128
|
+
|
129
|
+
<div class="pilwrap ">
|
130
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
131
|
+
</div>
|
132
|
+
<p>Make a request to API using client_id and private_key</p>
|
133
|
+
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<div class="content"><div class='highlight'><pre> files_list = <span class="constant">GroupDocs::Storage::Folder</span>.list!(<span class="string">'/'</span>, {})
|
137
|
+
document = <span class="string">''</span></pre></div></div>
|
138
|
+
|
139
|
+
</li>
|
140
|
+
|
141
|
+
|
142
|
+
<li id="section-8">
|
143
|
+
<div class="annotation">
|
144
|
+
|
145
|
+
<div class="pilwrap ">
|
146
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
147
|
+
</div>
|
148
|
+
<p>Get document by file ID</p>
|
113
149
|
|
114
150
|
</div>
|
115
151
|
|
@@ -124,17 +160,17 @@
|
|
124
160
|
</li>
|
125
161
|
|
126
162
|
|
127
|
-
<li id="section-
|
163
|
+
<li id="section-9">
|
128
164
|
<div class="annotation">
|
129
165
|
|
130
166
|
<div class="pilwrap ">
|
131
|
-
<a class="pilcrow" href="#section-
|
167
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
132
168
|
</div>
|
133
|
-
<p>
|
169
|
+
<p>Get list of annotations</p>
|
134
170
|
|
135
171
|
</div>
|
136
172
|
|
137
|
-
<div class="content"><div class='highlight'><pre> annotations = document.to_document.annotations!(
|
173
|
+
<div class="content"><div class='highlight'><pre> annotations = document.to_document.annotations!()
|
138
174
|
<span class="keyword">end</span>
|
139
175
|
|
140
176
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
@@ -144,17 +180,17 @@
|
|
144
180
|
</li>
|
145
181
|
|
146
182
|
|
147
|
-
<li id="section-
|
183
|
+
<li id="section-10">
|
148
184
|
<div class="annotation">
|
149
185
|
|
150
186
|
<div class="pilwrap ">
|
151
|
-
<a class="pilcrow" href="#section-
|
187
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
152
188
|
</div>
|
153
|
-
<p>
|
189
|
+
<p>Set variables for template</p>
|
154
190
|
|
155
191
|
</div>
|
156
192
|
|
157
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample12</span>, <span class="symbol">:locals</span> => {<span class="symbol">:
|
193
|
+
<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}
|
158
194
|
<span class="keyword">end</span></pre></div></div>
|
159
195
|
|
160
196
|
</li>
|
@@ -59,14 +59,15 @@
|
|
59
59
|
<div class="pilwrap ">
|
60
60
|
<a class="pilcrow" href="#section-3">¶</a>
|
61
61
|
</div>
|
62
|
-
<p>
|
62
|
+
<p>Set variables</p>
|
63
63
|
|
64
64
|
</div>
|
65
65
|
|
66
|
-
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:
|
67
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:
|
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
68
|
set <span class="symbol">:file_id</span>, params[<span class="symbol">:fileId</span>]
|
69
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>]
|
70
71
|
|
71
72
|
<span class="keyword">begin</span></pre></div></div>
|
72
73
|
|
@@ -79,11 +80,13 @@
|
|
79
80
|
<div class="pilwrap ">
|
80
81
|
<a class="pilcrow" href="#section-4">¶</a>
|
81
82
|
</div>
|
82
|
-
<p>
|
83
|
+
<p>Check required variables</p>
|
83
84
|
|
84
85
|
</div>
|
85
86
|
|
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? <span class="keyword">or</span> settings.email.empty
|
87
|
+
<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? <span class="keyword">or</span> settings.email.empty?
|
88
|
+
|
89
|
+
<span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div>
|
87
90
|
|
88
91
|
</li>
|
89
92
|
|
@@ -94,12 +97,13 @@
|
|
94
97
|
<div class="pilwrap ">
|
95
98
|
<a class="pilcrow" href="#section-5">¶</a>
|
96
99
|
</div>
|
97
|
-
<p>
|
100
|
+
<p>Configure your access to API server</p>
|
98
101
|
|
99
102
|
</div>
|
100
103
|
|
101
|
-
<div class="content"><div class='highlight'><pre>
|
102
|
-
|
104
|
+
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
105
|
+
groupdocs.client_id = settings.client_id
|
106
|
+
groupdocs.private_key = settings.private_key</pre></div></div>
|
103
107
|
|
104
108
|
</li>
|
105
109
|
|
@@ -110,7 +114,39 @@
|
|
110
114
|
<div class="pilwrap ">
|
111
115
|
<a class="pilcrow" href="#section-6">¶</a>
|
112
116
|
</div>
|
113
|
-
<p>
|
117
|
+
<p>Optionally specify API server and version</p>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
122
|
+
<span class="keyword">end</span></pre></div></div>
|
123
|
+
|
124
|
+
</li>
|
125
|
+
|
126
|
+
|
127
|
+
<li id="section-7">
|
128
|
+
<div class="annotation">
|
129
|
+
|
130
|
+
<div class="pilwrap ">
|
131
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
132
|
+
</div>
|
133
|
+
<p>Make a request to API using client_id and private_key</p>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="content"><div class='highlight'><pre> files_list = <span class="constant">GroupDocs::Storage::Folder</span>.list!(<span class="string">'/'</span>, {})
|
138
|
+
document = <span class="string">''</span></pre></div></div>
|
139
|
+
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
<li id="section-8">
|
144
|
+
<div class="annotation">
|
145
|
+
|
146
|
+
<div class="pilwrap ">
|
147
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
148
|
+
</div>
|
149
|
+
<p>Get document by file ID</p>
|
114
150
|
|
115
151
|
</div>
|
116
152
|
|
@@ -125,17 +161,17 @@
|
|
125
161
|
</li>
|
126
162
|
|
127
163
|
|
128
|
-
<li id="section-
|
164
|
+
<li id="section-9">
|
129
165
|
<div class="annotation">
|
130
166
|
|
131
167
|
<div class="pilwrap ">
|
132
|
-
<a class="pilcrow" href="#section-
|
168
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
133
169
|
</div>
|
134
|
-
<p>
|
170
|
+
<p>Add collaborator to doc with annotations</p>
|
135
171
|
|
136
172
|
</div>
|
137
173
|
|
138
|
-
<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
|
174
|
+
<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>)
|
139
175
|
<span class="keyword">end</span>
|
140
176
|
|
141
177
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
@@ -145,17 +181,17 @@
|
|
145
181
|
</li>
|
146
182
|
|
147
183
|
|
148
|
-
<li id="section-
|
184
|
+
<li id="section-10">
|
149
185
|
<div class="annotation">
|
150
186
|
|
151
187
|
<div class="pilwrap ">
|
152
|
-
<a class="pilcrow" href="#section-
|
188
|
+
<a class="pilcrow" href="#section-10">¶</a>
|
153
189
|
</div>
|
154
190
|
<p>set variables for template</p>
|
155
191
|
|
156
192
|
</div>
|
157
193
|
|
158
|
-
<div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample13</span>, <span class="symbol">:locals</span> => {<span class="symbol">:
|
194
|
+
<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}
|
159
195
|
<span class="keyword">end</span></pre></div></div>
|
160
196
|
|
161
197
|
</li>
|
@@ -63,9 +63,10 @@
|
|
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">:
|
67
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:
|
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
68
|
set <span class="symbol">:folder</span>, params[<span class="symbol">:folder</span>]
|
69
|
+
set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
|
69
70
|
|
70
71
|
<span class="keyword">begin</span></pre></div></div>
|
71
72
|
|
@@ -82,7 +83,9 @@
|
|
82
83
|
|
83
84
|
</div>
|
84
85
|
|
85
|
-
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.folder.empty
|
86
|
+
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.folder.empty?
|
87
|
+
|
88
|
+
<span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div>
|
86
89
|
|
87
90
|
</li>
|
88
91
|
|
@@ -93,11 +96,13 @@
|
|
93
96
|
<div class="pilwrap ">
|
94
97
|
<a class="pilcrow" href="#section-5">¶</a>
|
95
98
|
</div>
|
96
|
-
<p>
|
99
|
+
<p>Configure your access to API server</p>
|
97
100
|
|
98
101
|
</div>
|
99
102
|
|
100
|
-
<div class="content"><div class='highlight'><pre>
|
103
|
+
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
104
|
+
groupdocs.client_id = settings.client_id
|
105
|
+
groupdocs.private_key = settings.private_key</pre></div></div>
|
101
106
|
|
102
107
|
</li>
|
103
108
|
|
@@ -108,11 +113,49 @@
|
|
108
113
|
<div class="pilwrap ">
|
109
114
|
<a class="pilcrow" href="#section-6">¶</a>
|
110
115
|
</div>
|
116
|
+
<p>Optionally specify API server and version</p>
|
117
|
+
|
118
|
+
</div>
|
119
|
+
|
120
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
121
|
+
<span class="keyword">end</span>
|
122
|
+
folder = <span class="keyword">nil</span></pre></div></div>
|
123
|
+
|
124
|
+
</li>
|
125
|
+
|
126
|
+
|
127
|
+
<li id="section-7">
|
128
|
+
<div class="annotation">
|
129
|
+
|
130
|
+
<div class="pilwrap ">
|
131
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
132
|
+
</div>
|
133
|
+
<p>make a request to API using client_id and private_key</p>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div class="content"><div class='highlight'><pre> files_list = <span class="constant">GroupDocs::Storage::Folder</span>.list!()
|
138
|
+
|
139
|
+
files_list.map <span class="keyword">do</span> |e|
|
140
|
+
<span class="keyword">if</span> e.name == settings.folder
|
141
|
+
folder = e
|
142
|
+
<span class="keyword">end</span>
|
143
|
+
<span class="keyword">end</span></pre></div></div>
|
144
|
+
|
145
|
+
</li>
|
146
|
+
|
147
|
+
|
148
|
+
<li id="section-8">
|
149
|
+
<div class="annotation">
|
150
|
+
|
151
|
+
<div class="pilwrap ">
|
152
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
153
|
+
</div>
|
111
154
|
<p>get list of shares for a folder</p>
|
112
155
|
|
113
156
|
</div>
|
114
157
|
|
115
|
-
<div class="content"><div class='highlight'><pre> shares =
|
158
|
+
<div class="content"><div class='highlight'><pre> shares = folder.sharers!()
|
116
159
|
|
117
160
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
118
161
|
err = e.message
|
@@ -121,11 +164,11 @@
|
|
121
164
|
</li>
|
122
165
|
|
123
166
|
|
124
|
-
<li id="section-
|
167
|
+
<li id="section-9">
|
125
168
|
<div class="annotation">
|
126
169
|
|
127
170
|
<div class="pilwrap ">
|
128
|
-
<a class="pilcrow" href="#section-
|
171
|
+
<a class="pilcrow" href="#section-9">¶</a>
|
129
172
|
</div>
|
130
173
|
<p>set variables for template</p>
|
131
174
|
|
@@ -59,12 +59,13 @@
|
|
59
59
|
<div class="pilwrap ">
|
60
60
|
<a class="pilcrow" href="#section-3">¶</a>
|
61
61
|
</div>
|
62
|
-
<p>
|
62
|
+
<p>Set variables</p>
|
63
63
|
|
64
64
|
</div>
|
65
65
|
|
66
|
-
<div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:
|
67
|
-
set <span class="symbol">:private_key</span>, params[<span class="symbol">:
|
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">:base_path</span>, params[<span class="symbol">:basePath</span>]
|
68
69
|
|
69
70
|
<span class="keyword">begin</span></pre></div></div>
|
70
71
|
|
@@ -77,11 +78,13 @@
|
|
77
78
|
<div class="pilwrap ">
|
78
79
|
<a class="pilcrow" href="#section-4">¶</a>
|
79
80
|
</div>
|
80
|
-
<p>
|
81
|
+
<p>Check required variables</p>
|
81
82
|
|
82
83
|
</div>
|
83
84
|
|
84
|
-
<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
|
85
|
+
<div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty?
|
86
|
+
|
87
|
+
<span class="keyword">if</span> settings.base_path.empty? <span class="keyword">then</span> settings.base_path = <span class="string">'https://api.groupdocs.com'</span> <span class="keyword">end</span></pre></div></div>
|
85
88
|
|
86
89
|
</li>
|
87
90
|
|
@@ -92,11 +95,44 @@
|
|
92
95
|
<div class="pilwrap ">
|
93
96
|
<a class="pilcrow" href="#section-5">¶</a>
|
94
97
|
</div>
|
95
|
-
<p>
|
98
|
+
<p>Configure your access to API server</p>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs|
|
103
|
+
groupdocs.client_id = settings.client_id
|
104
|
+
groupdocs.private_key = settings.private_key</pre></div></div>
|
105
|
+
|
106
|
+
</li>
|
107
|
+
|
108
|
+
|
109
|
+
<li id="section-6">
|
110
|
+
<div class="annotation">
|
111
|
+
|
112
|
+
<div class="pilwrap ">
|
113
|
+
<a class="pilcrow" href="#section-6">¶</a>
|
114
|
+
</div>
|
115
|
+
<p>Optionally specify API server and version</p>
|
96
116
|
|
97
117
|
</div>
|
98
118
|
|
99
|
-
<div class="content"><div class='highlight'><pre>
|
119
|
+
<div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
|
120
|
+
<span class="keyword">end</span></pre></div></div>
|
121
|
+
|
122
|
+
</li>
|
123
|
+
|
124
|
+
|
125
|
+
<li id="section-7">
|
126
|
+
<div class="annotation">
|
127
|
+
|
128
|
+
<div class="pilwrap ">
|
129
|
+
<a class="pilcrow" href="#section-7">¶</a>
|
130
|
+
</div>
|
131
|
+
<p>Check the number of document's views. Make a request to API using client_id and private_key</p>
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div class="content"><div class='highlight'><pre> views = <span class="constant">GroupDocs::Document</span>.views!({})
|
100
136
|
total = views.count()
|
101
137
|
|
102
138
|
<span class="keyword">rescue</span> <span class="constant">Exception</span> => e
|
@@ -106,13 +142,13 @@
|
|
106
142
|
</li>
|
107
143
|
|
108
144
|
|
109
|
-
<li id="section-
|
145
|
+
<li id="section-8">
|
110
146
|
<div class="annotation">
|
111
147
|
|
112
148
|
<div class="pilwrap ">
|
113
|
-
<a class="pilcrow" href="#section-
|
149
|
+
<a class="pilcrow" href="#section-8">¶</a>
|
114
150
|
</div>
|
115
|
-
<p>
|
151
|
+
<p>Set variables for template</p>
|
116
152
|
|
117
153
|
</div>
|
118
154
|
|