groupdocs 1.5.8 → 1.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. data/CHANGELOG.md +9 -0
  2. data/examples/api-samples/public/docs/sample01.html +34 -15
  3. data/examples/api-samples/public/docs/sample02.html +36 -15
  4. data/examples/api-samples/public/docs/sample03.html +55 -34
  5. data/examples/api-samples/public/docs/sample04.html +33 -14
  6. data/examples/api-samples/public/docs/sample05.html +51 -33
  7. data/examples/api-samples/public/docs/sample06.html +86 -40
  8. data/examples/api-samples/public/docs/sample07.html +32 -13
  9. data/examples/api-samples/public/docs/sample08.html +39 -20
  10. data/examples/api-samples/public/docs/sample09.html +93 -39
  11. data/examples/api-samples/public/docs/sample10.html +39 -21
  12. data/examples/api-samples/public/docs/sample11.html +133 -88
  13. data/examples/api-samples/public/docs/sample12.html +33 -14
  14. data/examples/api-samples/public/docs/sample13.html +14 -7
  15. data/examples/api-samples/public/docs/sample14.html +37 -18
  16. data/examples/api-samples/public/docs/sample15.html +29 -10
  17. data/examples/api-samples/public/docs/sample16.html +58 -25
  18. data/examples/api-samples/public/docs/sample17.html +71 -38
  19. data/examples/api-samples/public/docs/sample18.html +98 -71
  20. data/examples/api-samples/public/docs/sample19.html +74 -42
  21. data/examples/api-samples/public/docs/sample20.html +39 -21
  22. data/examples/api-samples/public/docs/sample21.html +113 -69
  23. data/examples/api-samples/public/docs/sample22.html +89 -43
  24. data/examples/api-samples/public/docs/sample23.html +50 -32
  25. data/examples/api-samples/public/docs/sample24.html +64 -31
  26. data/examples/api-samples/public/docs/sample25.html +107 -60
  27. data/examples/api-samples/public/docs/sample26.html +29 -10
  28. data/examples/api-samples/public/docs/sample27.html +107 -61
  29. data/examples/api-samples/public/docs/sample28.html +158 -9
  30. data/examples/api-samples/public/docs/sample29.html +13 -8
  31. data/examples/api-samples/public/docs/sample30.html +34 -15
  32. data/examples/api-samples/public/docs/sample31.html +107 -76
  33. data/examples/api-samples/public/docs/sample32.html +104 -40
  34. data/examples/api-samples/public/docs/sample33.html +85 -36
  35. data/examples/api-samples/public/docs/sample34.html +30 -11
  36. data/examples/api-samples/public/docs/sample35.html +90 -27
  37. data/examples/api-samples/public/docs/sample36.html +36 -16
  38. data/examples/api-samples/public/docs/sample37.html +144 -265
  39. data/examples/api-samples/public/docs/sample38.html +113 -64
  40. data/examples/api-samples/public/docs/sample39.html +118 -45
  41. data/examples/api-samples/public/docs/sample40.html +81 -46
  42. data/examples/api-samples/public/docs/sample41.html +562 -90
  43. data/examples/api-samples/public/docs/sample42.html +94 -39
  44. data/examples/api-samples/public/docs/sample43.html +669 -0
  45. data/examples/api-samples/samples/sample01.rb +17 -10
  46. data/examples/api-samples/samples/sample02.rb +21 -12
  47. data/examples/api-samples/samples/sample03.rb +35 -29
  48. data/examples/api-samples/samples/sample04.rb +19 -12
  49. data/examples/api-samples/samples/sample05.rb +24 -17
  50. data/examples/api-samples/samples/sample06.rb +38 -32
  51. data/examples/api-samples/samples/sample07.rb +19 -12
  52. data/examples/api-samples/samples/sample08.rb +22 -15
  53. data/examples/api-samples/samples/sample09.rb +31 -29
  54. data/examples/api-samples/samples/sample10.rb +22 -15
  55. data/examples/api-samples/samples/sample11.rb +78 -81
  56. data/examples/api-samples/samples/sample12.rb +19 -21
  57. data/examples/api-samples/samples/sample13.rb +19 -21
  58. data/examples/api-samples/samples/sample14.rb +18 -12
  59. data/examples/api-samples/samples/sample15.rb +17 -10
  60. data/examples/api-samples/samples/sample16.rb +25 -17
  61. data/examples/api-samples/samples/sample17.rb +31 -23
  62. data/examples/api-samples/samples/sample18.rb +60 -55
  63. data/examples/api-samples/samples/sample19.rb +48 -42
  64. data/examples/api-samples/samples/sample20.rb +20 -13
  65. data/examples/api-samples/samples/sample21.rb +62 -54
  66. data/examples/api-samples/samples/sample22.rb +37 -31
  67. data/examples/api-samples/samples/sample23.rb +24 -17
  68. data/examples/api-samples/samples/sample24.rb +29 -22
  69. data/examples/api-samples/samples/sample25.rb +47 -40
  70. data/examples/api-samples/samples/sample26.rb +16 -9
  71. data/examples/api-samples/samples/sample27.rb +46 -39
  72. data/examples/api-samples/samples/sample28.rb +42 -11
  73. data/examples/api-samples/samples/sample29.rb +13 -8
  74. data/examples/api-samples/samples/sample30.rb +19 -12
  75. data/examples/api-samples/samples/sample31.rb +63 -58
  76. data/examples/api-samples/samples/sample32.rb +45 -42
  77. data/examples/api-samples/samples/sample33.rb +36 -25
  78. data/examples/api-samples/samples/sample34.rb +16 -9
  79. data/examples/api-samples/samples/sample35.rb +66 -53
  80. data/examples/api-samples/samples/sample36.rb +19 -15
  81. data/examples/api-samples/samples/sample37.rb +61 -99
  82. data/examples/api-samples/samples/sample38.rb +51 -43
  83. data/examples/api-samples/samples/sample39.rb +78 -62
  84. data/examples/api-samples/samples/sample40.rb +48 -38
  85. data/examples/api-samples/samples/sample41.rb +189 -67
  86. data/examples/api-samples/samples/sample42.rb +37 -29
  87. data/examples/api-samples/samples/sample43.rb +127 -0
  88. data/examples/api-samples/views/_others_samples.haml +4 -2
  89. data/examples/api-samples/views/index.haml +4 -2
  90. data/examples/api-samples/views/sample11.haml +1 -1
  91. data/examples/api-samples/views/sample28.haml +8 -0
  92. data/examples/api-samples/views/sample31.haml +1 -6
  93. data/examples/api-samples/views/sample39.haml +7 -2
  94. data/examples/api-samples/views/sample41.haml +78 -33
  95. data/examples/api-samples/views/sample42.haml +0 -1
  96. data/examples/api-samples/views/sample43.haml +91 -0
  97. data/lib/groupdocs/api/helpers/access_rights_helper.rb +6 -5
  98. data/lib/groupdocs/api/helpers/url_helper.rb +2 -1
  99. data/lib/groupdocs/document.rb +3 -3
  100. data/lib/groupdocs/version.rb +1 -1
  101. metadata +5 -2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## v1.5.9
