groupdocs 1.5.7 → 1.5.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (177) hide show
  1. data/CHANGELOG.md +51 -0
  2. data/examples/api-samples/Gemfile +1 -1
  3. data/examples/api-samples/Gemfile.lock +43 -0
  4. data/examples/api-samples/public/docs/{sample2.html → sample01.html} +39 -19
  5. data/examples/api-samples/public/docs/{sample3.html → sample02.html} +28 -22
  6. data/examples/api-samples/public/docs/sample03.html +285 -0
  7. data/examples/api-samples/public/docs/{sample4.html → sample04.html} +30 -36
  8. data/examples/api-samples/public/docs/{sample5.html → sample05.html} +68 -31
  9. data/examples/api-samples/public/docs/sample06.html +299 -0
  10. data/examples/api-samples/public/docs/{sample7.html → sample07.html} +53 -18
  11. data/examples/api-samples/public/docs/{sample8.html → sample08.html} +64 -41
  12. data/examples/api-samples/public/docs/sample09.html +260 -0
  13. data/examples/api-samples/public/docs/sample10.html +67 -28
  14. data/examples/api-samples/public/docs/sample11.html +171 -55
  15. data/examples/api-samples/public/docs/sample12.html +53 -17
  16. data/examples/api-samples/public/docs/sample13.html +52 -16
  17. data/examples/api-samples/public/docs/sample14.html +51 -8
  18. data/examples/api-samples/public/docs/sample15.html +46 -10
  19. data/examples/api-samples/public/docs/sample16.html +81 -7
  20. data/examples/api-samples/public/docs/sample17.html +103 -15
  21. data/examples/api-samples/public/docs/sample18.html +117 -41
  22. data/examples/api-samples/public/docs/sample19.html +410 -36
  23. data/examples/api-samples/public/docs/sample20.html +46 -10
  24. data/examples/api-samples/public/docs/sample21.html +504 -45
  25. data/examples/api-samples/public/docs/sample22.html +166 -28
  26. data/examples/api-samples/public/docs/sample23.html +61 -25
  27. data/examples/api-samples/public/docs/sample24.html +100 -12
  28. data/examples/api-samples/public/docs/sample25.html +123 -49
  29. data/examples/api-samples/public/docs/sample26.html +41 -8
  30. data/examples/api-samples/public/docs/sample27.html +125 -50
  31. data/examples/api-samples/public/docs/sample28.html +27 -9
  32. data/examples/api-samples/public/docs/sample29.html +10 -10
  33. data/examples/api-samples/public/docs/sample30.html +70 -14
  34. data/examples/api-samples/public/docs/sample31.html +108 -67
  35. data/examples/api-samples/public/docs/sample32.html +71 -99
  36. data/examples/api-samples/public/docs/sample33.html +107 -32
  37. data/examples/api-samples/public/docs/{sample1.html → sample34.html} +58 -18
  38. data/examples/api-samples/public/docs/sample35.html +666 -0
  39. data/examples/api-samples/public/docs/{sample6.html → sample36.html} +56 -37
  40. data/examples/api-samples/public/docs/sample37.html +815 -0
  41. data/examples/api-samples/public/docs/sample38.html +508 -0
  42. data/examples/api-samples/public/docs/sample39.html +921 -0
  43. data/examples/api-samples/public/docs/sample40.html +510 -0
  44. data/examples/api-samples/public/docs/sample41.html +452 -0
  45. data/examples/api-samples/public/docs/sample42.html +311 -0
  46. data/examples/api-samples/public/templates/test_all_fields2.pdf +0 -0
  47. data/examples/api-samples/samples/sample01.rb +37 -0
  48. data/examples/api-samples/samples/sample02.rb +41 -0
  49. data/examples/api-samples/samples/sample03.rb +73 -0
  50. data/examples/api-samples/samples/sample04.rb +47 -0
  51. data/examples/api-samples/samples/{sample5.rb → sample05.rb} +26 -14
  52. data/examples/api-samples/samples/sample06.rb +80 -0
  53. data/examples/api-samples/samples/sample07.rb +52 -0
  54. data/examples/api-samples/samples/sample08.rb +69 -0
  55. data/examples/api-samples/samples/sample09.rb +83 -0
  56. data/examples/api-samples/samples/sample10.rb +29 -15
  57. data/examples/api-samples/samples/sample11.rb +89 -37
  58. data/examples/api-samples/samples/sample12.rb +22 -11
  59. data/examples/api-samples/samples/sample13.rb +22 -10
  60. data/examples/api-samples/samples/sample14.rb +23 -5
  61. data/examples/api-samples/samples/sample15.rb +18 -7
  62. data/examples/api-samples/samples/sample16.rb +28 -4
  63. data/examples/api-samples/samples/sample17.rb +31 -5
  64. data/examples/api-samples/samples/sample18.rb +36 -8
  65. data/examples/api-samples/samples/sample19.rb +138 -18
  66. data/examples/api-samples/samples/sample20.rb +14 -3
  67. data/examples/api-samples/samples/sample21.rb +162 -23
  68. data/examples/api-samples/samples/sample22.rb +73 -22
  69. data/examples/api-samples/samples/sample23.rb +17 -6
  70. data/examples/api-samples/samples/sample24.rb +34 -7
  71. data/examples/api-samples/samples/sample25.rb +37 -12
  72. data/examples/api-samples/samples/sample26.rb +12 -5
  73. data/examples/api-samples/samples/sample27.rb +38 -12
  74. data/examples/api-samples/samples/sample28.rb +25 -6
  75. data/examples/api-samples/samples/sample29.rb +12 -12
  76. data/examples/api-samples/samples/sample30.rb +27 -15
  77. data/examples/api-samples/samples/sample31.rb +44 -33
  78. data/examples/api-samples/samples/sample32.rb +43 -41
  79. data/examples/api-samples/samples/sample33.rb +42 -14
  80. data/examples/api-samples/samples/sample34.rb +40 -0
  81. data/examples/api-samples/samples/sample35.rb +224 -0
  82. data/examples/api-samples/samples/sample36.rb +58 -0
  83. data/examples/api-samples/samples/sample37.rb +229 -0
  84. data/examples/api-samples/samples/sample38.rb +128 -0
  85. data/examples/api-samples/samples/sample39.rb +252 -0
  86. data/examples/api-samples/samples/sample40.rb +164 -0
  87. data/examples/api-samples/samples/sample41.rb +118 -0
  88. data/examples/api-samples/samples/sample42.rb +97 -0
  89. data/examples/api-samples/views/_others_samples.haml +25 -11
  90. data/examples/api-samples/views/index.haml +23 -11
  91. data/examples/api-samples/views/popup.haml +32 -0
  92. data/examples/api-samples/views/{sample1.haml → sample01.haml} +12 -7
  93. data/examples/api-samples/views/{sample2.haml → sample02.haml} +20 -15
  94. data/examples/api-samples/views/sample03.haml +83 -0
  95. data/examples/api-samples/views/sample04.haml +49 -0
  96. data/examples/api-samples/views/{sample5.haml → sample05.haml} +19 -14
  97. data/examples/api-samples/views/sample06.haml +53 -0
  98. data/examples/api-samples/views/sample07.haml +47 -0
  99. data/examples/api-samples/views/{sample8.haml → sample08.haml} +17 -12
  100. data/examples/api-samples/views/{sample9.haml → sample09.haml} +19 -4
  101. data/examples/api-samples/views/sample10.haml +18 -13
  102. data/examples/api-samples/views/sample11.haml +48 -19
  103. data/examples/api-samples/views/sample12.haml +26 -21
  104. data/examples/api-samples/views/sample13.haml +18 -12
  105. data/examples/api-samples/views/sample14.haml +21 -15
  106. data/examples/api-samples/views/sample15.haml +16 -9
  107. data/examples/api-samples/views/sample16.haml +18 -5
  108. data/examples/api-samples/views/sample17.haml +14 -9
  109. data/examples/api-samples/views/sample18.haml +13 -7
  110. data/examples/api-samples/views/sample19.haml +37 -8
  111. data/examples/api-samples/views/sample20.haml +13 -8
  112. data/examples/api-samples/views/sample21.haml +71 -13
  113. data/examples/api-samples/views/sample22.haml +53 -16
  114. data/examples/api-samples/views/sample23.haml +9 -4
  115. data/examples/api-samples/views/sample24.haml +9 -4
  116. data/examples/api-samples/views/sample25.haml +18 -13
  117. data/examples/api-samples/views/sample26.haml +8 -3
  118. data/examples/api-samples/views/sample27.haml +20 -14
  119. data/examples/api-samples/views/sample28.haml +16 -10
  120. data/examples/api-samples/views/sample29.haml +4 -4
  121. data/examples/api-samples/views/sample30.haml +16 -10
  122. data/examples/api-samples/views/sample31.haml +39 -32
  123. data/examples/api-samples/views/sample32.haml +25 -36
  124. data/examples/api-samples/views/sample33.haml +14 -17
  125. data/examples/api-samples/views/sample34.haml +48 -0
  126. data/examples/api-samples/views/sample35.haml +95 -0
  127. data/examples/api-samples/views/sample36.haml +64 -0
  128. data/examples/api-samples/views/sample37.haml +124 -0
  129. data/examples/api-samples/views/sample38.haml +115 -0
  130. data/examples/api-samples/views/sample39.haml +236 -0
  131. data/examples/api-samples/views/sample40.haml +95 -0
  132. data/examples/api-samples/views/{sample4.haml → sample41.haml} +90 -72
  133. data/examples/api-samples/views/sample42.haml +59 -0
  134. data/lib/groupdocs/api/helpers/rest_helper.rb +13 -1
  135. data/lib/groupdocs/datasource.rb +2 -1
  136. data/lib/groupdocs/document.rb +101 -13
  137. data/lib/groupdocs/document/annotation.rb +28 -13
  138. data/lib/groupdocs/document/annotation/marker.rb +18 -0
  139. data/lib/groupdocs/document/annotation/reply.rb +9 -2
  140. data/lib/groupdocs/document/field.rb +5 -1
  141. data/lib/groupdocs/job.rb +12 -2
  142. data/lib/groupdocs/questionnaire.rb +174 -4
  143. data/lib/groupdocs/questionnaire/collector.rb +21 -0
  144. data/lib/groupdocs/questionnaire/question.rb +19 -0
  145. data/lib/groupdocs/questionnaire/question/answer.rb +5 -0
  146. data/lib/groupdocs/questionnaire/question/conditions.rb +20 -0
  147. data/lib/groupdocs/signature.rb +36 -308
  148. data/lib/groupdocs/signature/envelope.rb +146 -4
  149. data/lib/groupdocs/signature/field.rb +20 -1
  150. data/lib/groupdocs/signature/field/location.rb +18 -7
  151. data/lib/groupdocs/signature/form.rb +199 -10
  152. data/lib/groupdocs/signature/shared/document_methods.rb +38 -0
  153. data/lib/groupdocs/signature/shared/entity_methods.rb +0 -1
  154. data/lib/groupdocs/signature/shared/field_methods.rb +13 -38
  155. data/lib/groupdocs/signature/shared/recipient_methods.rb +8 -0
  156. data/lib/groupdocs/signature/template.rb +3 -1
  157. data/lib/groupdocs/storage.rb +4 -1
  158. data/lib/groupdocs/storage/file.rb +18 -1
  159. data/lib/groupdocs/subscription.rb +8 -3
  160. data/lib/groupdocs/user.rb +8 -0
  161. data/lib/groupdocs/version.rb +1 -1
  162. data/spec/groupdocs/document/annotation_spec.rb +1 -14
  163. data/spec/groupdocs/subscription_spec.rb +2 -2
  164. metadata +86 -32
  165. checksums.yaml +0 -15
  166. data/examples/api-samples/public/docs/sample9.html +0 -200
  167. data/examples/api-samples/samples/sample1.rb +0 -25
  168. data/examples/api-samples/samples/sample2.rb +0 -29
  169. data/examples/api-samples/samples/sample3.rb +0 -33
  170. data/examples/api-samples/samples/sample4.rb +0 -51
  171. data/examples/api-samples/samples/sample6.rb +0 -49
  172. data/examples/api-samples/samples/sample7.rb +0 -42
  173. data/examples/api-samples/samples/sample8.rb +0 -61
  174. data/examples/api-samples/samples/sample9.rb +0 -48
  175. data/examples/api-samples/views/sample3.haml +0 -44
  176. data/examples/api-samples/views/sample6.haml +0 -49
  177. data/examples/api-samples/views/sample7.haml +0 -42
