groupdocs 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. data/CHANGELOG.md +34 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +3 -0
  4. data/examples/api-samples/public/docs/sample01.html +23 -23
  5. data/examples/api-samples/public/docs/sample02.html +27 -27
  6. data/examples/api-samples/public/docs/sample03.html +81 -69
  7. data/examples/api-samples/public/docs/sample04.html +29 -29
  8. data/examples/api-samples/public/docs/sample05.html +48 -48
  9. data/examples/api-samples/public/docs/sample06.html +47 -46
  10. data/examples/api-samples/public/docs/sample07.html +35 -35
  11. data/examples/api-samples/public/docs/sample08.html +45 -45
  12. data/examples/api-samples/public/docs/sample09.html +57 -57
  13. data/examples/api-samples/public/docs/sample10.html +41 -41
  14. data/examples/api-samples/public/docs/sample11.html +96 -118
  15. data/examples/api-samples/public/docs/sample12.html +29 -50
  16. data/examples/api-samples/public/docs/sample13.html +36 -44
  17. data/examples/api-samples/public/docs/sample14.html +29 -29
  18. data/examples/api-samples/public/docs/sample15.html +24 -24
  19. data/examples/api-samples/public/docs/sample16.html +32 -32
  20. data/examples/api-samples/public/docs/sample17.html +38 -38
  21. data/examples/api-samples/public/docs/sample18.html +105 -101
  22. data/examples/api-samples/public/docs/sample19.html +101 -101
  23. data/examples/api-samples/public/docs/sample20.html +42 -42
  24. data/examples/api-samples/public/docs/sample21.html +109 -109
  25. data/examples/api-samples/public/docs/sample22.html +56 -56
  26. data/examples/api-samples/public/docs/sample23.html +39 -39
  27. data/examples/api-samples/public/docs/sample24.html +36 -36
  28. data/examples/api-samples/public/docs/sample25.html +67 -67
  29. data/examples/api-samples/public/docs/sample26.html +23 -23
  30. data/examples/api-samples/public/docs/sample27.html +72 -72
  31. data/examples/api-samples/public/docs/sample28.html +46 -45
  32. data/examples/api-samples/public/docs/sample29.html +30 -30
  33. data/examples/api-samples/public/docs/sample30.html +30 -30
  34. data/examples/api-samples/public/docs/sample31.html +114 -114
  35. data/examples/api-samples/public/docs/sample32.html +96 -96
  36. data/examples/api-samples/public/docs/sample33.html +56 -56
  37. data/examples/api-samples/public/docs/sample34.html +27 -27
  38. data/examples/api-samples/public/docs/sample35.html +134 -135
  39. data/examples/api-samples/public/docs/sample36.html +32 -32
  40. data/examples/api-samples/public/docs/sample37.html +103 -103
  41. data/examples/api-samples/public/docs/sample38.html +76 -76
  42. data/examples/api-samples/public/docs/sample39.html +136 -136
  43. data/examples/api-samples/public/docs/sample40.html +104 -104
  44. data/examples/api-samples/public/docs/sample41.html +137 -137
  45. data/examples/api-samples/public/docs/sample42.html +61 -61
  46. data/examples/api-samples/public/docs/sample43.html +72 -72
  47. data/examples/api-samples/public/docs/sample44.html +751 -0
  48. data/examples/api-samples/public/docs/sample45.html +236 -0
  49. data/examples/api-samples/public/templates/merge_field3_doc.docx +0 -0
  50. data/examples/api-samples/samples/sample01.rb +2 -2
  51. data/examples/api-samples/samples/sample02.rb +2 -2
  52. data/examples/api-samples/samples/sample03.rb +2 -2
  53. data/examples/api-samples/samples/sample04.rb +2 -2
  54. data/examples/api-samples/samples/sample05.rb +2 -2
  55. data/examples/api-samples/samples/sample06.rb +2 -2
  56. data/examples/api-samples/samples/sample07.rb +2 -2
  57. data/examples/api-samples/samples/sample08.rb +2 -2
  58. data/examples/api-samples/samples/sample09.rb +2 -2
  59. data/examples/api-samples/samples/sample10.rb +2 -2
  60. data/examples/api-samples/samples/sample11.rb +2 -2
  61. data/examples/api-samples/samples/sample12.rb +2 -2
  62. data/examples/api-samples/samples/sample13.rb +2 -2
  63. data/examples/api-samples/samples/sample14.rb +2 -2
  64. data/examples/api-samples/samples/sample15.rb +2 -2
  65. data/examples/api-samples/samples/sample16.rb +2 -2
  66. data/examples/api-samples/samples/sample17.rb +2 -2
  67. data/examples/api-samples/samples/sample18.rb +2 -2
  68. data/examples/api-samples/samples/sample19.rb +2 -2
  69. data/examples/api-samples/samples/sample20.rb +2 -2
  70. data/examples/api-samples/samples/sample21.rb +2 -2
  71. data/examples/api-samples/samples/sample22.rb +2 -2
  72. data/examples/api-samples/samples/sample23.rb +2 -2
  73. data/examples/api-samples/samples/sample24.rb +2 -2
  74. data/examples/api-samples/samples/sample25.rb +2 -2
  75. data/examples/api-samples/samples/sample26.rb +2 -2
  76. data/examples/api-samples/samples/sample27.rb +2 -2
  77. data/examples/api-samples/samples/sample28.rb +2 -2
  78. data/examples/api-samples/samples/sample29.rb +2 -2
  79. data/examples/api-samples/samples/sample30.rb +2 -2
  80. data/examples/api-samples/samples/sample31.rb +2 -2
  81. data/examples/api-samples/samples/sample32.rb +2 -2
  82. data/examples/api-samples/samples/sample33.rb +2 -2
  83. data/examples/api-samples/samples/sample34.rb +2 -2
  84. data/examples/api-samples/samples/sample35.rb +4 -4
  85. data/examples/api-samples/samples/sample36.rb +2 -2
  86. data/examples/api-samples/samples/sample37.rb +2 -2
  87. data/examples/api-samples/samples/sample38.rb +2 -2
  88. data/examples/api-samples/samples/sample39.rb +2 -2
  89. data/examples/api-samples/samples/sample40.rb +2 -2
  90. data/examples/api-samples/samples/sample41.rb +2 -2
  91. data/examples/api-samples/samples/sample42.rb +2 -2
  92. data/examples/api-samples/samples/sample43.rb +2 -2
  93. data/examples/api-samples/samples/sample44.rb +188 -0
  94. data/examples/api-samples/samples/sample45.rb +74 -0
  95. data/examples/api-samples/views/_others_samples.haml +47 -43
  96. data/examples/api-samples/views/index.haml +55 -44
  97. data/examples/api-samples/views/layout.haml +1 -6
  98. data/examples/api-samples/views/sample01.haml +62 -57
  99. data/examples/api-samples/views/sample02.haml +52 -46
  100. data/examples/api-samples/views/sample03.haml +78 -73
  101. data/examples/api-samples/views/sample04.haml +51 -45
  102. data/examples/api-samples/views/sample05.haml +77 -71
  103. data/examples/api-samples/views/sample06.haml +58 -52
  104. data/examples/api-samples/views/sample07.haml +51 -45
  105. data/examples/api-samples/views/sample08.haml +90 -84
  106. data/examples/api-samples/views/sample09.haml +86 -80
  107. data/examples/api-samples/views/sample10.haml +83 -77
  108. data/examples/api-samples/views/sample11.haml +124 -120
  109. data/examples/api-samples/views/sample12.haml +65 -59
  110. data/examples/api-samples/views/sample13.haml +62 -56
  111. data/examples/api-samples/views/sample14.haml +57 -51
  112. data/examples/api-samples/views/sample15.haml +49 -43
  113. data/examples/api-samples/views/sample16.haml +49 -43
  114. data/examples/api-samples/views/sample17.haml +53 -47
  115. data/examples/api-samples/views/sample18.haml +140 -134
  116. data/examples/api-samples/views/sample19.haml +87 -81
  117. data/examples/api-samples/views/sample20.haml +53 -47
  118. data/examples/api-samples/views/sample21.haml +115 -111
  119. data/examples/api-samples/views/sample22.haml +94 -88
  120. data/examples/api-samples/views/sample23.haml +83 -78
  121. data/examples/api-samples/views/sample24.haml +54 -48
  122. data/examples/api-samples/views/sample25.haml +89 -83
  123. data/examples/api-samples/views/sample26.haml +62 -57
  124. data/examples/api-samples/views/sample27.haml +114 -109
  125. data/examples/api-samples/views/sample28.haml +55 -49
  126. data/examples/api-samples/views/sample29.haml +67 -69
  127. data/examples/api-samples/views/sample30.haml +54 -48
  128. data/examples/api-samples/views/sample31.haml +106 -100
  129. data/examples/api-samples/views/sample32.haml +90 -84
  130. data/examples/api-samples/views/sample33.haml +60 -54
  131. data/examples/api-samples/views/sample34.haml +51 -46
  132. data/examples/api-samples/views/sample35.haml +84 -78
  133. data/examples/api-samples/views/sample36.haml +63 -58
  134. data/examples/api-samples/views/sample37.haml +122 -116
  135. data/examples/api-samples/views/sample38.haml +104 -98
  136. data/examples/api-samples/views/sample39.haml +6 -2
  137. data/examples/api-samples/views/sample40.haml +94 -89
  138. data/examples/api-samples/views/sample41.haml +127 -123
  139. data/examples/api-samples/views/sample42.haml +60 -54
  140. data/examples/api-samples/views/sample43.haml +81 -77
  141. data/examples/api-samples/views/sample44.haml +85 -0
  142. data/examples/api-samples/views/sample45.haml +85 -0
  143. data/groupdocs.gemspec +2 -0
  144. data/lib/groupdocs/datasource/field.rb +9 -0
  145. data/lib/groupdocs/document.rb +66 -4
  146. data/lib/groupdocs/document/annotation.rb +11 -6
  147. data/lib/groupdocs/document/editor.rb +53 -0
  148. data/lib/groupdocs/document/field.rb +16 -0
  149. data/lib/groupdocs/document/style.rb +30 -0
  150. data/lib/groupdocs/job.rb +24 -0
  151. data/lib/groupdocs/questionnaire.rb +2 -0
  152. data/lib/groupdocs/questionnaire/collector.rb +52 -0
  153. data/lib/groupdocs/questionnaire/collector_style.rb +54 -0
  154. data/lib/groupdocs/questionnaire/question.rb +9 -0
  155. data/lib/groupdocs/questionnaire/style/base_font.rb +17 -0
  156. data/lib/groupdocs/questionnaire/style/question_title.rb +17 -0
  157. data/lib/groupdocs/questionnaire/style/title.rb +17 -0
  158. data/lib/groupdocs/signature/envelope.rb +43 -8
  159. data/lib/groupdocs/signature/form.rb +113 -12
  160. data/lib/groupdocs/signature/recipient.rb +38 -3
  161. data/lib/groupdocs/signature/shared/field_methods.rb +4 -2
  162. data/lib/groupdocs/signature/template.rb +20 -1
  163. data/lib/groupdocs/storage/file.rb +3 -2
  164. data/lib/groupdocs/user.rb +148 -0
  165. data/lib/groupdocs/version.rb +1 -1
  166. data/spec/groupdocs/api/helpers/access_rights_helper_spec.rb +5 -5
  167. data/spec/groupdocs/document/annotation_spec.rb +1 -1
  168. data/spec/groupdocs/signature/envelope_spec.rb +1 -1
  169. data/spec/groupdocs/user_spec.rb +4 -4
  170. data/spec/support/shared_examples/signature/shared/field_methods.rb +5 -4
  171. metadata +18 -3