2
+
3
+ **Changes**
4
+
5
+ * `Api::Helpers::URL#sign_url` changes an initialize library OpenSSL
6
+ * `Api::Helpers::AccessRights` changes an array ACCESS_RIGHTS
7
+ * `Document#changes` updates in request path
8
+
9
+
1
10
  ## v1.5.8
2
11
 
3
12
  **Changes**
@@ -67,9 +67,7 @@
67
67
  set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
68
68
  set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
69
69
 
70
- <span class="keyword">begin</span>
71
-
72
- <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>
70
+ <span class="keyword">begin</span></pre></div></div>
73
71
 
74
72
  </li>
75
73
 
@@ -80,6 +78,27 @@
80
78
  <div class="pilwrap ">
81
79
  <a class="pilcrow" href="#section-4">&#182;</a>
82
80
  </div>
81
+ <p>Prepare base path</p>
82
+
83
+ </div>
84
+
85
+ <div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
86
+ base_path = <span class="string">'https://api.groupdocs.com'</span>
87
+ <span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
88
+ base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
89
+ <span class="keyword">else</span>
90
+ base_path = settings.base_path
91
+ <span class="keyword">end</span></pre></div></div>
92
+
93
+ </li>
94
+
95
+
96
+ <li id="section-5">
97
+ <div class="annotation">
98
+
99
+ <div class="pilwrap ">
100
+ <a class="pilcrow" href="#section-5">&#182;</a>
101
+ </div>
83
102
  <p>Configure your access to API server</p>
