groupdocs 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +6 -0
- data/examples/api-samples/README.md +1 -1
- data/examples/api-samples/public/css/style.css +2 -2
- data/examples/api-samples/public/docs/annotation-sample.html +57 -0
- data/examples/api-samples/public/docs/envelope-sample.html +32 -32
- data/examples/api-samples/public/docs/sample1.html +3 -3
- data/examples/api-samples/public/docs/sample10.html +25 -24
- data/examples/api-samples/public/docs/sample11.html +17 -17
- data/examples/api-samples/public/docs/sample12.html +4 -4
- data/examples/api-samples/public/docs/sample13.html +5 -5
- data/examples/api-samples/public/docs/sample14.html +5 -5
- data/examples/api-samples/public/docs/sample15.html +4 -4
- data/examples/api-samples/public/docs/sample16.html +3 -3
- data/examples/api-samples/public/docs/sample17.html +3 -3
- data/examples/api-samples/public/docs/sample18.html +129 -34
- data/examples/api-samples/public/docs/sample19.html +59 -0
- data/examples/api-samples/public/docs/sample2.html +5 -5
- data/examples/api-samples/public/docs/sample20.html +51 -0
- data/examples/api-samples/public/docs/sample21.html +66 -0
- data/examples/api-samples/public/docs/sample22.html +53 -0
- data/examples/api-samples/public/docs/sample3.html +4 -4
- data/examples/api-samples/public/docs/sample4.html +27 -16
- data/examples/api-samples/public/docs/sample5.html +29 -22
- data/examples/api-samples/public/docs/sample6.html +6 -6
- data/examples/api-samples/public/docs/sample7.html +8 -8
- data/examples/api-samples/public/docs/sample8.html +31 -23
- data/examples/api-samples/public/docs/sample9.html +26 -8
- data/examples/api-samples/public/templates/merge_feid_doc.docx +0 -0
- data/examples/api-samples/samples/annotation-sample.rb +22 -16
- data/examples/api-samples/samples/envelope-sample.rb +26 -25
- data/examples/api-samples/samples/sample1.rb +2 -2
- data/examples/api-samples/samples/sample10.rb +21 -20
- data/examples/api-samples/samples/sample11.rb +18 -18
- data/examples/api-samples/samples/sample12.rb +3 -3
- data/examples/api-samples/samples/sample13.rb +4 -4
- data/examples/api-samples/samples/sample14.rb +4 -4
- data/examples/api-samples/samples/sample15.rb +3 -3
- data/examples/api-samples/samples/sample16.rb +2 -2
- data/examples/api-samples/samples/sample17.rb +2 -2
- data/examples/api-samples/samples/sample18.rb +90 -106
- data/examples/api-samples/samples/sample19.rb +5 -5
- data/examples/api-samples/samples/sample2.rb +4 -4
- data/examples/api-samples/samples/sample20.rb +4 -4
- data/examples/api-samples/samples/sample21.rb +4 -4
- data/examples/api-samples/samples/sample22.rb +2 -2
- data/examples/api-samples/samples/sample23.rb +0 -0
- data/examples/api-samples/samples/sample24.rb +0 -0
- data/examples/api-samples/samples/sample25.rb +96 -0
- data/examples/api-samples/samples/sample3.rb +3 -3
- data/examples/api-samples/samples/sample4.rb +23 -12
- data/examples/api-samples/samples/sample5.rb +23 -16
- data/examples/api-samples/samples/sample6.rb +8 -8
- data/examples/api-samples/samples/sample7.rb +7 -7
- data/examples/api-samples/samples/sample8.rb +29 -21
- data/examples/api-samples/samples/sample9.rb +23 -5
- data/examples/api-samples/views/_others_samples.haml +57 -0
- data/examples/api-samples/views/annotation_sample.haml +30 -30
- data/examples/api-samples/views/envelope_sample.haml +31 -31
- data/examples/api-samples/views/index.haml +33 -25
- data/examples/api-samples/views/sample1.haml +22 -69
- data/examples/api-samples/views/sample10.haml +57 -73
- data/examples/api-samples/views/sample11.haml +31 -79
- data/examples/api-samples/views/sample12.haml +18 -66
- data/examples/api-samples/views/sample13.haml +21 -70
- data/examples/api-samples/views/sample14.haml +18 -67
- data/examples/api-samples/views/sample15.haml +15 -63
- data/examples/api-samples/views/sample16.haml +13 -61
- data/examples/api-samples/views/sample17.haml +19 -67
- data/examples/api-samples/views/sample18.haml +74 -159
- data/examples/api-samples/views/sample19.haml +25 -74
- data/examples/api-samples/views/sample2.haml +19 -66
- data/examples/api-samples/views/sample20.haml +19 -68
- data/examples/api-samples/views/sample21.haml +28 -76
- data/examples/api-samples/views/sample22.haml +29 -77
- data/examples/api-samples/views/sample23.haml +0 -0
- data/examples/api-samples/views/sample24.haml +0 -0
- data/examples/api-samples/views/sample25.haml +91 -0
- data/examples/api-samples/views/sample3.haml +20 -68
- data/examples/api-samples/views/sample4.haml +53 -68
- data/examples/api-samples/views/sample5.haml +54 -70
- data/examples/api-samples/views/sample6.haml +21 -69
- data/examples/api-samples/views/sample7.haml +19 -66
- data/examples/api-samples/views/sample8.haml +60 -75
- data/examples/api-samples/views/sample9.haml +54 -70
- data/examples/api-samples/web.rb +20 -0
- data/lib/groupdocs/api/request.rb +4 -2
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/api/request_spec.rb +10 -2
- metadata +18 -5
- data/examples/api-samples/app.rb +0 -15
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html> <html> <head> <title>sample21.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> sample21.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">'/sample21'</span> <span class="k">do</span>
|
2
|
+
<span class="n">haml</span> <span class="ss">:sample21</span>
|
3
|
+
<span class="k">end</span>
|
4
|
+
|
5
|
+
|
6
|
+
<span class="n">post</span> <span class="s1">'/sample21'</span> <span class="k">do</span>
|
7
|
+
|
8
|
+
<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>
|
9
|
+
<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>
|
10
|
+
<span class="n">set</span> <span class="ss">:email</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:email</span><span class="o">]</span>
|
11
|
+
<span class="n">set</span> <span class="ss">:name</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:name</span><span class="o">]</span>
|
12
|
+
<span class="n">set</span> <span class="ss">:lastName</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:lastName</span><span class="o">]</span>
|
13
|
+
<span class="n">set</span> <span class="ss">:file</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">]</span>
|
14
|
+
|
15
|
+
<span class="k">begin</span>
|
16
|
+
|
17
|
+
|
18
|
+
<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">email</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">name</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">lastName</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">file</span><span class="o">.</span><span class="n">nil?</span>
|
19
|
+
|
20
|
+
|
21
|
+
<span class="n">filepath</span> <span class="o">=</span> <span class="s2">"</span><span class="si">#{</span><span class="no">Dir</span><span class="o">.</span><span class="n">tmpdir</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span><span class="si">}</span><span class="s2">"</span>
|
22
|
+
|
23
|
+
<span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="s1">'wb'</span><span class="p">)</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:tempfile</span><span class="o">].</span><span class="n">read</span><span class="p">)</span> <span class="p">}</span>
|
24
|
+
|
25
|
+
<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">upload!</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="p">{},</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
|
26
|
+
|
27
|
+
|
28
|
+
<span class="n">envelope</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Signature</span><span class="o">::</span><span class="no">Envelope</span><span class="o">.</span><span class="n">new</span>
|
29
|
+
<span class="n">envelope</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span>
|
30
|
+
<span class="n">envelope</span><span class="o">.</span><span class="n">email_subject</span> <span class="o">=</span> <span class="s1">'Sing this!'</span>
|
31
|
+
<span class="n">envelope</span><span class="o">.</span><span class="n">create!</span><span class="p">({},</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
|
32
|
+
|
33
|
+
|
34
|
+
<span class="n">envelope</span><span class="o">.</span><span class="n">add_document!</span><span class="p">(</span><span class="n">file</span><span class="o">.</span><span class="n">to_document</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span><span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
|
35
|
+
|
36
|
+
|
37
|
+
<span class="n">roles</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Signature</span><span class="o">::</span><span class="no">Role</span><span class="o">.</span><span class="n">get!</span><span class="p">({},</span> <span class="p">{</span><span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
|
38
|
+
|
39
|
+
|
40
|
+
<span class="n">recipient</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Signature</span><span class="o">::</span><span class="no">Recipient</span><span class="o">.</span><span class="n">new</span>
|
41
|
+
<span class="n">recipient</span><span class="o">.</span><span class="n">email</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span>
|
42
|
+
<span class="n">recipient</span><span class="o">.</span><span class="n">first_name</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">name</span>
|
43
|
+
<span class="n">recipient</span><span class="o">.</span><span class="n">last_name</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">lastName</span>
|
44
|
+
<span class="n">recipient</span><span class="o">.</span><span class="n">role_id</span> <span class="o">=</span> <span class="n">roles</span><span class="o">.</span><span class="n">detect</span> <span class="p">{</span> <span class="o">|</span><span class="n">role</span><span class="o">|</span> <span class="n">role</span><span class="o">.</span><span class="n">name</span> <span class="o">==</span> <span class="s1">'Signer'</span> <span class="p">}</span><span class="o">.</span><span class="n">id</span>
|
45
|
+
|
46
|
+
|
47
|
+
<span class="n">add</span> <span class="o">=</span> <span class="n">envelope</span><span class="o">.</span><span class="n">add_recipient!</span><span class="p">(</span><span class="n">recipient</span><span class="p">,</span> <span class="p">{</span><span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
|
48
|
+
|
49
|
+
|
50
|
+
<span class="n">recipient_id</span> <span class="o">=</span> <span class="n">add</span><span class="o">[</span><span class="ss">:recipient</span><span class="o">][</span><span class="ss">:id</span><span class="o">]</span>
|
51
|
+
|
52
|
+
|
53
|
+
<span class="n">envelope</span><span class="o">.</span><span class="n">send!</span><span class="p">(</span><span class="kp">nil</span><span class="p">,</span> <span class="p">{</span><span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
|
54
|
+
|
55
|
+
|
56
|
+
<span class="n">iframe</span> <span class="o">=</span> <span class="s2">"<iframe src='https://apps.groupdocs.com/signature/signembed/</span><span class="si">#{</span><span class="n">envelope</span><span class="o">.</span><span class="n">id</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">recipient_id</span><span class="si">}</span><span class="s2">' frameborder='0' width='720' height='600'></iframe>"</span>
|
57
|
+
|
58
|
+
<span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=></span> <span class="n">e</span>
|
59
|
+
<span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
|
60
|
+
<span class="k">end</span>
|
61
|
+
|
62
|
+
|
63
|
+
<span class="n">haml</span> <span class="ss">:sample21</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">:email</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="p">,</span> <span class="ss">:name</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="ss">:lastName</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">lastName</span><span class="p">,</span> <span class="ss">:iframe</span> <span class="o">=></span> <span class="n">iframe</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span><span class="p">}</span>
|
64
|
+
<span class="k">end</span>
|
65
|
+
|
66
|
+
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!DOCTYPE html> <html> <head> <title>sample22.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> sample22.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">'/sample22'</span> <span class="k">do</span>
|
2
|
+
<span class="n">haml</span> <span class="ss">:sample22</span>
|
3
|
+
<span class="k">end</span>
|
4
|
+
|
5
|
+
|
6
|
+
<span class="n">post</span> <span class="s1">'/sample22'</span> <span class="k">do</span>
|
7
|
+
|
8
|
+
<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>
|
9
|
+
<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>
|
10
|
+
<span class="n">set</span> <span class="ss">:fileId</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:fileId</span><span class="o">]</span>
|
11
|
+
<span class="n">set</span> <span class="ss">:email</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:email</span><span class="o">]</span>
|
12
|
+
<span class="n">set</span> <span class="ss">:first_name</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:first_name</span><span class="o">]</span>
|
13
|
+
<span class="n">set</span> <span class="ss">:last_name</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:last_name</span><span class="o">]</span>
|
14
|
+
|
15
|
+
<span class="k">begin</span>
|
16
|
+
|
17
|
+
|
18
|
+
<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">fileId</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">email</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">first_name</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">last_name</span><span class="o">.</span><span class="n">empty?</span>
|
19
|
+
|
20
|
+
|
21
|
+
<span class="n">user</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:User</span><span class="o">.</span><span class="n">new</span>
|
22
|
+
<span class="n">user</span><span class="o">.</span><span class="n">primary_email</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span>
|
23
|
+
<span class="n">user</span><span class="o">.</span><span class="n">nickname</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">first_name</span>
|
24
|
+
<span class="n">user</span><span class="o">.</span><span class="n">first_name</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">first_name</span>
|
25
|
+
<span class="n">user</span><span class="o">.</span><span class="n">last_name</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">last_name</span>
|
26
|
+
|
27
|
+
|
28
|
+
<span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:User</span><span class="o">.</span><span class="n">update_account!</span><span class="p">(</span><span class="n">user</span><span class="p">,</span> <span class="p">{</span><span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
|
29
|
+
|
30
|
+
|
31
|
+
<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">fileId</span><span class="p">)</span>
|
32
|
+
|
33
|
+
|
34
|
+
<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>
|
35
|
+
|
36
|
+
|
37
|
+
<span class="n">document</span><span class="o">.</span><span class="n">set_collaborators!</span><span class="p">(</span><span class="o">[</span><span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="o">]</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</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>
|
38
|
+
|
39
|
+
|
40
|
+
<span class="n">collaborations</span> <span class="o">=</span> <span class="n">document</span><span class="o">.</span><span class="n">collaborators!</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>
|
41
|
+
|
42
|
+
|
43
|
+
<span class="n">document</span><span class="o">.</span><span class="n">set_reviewers!</span><span class="p">(</span><span class="n">collaborations</span><span class="p">,</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>
|
44
|
+
|
45
|
+
<span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=></span> <span class="n">e</span>
|
46
|
+
<span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
|
47
|
+
<span class="k">end</span>
|
48
|
+
|
49
|
+
|
50
|
+
<span class="n">haml</span> <span class="ss">:sample22</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">:fileId</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">fileId</span><span class="p">,</span> <span class="ss">:email</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">email</span><span class="p">,</span> <span class="ss">:first_name</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">first_name</span><span class="p">,</span> <span class="ss">:last_name</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">last_name</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span><span class="p">}</span>
|
51
|
+
<span class="k">end</span>
|
52
|
+
|
53
|
+
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<!DOCTYPE html> <html> <head> <title>sample3.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="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="sample2.html"> sample2.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> sample3.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">'/sample3'</span> <span class="k">do</span>
|
1
|
+
<!DOCTYPE html> <html> <head> <title>sample3.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> sample3.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">'/sample3'</span> <span class="k">do</span>
|
2
2
|
<span class="n">haml</span> <span class="ss">:sample3</span>
|
3
3
|
<span class="k">end</span>
|
4
4
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
<span class="k">begin</span>
|
12
12
|
|
13
|
-
<span class="k">raise</span> <span class="
|
13
|
+
<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>
|
14
14
|
|
15
15
|
|
16
16
|
<span class="n">filepath</span> <span class="o">=</span> <span class="s2">"</span><span class="si">#{</span><span class="no">Dir</span><span class="o">.</span><span class="n">tmpdir</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span><span class="si">}</span><span class="s2">"</span>
|
@@ -22,13 +22,13 @@
|
|
22
22
|
|
23
23
|
<span class="n">massage</span> <span class="o">=</span> <span class="s2">"<p>File was uploaded to GroupDocs. Here you can see your <strong></span><span class="si">#{</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span><span class="si">}</span><span class="s2"></strong> file in the GroupDocs Embedded Viewer.</p>"</span>
|
24
24
|
<span class="n">iframe</span> <span class="o">=</span> <span class="s2">"<iframe src='https://apps.groupdocs.com/document-viewer/Embed/</span><span class="si">#{</span><span class="n">file</span><span class="o">.</span><span class="n">guid</span><span class="si">}</span><span class="s2">' frameborder='0' width='720' height='600'></iframe>"</span>
|
25
|
-
|
25
|
+
|
26
26
|
<span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=></span> <span class="n">e</span>
|
27
27
|
<span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
|
28
28
|
<span class="k">end</span>
|
29
29
|
|
30
30
|
|
31
|
-
<span class="n">haml</span> <span class="ss">:sample3</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=></span> <span class="p">{</span
|
31
|
+
<span class="n">haml</span> <span class="ss">:sample3</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">:iframe</span> <span class="o">=></span> <span class="n">iframe</span><span class="p">,</span> <span class="ss">:massage</span> <span class="o">=></span> <span class="n">massage</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span><span class="p">}</span>
|
32
32
|
<span class="k">end</span>
|
33
33
|
|
34
34
|
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<!DOCTYPE html> <html> <head> <title>sample4.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="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="sample2.html"> sample2.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> sample4.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">'/sample4'</span> <span class="k">do</span>
|
1
|
+
<!DOCTYPE html> <html> <head> <title>sample4.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> sample4.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">'/sample4'</span> <span class="k">do</span>
|
2
2
|
<span class="n">haml</span> <span class="ss">:sample4</span>
|
3
3
|
<span class="k">end</span>
|
4
4
|
|
@@ -8,24 +8,35 @@
|
|
8
8
|
<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>
|
9
9
|
<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>
|
10
10
|
<span class="n">set</span> <span class="ss">:file_id</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:file_id</span><span class="o">]</span>
|
11
|
+
<span class="n">set</span> <span class="ss">:source</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:source</span><span class="o">]</span>
|
12
|
+
<span class="n">set</span> <span class="ss">:url</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:url</span><span class="o">]</span>
|
11
13
|
|
12
14
|
<span class="k">begin</span>
|
13
15
|
|
14
|
-
<span class="k">raise</span> <span class="
|
15
|
-
|
16
|
-
|
17
|
-
<span class="n">
|
18
|
-
<span class="
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<span class="n">
|
24
|
-
|
16
|
+
<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>
|
17
|
+
|
18
|
+
|
19
|
+
<span class="n">file</span> <span class="o">=</span> <span class="kp">nil</span>
|
20
|
+
<span class="k">case</span> <span class="n">settings</span><span class="o">.</span><span class="n">source</span>
|
21
|
+
<span class="k">when</span> <span class="s1">'guid'</span>
|
22
|
+
<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="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">})</span>
|
23
|
+
<span class="k">when</span> <span class="s1">'local'</span>
|
24
|
+
|
25
|
+
<span class="n">filepath</span> <span class="o">=</span> <span class="s2">"</span><span class="si">#{</span><span class="no">Dir</span><span class="o">.</span><span class="n">tmpdir</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span><span class="si">}</span><span class="s2">"</span>
|
26
|
+
|
27
|
+
<span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="s1">'wb'</span><span class="p">)</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:tempfile</span><span class="o">].</span><span class="n">read</span><span class="p">)</span> <span class="p">}</span>
|
28
|
+
|
29
|
+
<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">upload!</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="p">{},</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
|
30
|
+
<span class="k">when</span> <span class="s1">'url'</span>
|
31
|
+
<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">upload_web!</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">url</span><span class="p">,</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
|
32
|
+
<span class="k">else</span>
|
33
|
+
<span class="k">raise</span> <span class="s1">'Wrong GUID source.'</span>
|
25
34
|
<span class="k">end</span>
|
26
35
|
|
27
|
-
|
28
|
-
<span class="n">
|
36
|
+
<span class="n">pp</span> <span class="n">file</span>
|
37
|
+
<span class="n">pp</span> <span class="n">file</span><span class="o">.</span><span class="n">name</span>
|
38
|
+
|
39
|
+
<span class="n">dowloaded_file</span> <span class="o">=</span> <span class="n">file</span><span class="o">.</span><span class="n">download!</span><span class="p">(</span><span class="s2">"</span><span class="si">#{</span><span class="no">File</span><span class="o">.</span><span class="n">dirname</span><span class="p">(</span><span class="bp">__FILE__</span><span class="p">)</span><span class="si">}</span><span class="s2">/../public/downloads"</span><span class="p">,</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>
|
29
40
|
<span class="k">unless</span> <span class="n">dowloaded_file</span><span class="o">.</span><span class="n">empty?</span>
|
30
41
|
<span class="n">massage</span> <span class="o">=</span> <span class="s2">"<font color='green'>File was downloaded to the <font color='blue'></span><span class="si">#{</span><span class="n">dowloaded_file</span><span class="si">}</span><span class="s2"></font> folder</font> <br />"</span>
|
31
42
|
<span class="k">end</span>
|
@@ -34,8 +45,8 @@
|
|
34
45
|
<span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
|
35
46
|
<span class="k">end</span>
|
36
47
|
|
37
|
-
|
38
|
-
<span class="n">haml</span> <span class="ss">:sample4</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=></span> <span class="p">{</span
|
48
|
+
|
49
|
+
<span class="n">haml</span> <span class="ss">:sample4</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">:file_id</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">,</span> <span class="ss">:massage</span> <span class="o">=></span> <span class="n">massage</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span><span class="p">}</span>
|
39
50
|
<span class="k">end</span>
|
40
51
|
|
41
52
|
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<!DOCTYPE html> <html> <head> <title>sample5.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="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="sample2.html"> sample2.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> sample5.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">'/sample5'</span> <span class="k">do</span>
|
1
|
+
<!DOCTYPE html> <html> <head> <title>sample5.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> sample5.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">'/sample5'</span> <span class="k">do</span>
|
2
2
|
<span class="n">haml</span> <span class="ss">:sample5</span>
|
3
3
|
<span class="k">end</span>
|
4
4
|
|
@@ -8,49 +8,56 @@
|
|
8
8
|
<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>
|
9
9
|
<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>
|
10
10
|
<span class="n">set</span> <span class="ss">:file_id</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:file_id</span><span class="o">]</span>
|
11
|
+
<span class="n">set</span> <span class="ss">:url</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:url</span><span class="o">]</span>
|
11
12
|
<span class="n">set</span> <span class="ss">:copy</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:copy</span><span class="o">]</span>
|
12
13
|
<span class="n">set</span> <span class="ss">:move</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:move</span><span class="o">]</span>
|
13
14
|
<span class="n">set</span> <span class="ss">:dest_path</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:dest_path</span><span class="o">]</span>
|
14
|
-
|
15
|
+
|
15
16
|
<span class="k">begin</span>
|
16
17
|
|
17
|
-
<span class="k">raise</span> <span class="
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<span class="n">
|
27
|
-
|
18
|
+
<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">file_id</span><span class="o">.</span><span class="n">empty?</span>
|
19
|
+
|
20
|
+
<span class="n">file</span> <span class="o">=</span> <span class="kp">nil</span>
|
21
|
+
|
22
|
+
<span class="k">case</span> <span class="n">settings</span><span class="o">.</span><span class="n">source</span>
|
23
|
+
<span class="k">when</span> <span class="s1">'guid'</span>
|
24
|
+
<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="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">})</span>
|
25
|
+
<span class="k">when</span> <span class="s1">'local'</span>
|
26
|
+
|
27
|
+
<span class="n">filepath</span> <span class="o">=</span> <span class="s2">"</span><span class="si">#{</span><span class="no">Dir</span><span class="o">.</span><span class="n">tmpdir</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span><span class="si">}</span><span class="s2">"</span>
|
28
|
+
|
29
|
+
<span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="s1">'wb'</span><span class="p">)</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:tempfile</span><span class="o">].</span><span class="n">read</span><span class="p">)</span> <span class="p">}</span>
|
30
|
+
|
31
|
+
<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">upload!</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="p">{},</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
|
32
|
+
<span class="k">when</span> <span class="s1">'url'</span>
|
33
|
+
<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">upload_web!</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">url</span><span class="p">,</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
|
34
|
+
<span class="k">else</span>
|
35
|
+
<span class="k">raise</span> <span class="s1">'Wrong GUID source.'</span>
|
28
36
|
<span class="k">end</span>
|
29
|
-
<span class="k">raise</span> <span class="s2">"No file with such FileID"</span> <span class="k">if</span> <span class="n">manipulate_file</span><span class="o">.</span><span class="n">nil?</span>
|
30
37
|
|
31
|
-
|
38
|
+
|
32
39
|
<span class="k">unless</span> <span class="n">settings</span><span class="o">.</span><span class="n">copy</span><span class="o">.</span><span class="n">nil?</span>
|
33
|
-
<span class="n">file</span> <span class="o">=</span> <span class="n">
|
40
|
+
<span class="n">file</span> <span class="o">=</span> <span class="n">file</span><span class="o">.</span><span class="n">copy!</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">dest_path</span><span class="p">,</span> <span class="p">{},</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>
|
34
41
|
<span class="n">button</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">copy</span>
|
35
42
|
<span class="k">end</span>
|
36
43
|
|
37
|
-
|
44
|
+
|
38
45
|
<span class="k">unless</span> <span class="n">settings</span><span class="o">.</span><span class="n">move</span><span class="o">.</span><span class="n">nil?</span>
|
39
|
-
<span class="n">file</span> <span class="o">=</span> <span class="n">
|
46
|
+
<span class="n">file</span> <span class="o">=</span> <span class="n">file</span><span class="o">.</span><span class="n">move!</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">dest_path</span><span class="p">,</span> <span class="p">{},</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>
|
40
47
|
<span class="n">button</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">move</span>
|
41
48
|
<span class="k">end</span>
|
42
49
|
|
43
|
-
|
50
|
+
|
44
51
|
<span class="k">if</span> <span class="n">file</span>
|
45
52
|
<span class="n">massage</span> <span class="o">=</span> <span class="s2">"File was </span><span class="si">#{</span><span class="n">button</span><span class="si">}</span><span class="s2">'ed to the </span><span class="si">#{</span><span class="n">settings</span><span class="o">.</span><span class="n">dest_path</span><span class="si">}</span><span class="s2"> folder"</span>
|
46
53
|
<span class="k">end</span>
|
47
|
-
|
54
|
+
|
48
55
|
<span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=></span> <span class="n">e</span>
|
49
56
|
<span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
|
50
57
|
<span class="k">end</span>
|
51
58
|
|
52
|
-
|
53
|
-
<span class="n">haml</span> <span class="ss">:sample5</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=></span> <span class="p">{</span
|
59
|
+
|
60
|
+
<span class="n">haml</span> <span class="ss">:sample5</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">:file_id</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">,</span> <span class="ss">:dest_path</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">dest_path</span><span class="p">,</span> <span class="ss">:massage</span> <span class="o">=></span> <span class="n">massage</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span><span class="p">}</span>
|
54
61
|
<span class="k">end</span>
|
55
62
|
|
56
63
|
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<!DOCTYPE html> <html> <head> <title>sample6.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="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="sample2.html"> sample2.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> sample6.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">'/sample6'</span> <span class="k">do</span>
|
1
|
+
<!DOCTYPE html> <html> <head> <title>sample6.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> sample6.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">'/sample6'</span> <span class="k">do</span>
|
2
2
|
<span class="n">haml</span> <span class="ss">:sample6</span>
|
3
3
|
<span class="k">end</span>
|
4
4
|
|
@@ -7,10 +7,10 @@
|
|
7
7
|
|
8
8
|
<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>
|
9
9
|
<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>
|
10
|
-
|
10
|
+
|
11
11
|
<span class="k">begin</span>
|
12
12
|
|
13
|
-
<span class="k">raise</span> <span class="
|
13
|
+
<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>
|
14
14
|
|
15
15
|
|
16
16
|
<span class="n">file_one_path</span> <span class="o">=</span> <span class="s2">"</span><span class="si">#{</span><span class="no">Dir</span><span class="o">.</span><span class="n">tmpdir</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">params</span><span class="o">[</span><span class="ss">:document</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span><span class="si">}</span><span class="s2">"</span>
|
@@ -26,10 +26,10 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
<span class="n">signature_one</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Signature</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="nb">name</span><span class="p">:</span> <span class="s1">'Test'</span><span class="p">,</span> <span class="n">image_path</span><span class="p">:</span> <span class="n">signature_one_path</span><span class="p">)</span>
|
29
|
-
<span class="n">signature_one</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="p">{</span
|
29
|
+
<span class="n">signature_one</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="p">{</span><span class="ss">top</span><span class="p">:</span> <span class="mi">0</span><span class="o">.</span><span class="mi">1</span><span class="p">,</span> <span class="ss">left</span><span class="p">:</span> <span class="mi">0</span><span class="o">.</span><span class="mo">07</span><span class="p">,</span> <span class="ss">width</span><span class="p">:</span> <span class="mi">50</span><span class="p">,</span> <span class="ss">height</span><span class="p">:</span> <span class="mi">50</span><span class="p">}</span>
|
30
30
|
|
31
31
|
|
32
|
-
<span class="n">signed_documents</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">sign_documents!</span><span class="p">(</span><span class="o">[</span><span class="n">document_one</span><span class="o">]</span><span class="p">,</span> <span class="o">[</span><span class="n">signature_one</span><span class="o">]</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span
|
32
|
+
<span class="n">signed_documents</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">sign_documents!</span><span class="p">(</span><span class="o">[</span><span class="n">document_one</span><span class="o">]</span><span class="p">,</span> <span class="o">[</span><span class="n">signature_one</span><span class="o">]</span><span class="p">,</span> <span class="p">{},</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>
|
33
33
|
<span class="n">guid</span> <span class="o">=</span> <span class="n">signed_documents</span><span class="o">.</span><span class="n">first</span><span class="o">.</span><span class="n">file</span><span class="o">.</span><span class="n">guid</span>
|
34
34
|
|
35
35
|
|
@@ -42,7 +42,7 @@
|
|
42
42
|
<span class="k">end</span>
|
43
43
|
|
44
44
|
|
45
|
-
<span class="n">haml</span> <span class="ss">:sample6</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=></span> <span class="p">{</span
|
45
|
+
<span class="n">haml</span> <span class="ss">:sample6</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">:iframe</span> <span class="o">=></span> <span class="n">iframe</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span><span class="p">}</span>
|
46
46
|
<span class="k">end</span>
|
47
47
|
|
48
48
|
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<!DOCTYPE html> <html> <head> <title>sample7.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="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="sample2.html"> sample2.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> sample7.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">'/sample7'</span> <span class="k">do</span>
|
1
|
+
<!DOCTYPE html> <html> <head> <title>sample7.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> sample7.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">'/sample7'</span> <span class="k">do</span>
|
2
2
|
<span class="n">haml</span> <span class="ss">:sample7</span>
|
3
3
|
<span class="k">end</span>
|
4
4
|
|
@@ -7,13 +7,13 @@
|
|
7
7
|
|
8
8
|
<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>
|
9
9
|
<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>
|
10
|
-
|
10
|
+
|
11
11
|
<span class="k">begin</span>
|
12
12
|
|
13
|
-
<span class="k">raise</span> <span class="
|
13
|
+
<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>
|
14
14
|
|
15
15
|
|
16
|
-
<span class="n">files_list</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">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">'/'</span><span class="p">,</span> <span class="p">{</span><span class="ss">:extended</span> <span class="o">=></span> <span class="kp">true</span><span class="p">},</span> <span class="p">{</span
|
16
|
+
<span class="n">files_list</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">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">'/'</span><span class="p">,</span> <span class="p">{</span><span class="ss">:extended</span> <span class="o">=></span> <span class="kp">true</span><span class="p">},</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>
|
17
17
|
|
18
18
|
|
19
19
|
<span class="n">thumbnails</span> <span class="o">=</span> <span class="s1">''</span>
|
@@ -21,13 +21,13 @@
|
|
21
21
|
<span class="k">if</span> <span class="n">element</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s1">'::'</span><span class="p">)</span><span class="o">.</span><span class="n">last</span> <span class="o">==</span> <span class="s1">'Folder'</span>
|
22
22
|
<span class="k">next</span>
|
23
23
|
<span class="k">end</span>
|
24
|
-
|
24
|
+
|
25
25
|
<span class="k">if</span> <span class="n">element</span><span class="o">.</span><span class="n">thumbnail</span>
|
26
|
-
<span class="nb">name</span> <span class="o">=</span> <span class="n">element</span><span class="o">.</span><span class="n">name</span>
|
26
|
+
<span class="nb">name</span> <span class="o">=</span> <span class="n">element</span><span class="o">.</span><span class="n">name</span>
|
27
27
|
<span class="n">thumbnails</span> <span class="o">+=</span> <span class="s2">"<p><img src='data:image/png;base64,</span><span class="si">#{</span><span class="n">element</span><span class="o">.</span><span class="n">thumbnail</span><span class="si">}</span><span class="s2">', width='40px', height='40px'> </span><span class="si">#{</span><span class="nb">name</span><span class="si">}</span><span class="s2"></p>"</span>
|
28
28
|
<span class="k">end</span>
|
29
29
|
<span class="k">end</span>
|
30
|
-
|
30
|
+
|
31
31
|
<span class="k">unless</span> <span class="n">thumbnails</span><span class="o">.</span><span class="n">empty?</span>
|
32
32
|
<span class="n">set</span> <span class="ss">:thumbnails</span><span class="p">,</span> <span class="n">thumbnails</span>
|
33
33
|
<span class="k">end</span>
|
@@ -37,7 +37,7 @@
|
|
37
37
|
<span class="k">end</span>
|
38
38
|
|
39
39
|
|
40
|
-
<span class="n">haml</span> <span class="ss">:sample7</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=></span> <span class="p">{</span
|
40
|
+
<span class="n">haml</span> <span class="ss">:sample7</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">:thumbnailList</span> <span class="o">=></span> <span class="n">thumbnails</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span><span class="p">}</span>
|
41
41
|
<span class="k">end</span>
|
42
42
|
|
43
43
|
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<!DOCTYPE html> <html> <head> <title>sample8.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="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="sample2.html"> sample2.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> sample8.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">'/sample8'</span> <span class="k">do</span>
|
1
|
+
<!DOCTYPE html> <html> <head> <title>sample8.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> sample8.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">'/sample8'</span> <span class="k">do</span>
|
2
2
|
<span class="n">haml</span> <span class="ss">:sample8</span>
|
3
3
|
<span class="k">end</span>
|
4
4
|
|
@@ -9,36 +9,44 @@
|
|
9
9
|
<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>
|
10
10
|
<span class="n">set</span> <span class="ss">:guid</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:guid</span><span class="o">]</span>
|
11
11
|
<span class="n">set</span> <span class="ss">:page_number</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:page_number</span><span class="o">]</span>
|
12
|
-
|
12
|
+
|
13
13
|
|
14
14
|
document = file.to<em>document
|
15
|
-
document.page</em>images! 1024, 768, first<em>page: 0, page</em>count: 1
|
16
|
-
|
15
|
+
document.page</em>images! 1024, 768, first<em>page: 0, page</em>count: 1</p> </td> <td class="code"> <div class="highlight"><pre>
|
16
|
+
|
17
17
|
<span class="k">begin</span>
|
18
18
|
|
19
|
-
<span class="k">raise</span> <span class="
|
20
|
-
|
21
|
-
|
22
|
-
<span class="n">files_list</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">Folder</span><span class="o">.</span><span class="n">list!</span><span class="p">(</span><span class="s1">'/'</span><span class="p">,</span> <span class="p">{},</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>
|
19
|
+
<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>
|
23
20
|
|
21
|
+
<span class="n">file</span> <span class="o">=</span> <span class="kp">nil</span>
|
24
22
|
<span class="n">doc</span> <span class="o">=</span> <span class="kp">nil</span>
|
25
23
|
<span class="n">metadata</span> <span class="o">=</span> <span class="kp">nil</span>
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
<span class="k">
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
<span class="n">
|
34
|
-
|
35
|
-
|
24
|
+
|
25
|
+
|
26
|
+
<span class="k">case</span> <span class="n">settings</span><span class="o">.</span><span class="n">source</span>
|
27
|
+
<span class="k">when</span> <span class="s1">'guid'</span>
|
28
|
+
<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="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">file_id</span><span class="p">})</span>
|
29
|
+
<span class="k">when</span> <span class="s1">'local'</span>
|
30
|
+
|
31
|
+
<span class="n">filepath</span> <span class="o">=</span> <span class="s2">"</span><span class="si">#{</span><span class="no">Dir</span><span class="o">.</span><span class="n">tmpdir</span><span class="si">}</span><span class="s2">/</span><span class="si">#{</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:filename</span><span class="o">]</span><span class="si">}</span><span class="s2">"</span>
|
32
|
+
|
33
|
+
<span class="no">File</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="s1">'wb'</span><span class="p">)</span> <span class="p">{</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span> <span class="n">f</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">params</span><span class="o">[</span><span class="ss">:file</span><span class="o">][</span><span class="ss">:tempfile</span><span class="o">].</span><span class="n">read</span><span class="p">)</span> <span class="p">}</span>
|
34
|
+
|
35
|
+
<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">upload!</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="p">{},</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
|
36
|
+
<span class="k">when</span> <span class="s1">'url'</span>
|
37
|
+
<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">upload_web!</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">url</span><span class="p">,</span> <span class="n">client_id</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="n">private_key</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">)</span>
|
38
|
+
<span class="k">else</span>
|
39
|
+
<span class="k">raise</span> <span class="s1">'Wrong GUID source.'</span>
|
36
40
|
<span class="k">end</span>
|
37
41
|
|
38
|
-
|
39
|
-
<span class="n">
|
42
|
+
<span class="n">doc</span> <span class="o">=</span> <span class="n">file</span><span class="o">.</span><span class="n">to_document</span>
|
43
|
+
<span class="n">metadata</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="n">metadata!</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>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
<span class="n">images</span> <span class="o">=</span> <span class="n">doc</span><span class="o">.</span><span class="n">page_images!</span><span class="p">(</span><span class="mi">800</span><span class="p">,</span> <span class="mi">400</span><span class="p">,</span> <span class="p">{</span><span class="ss">:first_page</span> <span class="o">=></span> <span class="mi">0</span><span class="p">,</span> <span class="ss">:page_count</span> <span class="o">=></span> <span class="n">metadata</span><span class="o">.</span><span class="n">page_count</span><span class="p">},</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>
|
40
48
|
|
41
|
-
|
49
|
+
|
42
50
|
<span class="k">unless</span> <span class="n">images</span><span class="o">.</span><span class="n">empty?</span>
|
43
51
|
<span class="n">image</span> <span class="o">=</span> <span class="n">images</span><span class="o">[</span><span class="nb">Integer</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">page_number</span><span class="p">)</span><span class="o">]</span>
|
44
52
|
<span class="k">end</span>
|
@@ -47,8 +55,8 @@
|
|
47
55
|
<span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
|
48
56
|
<span class="k">end</span>
|
49
57
|
|
50
|
-
|
51
|
-
<span class="n">haml</span> <span class="ss">:sample8</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=></span> <span class="p">{</span
|
58
|
+
|
59
|
+
<span class="n">haml</span> <span class="ss">:sample8</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">:guid</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">guid</span><span class="p">,</span> <span class="ss">:page_number</span> <span class="o">=></span> <span class="n">settings</span><span class="o">.</span><span class="n">page_number</span><span class="p">,</span> <span class="ss">:image</span> <span class="o">=></span> <span class="n">image</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=></span> <span class="n">err</span><span class="p">}</span>
|
52
60
|
<span class="k">end</span>
|
53
61
|
|
54
62
|
</pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
|