@@ -1,4 +1,7 @@
1
1
  %head
2
+ %title Sample 39 - How to add a Signature to a document and re-direct after signing with GroupDocs widget
3
+ %link(rel="stylesheet" type="text/css" href="/css/style.css")
4
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
2
5
  %script{:type=>"text/javascript", :src=>'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'}
3
6
  %script{:type=>"text/javascript", :src=>'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js'}
4
7
  %script{:type=>"text/javascript", :src=>'http://dev-apps-groupdocs.dynabic.com/content/signaturewidgets/groupdocs.sign.js'}
@@ -159,7 +162,8 @@
159
162
  %body
160
163
  %h3{:style => 'text-align:center;'}
161
164
  %a{:href => '/'} GroupDocs Ruby SDK Samples
162
- \- Sample39
165
+ %br/
166
+ Sample 39 - How to add a Signature to a document and re-direct after signing with GroupDocs widget
163
167
  .samplecontent{:style => 'padding:10px;'}
164
168
  %i This sample will show how to add a Signature to a document and redirect after signing with GroupDocs widget
165
169
  %br/
@@ -185,7 +189,7 @@
185
189
  %br/
186
190
  #requestForm{:style => 'padding:20px; border:1px solid black;'}
187
191
  %p Enter data for request and press "Make request" button
