groupdocs 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,14 @@
1
+ ## v.2.2.0
2
+
3
+ **Changes**
4
+ *`Storage::File.upload_google!` changed the required parameters
5
+ *`Storage.info!` added new parameters of response
6
+
7
+ **New**
8
+ *`Signature::Form#modify_form_field!` new method
9
+ * Added new attribute `Signature::Field` - "page", "locationX", "locationY", "locationWidth", "locationHeight", "forceNewField"
10
+
11
+
1
12
  ## v.2.1.0
2
13
 
3
14
  **Changes**
@@ -105,6 +105,21 @@ module GroupDocs
105
105
  # @attr [String] guidanceText
106
106
  attr_accessor :guidanceText
107
107
 
108
+ # added in realise 2.2.0
109
+ # @attr [Integer] page
110
+ attr_accessor :page
111
+ # @attr [Integer] locationX
112
+ attr_accessor :locationX
113
+ # @attr [Integer] locationY
114
+ attr_accessor :locationY
115
+ # @attr [Integer] locationWidth
116
+ attr_accessor :locationWidth
117
+ # @attr [Integer] locationHeight
118
+ attr_accessor :locationHeight
119
+ # @attr [Integer] forceNewField
120
+ attr_accessor :forceNewField
121
+
122
+
108
123
  # Human-readable accessors
109
124
  alias_accessor :template_id, :templateId
110
125
  alias_accessor :recipient_id, :recipientId
@@ -337,7 +337,7 @@ module GroupDocs
337
337
  #
338
338
  # Modifies field location.
339
339
  #
340
- # @example Modify field location in template
340
+ # @example Modify field location in form
341
341
  # form = GroupDocs::Signature::Form.get!("g94h5g84hj9g4gf23i40j")
342
342
  # document = form.documents!.first
343
343
  # field = form.fields!(document).first
@@ -373,6 +373,43 @@ module GroupDocs
373
373
  end.execute!
374
374
  end
375
375
 
376
+ #
377
+ # Added in release 2.2.0
378
+ #
379
+ # Modifies field location.
380
+ #
381
+ # @example Modify field in form
382
+ # form = GroupDocs::Signature::Form.get!("g94h5g84hj9g4gf23i40j")
383
+ # document = form.documents!.first
384
+ # field = form.get_fields!(document).first
385
+ # field.name = "New name"
386
+ # form.modify_field_location! location, field, document
387
+ #
388
+ # @param [GroupDocs::Signature::Field::Location] location
389
+ # @param [GroupDocs::Signature::Field] field
390
+ # @param [GroupDocs::Document] document
391
+ # @param [Hash] access Access credentials
392
+ # @option access [String] :client_id
393
+ # @option access [String] :private_key
394
+ # @raise [ArgumentError] if location is not GroupDocs::Signature::Field::Location
395
+ # @raise [ArgumentError] if field is not GroupDocs::Signature::Field
396
+ # @raise [ArgumentError] if document is not GroupDocs::Document
397
+ #
398
+ def modify_form_field!(field, document, access = {})
399
+
400
+ field.is_a?(GroupDocs::Signature::Field) or raise ArgumentError,
401
+ "Field should be GroupDocs::Signature::Field object, received: #{field.inspect}"
402
+ document.is_a?(GroupDocs::Document) or raise ArgumentError,
403
+ "Document should be GroupDocs::Document object, received: #{document.inspect}"
404
+
405
+ Api::Request.new do |request|
406
+ request[:access] = access
407
+ request[:method] = :PUT
408
+ request[:path] = "/signature/{{client_id}}/forms/#{id}/documents/#{document.file.guid}/field/#{field.id}"
409
+ request[:request_body] = field.to_hash
410
+ end.execute!
411
+ end
412
+
376
413
  #
377
414
  # Updates form adding fields from template.
378
415
  #
@@ -401,7 +438,7 @@ module GroupDocs
401
438
  # document = form.documents!.first
402
439
  # field = form.fields!(document).first
403
440
  # field.name = "Field"
404
- # envelope.modify_field! field, document
441
+ # form.modify_field! field, document
405
442
  #
406
443
  #
407
444
  # @param [GroupDocs::Document] document
