groupdocs 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/CHANGELOG.md +6 -0
  2. data/examples/api-samples/README.md +1 -1
  3. data/examples/api-samples/public/css/style.css +2 -2
  4. data/examples/api-samples/public/docs/annotation-sample.html +57 -0
  5. data/examples/api-samples/public/docs/envelope-sample.html +32 -32
  6. data/examples/api-samples/public/docs/sample1.html +3 -3
  7. data/examples/api-samples/public/docs/sample10.html +25 -24
  8. data/examples/api-samples/public/docs/sample11.html +17 -17
  9. data/examples/api-samples/public/docs/sample12.html +4 -4
  10. data/examples/api-samples/public/docs/sample13.html +5 -5
  11. data/examples/api-samples/public/docs/sample14.html +5 -5
  12. data/examples/api-samples/public/docs/sample15.html +4 -4
  13. data/examples/api-samples/public/docs/sample16.html +3 -3
  14. data/examples/api-samples/public/docs/sample17.html +3 -3
  15. data/examples/api-samples/public/docs/sample18.html +129 -34
  16. data/examples/api-samples/public/docs/sample19.html +59 -0
  17. data/examples/api-samples/public/docs/sample2.html +5 -5
  18. data/examples/api-samples/public/docs/sample20.html +51 -0
  19. data/examples/api-samples/public/docs/sample21.html +66 -0
  20. data/examples/api-samples/public/docs/sample22.html +53 -0
  21. data/examples/api-samples/public/docs/sample3.html +4 -4
  22. data/examples/api-samples/public/docs/sample4.html +27 -16
  23. data/examples/api-samples/public/docs/sample5.html +29 -22
  24. data/examples/api-samples/public/docs/sample6.html +6 -6
  25. data/examples/api-samples/public/docs/sample7.html +8 -8
  26. data/examples/api-samples/public/docs/sample8.html +31 -23
  27. data/examples/api-samples/public/docs/sample9.html +26 -8
  28. data/examples/api-samples/public/templates/merge_feid_doc.docx +0 -0
  29. data/examples/api-samples/samples/annotation-sample.rb +22 -16
  30. data/examples/api-samples/samples/envelope-sample.rb +26 -25
  31. data/examples/api-samples/samples/sample1.rb +2 -2
  32. data/examples/api-samples/samples/sample10.rb +21 -20
  33. data/examples/api-samples/samples/sample11.rb +18 -18
  34. data/examples/api-samples/samples/sample12.rb +3 -3
  35. data/examples/api-samples/samples/sample13.rb +4 -4
  36. data/examples/api-samples/samples/sample14.rb +4 -4
  37. data/examples/api-samples/samples/sample15.rb +3 -3
  38. data/examples/api-samples/samples/sample16.rb +2 -2
  39. data/examples/api-samples/samples/sample17.rb +2 -2
  40. data/examples/api-samples/samples/sample18.rb +90 -106
  41. data/examples/api-samples/samples/sample19.rb +5 -5
  42. data/examples/api-samples/samples/sample2.rb +4 -4
  43. data/examples/api-samples/samples/sample20.rb +4 -4
  44. data/examples/api-samples/samples/sample21.rb +4 -4
  45. data/examples/api-samples/samples/sample22.rb +2 -2
  46. data/examples/api-samples/samples/sample23.rb +0 -0
  47. data/examples/api-samples/samples/sample24.rb +0 -0
  48. data/examples/api-samples/samples/sample25.rb +96 -0
  49. data/examples/api-samples/samples/sample3.rb +3 -3
  50. data/examples/api-samples/samples/sample4.rb +23 -12
  51. data/examples/api-samples/samples/sample5.rb +23 -16
  52. data/examples/api-samples/samples/sample6.rb +8 -8
  53. data/examples/api-samples/samples/sample7.rb +7 -7
  54. data/examples/api-samples/samples/sample8.rb +29 -21
  55. data/examples/api-samples/samples/sample9.rb +23 -5
  56. data/examples/api-samples/views/_others_samples.haml +57 -0
  57. data/examples/api-samples/views/annotation_sample.haml +30 -30
  58. data/examples/api-samples/views/envelope_sample.haml +31 -31
  59. data/examples/api-samples/views/index.haml +33 -25
  60. data/examples/api-samples/views/sample1.haml +22 -69
  61. data/examples/api-samples/views/sample10.haml +57 -73
  62. data/examples/api-samples/views/sample11.haml +31 -79
  63. data/examples/api-samples/views/sample12.haml +18 -66
  64. data/examples/api-samples/views/sample13.haml +21 -70
  65. data/examples/api-samples/views/sample14.haml +18 -67
  66. data/examples/api-samples/views/sample15.haml +15 -63
  67. data/examples/api-samples/views/sample16.haml +13 -61
  68. data/examples/api-samples/views/sample17.haml +19 -67
  69. data/examples/api-samples/views/sample18.haml +74 -159
  70. data/examples/api-samples/views/sample19.haml +25 -74
  71. data/examples/api-samples/views/sample2.haml +19 -66
  72. data/examples/api-samples/views/sample20.haml +19 -68
  73. data/examples/api-samples/views/sample21.haml +28 -76
  74. data/examples/api-samples/views/sample22.haml +29 -77
  75. data/examples/api-samples/views/sample23.haml +0 -0
  76. data/examples/api-samples/views/sample24.haml +0 -0
  77. data/examples/api-samples/views/sample25.haml +91 -0
  78. data/examples/api-samples/views/sample3.haml +20 -68
  79. data/examples/api-samples/views/sample4.haml +53 -68
  80. data/examples/api-samples/views/sample5.haml +54 -70
  81. data/examples/api-samples/views/sample6.haml +21 -69
  82. data/examples/api-samples/views/sample7.haml +19 -66
  83. data/examples/api-samples/views/sample8.haml +60 -75
  84. data/examples/api-samples/views/sample9.haml +54 -70
  85. data/examples/api-samples/web.rb +20 -0
  86. data/lib/groupdocs/api/request.rb +4 -2
  87. data/lib/groupdocs/version.rb +1 -1
  88. data/spec/groupdocs/api/request_spec.rb +10 -2
  89. metadata +18 -5
  90. data/examples/api-samples/app.rb +0 -15
