examples/api-samples/public/docs/sample20.html in groupdocs-1.5.7 vs examples/api-samples/public/docs/sample20.html in groupdocs-1.5.8

- old
+ new

@@ -61,13 +61,14 @@ </div> <p>set variables</p> </div> - <div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:client_id</span>] - set <span class="symbol">:private_key</span>, params[<span class="symbol">:private_key</span>] + <div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:clientId</span>] + set <span class="symbol">:private_key</span>, params[<span class="symbol">:privateKey</span>] set <span class="symbol">:resultFileId</span>, params[<span class="symbol">:resultFileId</span>] + set <span class="symbol">:base_path</span>, params[<span class="symbol">:basePath</span>] <span class="keyword">begin</span></pre></div></div> </li> @@ -80,56 +81,91 @@ </div> <p>check required variables</p> </div> - <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.resultFileId.empty?</pre></div></div> + <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.resultFileId.empty? + + <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> </li> <li id="section-5"> <div class="annotation"> <div class="pilwrap "> <a class="pilcrow" href="#section-5">&#182;</a> </div> - <p>construct new storage file</p> + <p>Configure your access to API server</p> </div> - <div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.new(<span class="symbol">guid:</span> settings.resultFileId)</pre></div></div> + <div class="content"><div class='highlight'><pre> <span class="constant">GroupDocs</span>.configure <span class="keyword">do</span> |groupdocs| + groupdocs.client_id = settings.client_id + groupdocs.private_key = settings.private_key</pre></div></div> </li> <li id="section-6"> <div class="annotation"> <div class="pilwrap "> <a class="pilcrow" href="#section-6">&#182;</a> </div> - <p>construct new document</p> + <p>Optionally specify API server and version</p> </div> - <div class="content"><div class='highlight'><pre> document = <span class="constant">GroupDocs::Document</span>.new(<span class="symbol">file:</span> file)</pre></div></div> + <div class="content"><div class='highlight'><pre> groupdocs.api_server = settings.base_path <span class="comment"># default is 'https://api.groupdocs.com'</span> + <span class="keyword">end</span></pre></div></div> </li> <li id="section-7"> <div class="annotation"> <div class="pilwrap "> <a class="pilcrow" href="#section-7">&#182;</a> </div> + <p>construct new storage file</p> + + </div> + + <div class="content"><div class='highlight'><pre> file = <span class="constant">GroupDocs::Storage::File</span>.new(<span class="symbol">guid:</span> settings.resultFileId)</pre></div></div> + + </li> + + + <li id="section-8"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-8">&#182;</a> + </div> + <p>construct new document</p> + + </div> + + <div class="content"><div class='highlight'><pre> document = <span class="constant">GroupDocs::Document</span>.new(<span class="symbol">file:</span> file)</pre></div></div> + + </li> + + + <li id="section-9"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-9">&#182;</a> + </div> <p>get compare changes</p> </div> - <div class="content"><div class='highlight'><pre> changes = document.changes!({<span class="symbol">:client_id</span> =&gt; settings.client_id, <span class="symbol">:private_key</span> =&gt; settings.private_key}) + <div class="content"><div class='highlight'><pre> changes = document.changes!() result = <span class="string">''</span> result += <span class="string">"&lt;table class='border'&gt;"</span> result += <span class="string">"&lt;tr&gt;&lt;td&gt;&lt;font color='green'&gt;Change Name&lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font color='green'&gt;Change&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;"</span> changes.each <span class="keyword">do</span> |change| @@ -153,14 +189,14 @@ <span class="keyword">end</span></pre></div></div> </li> - <li id="section-8"> + <li id="section-10"> <div class="annotation"> <div class="pilwrap "> - <a class="pilcrow" href="#section-8">&#182;</a> + <a class="pilcrow" href="#section-10">&#182;</a> </div> <p>set variables for template</p> </div>