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 … <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">¶</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">'/sample20'</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">¶</a> </div> <p>POST request</p> </td> <td class="code"> <div class="highlight"><pre>
-<span class="n">post</span> <span class="s1">'/sample20'</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">¶</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">¶</a> </div> <p>check required variables</p> </td> <td class="code"> <div class="highlight"><pre>
- <span class="k">raise</span> <span class="s1">'Please enter all required parameters'</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">¶</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">¶</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">¶</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">=></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">=></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">''</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<table class='border'>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td><font color='green'>Change Name</font></td><td><font color='green'>Change</font></td></tr>"</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">"<tr><td>id</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td>type</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td>text</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td>page id</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td>page weight</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td>page height</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td>box x</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td>box y</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td>box weight</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr><td>box height</td><td></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"></td></tr>"</span>
- <span class="n">result</span> <span class="o">+=</span> <span class="s2">"<tr bgcolor='#808080'><td></td><td></td></tr>"</span>
- <span class="k">end</span>
-
- <span class="n">result</span> <span class="o">+=</span> <span class="s1">'</table>'</span>
-
- <span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=></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">¶</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">=></span> <span class="p">{</span><span class="ss">:userId</span> <span class="o">=></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">=></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">=></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">=></span> <span class="n">result</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></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">¶</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">¶</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">¶</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">¶</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">¶</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">¶</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">¶</a>
+ </div>
+ <p>get compare changes</p>
+
+ </div>
+
+ <div class="content"><div class='highlight'><pre> changes = document.changes!({<span class="symbol">:client_id</span> => settings.client_id, <span class="symbol">:private_key</span> => settings.private_key})
+
+ result = <span class="string">''</span>
+ result += <span class="string">"<table class='border'>"</span>
+ result += <span class="string">"<tr><td><font color='green'>Change Name</font></td><td><font color='green'>Change</font></td></tr>"</span>
+ changes.each <span class="keyword">do</span> |change|
+ result += <span class="string">"<tr><td>id</td><td><span class="subst">#{change.id}</span></td></tr>"</span>
+ result += <span class="string">"<tr><td>type</td><td><span class="subst">#{change.type}</span></td></tr>"</span>
+ result += <span class="string">"<tr><td>text</td><td><span class="subst">#{change.text}</span></td></tr>"</span>
+ result += <span class="string">"<tr><td>page id</td><td><span class="subst">#{change.page[<span class="symbol">:Id</span>]}</span></td></tr>"</span>
+ result += <span class="string">"<tr><td>page weight</td><td><span class="subst">#{change.page[<span class="symbol">:Width</span>]}</span></td></tr>"</span>
+ result += <span class="string">"<tr><td>page height</td><td><span class="subst">#{change.page[<span class="symbol">:Height</span>]}</span></td></tr>"</span>
+ result += <span class="string">"<tr><td>box x</td><td><span class="subst">#{change.box.x}</span></td></tr>"</span>
+ result += <span class="string">"<tr><td>box y</td><td><span class="subst">#{change.box.y}</span></td></tr>"</span>
+ result += <span class="string">"<tr><td>box weight</td><td><span class="subst">#{change.box.width}</span></td></tr>"</span>
+ result += <span class="string">"<tr><td>box height</td><td><span class="subst">#{change.box.height}</span></td></tr>"</span>
+ result += <span class="string">"<tr bgcolor='#808080'><td></td><td></td></tr>"</span>
+ <span class="keyword">end</span>
+
+ result += <span class="string">'</table>'</span>
+
+ <span class="keyword">rescue</span> <span class="constant">Exception</span> => 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">¶</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> => {<span class="symbol">:userId</span> => settings.client_id, <span class="symbol">:privateKey</span> => settings.private_key, <span class="symbol">:resultFileId</span> => settings.resultFileId, <span class="symbol">:result</span> => result, <span class="symbol">:err</span> => err}
+<span class="keyword">end</span></pre></div></div>
+
+ </li>
+
+ </ul>
+ </div>
+</body>
+</html>