@@ -1,90 +1,74 @@
1
- %h3{:style => "text-align:center;"}
2
- %a{:href => "/"} GroupDocs Ruby SDK Samples
1
+ %h3{:style => 'text-align:center;'}
2
+ %a{:href => '/'} GroupDocs Ruby SDK Samples
3
3
  \- Sample9
4
- .samplecontent{:style => "padding:10px;"}
4
+ .samplecontent{:style => 'padding:10px;'}
5
5
  %i This sample will show how to generate an embedded Viewer URL for particular Document in the GroupDocs account using Ruby SDK
6
6
  %br/
7
7
  %i You can find documentation for this sample
8
- %a{:href => "/docs/sample9.html"} here
8
+ %a{:href => '/docs/sample9.html'} here
9
9
  %br/
10
10
  %br/
11
11
  %p
12
12
  You entered:
13
13
  %p
14
- File GUID = #{(defined? guid) ? guid : ""}
14
+ File GUID = #{(defined? guid) ? guid : ''}
15
15
  %p
16
- Height = #{(defined? height) ? height : ""}
16
+ Height = #{(defined? height) ? height : ''}
17
17
  %p
18
- Width = #{(defined? width) ? width : ""}
18
+ Width = #{(defined? width) ? width : ''}
19
19
  %p
20
- Viewer URL = #{(defined? v_url) ? v_url : ""}
20
+ Viewer URL = #{(defined? v_url) ? v_url : ''}
21
21
  %p
22
- %font{:color => "red"} #{(defined? err) ? err : ""}
23
- #requestForm{:style => "padding:20px; border:1px solid black;"}
22
+ %font{:color => 'red'} #{(defined? err) ? err : ''}
23
+ #requestForm{:style => 'padding:20px; border:1px solid black;'}
24
24
  %p Enter data for request and press "Make request" button
25
- %form{:action => "/sample9", :enctype => "multipart/form-data", :method => "post"}
26
- %label{:for => "private_key"} GroupDocs File GUID
25
+ %form{:action => '/sample9', :enctype => 'multipart/form-data', :method => 'post'}
26
+ %div.guid_radio
27
+ %input{:type=>'radio', :name=>'source', :value=>'guid', :checked=>'checked'} File ID (GUID)
28
+ %br/
29
+ %input{:type=>'radio', :name=>'source', :value=>'local'}Upload local file
30
+ %br/
31
+ %input{:type=>'radio', :name=>'source', :value=>'url'} Upload file from URL
32
+ %br/
33
+
34
+ %div.guid_field
35
+ %label{:for=>'fileId', :id=>'guid'} File ID (GUID)
36
+ %br/
37
+ %input{:type=>'text', :name=>'fileId'}
38
+
39
+ %div.guid_field{:style=>'display:none;'}
40
+ %label{:for=>'file'} Upload local file
41
+ %br/
42
+ %input{:type=>'file', :name=>'file'}
43
+
44
+ %div.guid_field{:style=>'display:none;'}
45
+ %label{:for=>'url', :id=>'url'} Upload file from URL
46
+ %br/
47
+ %input{:type=>'text', :name=>'url'}
48
+
27
49
  %br/
