groupdocs 1.5.3 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/.travis.yml +0 -1
  2. data/README.md +2 -0
  3. data/examples/api-samples/public/docs/annotation-sample.html +167 -57
  4. data/examples/api-samples/public/docs/docco.css +459 -151
  5. data/examples/api-samples/public/docs/envelope-sample.html +373 -131
  6. data/examples/api-samples/public/docs/sample1.html +126 -26
  7. data/examples/api-samples/public/docs/sample10.html +213 -50
  8. data/examples/api-samples/public/docs/sample11.html +319 -87
  9. data/examples/api-samples/public/docs/sample12.html +165 -40
  10. data/examples/api-samples/public/docs/sample13.html +166 -41
  11. data/examples/api-samples/public/docs/sample14.html +142 -30
  12. data/examples/api-samples/public/docs/sample15.html +127 -27
  13. data/examples/api-samples/public/docs/sample16.html +125 -25
  14. data/examples/api-samples/public/docs/sample17.html +188 -37
  15. data/examples/api-samples/public/docs/sample18.html +614 -157
  16. data/examples/api-samples/public/docs/sample19.html +221 -59
  17. data/examples/api-samples/public/docs/sample2.html +142 -30
  18. data/examples/api-samples/public/docs/sample20.html +176 -51
  19. data/examples/api-samples/public/docs/sample21.html +287 -66
  20. data/examples/api-samples/public/docs/sample22.html +224 -53
  21. data/examples/api-samples/public/docs/sample23.html +256 -0
  22. data/examples/api-samples/public/docs/sample24.html +143 -0
  23. data/examples/api-samples/public/docs/sample25.html +429 -0
  24. data/examples/api-samples/public/docs/sample26.html +113 -0
  25. data/examples/api-samples/public/docs/sample27.html +433 -0
  26. data/examples/api-samples/public/docs/sample28.html +185 -0
  27. data/examples/api-samples/public/docs/sample29.html +175 -0
  28. data/examples/api-samples/public/docs/sample3.html +172 -34
  29. data/examples/api-samples/public/docs/sample30.html +144 -0
  30. data/examples/api-samples/public/docs/sample31.html +734 -0
  31. data/examples/api-samples/public/docs/sample4.html +204 -52
  32. data/examples/api-samples/public/docs/sample5.html +241 -63
  33. data/examples/api-samples/public/docs/sample6.html +209 -48
  34. data/examples/api-samples/public/docs/sample7.html +155 -43
  35. data/examples/api-samples/public/docs/sample8.html +235 -62
  36. data/examples/api-samples/public/docs/sample9.html +200 -49
  37. data/examples/api-samples/public/templates/merge_field1_doc.docx +0 -0
  38. data/examples/api-samples/public/templates/merge_field2_doc.docx +0 -0
  39. data/examples/api-samples/samples/sample23.rb +54 -0
  40. data/examples/api-samples/samples/sample24.rb +30 -0
  41. data/examples/api-samples/samples/sample25.rb +4 -4
  42. data/examples/api-samples/samples/sample26.rb +25 -0
  43. data/examples/api-samples/samples/sample27.rb +100 -0
  44. data/examples/api-samples/samples/sample28.rb +47 -0
  45. data/examples/api-samples/samples/sample29.rb +52 -0
  46. data/examples/api-samples/samples/sample30.rb +39 -0
  47. data/examples/api-samples/samples/sample31.rb +204 -0
  48. data/examples/api-samples/samples/sample5.rb +5 -3
  49. data/examples/api-samples/samples/sample6.rb +2 -0
  50. data/examples/api-samples/views/_others_samples.haml +12 -0
  51. data/examples/api-samples/views/index.haml +12 -0
  52. data/examples/api-samples/views/layout.haml +1 -0
  53. data/examples/api-samples/views/sample1.haml +3 -2
  54. data/examples/api-samples/views/sample10.haml +3 -2
  55. data/examples/api-samples/views/sample11.haml +4 -0
  56. data/examples/api-samples/views/sample12.haml +4 -0
  57. data/examples/api-samples/views/sample13.haml +4 -0
  58. data/examples/api-samples/views/sample14.haml +4 -0
  59. data/examples/api-samples/views/sample15.haml +4 -0
  60. data/examples/api-samples/views/sample16.haml +4 -0
  61. data/examples/api-samples/views/sample17.haml +4 -0
  62. data/examples/api-samples/views/sample19.haml +4 -0
  63. data/examples/api-samples/views/sample2.haml +3 -2
  64. data/examples/api-samples/views/sample20.haml +4 -0
  65. data/examples/api-samples/views/sample21.haml +4 -0
  66. data/examples/api-samples/views/sample22.haml +4 -0
  67. data/examples/api-samples/views/sample23.haml +87 -0
  68. data/examples/api-samples/views/sample24.haml +44 -0
  69. data/examples/api-samples/views/sample26.haml +54 -0
  70. data/examples/api-samples/views/sample27.haml +122 -0
  71. data/examples/api-samples/views/sample28.haml +47 -0
  72. data/examples/api-samples/views/sample29.haml +70 -0
  73. data/examples/api-samples/views/sample3.haml +3 -2
  74. data/examples/api-samples/views/sample30.haml +46 -0
  75. data/examples/api-samples/views/sample31.haml +114 -0
  76. data/examples/api-samples/views/sample4.haml +3 -2
  77. data/examples/api-samples/views/sample5.haml +3 -2
  78. data/examples/api-samples/views/sample6.haml +3 -2
  79. data/examples/api-samples/views/sample7.haml +3 -2
  80. data/examples/api-samples/views/sample8.haml +3 -2
  81. data/examples/api-samples/views/sample9.haml +3 -2
  82. data/examples/viewer/Gemfile +1 -1
  83. data/groupdocs.gemspec +3 -3
  84. data/lib/groupdocs/datasource.rb +22 -0
  85. data/lib/groupdocs/document.rb +493 -43
  86. data/lib/groupdocs/document/annotation.rb +73 -0
  87. data/lib/groupdocs/job.rb +82 -1
  88. data/lib/groupdocs/post.rb +83 -0
  89. data/lib/groupdocs/questionnaire.rb +41 -0
  90. data/lib/groupdocs/signature.rb +342 -0
  91. data/lib/groupdocs/signature/envelope.rb +56 -0
  92. data/lib/groupdocs/signature/form.rb +47 -5
  93. data/lib/groupdocs/signature/shared/field_methods.rb +37 -0
  94. data/lib/groupdocs/storage/file.rb +83 -0
  95. data/lib/groupdocs/subscription.rb +218 -0
  96. data/lib/groupdocs/user.rb +422 -1
  97. data/lib/groupdocs/version.rb +1 -1
  98. data/spec/groupdocs/job_spec.rb +4 -5
  99. data/spec/groupdocs/user_spec.rb +157 -0
  100. data/spec/support/json/annotation_resize.json +11 -0
  101. data/spec/support/json/annotation_text_color.json +10 -0
  102. data/spec/support/json/annotation_text_info.json +11 -0
  103. data/spec/support/json/document_content_get.json +8 -0
  104. data/spec/support/json/document_edit_lock_get.json +10 -0
  105. data/spec/support/json/document_editlock_remove.json +8 -0
  106. data/spec/support/json/document_page_html_urls_get.json +14 -0
  107. data/spec/support/json/document_password_set.json +19 -0
  108. data/spec/support/json/document_representations.json +25 -0
  109. data/spec/support/json/document_shared_documents_get.json +32 -0
  110. data/spec/support/json/document_tags_get.json +9 -0
  111. data/spec/support/json/document_tags_remove.json +8 -0
  112. data/spec/support/json/document_tags_set.json +8 -0
  113. data/spec/support/json/document_user_status_set.json +12 -0
  114. data/spec/support/json/job_documents.json +103 -35
  115. data/spec/support/json/job_xml_get.json +30 -0
  116. data/spec/support/json/jobs_documents.json +40 -0
  117. data/spec/support/json/user_get_profile.json +73 -0
  118. metadata +49 -177