84
103
 
85
104
  </div>
@@ -91,29 +110,29 @@
91
110
  </li>
92
111
 
93
112
 
94
- <li id="section-5">
113
+ <li id="section-6">
95
114
  <div class="annotation">
96
115
 
97
116
  <div class="pilwrap ">
98
- <a class="pilcrow" href="#section-5">&#182;</a>
117
+ <a class="pilcrow" href="#section-6">&#182;</a>
99
118
  </div>
100
119
  <p>Optionally specify API server and version</p>
101
120
 
102
121
  </div>
103
122
 
104
- <div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
123
+ <div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
105
124
  <span class="keyword">end</span></pre></div></div>
106
125
 
107
126
  </li>
108
127
 
109
128
 
110
- <li id="section-6">
129
+ <li id="section-7">
111
130
  <div class="annotation">
112
131
 
113
132
  <div class="pilwrap ">
114
- <a class="pilcrow" href="#section-6">&#182;</a>
133
+ <a class="pilcrow" href="#section-7">&#182;</a>
115
134
  </div>
116
- <p>check required variables</p>
135
+ <p>Check required variables</p>
117
136
 
118
137
  </div>
119
138
 
@@ -122,13 +141,13 @@
122
141
  </li>
123
142
 
124
143
 
125
- <li id="section-7">
144
+ <li id="section-8">
126
145
  <div class="annotation">
127
146
 
128
147
  <div class="pilwrap ">
129
- <a class="pilcrow" href="#section-7">&#182;</a>
148
+ <a class="pilcrow" href="#section-8">&#182;</a>
130
149
  </div>
131
- <p>make a request to API using client_id and private_key</p>
150
+ <p>Make a request to API using client_id and private_key</p>
132
151
 
133
152
  </div>
134
153
 
@@ -141,13 +160,13 @@
141
160
  </li>
142
161
 
143
162
 
144
- <li id="section-8">
163
+ <li id="section-9">
145
164
  <div class="annotation">
146
165
 
147
166
  <div class="pilwrap ">
148
- <a class="pilcrow" href="#section-8">&#182;</a>
167
+ <a class="pilcrow" href="#section-9">&#182;</a>
149
168
  </div>
150
- <p>set variables for template</p>
169
+ <p>Set variables for template</p>
151
170
 
152
171
  </div>
153
172
 
@@ -67,9 +67,7 @@
67
67
  set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
68
68
  set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
69
69
 
70
- <span class="keyword">begin</span>
71
-
72
- <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>
70
+ <span class="keyword">begin</span></pre></div></div>
73
71
 
74
72
  </li>
75
73
 
@@ -80,6 +78,27 @@
80
78
  <div class="pilwrap ">
81
79
  <a class="pilcrow" href="#section-4">&#182;</a>
82
80
  </div>