28
- %input{:type=>"text", :name=>"guid"}
50
+ %label{:for => 'private_key'} Width
29
51
  %br/
30
- %label{:for => "private_key"} Width
52
+ %input{:type=>'text', :name=>'width'}
31
53
  %br/
32
- %input{:type=>"text", :name=>"width"}
54
+ %label{:for => 'private_key'} Height
33
55
  %br/
34
- %label{:for => "private_key"} Height
56
+ %input{:type=>'text', :name=>'height'}
35
57
  %br/
36
- %input{:type=>"text", :name=>"height"}
37
- %br/
38
- %input{:type => "submit", :value => "Make Request"}/
39
- %div{:style => "padding:20px; border:1px solid black;"}
40
- %iframe{:src => "#{(defined? v_url) ? v_url : ""}", :width=> "#{(defined? width) ? width : ""}", :height=>"#{(defined? height) ? height : ""}"}
58
+ %input{:type => 'submit', :value => 'Make Request'}/
59
+ %div{:style => 'padding:20px; border:1px solid black;'}
60
+ %iframe{:src => "#{(defined? v_url) ? v_url : ''}", :width=> "#{(defined? width) ? width : ''}", :height=>"#{(defined? height) ? height : ''}"}
41
61
  %br/
42
- %div{:style => "padding:10px;"}
43
- Choose another one sample:
44
- %ul
45
- %li
46
- %a{:href => "/sample1"} Sample1 - How to login to GroupDocs using the API
47
- %li
48
- %a{:href => "/sample2"} Sample2 - How to list files within GroupDocs Storage using the Storage API
49
- %li
50
- %a{:href => "/sample3"} Sample3 - How to upload a file to GroupDocs using the Storage API
51
- %li
52
- %a{:href => "/sample4"} Sample4 - How to download a file from GroupDocs Storage using the Storage API
53
- %li
54
- %a{:href => "/sample5"} Sample5 - How to copy / move a file using the GroupDocs Storage API
55
- %li
56
- %a{:href => "/sample6"} Sample6 - How to add a Signature to a document in GroupDocs Signature
57
- %li
58
- %a{:href => "/sample7"} Sample7 - How to create a list of thumbnails for a document
59
- %li
60
- %a{:href => "/sample8"} Sample8 - How to return a URL representing a single page of a Document
61
- %li
62
- %a{:href => "/sample9"} Sample9 - How to generate an embedded Viewer URL for a Document
63
- %li
64
- %a{:href => "/sample10"} Sample10 - How to share a document to other users
65
- %li
66
- %a{:href => "/sample11"}Sample11 - How programmatically create and post an annotation into document. How to delete the annotation
67
- %li
68
- %a{:href => "/sample12"}Sample12 - How to list all annotations from document
69
- %li
70
- %a{:href => "/sample13"}Sample13 - How to add collaborator to doc with annotations
71
- %li
72
- %a{:href => "/sample14"}Sample14 - How to check the list of shares for a folder
73
- %li
74
- %a{:href => "/sample15"}Sample15 - How to check the number of document's views
75
- %li
76
- %a{:href => "/sample16"}Sample16 - How to insert Assembly questionary into webpage
77
- %li
78
- %a{:href => "/sample17"}Sample17 - How to upload a file into the storage and compress it into zip archive
79
- %li
80
- %a{:href => "/sample18"}Sample18 - How to convert Doc to Docx, Docx to Doc, Docx to PDF, PPT to PDF
81
- %li
82
- %a{:href => "/sample19"}Sample19 - How to Compare documents using Ruby SDK
83
- %li
84
- %a{:href => "/sample20"}Sample20 - How to Get Compare Change list for document using Ruby SDK
85
- %li
86
- %a{:href => "/sample21"}Sample21 - How to Create and Upload Envelop to GroupDocs account using Ruby SDK
87
- %li
88
- %a{:href => "/sample22"}Sample22 - How create or update user and add him to collaborators using PHP SDK
89
- %li
90
- %a{:href => "/envelope-sample"}Envelope sample - How to use envelope and signature API
62
+
63
+ = partial :_others_samples
64
+
65
+ %script{:src=>'//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'}
66
+ :javascript
67
+
68
+ $(function($){
69
+ $('.guid_radio input').change(function(){
70
+ var elementIndex = $(this).parent().children('input').index($(this));
71
+ $('.guid_field').hide();
72
+ $('.guid_field').eq(elementIndex).show();
73
+ });
74
+ });
@@ -0,0 +1,20 @@
1
+ require 'sinatra'
2
+ require 'groupdocs'
3
+ require 'haml'
4
+ require 'pp'
5
+
6
+ GroupDocs.api_version = '2.0'
7
+
8
+ get '/' do
9
+ haml :index
10
+ end
11
+
12
+ get '/style.css' do
13
+ sass :style
14
+ end
15
+
16
+ Dir['samples/*.rb'].each {|file| require_relative file }
17
+
18
+ def partial(page, options={})
19
+ haml page, options.merge!(:layout => false)
20
+ end
@@ -30,7 +30,8 @@ module GroupDocs
30
30
  # @option options [Hash] :headers Additional HTTP headers