@@ -1,59 +1,221 @@
1
- <!DOCTYPE html> <html> <head> <title>sample19.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample19.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample19&#39;</span> <span class="k">do</span>
2
- <span class="n">haml</span> <span class="ss">:sample19</span>
3
- <span class="k">end</span>
4
-
5
-
6
- <span class="n">post</span> <span class="s1">&#39;/sample19&#39;</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">:sourceFileId</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:sourceFileId</span><span class="o">]</span>
11
- <span class="n">set</span> <span class="ss">:targetFileId</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:targetFileId</span><span class="o">]</span>
12
- <span class="n">set</span> <span class="ss">:callbackUrl</span><span class="p">,</span> <span class="n">params</span><span class="o">[</span><span class="ss">:callbackUrl</span><span class="o">]</span>
13
-
14
- <span class="k">begin</span>
15
-
16
- <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">sourceFileId</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">targetFileId</span><span class="o">.</span><span class="n">empty?</span>
17
-
18
-
19
- <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">&#39;/&#39;</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
20
-
21
- <span class="n">source_document</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
22
- <span class="n">target_document</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
23
-
24
-
25
- <span class="n">files_list</span><span class="o">.</span><span class="n">each</span> <span class="k">do</span> <span class="o">|</span><span class="n">element</span><span class="o">|</span>
26
- <span class="k">if</span> <span class="n">element</span><span class="o">.</span><span class="n">respond_to?</span><span class="p">(</span><span class="s1">&#39;guid&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="kp">true</span> <span class="ow">and</span> <span class="n">element</span><span class="o">.</span><span class="n">guid</span> <span class="o">==</span> <span class="n">settings</span><span class="o">.</span><span class="n">sourceFileId</span>
27
- <span class="n">source_document</span> <span class="o">=</span> <span class="n">element</span>
28
- <span class="k">end</span>
29
- <span class="k">if</span> <span class="n">element</span><span class="o">.</span><span class="n">respond_to?</span><span class="p">(</span><span class="s1">&#39;guid&#39;</span><span class="p">)</span> <span class="o">==</span> <span class="kp">true</span> <span class="ow">and</span> <span class="n">element</span><span class="o">.</span><span class="n">guid</span> <span class="o">==</span> <span class="n">settings</span><span class="o">.</span><span class="n">targetFileId</span>
30
- <span class="n">target_document</span> <span class="o">=</span> <span class="n">element</span>
31
- <span class="k">end</span>
32
- <span class="k">end</span>
33
-
34
- <span class="k">unless</span> <span class="n">source_document</span><span class="o">.</span><span class="n">instance_of?</span> <span class="nb">String</span> <span class="ow">and</span> <span class="n">target_document</span><span class="o">.</span><span class="n">instance_of?</span> <span class="nb">String</span>
35
-
36
- <span class="n">info</span> <span class="o">=</span> <span class="n">source_document</span><span class="o">.</span><span class="n">to_document</span><span class="o">.</span><span class="n">compare!</span><span class="p">(</span><span class="n">target_document</span><span class="o">.</span><span class="n">to_document</span><span class="p">,</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
37
- <span class="nb">sleep</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
38
-
39
-
40
- <span class="n">job</span> <span class="o">=</span> <span class="ss">GroupDocs</span><span class="p">:</span><span class="ss">:Job</span><span class="o">.</span><span class="n">new</span><span class="p">(</span><span class="nb">id</span><span class="p">:</span> <span class="n">info</span><span class="o">.</span><span class="n">id</span><span class="p">)</span>
41
-
42
- <span class="n">documents</span> <span class="o">=</span> <span class="n">job</span><span class="o">.</span><span class="n">documents!</span><span class="p">({</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
43
-
44
- <span class="n">guid</span> <span class="o">=</span> <span class="n">documents</span><span class="o">[</span><span class="ss">:outputs</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>
45
-
46
-
47
- <span class="n">iframe</span> <span class="o">=</span> <span class="s2">&quot;&lt;iframe src=&#39;https://apps.groupdocs.com/document-viewer/embed/</span><span class="si">#{</span><span class="n">guid</span><span class="si">}</span><span class="s2">&#39; frameborder=&#39;0&#39; width=&#39;100%&#39; height=&#39;600&#39;&gt;&lt;/iframe&gt;&quot;</span>
48
-
49
- <span class="k">end</span>
50
-
51
- <span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=&gt;</span> <span class="n">e</span>
52
- <span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
53
- <span class="k">end</span>
54
-
55
-
56
- <span class="n">haml</span> <span class="ss">:sample19</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:userId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:sourceFileId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">sourceFileId</span><span class="p">,</span> <span class="ss">:targetFileId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">targetFileId</span><span class="p">,</span> <span class="ss">:callbackUrl</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">callbackUrl</span><span class="p">,</span> <span class="ss">:iframe</span> <span class="o">=&gt;</span> <span class="n">iframe</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">}</span>
57
- <span class="k">end</span>
58
-
59
- </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <title>sample19.rb</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7
+ <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
8
+ <link rel="stylesheet" media="all" href="docco.css" />
9
+ </head>
10
+ <body>
11
+ <div id="container">
12
+ <div id="background"></div>
13
+
14
+ <ul class="sections">
15
+
16
+ <li id="title">
17
+ <div class="annotation">
18
+ <h1>sample19.rb</h1>
19
+ </div>
20
+ </li>
21
+
22
+
23
+
24
+ <li id="section-1">
25
+ <div class="annotation">
26
+
27
+ <div class="pilwrap ">
28
+ <a class="pilcrow" href="#section-1">&#182;</a>
29
+ </div>
30
+ <p>GET request</p>
31
+
32
+ </div>
33
+
34
+ <div class="content"><div class='highlight'><pre>get <span class="string">'/sample19'</span> <span class="keyword">do</span>
35
+ haml <span class="symbol">:sample19</span>
36
+ <span class="keyword">end</span></pre></div></div>
37
+
38
+ </li>
39
+
40
+
41
+ <li id="section-2">
42
+ <div class="annotation">
43
+
44
+ <div class="pilwrap ">
45
+ <a class="pilcrow" href="#section-2">&#182;</a>
46
+ </div>
47
+ <p>POST request</p>
48
+
49
+ </div>
50
+
51
+ <div class="content"><div class='highlight'><pre>post <span class="string">'/sample19'</span> <span class="keyword">do</span></pre></div></div>
52
+
53
+ </li>
54
+
55
+
56
+ <li id="section-3">
57
+ <div class="annotation">
58
+
59
+ <div class="pilwrap ">
60
+ <a class="pilcrow" href="#section-3">&#182;</a>
61
+ </div>
62
+ <p>set variables</p>
63
+
64
+ </div>
65
+
66
+ <div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:client_id</span>]
67
+ set <span class="symbol">:private_key</span>, params[<span class="symbol">:private_key</span>]
68
+ set <span class="symbol">:sourceFileId</span>, params[<span class="symbol">:sourceFileId</span>]
69
+ set <span class="symbol">:targetFileId</span>, params[<span class="symbol">:targetFileId</span>]
70
+ set <span class="symbol">:callbackUrl</span>, params[<span class="symbol">:callbackUrl</span>]
71
+
72
+ <span class="keyword">begin</span></pre></div></div>
73
+
74
+ </li>
75
+
76
+
77
+ <li id="section-4">
78
+ <div class="annotation">
79
+
80
+ <div class="pilwrap ">
81
+ <a class="pilcrow" href="#section-4">&#182;</a>
82
+ </div>
83
+ <p>check required variables</p>
84
+
85
+ </div>
86
+
87
+ <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty? <span class="keyword">or</span> settings.sourceFileId.empty? <span class="keyword">or</span> settings.targetFileId.empty?</pre></div></div>
88
+
89
+ </li>
90
+
91
+
92
+ <li id="section-5">
93
+ <div class="annotation">
94
+
95
+ <div class="pilwrap ">
96
+ <a class="pilcrow" href="#section-5">&#182;</a>
97
+ </div>
98
+ <p>make a request to API using client_id and private_key</p>
99
+
100
+ </div>
101
+
102
+ <div class="content"><div class='highlight'><pre> files_list = <span class="constant">GroupDocs::Storage::Folder</span>.list!(<span class="string">'/'</span>, {}, {<span class="symbol">:client_id</span> =&gt; settings.client_id, <span class="symbol">:private_key</span> =&gt; settings.private_key})
103
+
104
+ source_document = <span class="string">''</span>
105
+ target_document = <span class="string">''</span></pre></div></div>
106
+
107
+ </li>
108
+
109
+
110
+ <li id="section-6">
111
+ <div class="annotation">
112
+
113
+ <div class="pilwrap ">
114
+ <a class="pilcrow" href="#section-6">&#182;</a>
115
+ </div>
116
+ <p>get source and target documents by file ID</p>
117
+
118
+ </div>
119
+
120
+ <div class="content"><div class='highlight'><pre> files_list.each <span class="keyword">do</span> |element|
121
+ <span class="keyword">if</span> element.respond_to?(<span class="string">'guid'</span>) == <span class="keyword">true</span> <span class="keyword">and</span> element.guid == settings.sourceFileId
122
+ source_document = element
123
+ <span class="keyword">end</span>
124
+ <span class="keyword">if</span> element.respond_to?(<span class="string">'guid'</span>) == <span class="keyword">true</span> <span class="keyword">and</span> element.guid == settings.targetFileId
125
+ target_document = element
126
+ <span class="keyword">end</span>
127
+ <span class="keyword">end</span>
128
+
129
+ <span class="keyword">unless</span> source_document.instance_of? <span class="constant">String</span> <span class="keyword">and</span> target_document.instance_of? <span class="constant">String</span>
130
+
131
+ info = source_document.to_document.compare!(target_document.to_document, {<span class="symbol">:client_id</span> =&gt; settings.client_id, <span class="symbol">:private_key</span> =&gt; settings.private_key})
132
+ sleep(<span class="number">5</span>)</pre></div></div>
133
+
134
+ </li>
135
+
136
+
137
+ <li id="section-7">
138
+ <div class="annotation">
139
+
140
+ <div class="pilwrap ">
141
+ <a class="pilcrow" href="#section-7">&#182;</a>
142
+ </div>
143
+ <p>get job by ID</p>
144
+
145
+ </div>
146
+
147
+ <div class="content"><div class='highlight'><pre> job = <span class="constant">GroupDocs::Job</span>.new(<span class="symbol">id:</span> info.id)</pre></div></div>
148
+
149
+ </li>
150
+
151
+
152
+ <li id="section-8">
153
+ <div class="annotation">
154
+
155
+ <div class="pilwrap ">
156
+ <a class="pilcrow" href="#section-8">&#182;</a>
157
+ </div>
158
+ <p>get all job documents</p>
159
+
160
+ </div>
161
+
162
+ <div class="content"><div class='highlight'><pre> documents = job.documents!({<span class="symbol">:client_id</span> =&gt; settings.client_id, <span class="symbol">:private_key</span> =&gt; settings.private_key})</pre></div></div>
163
+
164
+ </li>
165
+
166
+
167
+ <li id="section-9">
168
+ <div class="annotation">
169
+
170
+ <div class="pilwrap ">
171
+ <a class="pilcrow" href="#section-9">&#182;</a>
172
+ </div>
173
+ <p>get compared file giud</p>
174
+
175
+ </div>
176
+
177
+ <div class="content"><div class='highlight'><pre> guid = documents[<span class="symbol">:outputs</span>].first.file.guid</pre></div></div>
178
+
179
+ </li>
180
+
181
+
182
+ <li id="section-10">
183
+ <div class="annotation">
184
+
185
+ <div class="pilwrap ">
186
+ <a class="pilcrow" href="#section-10">&#182;</a>
187
+ </div>
188
+ <p>construct result iframe</p>
189
+
190
+ </div>
191
+
192
+ <div class="content"><div class='highlight'><pre> iframe = <span class="string">"&lt;iframe src='https://apps.groupdocs.com/document-viewer/embed/<span class="subst">#{guid}</span>' frameborder='0' width='100%' height='600'&gt;&lt;/iframe&gt;"</span>
193
+
194
+ <span class="keyword">end</span>
195
+
196
+ <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e
197
+ err = e.message
198
+ <span class="keyword">end</span></pre></div></div>
199
+
200
+ </li>
201
+
202
+
203
+ <li id="section-11">
204
+ <div class="annotation">
205
+
206
+ <div class="pilwrap ">
207
+ <a class="pilcrow" href="#section-11">&#182;</a>
208
+ </div>
209
+ <p>set variables for template</p>
210
+
211
+ </div>
212
+
213
+ <div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample19</span>, <span class="symbol">:locals</span> =&gt; {<span class="symbol">:userId</span> =&gt; settings.client_id, <span class="symbol">:privateKey</span> =&gt; settings.private_key, <span class="symbol">:sourceFileId</span> =&gt; settings.sourceFileId, <span class="symbol">:targetFileId</span> =&gt; settings.targetFileId, <span class="symbol">:callbackUrl</span> =&gt; settings.callbackUrl, <span class="symbol">:iframe</span> =&gt; iframe, <span class="symbol">:err</span> =&gt; err}
214
+ <span class="keyword">end</span></pre></div></div>
215
+
216
+ </li>
217
+
218
+ </ul>
219
+ </div>
220
+ </body>
221
+ </html>
@@ -1,30 +1,142 @@
1
- <!DOCTYPE html> <html> <head> <title>sample2.rb</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="annotation-sample.html"> annotation-sample.rb </a> <a class="source" href="envelope-sample.html"> envelope-sample.rb </a> <a class="source" href="sample1.html"> sample1.rb </a> <a class="source" href="sample10.html"> sample10.rb </a> <a class="source" href="sample11.html"> sample11.rb </a> <a class="source" href="sample12.html"> sample12.rb </a> <a class="source" href="sample13.html"> sample13.rb </a> <a class="source" href="sample14.html"> sample14.rb </a> <a class="source" href="sample15.html"> sample15.rb </a> <a class="source" href="sample16.html"> sample16.rb </a> <a class="source" href="sample17.html"> sample17.rb </a> <a class="source" href="sample18.html"> sample18.rb </a> <a class="source" href="sample19.html"> sample19.rb </a> <a class="source" href="sample2.html"> sample2.rb </a> <a class="source" href="sample20.html"> sample20.rb </a> <a class="source" href="sample21.html"> sample21.rb </a> <a class="source" href="sample22.html"> sample22.rb </a> <a class="source" href="sample3.html"> sample3.rb </a> <a class="source" href="sample4.html"> sample4.rb </a> <a class="source" href="sample5.html"> sample5.rb </a> <a class="source" href="sample6.html"> sample6.rb </a> <a class="source" href="sample7.html"> sample7.rb </a> <a class="source" href="sample8.html"> sample8.rb </a> <a class="source" href="sample9.html"> sample9.rb </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> sample2.rb </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>GET request</p> </td> <td class="code"> <div class="highlight"><pre><span class="n">get</span> <span class="s1">&#39;/sample2&#39;</span> <span class="k">do</span>
2
- <span class="n">haml</span> <span class="ss">:sample2</span>
3
- <span class="k">end</span>
4
-
5
-
6
- <span class="n">post</span> <span class="s1">&#39;/sample2&#39;</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
-
11
- <span class="k">begin</span>
12
-
13
- <span class="k">raise</span> <span class="s1">&#39;Please enter all required parameters&#39;</span> <span class="k">if</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="o">.</span><span class="n">empty?</span> <span class="ow">or</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="o">.</span><span class="n">empty?</span>
14
-
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">&#39;/&#39;</span><span class="p">,</span> <span class="p">{},</span> <span class="p">{</span><span class="ss">:client_id</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:private_key</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">})</span>
17
-
18
-
19
- <span class="n">filelist</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span>
20
- <span class="n">files_list</span><span class="o">.</span><span class="n">each</span> <span class="p">{</span> <span class="o">|</span><span class="n">element</span><span class="o">|</span> <span class="n">filelist</span> <span class="o">&lt;&lt;</span> <span class="s2">&quot;</span><span class="si">#{</span><span class="n">element</span><span class="o">.</span><span class="n">name</span><span class="si">}</span><span class="s2">&lt;br /&gt;&quot;</span> <span class="p">}</span>
21
-
22
- <span class="k">rescue</span> <span class="no">Exception</span> <span class="o">=&gt;</span> <span class="n">e</span>
23
- <span class="n">err</span> <span class="o">=</span> <span class="n">e</span><span class="o">.</span><span class="n">message</span>
24
- <span class="k">end</span>
25
-
26
-
27
- <span class="n">haml</span> <span class="ss">:sample2</span><span class="p">,</span> <span class="ss">:locals</span> <span class="o">=&gt;</span> <span class="p">{</span><span class="ss">:userId</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">client_id</span><span class="p">,</span> <span class="ss">:privateKey</span> <span class="o">=&gt;</span> <span class="n">settings</span><span class="o">.</span><span class="n">private_key</span><span class="p">,</span> <span class="ss">:filelist</span> <span class="o">=&gt;</span> <span class="n">filelist</span><span class="p">,</span> <span class="ss">:err</span> <span class="o">=&gt;</span> <span class="n">err</span><span class="p">}</span>
28
- <span class="k">end</span>
29
-
30
- </pre></div> </td> </tr> </tbody> </table> </div> </body> </html>
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <title>sample2.rb</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7
+ <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
8
+ <link rel="stylesheet" media="all" href="docco.css" />
9
+ </head>
10
+ <body>
11
+ <div id="container">
12
+ <div id="background"></div>
13
+
14
+ <ul class="sections">
15
+
16
+ <li id="title">
17
+ <div class="annotation">
18
+ <h1>sample2.rb</h1>
19
+ </div>
20
+ </li>
21
+
22
+
23
+
24
+ <li id="section-1">
25
+ <div class="annotation">
26
+
27
+ <div class="pilwrap ">
28
+ <a class="pilcrow" href="#section-1">&#182;</a>
29
+ </div>
30
+ <p>GET request</p>
31
+
32
+ </div>
33
+
34
+ <div class="content"><div class='highlight'><pre>get <span class="string">'/sample2'</span> <span class="keyword">do</span>
35
+ haml <span class="symbol">:sample2</span>
36
+ <span class="keyword">end</span></pre></div></div>
37
+
38
+ </li>
39
+
40
+
41
+ <li id="section-2">
42
+ <div class="annotation">
43
+
44
+ <div class="pilwrap ">
45
+ <a class="pilcrow" href="#section-2">&#182;</a>
46
+ </div>
47
+ <p>POST request</p>
48
+
49
+ </div>
50
+
51
+ <div class="content"><div class='highlight'><pre>post <span class="string">'/sample2'</span> <span class="keyword">do</span></pre></div></div>
52
+
53
+ </li>
54
+
55
+
56
+ <li id="section-3">
57
+ <div class="annotation">
58
+
59
+ <div class="pilwrap ">
60
+ <a class="pilcrow" href="#section-3">&#182;</a>
61
+ </div>
62
+ <p>set variables</p>
63
+
64
+ </div>
65
+
66
+ <div class="content"><div class='highlight'><pre> set <span class="symbol">:client_id</span>, params[<span class="symbol">:client_id</span>]
67
+ set <span class="symbol">:private_key</span>, params[<span class="symbol">:private_key</span>]
68
+
69
+ <span class="keyword">begin</span></pre></div></div>
70
+
71
+ </li>
72
+
73
+
74
+ <li id="section-4">
75
+ <div class="annotation">
76
+
77
+ <div class="pilwrap ">
78
+ <a class="pilcrow" href="#section-4">&#182;</a>
79
+ </div>
80
+ <p>check required variables</p>
81
+
82
+ </div>
83
+
84
+ <div class="content"><div class='highlight'><pre> raise <span class="string">'Please enter all required parameters'</span> <span class="keyword">if</span> settings.client_id.empty? <span class="keyword">or</span> settings.private_key.empty?</pre></div></div>
85
+
86
+ </li>
87
+
88
+
89
+ <li id="section-5">
90
+ <div class="annotation">
91
+
92
+ <div class="pilwrap ">
93
+ <a class="pilcrow" href="#section-5">&#182;</a>
94
+ </div>
95
+ <p>make a request to API using client_id and private_key</p>
96
+
97
+ </div>
98
+
99
+ <div class="content"><div class='highlight'><pre> files_list = <span class="constant">GroupDocs::Storage::Folder</span>.list!(<span class="string">'/'</span>, {}, {<span class="symbol">:client_id</span> =&gt; settings.client_id, <span class="symbol">:private_key</span> =&gt; settings.private_key})</pre></div></div>
100
+
101
+ </li>
102
+
103
+
104
+ <li id="section-6">
105
+ <div class="annotation">
106
+
107
+ <div class="pilwrap ">
108
+ <a class="pilcrow" href="#section-6">&#182;</a>
109
+ </div>
110
+ <p>construct list of files</p>
111
+
112
+ </div>
113
+
114
+ <div class="content"><div class='highlight'><pre> filelist = <span class="string">''</span>
115
+ files_list.each { |element| filelist &lt;&lt; <span class="string">"<span class="subst">#{element.name}</span>&lt;br /&gt;"</span> }
116
+
117
+ <span class="keyword">rescue</span> <span class="constant">Exception</span> =&gt; e
118
+ err = e.message
119
+ <span class="keyword">end</span></pre></div></div>
120
+
121
+ </li>
122
+
123
+
124
+ <li id="section-7">
125
+ <div class="annotation">
126
+
127
+ <div class="pilwrap ">
128
+ <a class="pilcrow" href="#section-7">&#182;</a>
129
+ </div>
130
+ <p>set variables for template</p>
131
+
132
+ </div>
133
+
134
+ <div class="content"><div class='highlight'><pre> haml <span class="symbol">:sample2</span>, <span class="symbol">:locals</span> =&gt; {<span class="symbol">:userId</span> =&gt; settings.client_id, <span class="symbol">:privateKey</span> =&gt; settings.private_key, <span class="symbol">:filelist</span> =&gt; filelist, <span class="symbol">:err</span> =&gt; err}
135
+ <span class="keyword">end</span></pre></div></div>
136
+
137
+ </li>
138
+
139
+ </ul>
140
+ </div>
141
+ </body>
142
+ </html>