188
- %form{:action => '/sample39', :enctype => 'multipart/form-data', :method => 'post'}
192
+ %form{:action => '/sample-39-how-to-add-a-signature-to-a-document-and-re-direct-after-signing-with-groupdocs-widget', :enctype => 'multipart/form-data', :method => 'post'}
189
193
  %label{:for => 'clientId'} GroupDocs ClientID
190
194
  %br/
191
195
  %input{:type=>'text', :name=>'clientId', :id=>'clientId'}
@@ -1,95 +1,100 @@
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
1
+ %head
2
+ %title Sample 40 - How to set callback for Annotation and manage user rights
3
+ %link(rel="stylesheet" type="text/css" href="/css/style.css")
4
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
5
+ %body
6
+ %h3{:style => 'text-align:center;'}
7
+ %a{:href => '/'} GroupDocs Ruby SDK Samples
8
+ %br/
9
+ Sample 40 - How to set callback for Annotation and manage user rights
10
+ .samplecontent{:style => 'padding:10px;'}
11
+ %span.description
12
+ %i
13
+ This sample will show how to set callback for signature form and re-direct when it was signed using Ruby SDK
14
+ %br/
15
+ %br/
16
+ /
17
+ %span.documentation
18
+ %a{:href => '/docs/sample40.html'} Builtin documentation for this sample
13
19
 
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'}
20
+ %br/
21
+ %br/
22
+ %p
23
+ You entered:
24
+ %p
25
+ ClientID = #{(defined? userId) ? userId : ''}
26
+ %p
27
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
62
28
  %p