@@ -429,8 +466,8 @@ module GroupDocs
429
466
  # Changed in release 1.5.8
430
467
  #
431
468
  # Downloads signed documents to given path.
432
- # If there is only one file in envelope, it's saved as PDF.
433
- # If there are two or more files in envelope, it's saved as ZIP.
469
+ # If there is only one file in form, it's saved as PDF.
470
+ # If there are two or more files in form, it's saved as ZIP.
434
471
  #
435
472
  # @param [String] path Directory to download file to
436
473
  # @param [Hash] access Access credentials
@@ -485,7 +522,7 @@ module GroupDocs
485
522
  # field = form.fields!(document).first
486
523
  # fill_form = form.public_fill!
487
524
  # participant = fill_form[:participant][:id]
488
- # envelope.fill_field! "my_data", field, document, participant
525
+ # form.fill_field! "my_data", field, document, participant
489
526
  #
490
527
  # @example Fill signature field
491
528
  # form = GroupDocs::Signature::Form.get!("g94h5g84hj9g4gf23i40j")
@@ -8,7 +8,7 @@ module GroupDocs
8
8
  module Storage
9
9
 
10
10
  #
11
- # Changed in release 1.5.8
11
+ # Changed in release 2.2.0
12
12
  #
13
13
  # Returns hash of information about user's storage.
14
14
  #
@@ -29,11 +29,14 @@ module GroupDocs
29
29
  end.execute!
30
30
 
31
31
  {
32
- :total_space => "#{json[:total_space] / 1048576} MB",
33
- :available_space => "#{json[:avail_space] / 1048576} MB",
34
- :document_credits => json[:doc_credits],
35
- :available_credits => json[:avail_credits],
36
- :maxViewingFileSize => json[:maxViewingFileSize]
32
+ :total_space => "#{json[:total_space] / 1048576} MB",
33
+ :available_space => "#{json[:avail_space] / 1048576} MB",
34
+ :document_credits => json[:doc_credits],
35
+ :available_credits => json[:avail_credits],
36
+ :maxViewingFileSize => json[:maxViewingFileSize],
37
+ :total_documents => json[:total_documents],
38
+ :available_documents => json[:avail_documents],
39
+ :used_documents => json[:used_documents]
37
40
  }
38
41
  end
39
42
 
@@ -97,23 +97,27 @@ module GroupDocs
97
97
  Storage::File.new(json)
98
98
  end
99
99
 
100
+ # Updated in release 2.2.0
100
101
  #
101
102
  # Uploads google page as file.
102
103
  #
103
- # @param [String] path
104
+ # @param [Hash] options
105
+ # @option url [String]
106
+ # @option description [String]
107
+ # @option accessToken [String]
104
108
  # @param [Hash] access Access credentials
105
109
  # @option access [String] :client_id
106
110
  # @option access [String] :private_key
107
111
  # @return [GroupDocs::Storage::File]
108
112
  #
109
- def self.upload_google!(path, file_id, access = {})
113
+ def self.upload_google!(options = {}, access = {})
110
114
  api = Api::Request.new do |request|
111
115
  request[:access] = access
112
116
  request[:method] = :POST
113
- request[:path] = "/storage/{{client_id}}/google/files/#{path}"
117
+ request[:path] = "/storage/{{client_id}}/google/files/"
114
118
  end
115
119
 
116
- api.add_params(:file_id => file_id)
120
+ api.add_params(options)
117
121
  json = api.execute!
118
122
 
119
123
  Storage::File.new(json)
@@ -1,3 +1,3 @@
1
1
  module GroupDocs
2
- VERSION = '2.1.0'
2
+ VERSION = '2.2.0'
3
3
  end # GroupDocs
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: 2.1.0
4
+ version: 2.2.0
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: 2015-03-26 00:00:00.000000000 Z
12
+ date: 2015-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -639,7 +639,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
639
639
  version: '0'
640
640
  requirements: []
641
641
  rubyforge_project:
642
- rubygems_version: 1.8.29
642
+ rubygems_version: 1.8.30
643
643
  signing_key:
644
644
  specification_version: 3
645
645
  summary: Ruby SDK for GroupDocs REST API