31
31
  # @option options [Hash] :access Access credentials hash
32
32
  # @option options [Hash, String, Array, File] :request_body payload
33
- # @option options [Boolean] :plain Send payload as plain text (i.e. do not convert to JSON)
33
+ # @option options [Boolean] :plain Send payload as plain text (i.e. do not convert to JSON). Defaults to false.
34
+ # @option options [Boolean] :sign Should URL be signed. Defaults to true.
34
35
  #
35
36
  # @yieldparam [Hash] options
36
37
  #
@@ -38,6 +39,7 @@ module GroupDocs
38
39
  @options = options
39
40
  yield @options if block_given?
40
41
  @options[:access] ||= {}
42
+ @options[:sign] = true if @options[:sign].nil?
41
43
  @resource = RestClient::Resource.new(GroupDocs.api_server)
42
44
  end
43
45
 
@@ -55,7 +57,7 @@ module GroupDocs
55
57
  unless @signed
56
58
  parse_path
57
59
  url_encode_path
58
- sign_url
60
+ sign_url if @options[:sign]
59
61
  @signed = true
60
62
  end
61
63
 
@@ -1,3 +1,3 @@
1
1
  module GroupDocs
2
- VERSION = '1.5.0'
2
+ VERSION = '1.5.1'
3
3
  end # GroupDocs
@@ -16,11 +16,13 @@ describe GroupDocs::Api::Request do
16
16
  end
17
17
 
18
18
  it 'allows passing block to configure options' do
19
- described_class.new do |request|
19
+ api = described_class.new do |request|
20
20
  request[:access] = { :client_id => 'client_id', :private_key => 'private_key' }
21
21
  request[:method] = :GET
22
22
  request[:path] = '/folders'
23
- end.options.should == { :method => :GET, :path => '/folders', :access => { :client_id => 'client_id', :private_key => 'private_key' }}
23
+ request[:sign] = false
24
+ end
25
+ api.options.should == { :method => :GET, :path => '/folders', :sign => false, :access => { :client_id => 'client_id', :private_key => 'private_key' }}
24
26
  end
25
27
 
26
28
  it 'sets access hash to empty if it was not passed' do
@@ -46,6 +48,12 @@ describe GroupDocs::Api::Request do
46
48
  subject.prepare_and_sign_url
47
49
  end
48
50
 
51
+ it 'does not sign url if sign options is passed' do
52
+ subject.options[:sign] = false
53
+ subject.should_not_receive(:sign_url)
54
+ subject.prepare_and_sign_url
55
+ end
56
+
49
57
  it 'signs url' do
50
58
  subject.should_receive(:sign_url)
51
59
  subject.prepare_and_sign_url
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groupdocs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-26 00:00:00.000000000 Z
12
+ date: 2013-05-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -185,9 +185,9 @@ files:
185
185
  - examples/README.md
186
186
  - examples/api-samples/Gemfile
187
187
  - examples/api-samples/README.md
188
- - examples/api-samples/app.rb
189
188
  - examples/api-samples/public/GroupDocs_Signature_Demo.pdf
190
189
  - examples/api-samples/public/css/style.css
