groupdocs 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
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,64 +1,69 @@
1
- %h3{:style => 'text-align:center;'}
2
- %a{:href => '/'}GroupDocs Ruby SDK Samples
3
- \- Sample36
4
-
5
- .samplecontent{:style => 'padding:10px;'}
6
- %i How to download signed documents when envelope was signed using Ruby SDK
7
- %br/
8
- %br/
9
- %span.documentation
10
- %a{:href => '/docs/sample36.html'} Builtin documentation for this sample
11
- %br/
12
- %br/
13
- %p
14
- You entered:
15
- %p
16
- UserId = #{(defined? userId) ? userId : ''}
17
- %p
18
- PrivateKey = #{(defined? privateKey) ? privateKey : ''}
19
- %p
20
- Signed Envelope Guid = #{(defined? envelopeGuid) ? envelopeGuid : ''}
21
- %p
22
- %font{:color => 'red'} #{(defined? err) ? err : ''}
23
- %p
24
- Results:
1
+ %head
2
+ %title Sample 36 - How to download signed documents when envelope was signed
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
25
8
  %br/
9
+ Sample 36 - How to download signed documents when envelope was signed
10
+ .samplecontent{:style => 'padding:10px;'}
11
+ %i How to download signed documents when envelope was signed using Ruby SDK
26
12
  %br/
27
- %p
28
- #{(defined? message) ? message : ''}
29
13
  %br/
14
+ %span.documentation
15
+ %a{:href => '/docs/sample36.html'} Builtin documentation for this sample
16
+ %br/
17
+ %br/
18
+ %p
19
+ You entered:
20
+ %p
21
+ UserId = #{(defined? userId) ? userId : ''}
22
+ %p
23
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
24
+ %p
25
+ Signed Envelope Guid = #{(defined? envelopeGuid) ? envelopeGuid : ''}
26
+ %p
27
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
28
+ %p
29
+ Results:
30
+ %br/
31
+ %br/
32
+ %p
33
+ #{(defined? message) ? message : ''}
34
+ %br/
30
35
 
31
36
 
32
- #requestForm{:style => 'padding:20px; border:1px solid black;'}
33
- %p Enter data for request and press "Make request" button
34
- %form{:action => '/sample36', :enctype => 'multipart/form-data', :method => 'post'}
35
- %label{:for => 'clientId'} GroupDocs Client ID
36
- %br/
37
- %input{:type=>'text', :name=>'clientId'}
38
- %br/
39
- %label{:for => 'privateKey'} GroupDocs Private Key
40
- %br/
41
- %input{:type=>'text', :name=>'privateKey'}
42
- %br/
43
- %label{:for => 'path'} Signed Envelop Guid
44
- %br/
45
- %input{:type=>'text', :name=>'envelopeGuid'}
46
- %br/
47
- %label{:for => 'basePath'} Base Path
48
- %span{:class => 'optional'} (Optional)
49
- %br/
50
- %input{:type=>'text', :name=>'basePath'}
51
- %br/
52
- %br/
53
- %input{:type => 'submit', :value => 'Make Request'}
54
- %br/
55
- = partial :_others_samples
37
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
38
+ %p Enter data for request and press "Make request" button
39
+ %form{:action => '/sample-36-how-to-download-signed-documents-when-envelope-was-signed', :enctype => 'multipart/form-data', :method => 'post'}
40
+ %label{:for => 'clientId'} GroupDocs Client ID
41
+ %br/
42
+ %input{:type=>'text', :name=>'clientId'}
43
+ %br/
44
+ %label{:for => 'privateKey'} GroupDocs Private Key
45
+ %br/
46
+ %input{:type=>'text', :name=>'privateKey'}
47
+ %br/
48
+ %label{:for => 'path'} Signed Envelop Guid
49
+ %br/
50
+ %input{:type=>'text', :name=>'envelopeGuid'}
51
+ %br/
52
+ %label{:for => 'basePath'} Base Path
53
+ %span{:class => 'optional'} (Optional)
54
+ %br/
55
+ %input{:type=>'text', :name=>'basePath'}
56
+ %br/
57
+ %br/
58
+ %input{:type => 'submit', :value => 'Make Request'}
59
+ %br/
60
+ = partial :_others_samples
56
61
 
