examples/api-samples/public/docs/sample20.html in groupdocs-1.5.3 vs examples/api-samples/public/docs/sample20.html in groupdocs-1.5.4

- old
+ new

@@ -1,51 +1,176 @@ -<!DOCTYPE html> <html> <head> <title>sample20.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample20.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample20&#39;</span> <span class="k">do</span> - <span class="n">haml</span> <span class="ss">:sample20</span> -<span class="k">end</span> - - </pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>POST request</p> </td> <td class="code"> <div class="highlight"><pre> -<span class="n">post</span> <span class="s1">&#39;/sample20&#39;</span> <span class="k">do</span> - </pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>set variables</p> </td> <td class="code"> <div class="highlight"><pre> - <span class="n">set</span> <span class="ss">:client_id</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:client_id</span><span class="o">]</span> - <span class="n">set</span> <span class="ss">:private_key</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:private_key</span><span class="o">]</span> - <span class="n">set</span> <span class="ss">:resultFileId</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:resultFileId</span><span class="o">]</span> - - <span class="k">begin</span> - - </pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>check required variables</p> </td> <td class="code"> <div class="highlight"><pre> - <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">resultFileId</span><span class="o">.</span><span class="n">empty?</span> - - </pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>construct new storage file</p> </td> <td class="code"> <div class="highlight"><pre> - <span class="n">file</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Storage</span><span class="o">::</span><span class="no">File</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">guid</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">resultFileId</span><span class="p">)</span> - </pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>construct new document</p> </td> <td class="code"> <div class="highlight"><pre> - <span class="n">document</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Document</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="ss">file</span><span class="p">:</span> <span class="n">file</span><span class="p">)</span> - </pre></div> </td> </tr> <tr id="section-7"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-7">&#182;</a> </div> <p>get compare changes</p> </td> <td class="code"> <div class="highlight"><pre> - <span class="n">changes</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">changes!</span><span class="p">({</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span> - - <span class="n">result</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;table class=&#39;border&#39;&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;&lt;font color=&#39;green&#39;&gt;Change Name&lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font color=&#39;green&#39;&gt;Change&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">changes</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">change</span><span class="o">|</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;id&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;type&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">type</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;text&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">text</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;page id&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">page</span><span class="o">[</span><span class="ss">:Id</span><span class="o">]</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;page weight&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">page</span><span class="o">[</span><span class="ss">:Width</span><span class="o">]</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;page height&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">page</span><span class="o">[</span><span class="ss">:Height</span><span class="o">]</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;box x&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">x</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;box y&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">y</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;box weight&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">width</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr&gt;&lt;td&gt;box height&lt;/td&gt;&lt;td&gt;</span><span class="si">#{</span><span class="n">change</span><span class="o">.</span><span class="n">box</span><span class="o">.</span><span class="n">height</span><span class="si">}</span><span class="s2">&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="n">result</span> <span class="o">+=</span> <span class="s2">&quot;&lt;tr bgcolor=&#39;#808080&#39;&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&quot;</span> - <span class="k">end</span> - - <span class="n">result</span> <span class="o">+=</span> <span class="s1">&#39;&lt;/table&gt;&#39;</span> - - <span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=&gt;</span> <span class="n">e</span> - <span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span> - <span class="k">end</span> - - </pre></div> </td> </tr> <tr id="section-8"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-8">&#182;</a> </div> <p>set variables for template</p> </td> <td class="code"> <div class="highlight"><pre> - <span class="n">haml</span> <span class="ss">:sample20</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:userId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:resultFileId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">resultFileId</span><span class="p">,</span> <span class="ss">:result</span> <span class="o">=&gt;</span> <span class="n">result</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">}</span> -<span class="k">end</span> - -</pre></div> </td> </tr> </tbody> </table> </div> </body> </html> \ No newline at end of file +<!DOCTYPE html> + +<html> +<head> + <title>sample20.rb</title> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"> + <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> + <link rel="stylesheet" media="all" href="docco.css" /> +</head> +<body> + <div id="container"> + <div id="background"></div> + + <ul class="sections"> + + <li id="title"> + <div class="annotation"> + <h1>sample20.rb</h1> + </div> + </li> + + + + <li id="section-1"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-1">&#182;</a> + </div> + <p>GET request</p> + + </div> + + <div class="content"><div class='highlight'><pre>get <span class="string">'/sample20'</span> <span class="keyword">do</span> + haml <span class="symbol">:sample20</span> +<span class="keyword">end</span></pre></div></div> + + </li> + + + <li id="section-2"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-2">&#182;</a> + </div> + <p>POST request</p> + + </div> + + <div class="content"><div class='highlight'><pre>post <span class="string">'/sample20'</span> <span class="keyword">do</span></pre></div></div> + + </li> + + + <li id="section-3"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-3">&#182;</a> + </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>] + set <span class="symbol">:resultFileId</span>, params[<span class="symbol">:resultFileId</span>] + + <span class="keyword">begin</span></pre></div></div> + + </li> + + + <li id="section-4"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-4">&#182;</a> + </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> + + </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> + + </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-6"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-6">&#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-7"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-7">&#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}) + + 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| + result += <span class="string">"&lt;tr&gt;&lt;td&gt;id&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.id}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr&gt;&lt;td&gt;type&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.type}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr&gt;&lt;td&gt;text&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.text}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr&gt;&lt;td&gt;page id&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.page[<span class="symbol">:Id</span>]}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr&gt;&lt;td&gt;page weight&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.page[<span class="symbol">:Width</span>]}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr&gt;&lt;td&gt;page height&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.page[<span class="symbol">:Height</span>]}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr&gt;&lt;td&gt;box x&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.box.x}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr&gt;&lt;td&gt;box y&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.box.y}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr&gt;&lt;td&gt;box weight&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.box.width}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr&gt;&lt;td&gt;box height&lt;/td&gt;&lt;td&gt;<span class="subst">#{change.box.height}</span>&lt;/td&gt;&lt;/tr&gt;"</span> + result += <span class="string">"&lt;tr bgcolor='#808080'&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;"</span> + <span class="keyword">end</span> + + result += <span class="string">'&lt;/table&gt;'</span> + + <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e + err = e.message + <span class="keyword">end</span></pre></div></div> + + </li> + + + <li id="section-8"> + <div class="annotation"> + + <div class="pilwrap "> + <a class="pilcrow" href="#section-8">&#182;</a> + </div> + <p>set variables for template</p> + + </div> + + <div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample20</span>, <span class="symbol">:locals</span> =&gt; {<span class="symbol">:userId</span> =&gt; settings.client_id, <span class="symbol">:privateKey</span> =&gt; settings.private_key, <span class="symbol">:resultFileId</span> =&gt; settings.resultFileId, <span class="symbol">:result</span> =&gt; result, <span class="symbol">:err</span> =&gt; err} +<span class="keyword">end</span></pre></div></div> + + </li> + + </ul> + </div> +</body> +</html>