81
+ <p>Prepare base path</p>
82
+
83
+ </div>
84
+
85
+ <div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
86
+ base_path = <span class="string">'https://api.groupdocs.com'</span>
87
+ <span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
88
+ base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
89
+ <span class="keyword">else</span>
90
+ base_path = settings.base_path
91
+ <span class="keyword">end</span></pre></div></div>
92
+
93
+ </li>
94
+
95
+
96
+ <li id="section-5">
97
+ <div class="annotation">
98
+
99
+ <div class="pilwrap ">
100
+ <a class="pilcrow" href="#section-5">&#182;</a>
101
+ </div>
83
102
  <p>Configure your access to API server</p>
84
103
 
85
104
  </div>
@@ -91,27 +110,27 @@
91
110
  </li>
92
111
 
93
112
 
94
- <li id="section-5">
113
+ <li id="section-6">
95
114
  <div class="annotation">
96
115
 
97
116
  <div class="pilwrap ">
98
- <a class="pilcrow" href="#section-5">&#182;</a>
117
+ <a class="pilcrow" href="#section-6">&#182;</a>
99
118
  </div>
100
119
  <p>Optionally specify API server and version</p>
101
120
 
102
121
  </div>
103
122
 
104
- <div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
123
+ <div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
105
124
  <span class="keyword">end</span></pre></div></div>
106
125
 
107
126
  </li>
108
127
 
109
128
 
110
- <li id="section-6">
129
+ <li id="section-7">
111
130
  <div class="annotation">
112
131
 
113
132
  <div class="pilwrap ">
114
- <a class="pilcrow" href="#section-6">&#182;</a>
133
+ <a class="pilcrow" href="#section-7">&#182;</a>
115
134
  </div>
116
135
  <p>Check required variables</p>
117
136
 
@@ -122,11 +141,11 @@
122
141
  </li>
123
142
 
124
143
 
125
- <li id="section-7">
144
+ <li id="section-8">
126
145
  <div class="annotation">
127
146
 
128
147
  <div class="pilwrap ">
129
- <a class="pilcrow" href="#section-7">&#182;</a>
148
+ <a class="pilcrow" href="#section-8">&#182;</a>
130
149
  </div>
131
150
  <p>Make a request to API using client_id and private_key</p>
132
151
 
@@ -137,18 +156,20 @@
137
156
  </li>
138
157
 
139
158
 
140
- <li id="section-8">
159
+ <li id="section-9">
141
160
  <div class="annotation">
142
161
 
143
162
  <div class="pilwrap ">
144
- <a class="pilcrow" href="#section-8">&#182;</a>
163
+ <a class="pilcrow" href="#section-9">&#182;</a>
145
164
  </div>
146
165
  <p>Construct list of files</p>
147
166
 
148
167
  </div>
149
168
 
150
169
  <div class="content"><div class='highlight'><pre> filelist = <span class="string">''</span>
151
- files_list.each { |element| filelist &lt;&lt; <span class="string">"<span class="subst">#{element.name}</span>&lt;br /&gt;"</span> }
170
+ files_list.each <span class="keyword">do</span> |element|
171
+ <span class="keyword">if</span> element.<span class="keyword">class</span>.name.split(<span class="string">'::'</span>).last == <span class="string">'File'</span> <span class="keyword">then</span> filelist &lt;&lt; <span class="string">"<span class="subst">#{element.name}</span>&lt;br /&gt;"</span> <span class="keyword">end</span>
172
+ <span class="keyword">end</span>
152
173
 
153
174
  <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e
154
175
  err = e.message
@@ -157,11 +178,11 @@
157
178
  </li>
158
179
 
159
180
 
160
- <li id="section-9">
181
+ <li id="section-10">
161
182
  <div class="annotation">
162
183
 
163
184
  <div class="pilwrap ">
164
- <a class="pilcrow" href="#section-9">&#182;</a>
185
+ <a class="pilcrow" href="#section-10">&#182;</a>
165
186
  </div>
166
187
  <p>Set variables for template</p>
167
188
 
@@ -33,7 +33,10 @@
33
33
 
34
34
  <div class="content"><div class='highlight'><pre>get <span class="string">'/sample03'</span> <span class="keyword">do</span>