63
- Results:
64
- #{(defined? iframe) ? iframe : ''}
29
+ Email = #{(defined? email) ? email : ''}
30
+ %p
31
+ Callback = #{(defined? callback) ? callback : ''}
32
+ %p
33
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
34
+ %br/
35
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
36
+ %p Enter data for request and press "Make request" button
37
+ %form{:action => '/sample-40-how-to-set-callback-for-signature-form-and-re-direct-when-it-was-signed', :enctype => 'multipart/form-data', :method => 'post'}
38
+ %label{:for => 'clientId'} GroupDocs ClientID
39
+ %br/
40
+ %input{:type=>'text', :name=>'clientId'}
41
+ %br/
42
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
43
+ %br/
44
+ %input{:type=>'text', :name=>'privateKey'}
45
+ %br/
46
+ %label{:for=>'form', :id=>'form'} Form GUID
47
+ %br/
48
+ %input{:type=>'text', :name=>'formGuid'}
49
+ %br/
50
+ %label{:for=>'callback'}
51
+ Callback URL
52
+ %span.optional (Optional)
53
+ %br/
54
+ %font{:color=>'grey'} (For test Callback you can use this URL: http://groupdocs-ruby-samples.herokuapp.com/sample40/callback)
55
+ %input{:type=>'text', :size=>'70', :value=>"#{(defined? callback) ? callback : ''}", :name=>'callbackUrl'}
56
+ %br/
57
+ %label{:for => 'basePath'} Base Path
58
+ %span{:class => 'optional'} (Optional)
59
+ %br/
60
+ %input{:type=>'text', :name=>'basePath', :id=>'basePath'}
61
+ %br/
62
+ %br/
65
63
 
66
- = partial :_others_samples
64
+ %input{:type => 'submit', :value => 'Publish form'}
65
+ %span{:id=>'resultsStatus', :style=>'color:red;display:none;'} (Please wait for ajax response)
66
+ %br/
67
+ %div{:style => 'padding:20px; border:1px solid black;', :id => 'result'}
68
+ %p
69
+ Results:
70
+ #{(defined? iframe) ? iframe : ''}
67
71
 
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
+ = partial :_others_samples
72
73
 
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
- }
74
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
75
+ :javascript
76
+ $(document).ready(setTimeout(check, 15000));
77
+ function check() {
78
+ if (($("input[name=callbackUrl]").val() != "") && (document.getElementById("result") != null)) {
79
+ $('#resultsStatus').fadeIn("slow");
80
+ $.ajax({
81
+ type: 'POST',
82
+ url: '/sample40/check_guid',
83
+ success: function(data) {
84
+ $('#resultsStatus').fadeOut("slow");
85
+ var result = null;
86
+ result = data;
87
+ console.log(result)
88
+ if (result) {
89
+ $("#result").css("display", "none");
90
+ var guid = result;
91
+ var leftvar = (screen.width - 800) / 2;
92
+ var topvar = (screen.height - 600) / 2;
93
+ window.open('/popup?guid=' + guid, 'Redirect window', 'width=850,height=500,left=' + leftvar + ',top=' + topvar + ',resizable=no,scrollbars=no,location=no');
94
+ }
95
+ },
96
+ dataType: "text"
97
+ });
98
+ }
99
+ }
95
100
 