@@ -0,0 +1,236 @@
1
+ %head
2
+ %script{:type=>"text/javascript", :src=>'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'}
3
+ %script{:type=>"text/javascript", :src=>'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js'}
4
+ %script{:type=>"text/javascript", :src=>'http://dev-apps-groupdocs.dynabic.com/content/signaturewidgets/groupdocs.sign.js'}
5
+ :javascript
6
+ $(document).ready(setTimeout(check, 5000));
7
+ function check() {
8
+
9
+ if (($("input[name=callbackUrl]").val() != "") && (document.getElementById("result") != null)) {
10
+ $('#resultsStatus').fadeIn("slow");
11
+ $.ajax({
12
+ type: 'POST',
13
+ url: '/sample39/check',
14
+ success: function (data) {
15
+ var result = null;
16
+ result = data
17
+ if (result!= null) {
18
+ $("#result").css("display", "none");
19
+ var guid = result;
20
+ var leftvar = (screen.width-800)/2;
21
+ var topvar = (screen.height-600)/2;
22
+ window.open('/popup?guid=' + guid, 'Redirect window', 'width=850,height=500,left=' + leftvar + ',top=' + topvar + ',resizable=no,scrollbars=no,location=no');
23
+ } else {
24
+ var leftvar = (screen.width-800)/2;
25
+ var topvar = (screen.height-600)/2;
26
+ window.open('/popup', 'Redirect window', 'width=850,height=500,left=' + leftvar + ',top=' + topvar + ',resizable=no,scrollbars=no,location=no');
27
+ }
28
+ },
29
+ dataType: "text"
30
+ });
31
+ }
32
+ }
33
+ function setLogic() {
34
+ if ($("#useWidget").is(':checked')) {
35
+ $("#btnLoad").prop('type', 'button');
36
+ $("#btnLoad").attr('onClick', 'load();');
37
+ $("#form").removeAttr("type");
38
+ $("#form").removeAttr("method");
39
+ $("#form").attr('action', '#');
40
+ $("#signature").css("display", "block");
41
+ $("#fiSignatureLabel").css("display", "block");
42
+ $("#callBackLabel").css("display", "none");
43
+ $("#callbackUrl").css("display", "none");
44
+ $("#emailLabel").css("display", "none");
45
+ $("#email").css("display", "none");
46
+ $("#nameLabel").css("display", "none");
47
+ $("#name").css("display", "none");
48
+ $("#lastNameLabel").css("display", "none");
49
+ $("#lastName").css("display", "none");
50
+ $("#result").css("display", "none");
51
+ } else {
52
+ $("#form").attr('action', 'sample39');
53
+ $("#form").attr('method', 'post');
54
+ $("#btnLoad").prop('type', 'multipart/form-data');
55
+ $("#signature").css("display", "none");
56
+ $("#fiSignatureLabel").css("display", "none");
57
+ $("#callBackLabel").css("display", "block");
58
+ $("#callbackUrl").css("display", "block");
59
+ $("#btnLoad").prop('type', 'submit');
60
+ $("#btnLoad").removeAttr('onClick');
61
+ $("#emailLabel").css("display", "block");
62
+ $("#email").css("display", "block");
63
+ $("#nameLabel").css("display", "block");
64
+ $("#name").css("display", "block");
65
+ $("#lastNameLabel").css("display", "block");
66
+ $("#lastName").css("display", "block");
67
+ $("#result").css("display", "block");
68
+ }
69
+ }
70
+
71
+ function load() {
72
+ $('#resultsStatus').fadeIn("slow");
73
+ var inputDocument, inputSignature, fileDocument, fileSignature, frDocument, frSignature;
74
+ if (typeof window.FileReader !== 'function') {
75
+ $("enteredData").append("p", "The file API isn't supported on this browser yet.");
76
+ return;
77
+ }
78
+ inputDocument = document.getElementById('document');
79
+ if (!inputDocument) {
80
+ $("enteredData").append("p", "Um, couldn't find the fileinput element.");
81
+ }
82
+ else if (!inputDocument.files) {
83
+ $("enteredData").append("p", "This browser doesn't seem to support the `files` property of file inputs.");
84
+ }
85
+ else if (!inputDocument.files[0]) {
86
+ $("#files_form").append("<p class='error'>Please select a file before clicking 'Load'</p>");
87
+ }
88
+ else {
89
+ fileDocument = inputDocument.files[0];
90
+ frDocument = new FileReader();
91
+ frDocument.onload = receivedDocument;
92
+ frDocument.readAsDataURL(fileDocument);
93
+ }
94
+
95
+
96
+ function receivedDocument() {
97
+
98
+ inputSignature = document.getElementById('signature');
99
+ if (!inputSignature) {
100
+ $("enteredData").append("Um, couldn't find the fileinput element.");
101
+ }
102
+ else if (!inputSignature.files) {
103
+ $("enteredData").append("p", "This browser doesn't seem to support the `files` property of file inputs.");
104
+ }
105
+ else if (!inputSignature.files[0]) {
106
+ $("enteredData").append("<p>Please select a file before clicking 'Load'</p>");
107
+ }
108
+ else {
109
+ fileSignature = inputSignature.files[0];
110
+ frSignature = new FileReader();
111
+ frSignature.onload = receivedSignature;
112
+ frSignature.readAsDataURL(fileSignature);
113
+ }
114
+ }
115
+
116
+ function receivedSignature() {
117
+ var span = document.createElement('span');
118
+ span.innerHTML = ['<img class="thumb" width="100" src="', frSignature.result, '"/>'].join('');
119
+ signDocument();
120
+ }
121
+
122
+ function signDocument() {
123
+ $("body").sign({
124
+ userId: $('#clientId').val(),
125
+ privateKey: $('#privateKey').val(),
126
+ signMethod: "/sample39/postdata",
127
+ onError: function(e, data) {
128
+ alert(data);
129
+ },
130
+ onSigned: function(e, data) {
131
+ $('#resultsStatus').fadeOut("slow");
132
+ var result = $.parseJSON(data);
133
+ console.log(result)
134
+ if (result.error == null) {
135
+ var guid = result[0].guid;
136
+ $("#clientId").val(result[0].clientId);
137
+ $("#privateKey").val(result[0].privateKey);
138
+ var leftvar = (screen.width-800)/2;
139
+ var topvar = (screen.height-600)/2;
140
+ window.open('/popup?guid=' + guid, 'Redirect window', 'width=850,height=500,left=' + leftvar + ',top=' + topvar + ',resizable=no,scrollbars=no,location=no');
141
+ }
142
+ }
143
+ });
144
+ $("body").sign("addDocument", {
145
+ name: fileDocument.name,
146
+ data: frDocument.result
147
+ });
148
+ $("body").sign("addSigner", {
149
+ name: 'Marketplace Team',
150
+ top: 0.03319,
151
+ left: 0.52171,
152
+ width: 100,
153
+ height: 40,
154
+ data: frSignature.result
155
+ });
156
+ $("body").sign("sign");
157
+ }
158
+ }
159
+ %body
160
+ %h3{:style => 'text-align:center;'}
161
+ %a{:href => '/'} GroupDocs Ruby SDK Samples
162
+ \- Sample39
163
+ .samplecontent{:style => 'padding:10px;'}
164
+ %i This sample will show how to add a Signature to a document and redirect after signing with GroupDocs widget
165
+ %br/
166
+ %br/
167
+ %span.documentation
168
+ %a{:href => '/docs/sample39.html'} Builtin documentation for this sample
169
+ %br/
170
+ %br/
171
+ %p
172
+ You entered:
173
+ %p
174
+ UserId = #{(defined? userId) ? userId : ''}
175
+ %p
176
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
177
+ %p
178
+ Email = #{(defined? email) ? email : ''}
179
+ %p
180
+ Name = #{(defined? name) ? name : ''}
181
+ %p
182
+ Last Name = #{(defined? lastName) ? lastName : ''}
183
+ %p
184
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
185
+ %br/
186
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
187
+ %p Enter data for request and press "Make request" button
188
+ %form{:action => '/sample39', :enctype => 'multipart/form-data', :method => 'post'}
189
+ %label{:for => 'clientId'} GroupDocs ClientID
190
+ %br/
191
+ %input{:type=>'text', :name=>'clientId', :id=>'clientId'}
192
+ %br/
193
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
194
+ %br/
195
+ %input{:type=>'text', :name=>'privateKey', :id=>'privateKey'}
196
+ %br/
197
+ %input{:type=>'checkbox', :name=>'useWidget', :value=>'use', :id=>'useWidget', :onclick=> 'setLogic();'}
198
+ %br/
199
+ %label{:for => 'email', :id=>"emailLabel"} Email
200
+ %br/
201
+ %input{:type=>'text', :name=>'email', :id=>'email'}
202
+ %br/
203
+ %label{:for => 'name', :id=>'nameLabel'} Name
204
+ %br/
205
+ %input{:type=>'text', :name=>'name', :id=>'name'}
206
+ %br/
207
+ %label{:for => 'lastName', :id=>'lastNameLabel'} Last Name
208
+ %br/
209
+ %input{:type=>'text', :name=>'lastName', :id=>'lastName'}
210
+ %br/
211
+ %br/
212
+ %label{:for => 'document'} Document to sign
213
+ %br/
214
+ %input{:type=>'file', :name=>'file', :id=>'document'}
215
+ %br/
216
+ %label{:for => 'signature', :id=>'fiSignatureLabel', :style=>'display:none;'} Signature
217
+ %br/
218
+ %input{:type=>'file',:id=>'signature', :style=>'display:none;'}
219
+ %br/
220
+ %label{:for=>'callbackUrl', :id=>'callBackLabel'}
221
+ Callback URL
222
+ %span{:class => 'optional'} (Optional) <br/> (For test Callback you can use this URL: http://groupdocs-ruby-samples.herokuapp.com/sample39/signature_callback)
223
+ %input{:type=>'text', :size=>'70', :value=>"#{(defined? callback) ? callback : ''}", :name=>'callbackUrl', :id=>'callbackUrl'}
224
+ %br/
225
+ %br/
226
+ %input{:type => 'submit', :id=>'btnLoad', :value => 'Upload and sign the document'}
227
+ %span{:id=>'resultsStatus', :style=>'color:red;display:none;'} (Please wait for ajax response)
228
+ %br/
229
+ %iframe{:id=>'downloadframe', :style=>'display:none'}
230
+ %div{:style => 'padding:20px; border:1px solid black;', :id=>'result'}
231
+ %p
232
+ Results:
233
+ %br/
234
+ #{(defined? iframe) ? iframe : ''}
235
+
236
+ = partial :_others_samples
@@ -0,0 +1,95 @@
1
+ %h3{:style => 'text-align:center;'}
2
+ %a{:href => '/'} GroupDocs Ruby SDK Samples
3
+ \- Sample40
4
+ .samplecontent{:style => 'padding:10px;'}
5
+ %span.description
6
+ %i
7
+ This sample will show how to set callback for signature form and re-direct when it was signed using Ruby SDK
8
+ %br/
9
+ %br/
10
+ /
11
+ %span.documentation
12
+ %a{:href => '/docs/sample40.html'} Builtin documentation for this sample
13
+
14
+ %br/
15
+ %br/
16
+ %p
17
+ You entered:
18
+ %p
19
+ ClientID = #{(defined? userId) ? userId : ''}
20
+ %p
21
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
22
+ %p
23
+ Email = #{(defined? email) ? email : ''}
24
+ %p
25
+ Callback = #{(defined? callback) ? callback : ''}
26
+ %p
27
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
28
+ %br/
29
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
30
+ %p Enter data for request and press "Make request" button
31
+ %form{:action => '/sample40', :enctype => 'multipart/form-data', :method => 'post'}
32
+ %label{:for => 'clientId'} GroupDocs ClientID
33
+ %br/
34
+ %input{:type=>'text', :name=>'clientId'}
35
+ %br/
36
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
37
+ %br/
38
+ %input{:type=>'text', :name=>'privateKey'}
39
+ %br/
40
+ %label{:for=>'form', :id=>'form'} Form GUID
41
+ %br/
42
+ %input{:type=>'text', :name=>'formGuid'}
43
+ %br/
44
+ %label{:for=>'callback'}
45
+ Callback URL
46
+ %span.optional (Optional)
47
+ %br/
48
+ %font{:color=>'grey'} (For test Callback you can use this URL: http://groupdocs-ruby-samples.herokuapp.com/sample40/callback)
49
+ %input{:type=>'text', :size=>'70', :value=>"#{(defined? callback) ? callback : ''}", :name=>'callbackUrl'}
50
+ %br/
51
+ %label{:for => 'basePath'} Base Path
52
+ %span{:class => 'optional'} (Optional)
53
+ %br/
54
+ %input{:type=>'text', :name=>'basePath', :id=>'basePath'}
55
+ %br/
56
+ %br/
57
+
58
+ %input{:type => 'submit', :value => 'Publish form'}
59
+ %span{:id=>'resultsStatus', :style=>'color:red;display:none;'} (Please wait for ajax response)
60
+ %br/
61
+ %div{:style => 'padding:20px; border:1px solid black;', :id => 'result'}
62
+ %p
63
+ Results:
64
+ #{(defined? iframe) ? iframe : ''}
65
+
66
+ = partial :_others_samples
67
+
68
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
69
+ :javascript
70
+ $(document).ready(setTimeout(check, 15000));
71
+ function check() {
72
+
73
+ if (($("input[name=callbackUrl]").val() != "") && (document.getElementById("result") != null)) {
74
+ $('#resultsStatus').fadeIn("slow");
75
+ $.ajax({
76
+ type: 'POST',
77
+ url: '/sample40/check_guid',
78
+ success: function(data) {
79
+ $('#resultsStatus').fadeOut("slow");
80
+ var result = null;
81
+ result = data;
82
+ console.log(result)
83
+ if (result) {
84
+ $("#result").css("display", "none");
85
+ var guid = result;
86
+ var leftvar = (screen.width - 800) / 2;
87
+ var topvar = (screen.height - 600) / 2;
88
+ window.open('/popup?guid=' + guid, 'Redirect window', 'width=850,height=500,left=' + leftvar + ',top=' + topvar + ',resizable=no,scrollbars=no,location=no');
89
+ }
90
+ },
91
+ dataType: "text"
92
+ });
93
+ }
94
+ }
95
+
@@ -1,73 +1,91 @@
1
- %h3{:style => 'text-align:center;'}
2
- %a{:href => '/'} GroupDocs Ruby SDK Samples
3
- \- Sample4
4
- .samplecontent{:style => 'padding:10px;'}
5
- %i This sample will show how to download particular file from GroupDocs account using Ruby SDK
6
- %br/
7
- %br/
8
- %span.documentation
9
- %a{:href => '/docs/sample4.html'} Builtin documentation for this sample
10
- %br/
11
- %br/
12
- %p
13
- You entered:
14
- %p
15
- UserId = #{(defined? userId) ? userId : ''}
16
- %p
17
- PrivateKey = #{(defined? privateKey) ? privateKey : ''}
18
- %p
19
- FileId = #{(defined? file_id) ? file_id : ''}
20
- %p
21
- %font{:color => 'red'} #{(defined? err) ? err : ''}
22
- #requestForm{:style => 'padding:20px; border:1px solid black;'}
23
- %p Enter data for request and press "Download" button
24
- %form{:action => '/sample4', :enctype => 'multipart/form-data', :method => 'post'}
25
- %label{:for => 'client_id'} GroupDocs ClientID
26
- %br/
27
- %input{:type=>'text', :name=>'client_id'}
28
- %br/
29
- %label{:for => 'private_key'} GroupDocs PrivateKey
30
- %br/
31
- %input{:type=>'text', :name=>'private_key'}
32
- %br/
33
-
34
- %div.guid_radio
35
- %input{:type=>'radio', :name=>'source', :value=>'guid', :checked=>'checked'} File ID (GUID)
36
- %br/
37
- %input{:type=>'radio', :name=>'source', :value=>'local'}Upload local file
38
- %br/
39
- %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
40
- %br/
41
-
42
- %div.guid_field
43
- %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
44
- %br/
45
- %input{:type=>'text', :name=>'fileId'}
46
-
47
- %div.guid_field{:style=>'display:none;'}
48
- %label{:for=>'file'} Upload local file
49
- %br/
50
- %input{:type=>'file', :name=>'file'}
51
-
52
- %div.guid_field{:style=>'display:none;'}
53
- %label{:for=>'url', :id=>'url'} Upload file from URL
54
- %br/
55
- %input{:type=>'text', :name=>'url'}
56
-
57
- %br/
58
- %input{:type => 'submit', :value => 'Download'}/
59
- #{(defined? massage) ? massage : ''}
60
- %br/
61
-
62
- = partial :_others_samples
63
-
64
- %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
65
- :javascript
66
-
67
- $(function($){
68
- $('.guid_radio input').change(function(){
69
- var elementIndex = $(this).parent().children('input').index($(this));
70
- $('.guid_field').hide();
71
- $('.guid_field').eq(elementIndex).show();
72
- });
1
+ %h3{:style => 'text-align:center;'}
2
+ %a{:href => '/'} GroupDocs Ruby SDK Samples
3
+ \- Sample41
4
+ .samplecontent{:style => 'padding:10px;'}
5
+ %span.description
6
+ %i
7
+ This sample will show how to add numeration in the doc file using GroupDocs Ruby SDK.
8
+
9
+ %br/
10
+ %br/
11
+ /
12
+ %span.documentation
13
+ %a{:href => '/docs/sample41.html'} Builtin documentation for this sample
14
+
15
+ %br/
16
+ %br/
17
+ %p
18
+ You entered:
19
+ %p
20
+ ClientID = #{(defined? userId) ? userId : ''}
21
+ %p
22
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
23
+ %p
24
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
25
+ %br/
26
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
27
+ %p Enter data for request and press "Make request" button
28
+ %form{:action => '/sample41', :enctype => 'multipart/form-data', :method => 'post'}
29
+ %label{:for => 'clientId'} GroupDocs ClientID
30
+ %br/
31
+ %input{:type=>'text', :name=>'clientId'}
32
+ %br/
33
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
34
+ %br/
35
+ %input{:type=>'text', :name=>'privateKey'}
36
+ %br/
37
+
38
+
39
+ %div.guid_radio
40
+ %input{:type=>'radio', :name=>'source', :value=>'guid'} File ID (GUID)
41
+ %br/
42
+ %input{:type=>'radio', :name=>'source', :value=>'local', :checked=>'checked'}Upload local file
43
+ %br/
44
+ %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
45
+ %br/
46
+
47
+ %div.guid_field{:style=>'display:none;'}
48
+ %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
49
+ %br/
50
+ %input{:type=>'text', :name=>'fileId'}
51
+
52
+ %div.guid_field
53
+ %label{:for=>'file'} Upload local file
54
+ %br/
55
+ %input{:type=>'file', :name=>'file'}
56
+
57
+ %div.guid_field{:style=>'display:none;'}
58
+ %label{:for=>'url', :id=>'url'} Upload file from URL
59
+ %br/
60
+ %input{:type=>'text', :name=>'url'}
61
+
62
+ %br/
63
+ %label{:for => 'basePath'} Base Path
64
+ %span{:class => 'optional'} (Optional)
65
+ %br/
66
+ %input{:type=>'text', :name=>'basePath'}
67
+ %br/
68
+ %br/
69
+
70
+ %input{:type => 'submit', :value => 'Make request'}
71
+
72
+ %br/
73
+ %br/
74
+ %br/
75
+ %div{:style => 'padding:20px; border:1px solid black;'}
76
+ %p
77
+ Results:
78
+ #{(defined? iframe) ? iframe : ''}
79
+
80
+ = partial :_others_samples
81
+
82
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
83
+ :javascript
84
+ $(function($){
85
+
86
+ $('.guid_radio input').change(function(){
87
+ var elementIndex = $(this).parent().children('input').index($(this));
88
+ $('.guid_field').hide();
89
+ $('.guid_field').eq(elementIndex).show();
90
+ });
73
91
  });