35
35
  haml <span class="symbol">:sample03</span>
36
- <span class="keyword">end</span></pre></div></div>
36
+ <span class="keyword">end</span>
37
+
38
+ <span class="constant">POST</span> request
39
+ post <span class="string">'/sample03'</span> <span class="keyword">do</span></pre></div></div>
37
40
 
38
41
  </li>
39
42
 
@@ -44,11 +47,19 @@
44
47
  <div class="pilwrap ">
45
48
  <a class="pilcrow" href="#section-2">&#182;</a>
46
49
  </div>
47
- <p>POST request</p>
50
+ <p>Set variables</p>
48
51
 
49
52
  </div>
50
53
 
51
- <div class="content"><div class='highlight'><pre>post <span class="string">'/sample03'</span> <span class="keyword">do</span></pre></div></div>
54
+ <div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
55
+ set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
56
+ set <span class="symbol">:source</span>, params[<span class="symbol">:source</span>]
57
+ set <span class="symbol">:url</span>, params[<span class="symbol">:url</span>]
58
+ set <span class="symbol">:folder_path</span>, params[<span class="symbol">:folderPath</span>]
59
+ set <span class="symbol">:callback</span>, params[<span class="symbol">:callback</span>]
60
+ set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
61
+
62
+ <span class="keyword">begin</span></pre></div></div>
52
63
 
53
64
  </li>
54
65
 
@@ -59,19 +70,11 @@
59
70
  <div class="pilwrap ">
60
71
  <a class="pilcrow" href="#section-3">&#182;</a>
61
72
  </div>
62
- <p>Set variables</p>
73
+ <p>Check required variables</p>
63
74
 
64
75
  </div>
65
76
 
66
- <div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>]
67
- set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>]
68
- set <span class="symbol">:source</span>, params[<span class="symbol">:source</span>]
69
- set <span class="symbol">:url</span>, params[<span class="symbol">:url</span>]
70
- set <span class="symbol">:folder_path</span>, params[<span class="symbol">:folderPath</span>]
71
- set <span class="symbol">:callback</span>, params[<span class="symbol">:callback</span>]
72
- set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>]
73
-
74
- <span class="keyword">begin</span></pre></div></div>
77
+ <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty?</pre></div></div>
75
78
 
76
79
  </li>
77
80
 
@@ -82,13 +85,17 @@
82
85
  <div class="pilwrap ">
83
86
  <a class="pilcrow" href="#section-4">&#182;</a>
84
87
  </div>
85
- <p>Check required variables</p>
88
+ <p>Prepare base path</p>
86
89
 
87
90
  </div>
88
91
 
89
- <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?
90
-
91
- <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>
92
+ <div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
93
+ base_path = <span class="string">'https://api.groupdocs.com'</span>
94
+ <span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
95
+ base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
96
+ <span class="keyword">else</span>
97
+ base_path = settings.base_path
98
+ <span class="keyword">end</span></pre></div></div>
92
99
 
93
100
  </li>
94
101
 
@@ -120,7 +127,7 @@
120
127
 
121
128
  </div>
122
129
 
123
- <div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
130
+ <div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
124
131
  <span class="keyword">end</span></pre></div></div>
125
132
 
126
133
  </li>
@@ -213,19 +220,11 @@
213
220
  <div class="pilwrap ">
214
221
  <a class="pilcrow" href="#section-12">&#182;</a>
215
222
  </div>
216
- <p>Get url from request</p>
223
+ <p>Prepare to sign url</p>
217
224
 
218
225
  </div>
219
226
 