@@ -1,134 +1,138 @@
1
- %h3{:style => 'text-align:center;'}
2
- %a{:href => '/'} GroupDocs Ruby SDK Samples
3
- \- Sample41
4
- .samplecontent{:style => 'padding:10px;'}
5
- %span.description
6
- This sample will show how to set callback for Annotation and manage user rights using Ruby SDK.
7
- %br/
8
- %br/
9
- /
10
- %span.documentation
11
- %a{:href => '/docs/sample41.html'} Builtin documentation for this sample
12
-
13
- %br/
14
- %br/
15
- %p
16
- You entered:
17
- %p
18
- ClientID = #{(defined? userId) ? userId : ''}
19
- %p
20
- PrivateKey = #{(defined? privateKey) ? privateKey : ''}
21
- %p
22
- FileID = #{(defined? fileId) ? fileId : ''}
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
-
29
- %form{:action => "/sample41", :enctype => 'multipart/form-data', :method => 'post', :id=>'form'}
30
- %label{:for => 'clientId'} GroupDocs ClientID
31
- %br/
32
- %input{:type=>'text', :name=>'clientId', :id=>'client_id', :value=>"#{(defined? userId) ? userId : ''}"}
33
- %br/
34
- %label{:for => 'privateKey'} GroupDocs PrivateKey
35
- %br/
36
- %input{:type=>'text', :name=>'privateKey', :id=>'private_key', :value=>"#{(defined? privateKey) ? privateKey : ''}"}
37
- %br/
38
-
39
-
40
- %div.guid_radio{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
41
- %input{:type=>'radio', :name=>'source', :value=>'guid'} File ID (GUID)
1
+ %head
2
+ %title Sample 41 - How to set callback for Annotation and manage user rights
3
+ %link(rel="stylesheet" type="text/css" href="/css/style.css")
4
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
5
+ %body
6
+ %h3{:style => 'text-align:center;'}
7
+ %a{:href => '/'} GroupDocs Ruby SDK Samples
8
+ %br/
9
+ Sample 41 - How to set callback for Annotation and manage user rights
10
+ .samplecontent{:style => 'padding:10px;'}
11
+ %span.description
12
+ This sample will show how to set callback for Annotation and manage user rights using Ruby SDK.
13
+ %br/
14
+ %br/
15
+ /
16
+ %span.documentation
17
+ %a{:href => '/docs/sample41.html'} Builtin documentation for this sample
18
+
19
+ %br/
20
+ %br/
21
+ %p
22
+ You entered:
23
+ %p
24
+ ClientID = #{(defined? userId) ? userId : ''}
25
+ %p
26
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
27
+ %p
28
+ FileID = #{(defined? fileId) ? fileId : ''}
29
+ %p
30
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
31
+ %br/
32
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
33
+ %p Enter data for request and press "Make request" button
34
+
35
+ %form{:action => "/sample-41-how-to-set-callback-for-annotation-and-manage-user-rights", :enctype => 'multipart/form-data', :method => 'post', :id=>'form'}
36
+ %label{:for => 'clientId'} GroupDocs ClientID
42
37
  %br/
43
- %input{:type=>'radio', :name=>'source', :value=>'local', :checked=>'checked'}Upload local file
38
+ %input{:type=>'text', :name=>'clientId', :id=>'client_id', :value=>"#{(defined? userId) ? userId : ''}"}
44
39
  %br/
45
- %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
40
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
41
+ %br/
42
+ %input{:type=>'text', :name=>'privateKey', :id=>'private_key', :value=>"#{(defined? privateKey) ? privateKey : ''}"}
46
43
  %br/
47
44
 
48
- %div.fields{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
49
- %div.guid_field{:style=>'display:none;'}
50
- %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
51
- %br/
52
- %input{:type=>'text', :name=>'fileId', :id=>'guid', :value=>"#{(defined? fileId) ? fileId : ''}"}
53
45
 
54
- %div.guid_field
55
- %label{:for=>'file'} Upload local file
46
+ %div.guid_radio{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
47
+ %input{:type=>'radio', :name=>'source', :value=>'guid'} File ID (GUID)
56
48
  %br/
57
- %input{:type=>'file', :name=>'file', :id=>'file'}
58
-
59
- %div.guid_field{:style=>'display:none;'}
60
- %label{:for=>'url', :id=>'url'} Upload file from URL
49
+ %input{:type=>'radio', :name=>'source', :value=>'local', :checked=>'checked'}Upload local file
50
+ %br/
51
+ %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
61
52
  %br/
62
- %input{:type=>'text', :name=>'url', :id=>'url'}
63
- %label First collaborator email
64
- %br/
65
- %input{:type=>'text', :name=>'email[]', :value=>""}
66
- %br/
67
- %label Second collaborator email
68
- %br/
69
- %input{:type=>'text', :name=>'email[]', :value=>""}
70
- %br/
71
- %label callbackUrl
72
- %span{:class => 'optional'} (Optional) <br/> (For test Callback you can use this URL: http://groupdocs-ruby-samples.herokuapp.com/sample41/callback)
73
- %br/
74
- %input{:type=>'text', :name=>'callbackUrl', :id => 'callbackUrl', :value=>"#{(defined? callbackUrl) ? callbackUrl : ''}"}
75
- %br/
76
- %label{:for => 'basePath'} Base Path
77
- %font{:color=>'grey'} (Optional)
78
- %br/
79
- %input{:type=>'text', :name=>'basePath', :id=>'base_path', :value=>"#{(defined? base_path) ? base_path : ''}"}
80
- %br/
81
- %br/
82
- %input{:type => 'submit', :id => 'button', :value => 'Make request'}
83
- %br/
84
- %span{:id=>'resultsStatus', :style=>'color:red;display:none;'} (Please wait for ajax response)
85
- %br/
86
- %div{:style => 'padding:20px; border:1px solid black;'}
87
- %p
88
- Results:
89
- #rights
90
- %p
91
- #result
92
- %p
93
- #{(defined? iframe) ? iframe : ''}
94
-
95
-
96
-
97
- = partial :_others_samples
98
- %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
99
-
100
- :javascript
101
- $(function($){
102
- $('.guid_radio input').change(function(){
103
- var elementIndex = $(this).parent().children('input').index($(this));
104
- $('.guid_field').hide();
105
- $('.guid_field').eq(elementIndex).show();
53
+
54
+ %div.fields{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
55
+ %div.guid_field{:style=>'display:none;'}
56
+ %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
57
+ %br/
58
+ %input{:type=>'text', :name=>'fileId', :id=>'guid', :value=>"#{(defined? fileId) ? fileId : ''}"}
59
+
60
+ %div.guid_field
61
+ %label{:for=>'file'} Upload local file
62
+ %br/
63
+ %input{:type=>'file', :name=>'file', :id=>'file'}
64
+
65
+ %div.guid_field{:style=>'display:none;'}
66
+ %label{:for=>'url', :id=>'url'} Upload file from URL
67
+ %br/
68
+ %input{:type=>'text', :name=>'url', :id=>'url'}
69
+ %label First collaborator email
70
+ %br/
71
+ %input{:type=>'text', :name=>'email[]', :value=>""}
72
+ %br/
73
+ %label Second collaborator email
74
+ %br/
75
+ %input{:type=>'text', :name=>'email[]', :value=>""}
76
+ %br/
77
+ %label callbackUrl
78
+ %span{:class => 'optional'} (Optional) <br/> (For test Callback you can use this URL: http://groupdocs-ruby-samples.herokuapp.com/sample41/callback)
79
+ %br/
80
+ %input{:type=>'text', :name=>'callbackUrl', :id => 'callbackUrl', :value=>"#{(defined? callbackUrl) ? callbackUrl : ''}"}
81
+ %br/
82
+ %label{:for => 'basePath'} Base Path
83
+ %font{:color=>'grey'} (Optional)
84
+ %br/
85
+ %input{:type=>'text', :name=>'basePath', :id=>'base_path', :value=>"#{(defined? base_path) ? base_path : ''}"}
86
+ %br/
87
+ %br/
88
+ %input{:type => 'submit', :id => 'button', :value => 'Make request'}
89
+ %br/
90
+ %span{:id=>'resultsStatus', :style=>'color:red;display:none;'} (Please wait for ajax response)
91
+ %br/
92
+ %div{:style => 'padding:20px; border:1px solid black;'}
93
+ %p
94
+ Results:
95
+ #rights
96
+ %p
97
+ #result
98
+ %p
99
+ #{(defined? iframe) ? iframe : ''}
100
+
101
+
102
+
103
+ = partial :_others_samples
104
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
105
+
106
+ :javascript
107
+ $(function($){
108
+ $('.guid_radio input').change(function(){
109
+ var elementIndex = $(this).parent().children('input').index($(this));
110
+ $('.guid_field').hide();
111
+ $('.guid_field').eq(elementIndex).show();
112
+ });
106
113
  });
107
- });
108
-
109
- $(document).ready(setTimeout(check, 5000));
110
-
111
- function check() {
112
- if (($("input[name=callbackUrl]").val() != "") && (document.getElementById("result") != null)) {
113
- $('#resultsStatus').fadeIn("slow");
114
- $.ajax({
115
- type: 'POST',
116
- url: '/sample41/check_guid',
117
- success: function (data) {
118
- $('#resultsStatus').fadeOut("slow");
119
- var result = null;
120
- result = data;
121
- if (result) {
122
- var message = result;
123
- $("#rights").append('<span style="color:red"><i>' + message + '</i></span>')
124
- var url = $('#iframe').attr('src');
125
- $('#iframe').attr('src', url);
126
- }
127
- },
128
- dataType: "text"
129
- });
130
- }
131
- }
114
+ $(document).ready(setTimeout(check, 5000));
115
+ function check() {
116
+ if (($("input[name=callbackUrl]").val() != "") && (document.getElementById("result") != null)) {
117
+ $('#resultsStatus').fadeIn("slow");
118
+ $.ajax({
119
+ type: 'POST',
120
+ url: '/sample41/check_guid',
121
+ success: function (data) {
122
+ $('#resultsStatus').fadeOut("slow");
123
+ var result = null;
124
+ result = data;
125
+ if (result) {
126
+ var message = result;
127
+ $("#rights").append('<span style="color:red"><i>' + message + '</i></span>')
128
+ var url = $('#iframe').attr('src');
129
+ $('#iframe').attr('src', url);
130
+ }
131
+ },
132
+ dataType: "text"
133
+ });
134
+ }
135
+ }
132
136
 
133
137
 
134
138