190
+ - examples/api-samples/public/docs/annotation-sample.html
191
191
  - examples/api-samples/public/docs/docco.css
192
192
  - examples/api-samples/public/docs/envelope-sample.html
193
193
  - examples/api-samples/public/docs/sample1.html
@@ -200,7 +200,11 @@ files:
200
200
  - examples/api-samples/public/docs/sample16.html
201
201
  - examples/api-samples/public/docs/sample17.html
202
202
  - examples/api-samples/public/docs/sample18.html
203
+ - examples/api-samples/public/docs/sample19.html
203
204
  - examples/api-samples/public/docs/sample2.html
205
+ - examples/api-samples/public/docs/sample20.html
206
+ - examples/api-samples/public/docs/sample21.html
207
+ - examples/api-samples/public/docs/sample22.html
204
208
  - examples/api-samples/public/docs/sample3.html
205
209
  - examples/api-samples/public/docs/sample4.html
206
210
  - examples/api-samples/public/docs/sample5.html
@@ -211,6 +215,7 @@ files:
211
215
  - examples/api-samples/public/images/help.png
212
216
  - examples/api-samples/public/images/info.png
213
217
  - examples/api-samples/public/templates/base-simple_source.html
218
+ - examples/api-samples/public/templates/merge_feid_doc.docx
214
219
  - examples/api-samples/public/templates/testdocument.html
215
220
  - examples/api-samples/public/templates/welcome.htm
216
221
  - examples/api-samples/samples/annotation-sample.rb
@@ -230,6 +235,9 @@ files:
230
235
  - examples/api-samples/samples/sample20.rb
231
236
  - examples/api-samples/samples/sample21.rb
232
237
  - examples/api-samples/samples/sample22.rb
238
+ - examples/api-samples/samples/sample23.rb
239
+ - examples/api-samples/samples/sample24.rb
240
+ - examples/api-samples/samples/sample25.rb
233
241
  - examples/api-samples/samples/sample3.rb
234
242
  - examples/api-samples/samples/sample4.rb
235
243
  - examples/api-samples/samples/sample5.rb
@@ -237,6 +245,7 @@ files:
237
245
  - examples/api-samples/samples/sample7.rb
238
246
  - examples/api-samples/samples/sample8.rb
239
247
  - examples/api-samples/samples/sample9.rb
248
+ - examples/api-samples/views/_others_samples.haml
240
249
  - examples/api-samples/views/annotation_sample.haml
241
250
  - examples/api-samples/views/envelope_sample.haml
242
251
  - examples/api-samples/views/index.haml
@@ -256,6 +265,9 @@ files:
256
265
  - examples/api-samples/views/sample20.haml
257
266
  - examples/api-samples/views/sample21.haml
258
267
  - examples/api-samples/views/sample22.haml
268
+ - examples/api-samples/views/sample23.haml
269
+ - examples/api-samples/views/sample24.haml
270
+ - examples/api-samples/views/sample25.haml
259
271
  - examples/api-samples/views/sample3.haml
260
272
  - examples/api-samples/views/sample4.haml
261
273
  - examples/api-samples/views/sample5.haml
@@ -263,6 +275,7 @@ files:
263
275
  - examples/api-samples/views/sample7.haml
264
276
  - examples/api-samples/views/sample8.haml
265
277
  - examples/api-samples/views/sample9.haml
278
+ - examples/api-samples/web.rb
266
279
  - examples/viewer/Gemfile
267
280
  - examples/viewer/app.rb
268
281
  - groupdocs.gemspec
@@ -501,7 +514,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
501
514
  version: '0'
502
515
  segments:
503
516
  - 0
504
- hash: 2302864106414593407
517
+ hash: -2320270531511539670
505
518
  required_rubygems_version: !ruby/object:Gem::Requirement
506
519
  none: false
507
520
  requirements:
@@ -510,7 +523,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
510
523
  version: '0'
511
524
  segments:
512
525
  - 0
513
- hash: 2302864106414593407
526
+ hash: -2320270531511539670
514
527
  requirements: []
515
528
  rubyforge_project:
516
529
  rubygems_version: 1.8.23
@@ -1,15 +0,0 @@
1
- require 'sinatra'
2
- require 'groupdocs'
3
- require 'haml'
4
- require 'pp'
5
-
6
- get '/' do
7
- haml :index
8
- end
9
-
10
- get '/style.css' do
11
- sass :style
12
- end
13
-
14
- Dir["samples/*.rb"].each {|file| require_relative file }
15
-