220
- <div class="content"><div class='highlight'><pre> <span class="keyword">case</span> settings.base_path
221
-
222
- <span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
223
- url = <span class="string">"http://stage-apps-groupdocs.dynabic.com/document-viewer/embed/<span class="subst">#{file.guid}</span>"</span>
224
- <span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
225
- url = <span class="string">"http://dev-apps-groupdocs.dynabic.com/document-viewer/embed/<span class="subst">#{file.guid}</span>"</span>
226
- <span class="keyword">else</span>
227
- url = <span class="string">"https://apps.groupdocs.com/document-viewer/embed/<span class="subst">#{file.guid}</span>"</span>
228
- <span class="keyword">end</span></pre></div></div>
227
+ <div class="content"><div class='highlight'><pre> iframe = <span class="string">"/document-viewer/embed/<span class="subst">#{file.guid}</span>"</span></pre></div></div>
229
228
 
230
229
  </li>
231
230
 
@@ -236,11 +235,11 @@
236
235
  <div class="pilwrap ">
237
236
  <a class="pilcrow" href="#section-13">&#182;</a>
238
237
  </div>
239
- <p>Add the signature in url</p>
238
+ <p>Construct result string</p>
240
239
 
241
240
  </div>
242
241
 
243
- <div class="content"><div class='highlight'><pre> url = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> =&gt; url).prepare_and_sign_url</pre></div></div>
242
+ <div class="content"><div class='highlight'><pre> url = <span class="constant">GroupDocs::Api::Request</span>.new(<span class="symbol">:path</span> =&gt; iframe).prepare_and_sign_url</pre></div></div>
244
243
 
245
244
  </li>
246
245
 
@@ -251,11 +250,33 @@
251
250
  <div class="pilwrap ">
252
251
  <a class="pilcrow" href="#section-14">&#182;</a>
253
252
  </div>
253
+ <p>Generate iframe URL</p>
254
+
255
+ </div>
256
+
257
+ <div class="content"><div class='highlight'><pre> <span class="keyword">case</span> base_path
258
+ <span class="keyword">when</span> <span class="string">'https://stage-api-groupdocs.dynabic.com'</span>
259
+ iframe = <span class="string">"https://stage-api-groupdocs.dynabic.com<span class="subst">#{url}</span>"</span>
260
+ <span class="keyword">when</span> <span class="string">'https://dev-api-groupdocs.dynabic.com'</span>
261
+ iframe = <span class="string">"https://dev-apps.groupdocs.com<span class="subst">#{url}</span>"</span>
262
+ <span class="keyword">else</span>
263
+ iframe = <span class="string">"https://apps.groupdocs.com<span class="subst">#{url}</span>"</span>
264
+ <span class="keyword">end</span></pre></div></div>
265
+
266
+ </li>
267
+
268
+
269
+ <li id="section-15">
270
+ <div class="annotation">
271
+
272
+ <div class="pilwrap ">
273
+ <a class="pilcrow" href="#section-15">&#182;</a>
274
+ </div>
254
275
  <p>Set iframe with document GUID</p>
255
276
 
256
277
  </div>
257
278
 
258
- <div class="content"><div class='highlight'><pre> iframe = <span class="string">"&lt;iframe src='<span class="subst">#{url}</span>' frameborder='0' width='720' height='600'&gt;&lt;/iframe&gt;"</span>
279
+ <div class="content"><div class='highlight'><pre> iframe = <span class="string">"&lt;iframe src='<span class="subst">#{iframe}</span>' frameborder='0' width='720' height='600'&gt;&lt;/iframe&gt;"</span>
259
280
 
260
281
  <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e
261
282
  err = e.message
@@ -264,13 +285,13 @@
264
285
  </li>
265
286
 
266
287
 
267
- <li id="section-15">
288
+ <li id="section-16">
268
289
  <div class="annotation">
269
290
 
270
291
  <div class="pilwrap ">
271
- <a class="pilcrow" href="#section-15">&#182;</a>
292
+ <a class="pilcrow" href="#section-16">&#182;</a>
272
293
  </div>
273
- <p>set variables for template</p>
294
+ <p>Set variables for template</p>
274
295
 
275
296
  </div>
276
297
 
@@ -84,9 +84,7 @@
84
84
 
85
85
  </div>