57
- %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
58
- :javascript
59
- function check() {
60
- $.get('/sample36/check', function(data) {
61
- $('#results_status').fadeOut("slow");
62
- $('#downloadframe').attr("src", "/sample36/downloads/" + data);
63
- }, 'text');
64
- }
62
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
63
+ :javascript
64
+ function check() {
65
+ $.get('/sample36/check', function(data) {
66
+ $('#results_status').fadeOut("slow");
67
+ $('#downloadframe').attr("src", "/sample36/downloads/" + data);
68
+ }, 'text');
69
+ }
@@ -1,124 +1,130 @@
1
- %h3{:style => 'text-align:center;'}
2
- %a{:href => '/'} GroupDocs Ruby SDK Samples
3
- \- Sample37
4
- .samplecontent{:style => 'padding:10px;'}
5
- %i This sample will show how to create envelop and download signed document when envelop was signed using callback
6
- %br/
7
- %br/
8
- %span.documentation
9
- %a{:href => '/docs/sample37.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
- Email = #{(defined? email) ? email : ''}
20
- %p
21
- Name = #{(defined? name) ? name : ''}
22
- %p
23
- Last Name = #{(defined? lastName) ? lastName : ''}
24
- %p
25
- %font{:color => 'red'} #{(defined? err) ? err : ''}
26
- %br/
27
- #requestForm{:style => 'padding:20px; border:1px solid black;'}
28
- %p Enter data for request and press "Make request" button
29
- %form{:action => '/sample37', :enctype => 'multipart/form-data', :method => 'post'}
30
- %label{:for => 'clientId'} GroupDocs ClientID
31
- %br/
32
- %input{:type=>'text', :name=>'clientId'}
33
- %br/
34
- %label{:for => 'privateKey'} GroupDocs PrivateKey
35
- %br/
36
- %input{:type=>'text', :name=>'privateKey'}
37
- %br/
38
- %label{:for => 'email'} Email
39
- %br/
40
- %input{:type=>'text', :name=>'email'}
41
- %br/
42
- %label{:for => 'name'} Name
43
- %br/
44
- %input{:type=>'text', :name=>'name'}
45
- %br/
46
- %label{:for => 'lastName'} Last Name
47
- %br/
48
- %input{:type=>'text', :name=>'lastName'}
49
- %br/
50
- %div.guid_radio
51
- %input{:type=>'radio', :name=>'source', :value=>'guid'} File ID (GUID)
52
- %br/
53
- %input{:type=>'radio', :name=>'source', :value=>'local', :checked=>'checked'}Upload local file
54
- %br/
55
- %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
1
+ %head
2
+ %title Sample 37 - How to create envelop and download signed document when envelop was signed using callback
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 37 - How to create envelop and download signed document when envelop was signed using callback
10
+ .samplecontent{:style => 'padding:10px;'}
11
+ %i This sample will show how to create envelop and download signed document when envelop was signed using callback
12
+ %br/
13
+ %br/
14
+ %span.documentation
15
+ %a{:href => '/docs/sample37.html'} Builtin documentation for this sample
16
+ %br/
17
+ %br/
18
+ %p
19
+ You entered:
20
+ %p
21
+ UserId = #{(defined? userId) ? userId : ''}
22
+ %p
23
+ PrivateKey = #{(defined? privateKey) ? privateKey : ''}
24
+ %p
25
+ Email = #{(defined? email) ? email : ''}
26
+ %p
27
+ Name = #{(defined? name) ? name : ''}
28
+ %p
29
+ Last Name = #{(defined? lastName) ? lastName : ''}
30
+ %p
31
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
32
+ %br/
33
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
34
+ %p Enter data for request and press "Make request" button
35
+ %form{:action => '/sample-37-how-to-create-envelop-and-download-signed-document-when-envelop-was-signed-using-callback', :enctype => 'multipart/form-data', :method => 'post'}
36
+ %label{:for => 'clientId'} GroupDocs ClientID
56
37
  %br/
57
-
58
- %div.guid_field{:style=>'display:none;'}
59
- %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
38
+ %input{:type=>'text', :name=>'clientId'}
60
39
  %br/
61
- %input{:type=>'text', :name=>'fileId'}
62
-
63
- %div.guid_field
64
- %label{:for=>'file'} Upload local file
40
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
65
41
  %br/
66
- %input{:type=>'file', :name=>'file'}
67
-
68
- %div.guid_field{:style=>'display:none;'}
69
- %label{:for=>'url', :id=>'url'} Upload file from URL
42
+ %input{:type=>'text', :name=>'privateKey'}
43
+ %br/
44
+ %label{:for => 'email'} Email
45
+ %br/
46
+ %input{:type=>'text', :name=>'email'}
47
+ %br/
48
+ %label{:for => 'name'} Name
49
+ %br/
50
+ %input{:type=>'text', :name=>'name'}
51
+ %br/
52
+ %label{:for => 'lastName'} Last Name
70
53
  %br/
71
- %input{:type=>'text', :name=>'url'}
54
+ %input{:type=>'text', :name=>'lastName'}
55
+ %br/
56
+ %div.guid_radio
57
+ %input{:type=>'radio', :name=>'source', :value=>'guid'} File ID (GUID)
58
+ %br/
59
+ %input{:type=>'radio', :name=>'source', :value=>'local', :checked=>'checked'}Upload local file
60
+ %br/
61
+ %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
62
+ %br/
72
63
 
73
- %br/
74
- %label{:for=>'callback'}
75
- Callback URL
76
- %span.optional (Optional)
77
- %br/
78
- %font{:color=>'grey'} (For test Callback you can use this URL: http://groupdocs-ruby-samples.herokuapp.com/sample37/signature_callback)
79
- %input{:type=>'text', :size=>'70', :value=>"#{(defined? callback) ? callback : ''}", :name=>'callback'}
80
- %br/
81
- %label{:for => 'basePath'} Base Path
82
- %span{:class => 'optional'} (Optional)
83
- %br/
84
- %input{:type=>'text', :name=>'basePath'}
85
- %br/
86
- %br/
87
- %input{:type => 'submit', :value => 'Make request'}
88
- %span{:id=>'results_status', :style=>'color:red;display:none;'} (Please wait for ajax response)
89
- %br/
90
- %iframe{:id=>'downloadframe', :style=>'display:none'}
91
- %div{:style => 'padding:20px; border:1px solid black;'}
92
- %p
93
- Results:
94
- %br/
95
- #{(defined? message) ? message : ''}
96
- #{(defined? iframe) ? iframe : ''}
64
+ %div.guid_field{:style=>'display:none;'}
65
+ %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
66
+ %br/
67
+ %input{:type=>'text', :name=>'fileId'}
68
+
69
+ %div.guid_field
70
+ %label{:for=>'file'} Upload local file
71
+ %br/
72
+ %input{:type=>'file', :name=>'file'}
73
+
74
+ %div.guid_field{:style=>'display:none;'}
75
+ %label{:for=>'url', :id=>'url'} Upload file from URL
76
+ %br/
77
+ %input{:type=>'text', :name=>'url'}
78
+
79
+ %br/
80
+ %label{:for=>'callback'}
81
+ Callback URL
82
+ %span.optional (Optional)
83
+ %br/
84
+ %font{:color=>'grey'} (For test Callback you can use this URL: http://groupdocs-ruby-samples.herokuapp.com/sample37/signature_callback)
85
+ %input{:type=>'text', :size=>'70', :value=>"#{(defined? callback) ? callback : ''}", :name=>'callback'}
86
+ %br/
87
+ %label{:for => 'basePath'} Base Path
88
+ %span{:class => 'optional'} (Optional)
89
+ %br/
90
+ %input{:type=>'text', :name=>'basePath'}
91
+ %br/
92
+ %br/
93
+ %input{:type => 'submit', :value => 'Make request'}
94
+ %span{:id=>'results_status', :style=>'color:red;display:none;'} (Please wait for ajax response)
95
+ %br/
96
+ %iframe{:id=>'downloadframe', :style=>'display:none'}
97
+ %div{:style => 'padding:20px; border:1px solid black;'}
98
+ %p
99
+ Results:
100
+ %br/
101
+ #{(defined? message) ? message : ''}
102
+ #{(defined? iframe) ? iframe : ''}
97
103
 
98
- = partial :_others_samples
99
- %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
100
- :javascript
101
- function callback_handler(data) {
102
- if (data === undefined) {
103
- return check();
104
- }
105
- $('#results_status').fadeOut("slow");
106
- $('#downloadframe').attr("src", "/sample37/downloads/" + data);
107
- };
108
-
109
- function check() {
110
- $.get('/sample37/check', callback_handler, 'text');
111
- };
104
+ = partial :_others_samples
105
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
106
+ :javascript
107
+ function callback_handler(data) {
108
+ if (data === undefined) {
109
+ return check();
110
+ }
111
+ $('#results_status').fadeOut("slow");
112
+ $('#downloadframe').attr("src", "/sample37/downloads/" + data);
113
+ };
112
114
 
113
- $(function($) {
114
- callbackUrl = $("input[name=callback]").val();
115
- if(callbackUrl !== "") {
116
- $('#results_status').fadeIn("slow");
117
- setTimeout(check, 5000);
115
+ function check() {
116
+ $.get('/sample37/check', callback_handler, 'text');
118
117
  };
119
- $('.guid_radio input').change(function(){
120
- var elementIndex = $(this).parent().children('input').index($(this));
121
- $('.guid_field').hide();
122
- $('.guid_field').eq(elementIndex).show();
123
- });
124
- });
118
+
119
+ $(function($) {
120
+ callbackUrl = $("input[name=callback]").val();
121
+ if(callbackUrl !== "") {
122
+ $('#results_status').fadeIn("slow");
123
+ setTimeout(check, 5000);
124
+ };
125
+ $('.guid_radio input').change(function(){
126
+ var elementIndex = $(this).parent().children('input').index($(this));
127
+ $('.guid_field').hide();
128
+ $('.guid_field').eq(elementIndex).show();
129
+ });
130
+ });
@@ -1,114 +1,120 @@
1
- %h3{:style => 'text-align:center;'}
2
- %a{:href => '/'} GroupDocs Ruby SDK Samples
3
- \- Sample38
4
- .samplecontent{:style => 'padding:10px;'}
5
- %span.description
6
- This sample will show how to get fields and their data from PDF file programmatically and dynamically create HTML form using the data about fields.
7
- %br/
8
- %br/
9
- /
10
- %span.documentation
11
- %a{:href => '/docs/sample38.html'} Builtin documentation for this sample
1
+ %head
2
+ %title Sample 38 - How to create new user and add him as collaborator to doc with annotations
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 38 - How to create new user and add him as collaborator to doc with annotations
10
+ .samplecontent{:style => 'padding:10px;'}
11
+ %span.description
12
+ This sample will show how to create new user and add him as collaborator to doc with annotations.
13
+ %br/
14
+ %br/
15
+ /
16
+ %span.documentation
17
+ %a{:href => '/docs/sample38.html'} Builtin documentation for this sample
12
18
 
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
- Email = #{(defined? email) ? email : ''}
25
- %p
26
- First Name = #{(defined? firstName) ? firstName : ''}
27
- %p
28
- Last Name = #{(defined? lastName) ? lastName : ''}
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
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
+ Email = #{(defined? email) ? email : ''}
31
+ %p
32
+ First Name = #{(defined? firstName) ? firstName : ''}
33
+ %p
34
+ Last Name = #{(defined? lastName) ? lastName : ''}
35
+ %p
36
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
37
+ %br/
38
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
39
+ %p Enter data for request and press "Make request" button
34
40
 
35
- %form{:action => "/sample38", :enctype => 'multipart/form-data', :method => 'post', :id=>'form'}
36
- %label{:for => 'clientId'} GroupDocs ClientID
37
- %br/
38
- %input{:type=>'text', :name=>'clientId', :id=>'client_id', :value=>"#{(defined? userId) ? userId : ''}"}
39
- %br/
40
- %label{:for => 'privateKey'} GroupDocs PrivateKey
41
- %br/
42
- %input{:type=>'text', :name=>'privateKey', :id=>'private_key', :value=>"#{(defined? privateKey) ? privateKey : ''}"}
43
- %br/
44
-
45
-
46
- %div.guid_radio{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
47
- %input{:type=>'radio', :name=>'source', :value=>'guid', :checked=>'checked'} File ID (GUID)
41
+ %form{:action => "/sample-38-how-to-create-new-user-and-add-him-as-collaborator-to-doc-with-annotations", :enctype => 'multipart/form-data', :method => 'post', :id=>'form'}
42
+ %label{:for => 'clientId'} GroupDocs ClientID
43
+ %br/
44
+ %input{:type=>'text', :name=>'clientId', :id=>'client_id', :value=>"#{(defined? userId) ? userId : ''}"}
48
45
  %br/
49
- %input{:type=>'radio', :name=>'source', :value=>'local'}Upload local file
46
+ %label{:for => 'privateKey'} GroupDocs PrivateKey
50
47
  %br/
51
- %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
48
+ %input{:type=>'text', :name=>'privateKey', :id=>'private_key', :value=>"#{(defined? privateKey) ? privateKey : ''}"}
52
49
  %br/
53
50
 
54
- %div.fields{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
55
- %div.guid_field
56
- %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
57
- %br/
58
- %input{:type=>'text', :name=>'fileId', :id=>'guid', :value=>"#{(defined? fileId) ? fileId : ''}"}
59
51
 
60
- %div.guid_field{:style=>'display:none;'}
61
- %label{:for=>'file'} Upload local file
52
+ %div.guid_radio{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
53
+ %input{:type=>'radio', :name=>'source', :value=>'guid', :checked=>'checked'} File ID (GUID)
62
54
  %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
55
+ %input{:type=>'radio', :name=>'source', :value=>'local'}Upload local file
56
+ %br/
57
+ %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
67
58
  %br/
68
- %input{:type=>'text', :name=>'url', :id=>'url'}
69
- %label User email
70
- %br/
71
- %input{:type=>'text', :name=>'email', :value=>""}
72
- %br/
73
- %label User first name
74
- %br/
75
- %input{:type=>'text', :name=>'firstName', :value=>""}
76
- %br/
77
- %label User last name
78
- %br/
79
- %input{:type=>'text', :name=>'lastName', :value=>""}
80
- %br/
81
- %label{:for => 'basePath'} Base Path
82
- %font{:color=>'grey'} (Optional)
83
- %br/
84
- %input{:type=>'text', :name=>'basePath', :id=>'base_path', :value=>"#{(defined? base_path) ? base_path : ''}"}
85
- %br/
86
- #{(defined? html) ? "<div style='background-color:#e5e5e5;border:3px double gray;width:700px;padding:3px;font-size:10pt;>#{html}</div>" : '' }
87
- %br/
88
- %input{:type => 'submit', :id => 'button', :value => 'Make request'}
89
59
 
90
- %br/
91
- %a{:href=>'/templates/test_all_fields2.pdf'} Download sample Pdf file
92
- %br/
93
- %br/
94
- %div{:style => 'padding:20px; border:1px solid black;'}
95
- %p
96
- Results:
97
- #result
98
- %span{:style=>'color:green'} New collaborations: #{(defined? email) ? email : ''}
99
- #{(defined? iframe) ? iframe : ''}
60
+ %div.fields{:style=>"#{(defined? userId) ? 'display:none' : 'display:block'}"}
61
+ %div.guid_field
62
+ %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
63
+ %br/
64
+ %input{:type=>'text', :name=>'fileId', :id=>'guid', :value=>"#{(defined? fileId) ? fileId : ''}"}
65
+
66
+ %div.guid_field{:style=>'display:none;'}
67
+ %label{:for=>'file'} Upload local file
68
+ %br/
69
+ %input{:type=>'file', :name=>'file', :id=>'file'}
70
+
71
+ %div.guid_field{:style=>'display:none;'}
72
+ %label{:for=>'url', :id=>'url'} Upload file from URL
73
+ %br/
74
+ %input{:type=>'text', :name=>'url', :id=>'url'}
75
+ %label User email
76
+ %br/
77
+ %input{:type=>'text', :name=>'email', :value=>""}
78
+ %br/
79
+ %label User first name
80
+ %br/
81
+ %input{:type=>'text', :name=>'firstName', :value=>""}
82
+ %br/
83
+ %label User last name
84
+ %br/
85
+ %input{:type=>'text', :name=>'lastName', :value=>""}
86
+ %br/
87
+ %label{:for => 'basePath'} Base Path
88
+ %font{:color=>'grey'} (Optional)
89
+ %br/
90
+ %input{:type=>'text', :name=>'basePath', :id=>'base_path', :value=>"#{(defined? base_path) ? base_path : ''}"}
91
+ %br/
92
+ #{(defined? html) ? "<div style='background-color:#e5e5e5;border:3px double gray;width:700px;padding:3px;font-size:10pt;>#{html}</div>" : '' }
93
+ %br/
94
+ %input{:type => 'submit', :id => 'button', :value => 'Make request'}
95
+
96
+ %br/
97
+ %a{:href=>'/templates/test_all_fields2.pdf'} Download sample Pdf file
98
+ %br/
99
+ %br/
100
+ %div{:style => 'padding:20px; border:1px solid black;'}
101
+ %p
102
+ Results:
103
+ #result
104
+ %span{:style=>'color:green'} New collaborations: #{(defined? email) ? email : ''}
105
+ #{(defined? iframe) ? iframe : ''}
100
106
 
101
- = partial :_others_samples
102
- %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
107
+ = partial :_others_samples
108
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
103
109
 
104
- :javascript
105
- $(function($){
106
- $('.guid_radio input').change(function(){
107
- var elementIndex = $(this).parent().children('input').index($(this));
108
- $('.guid_field').hide();
109
- $('.guid_field').eq(elementIndex).show();
110
+ :javascript
111
+ $(function($){
112
+ $('.guid_radio input').change(function(){
113
+ var elementIndex = $(this).parent().children('input').index($(this));
114
+ $('.guid_field').hide();
115
+ $('.guid_field').eq(elementIndex).show();
116
+ });
110
117
  });
111
- });
112
118
 
113
119
 
114
120