86
86
 
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?
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
+ <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>
90
88
 
91
89
  </li>
92
90
 
@@ -97,6 +95,27 @@
97
95
  <div class="pilwrap ">
98
96
  <a class="pilcrow" href="#section-5">&#182;</a>
99
97
  </div>
98
+ <p>Prepare base path</p>
99
+
100
+ </div>
101
+
102
+ <div class="content"><div class='highlight'><pre> <span class="keyword">if</span> settings.base_path.empty?
103
+ base_path = <span class="string">'https://api.groupdocs.com'</span>
104
+ <span class="keyword">elsif</span> settings.base_path.match(<span class="string">'/v2.0'</span>)
105
+ base_path = settings.base_path.split(<span class="string">'/v2.0'</span>)[<span class="number">0</span>]
106
+ <span class="keyword">else</span>
107
+ base_path = settings.base_path
108
+ <span class="keyword">end</span></pre></div></div>
109
+
110
+ </li>
111
+
112
+
113
+ <li id="section-6">
114
+ <div class="annotation">
115
+
116
+ <div class="pilwrap ">
117
+ <a class="pilcrow" href="#section-6">&#182;</a>
118
+ </div>
100
119
  <p>Configure your access to API server</p>
101
120
 
102
121
  </div>
@@ -108,27 +127,27 @@
108
127
  </li>
109
128
 
110
129
 
111
- <li id="section-6">
130
+ <li id="section-7">
112
131
  <div class="annotation">
113
132
 
114
133
  <div class="pilwrap ">
115
- <a class="pilcrow" href="#section-6">&#182;</a>
134
+ <a class="pilcrow" href="#section-7">&#182;</a>
116
135
  </div>
117
136
  <p>Optionally specify API server and version</p>
118
137
 
119
138
  </div>
120
139
 
121
- <div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
140
+ <div class="content"><div class='highlight'><pre> groupdocs.api_server = base_path <span class="comment"># default is 'https://api.groupdocs.com'</span>
122
141
  <span class="keyword">end</span></pre></div></div>
123
142
 
124
143
  </li>
125
144
 
126
145
 
127
- <li id="section-7">
146
+ <li id="section-8">
128
147
  <div class="annotation">
129
148
 
130
149
  <div class="pilwrap ">
131
- <a class="pilcrow" href="#section-7">&#182;</a>
150
+ <a class="pilcrow" href="#section-8">&#182;</a>
132
151
  </div>
133
152
  <p>Get file GUID</p>
134
153
 
@@ -139,11 +158,11 @@
139
158
  </li>
140
159
 
141
160
 
142
- <li id="section-8">
161
+ <li id="section-9">
143
162
  <div class="annotation">
144
163
 
145
164
  <div class="pilwrap ">
146
- <a class="pilcrow" href="#section-8">&#182;</a>
165
+ <a class="pilcrow" href="#section-9">&#182;</a>
147
166
  </div>
148
167
  <p>Obtaining all Metadata for file</p>
149
168
 
@@ -155,11 +174,11 @@
155
174
  </li>
156
175
 
157
176
 
158
- <li id="section-9">
177
+ <li id="section-10">
159
178
  <div class="annotation">
160
179
 
161
180
  <div class="pilwrap ">
162
- <a class="pilcrow" href="#section-9">&#182;</a>
181
+ <a class="pilcrow" href="#section-10">&#182;</a>
163
182
  </div>
164
183
  <p>Download file</p>
165
184
 
@@ -177,11 +196,11 @@
177
196
  </li>
178
197
 
179
198
 
180
- <li id="section-10">
199
+ <li id="section-11">
181
200
  <div class="annotation">
182
201
 
183
202
  <div class="pilwrap ">
184
- <a class="pilcrow" href="#section-10">&#182;</a>
203
+ <a class="pilcrow" href="#section-11">&#182;</a>
185
204
  </div>
186
205
  <p>Set variables for template</p>
187
206