groupdocs 2.0.0 → 2.1.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.
- data/CHANGELOG.md +13 -0
- data/examples/api-samples/samples/sample04.rb +1 -1
- data/lib/groupdocs/document.rb +21 -13
- data/lib/groupdocs/document/annotation/reviewer.rb +10 -2
- data/lib/groupdocs/document/change.rb +22 -1
- data/lib/groupdocs/document/page.rb +13 -0
- data/lib/groupdocs/version.rb +1 -1
- data/spec/groupdocs/document/annotation/reviewer_spec.rb +1 -3
- data/spec/groupdocs/document/change_spec.rb +9 -0
- data/spec/support/json/comparison_changes.json +6 -6
- metadata +4 -4
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## v.2.1.0
|
2
|
+
|
3
|
+
**Changes**
|
4
|
+
*`Document.editor_fields!` return the all json
|
5
|
+
*`Document.update_changes!` the changes should be array
|
6
|
+
* Deleted attribute `Document::Annotation::Reviewer` - "full_name"
|
7
|
+
|
8
|
+
|
9
|
+
**New**
|
10
|
+
* Added new attributes `Document::Annotation::Reviewer` - "first_name", "last_name'
|
11
|
+
* Added new `Document::Page`
|
12
|
+
* Added new attributes `Document::Change` - "type", "typeStr", "action', "actionStr"
|
13
|
+
|
1
14
|
## v.2.0.0
|
2
15
|
|
3
16
|
**Changes**
|
@@ -42,7 +42,7 @@ post '/sample-4-how-to-download-a-file-from-groupdocs-storage-using-the-storage-
|
|
42
42
|
#Download file
|
43
43
|
dowloaded_file = file.download!("#{File.dirname(__FILE__)}/../public/downloads")
|
44
44
|
unless dowloaded_file.empty?
|
45
|
-
massage =
|
45
|
+
massage = '<font color="green">File was downloaded to the <font color="blue">' + dowloaded_file + '</font> folder</font> <br />'
|
46
46
|
end
|
47
47
|
|
48
48
|
rescue Exception => e
|
data/lib/groupdocs/document.rb
CHANGED
@@ -9,6 +9,8 @@ module GroupDocs
|
|
9
9
|
require 'groupdocs/document/view'
|
10
10
|
require 'groupdocs/document/editor'
|
11
11
|
require 'groupdocs/document/style'
|
12
|
+
require 'groupdocs/document/page'
|
13
|
+
|
12
14
|
|
13
15
|
ACCESS_MODES = {
|
14
16
|
:private => 0,
|
@@ -219,10 +221,12 @@ module GroupDocs
|
|
219
221
|
# @attr [Long] upload_time
|
220
222
|
attr_accessor :upload_time
|
221
223
|
|
224
|
+
|
222
225
|
#added in release 2.0.0
|
223
226
|
# @attr [String] documentDescription
|
224
227
|
attr_accessor :documentDescription
|
225
228
|
|
229
|
+
|
226
230
|
[
|
227
231
|
:news ,
|
228
232
|
:alerts ,
|
@@ -263,6 +267,7 @@ module GroupDocs
|
|
263
267
|
attr_accessor :"is_#{option}_shown"
|
264
268
|
end
|
265
269
|
|
270
|
+
|
266
271
|
#
|
267
272
|
# Coverts passed array of attributes hash to array of GroupDocs::Storage::File.
|
268
273
|
#
|
@@ -735,7 +740,7 @@ module GroupDocs
|
|
735
740
|
#
|
736
741
|
# Sets document user status.
|
737
742
|
#
|
738
|
-
# @param [String] status
|
743
|
+
# @param [String] status (Pending = 0, Accepted = 1, Declined = 2)
|
739
744
|
# @param [Hash] access Access credentials
|
740
745
|
# @option access [String] :client_id
|
741
746
|
# @option access [String] :private_key
|
@@ -1025,10 +1030,12 @@ module GroupDocs
|
|
1025
1030
|
Job.new(:id => json[:job_id])
|
1026
1031
|
end
|
1027
1032
|
|
1033
|
+
#
|
1034
|
+
# Updated in release 2.1.0
|
1028
1035
|
#
|
1029
1036
|
# Schedules a job for comparing document with given.
|
1030
1037
|
#
|
1031
|
-
# @param [Array] changes Comparison changes to update (accept or reject)
|
1038
|
+
# @param [Array[GroupDocs::Document::Change]] changes Comparison changes to update (accept or reject)
|
1032
1039
|
# @option id [Float] :id
|
1033
1040
|
# @option type [String] :type
|
1034
1041
|
# @option action [String] :action
|
@@ -1041,18 +1048,21 @@ module GroupDocs
|
|
1041
1048
|
# @return [GroupDocs::Change]
|
1042
1049
|
#
|
1043
1050
|
def update_changes!(changes, access = {})
|
1044
|
-
|
1051
|
+
if changes.is_a?(Array)
|
1052
|
+
changes.each do |e|
|
1053
|
+
e.is_a?(GroupDocs::Document::Change) or raise ArgumentError,
|
1054
|
+
"Change should be GroupDocs::Document::Change object, received: #{e.inspect}"
|
1055
|
+
end
|
1056
|
+
else
|
1057
|
+
raise ArgumentError, "Changes should be Array , received: #{changes.inspect}"
|
1058
|
+
end
|
1045
1059
|
api = Api::Request.new do |request|
|
1046
1060
|
request[:access] = access
|
1047
1061
|
request[:method] = :PUT
|
1048
1062
|
request[:path] = "/comparison/public/#{file.guid}/changes"
|
1049
1063
|
request[:request_body] = changes
|
1050
1064
|
end
|
1051
|
-
|
1052
|
-
|
1053
|
-
json[:changes].map do |change|
|
1054
|
-
Document::Change.new(change)
|
1055
|
-
end
|
1065
|
+
api.execute!
|
1056
1066
|
end
|
1057
1067
|
|
1058
1068
|
#
|
@@ -1266,6 +1276,7 @@ module GroupDocs
|
|
1266
1276
|
request[:method] = :PUT
|
1267
1277
|
request[:path] = "/ant/{{client_id}}/files/#{file.guid}/sharedLinkAccessRights"
|
1268
1278
|
request[:request_body] = convert_access_rights_to_byte(rights)
|
1279
|
+
|
1269
1280
|
end.execute!
|
1270
1281
|
end
|
1271
1282
|
|
@@ -1373,7 +1384,7 @@ module GroupDocs
|
|
1373
1384
|
end.execute!
|
1374
1385
|
end
|
1375
1386
|
|
1376
|
-
#
|
1387
|
+
# changed in release 2.1.0
|
1377
1388
|
#
|
1378
1389
|
# Get template fields.
|
1379
1390
|
#
|
@@ -1382,14 +1393,11 @@ module GroupDocs
|
|
1382
1393
|
# @option access [String] :private_key
|
1383
1394
|
#
|
1384
1395
|
def editor_fields!(access = {})
|
1385
|
-
|
1396
|
+
Api::Request.new do |request|
|
1386
1397
|
request[:access] = access
|
1387
1398
|
request[:method] = :GET
|
1388
1399
|
request[:path] = "/doc/{{client_id}}/files/#{file.guid}/editor_fields"
|
1389
1400
|
end.execute!
|
1390
|
-
json[:fields].map do |field|
|
1391
|
-
TemplateEditorFields.new(field)
|
1392
|
-
end
|
1393
1401
|
end
|
1394
1402
|
|
1395
1403
|
# added in release 1.7.0
|
@@ -48,11 +48,19 @@ module GroupDocs
|
|
48
48
|
# @attr [String] emailAddress
|
49
49
|
attr_accessor :emailAddress
|
50
50
|
# @attr [String] FullName
|
51
|
-
attr_accessor :FullName
|
51
|
+
#attr_accessor :FullName
|
52
|
+
|
53
|
+
# Added in release 2.1.0
|
54
|
+
# @attr [String] firstName
|
55
|
+
attr_accessor :firstName
|
56
|
+
# @attr [String] lastName
|
57
|
+
attr_accessor :lastName
|
52
58
|
|
53
59
|
# Human-readable accessors
|
54
60
|
alias_accessor :email_address, :emailAddress
|
55
|
-
alias_accessor :full_name, :FullName
|
61
|
+
#alias_accessor :full_name, :FullName
|
62
|
+
alias_accessor :first_name, :firstName
|
63
|
+
alias_accessor :last_name, :lastName
|
56
64
|
|
57
65
|
end # Document::Annotation::Reviewer
|
58
66
|
end # GroupDocs
|
@@ -9,9 +9,20 @@ module GroupDocs
|
|
9
9
|
attr_accessor :box
|
10
10
|
# @attr [String] text
|
11
11
|
attr_accessor :text
|
12
|
-
# @attr [
|
12
|
+
# @attr [GroupDocs::Document::Page] page
|
13
13
|
attr_accessor :page
|
14
14
|
|
15
|
+
|
16
|
+
#Added in release 2.1.0
|
17
|
+
# @attr [String] type
|
18
|
+
attr_accessor :type
|
19
|
+
# @attr [String] typeStr
|
20
|
+
attr_accessor :typeStr
|
21
|
+
# @attr [String] action
|
22
|
+
attr_accessor :action
|
23
|
+
# @attr [String] actionStr
|
24
|
+
attr_accessor :actionStr
|
25
|
+
|
15
26
|
#
|
16
27
|
# Returns type as symbol.
|
17
28
|
#
|
@@ -31,5 +42,15 @@ module GroupDocs
|
|
31
42
|
@box = GroupDocs::Document::Rectangle.new(options)
|
32
43
|
end
|
33
44
|
|
45
|
+
#
|
46
|
+
# Coverts passed hash to GroupDocs::Document::Page object.
|
47
|
+
#
|
48
|
+
# @param [Hash] options
|
49
|
+
# @return [GroupDocs::Document::Page]
|
50
|
+
#
|
51
|
+
def page=(options)
|
52
|
+
@page = GroupDocs::Document::Page.new(options)
|
53
|
+
end
|
54
|
+
|
34
55
|
end # Document::Change
|
35
56
|
end # GroupDocs
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#Added in release 2.1.0
|
2
|
+
module GroupDocs
|
3
|
+
class Document::Page < Api::Entity
|
4
|
+
|
5
|
+
# @attr [Integer] Id
|
6
|
+
attr_accessor :Id
|
7
|
+
# @attr [Integer] Width
|
8
|
+
attr_accessor :Width
|
9
|
+
# @attr [Integer] Height
|
10
|
+
attr_accessor :Height
|
11
|
+
|
12
|
+
end #Document::Page
|
13
|
+
end #GroupDocs
|
data/lib/groupdocs/version.rb
CHANGED
@@ -46,8 +46,6 @@ describe GroupDocs::Document::Annotation::Reviewer do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it { should have_accessor(:emailAddress) }
|
49
|
-
it { should have_accessor(:FullName) }
|
50
49
|
|
51
|
-
it { should alias_accessor(:email_address, :emailAddress) }
|
52
|
-
it { should alias_accessor(:full_name, :FullName) }
|
50
|
+
it { should alias_accessor(:email_address, :emailAddress) }
|
53
51
|
end
|
@@ -27,4 +27,13 @@ describe GroupDocs::Document::Change do
|
|
27
27
|
subject.box.h.should == 0.005967
|
28
28
|
end
|
29
29
|
end
|
30
|
+
describe '#page=' do
|
31
|
+
it 'converts passed hash to GroupDocs::Document::Page object' do
|
32
|
+
subject.page = { :Id => 1, :Width => 674, :Height => 596 }
|
33
|
+
subject.page.should be_a(GroupDocs::Document::Page)
|
34
|
+
subject.page.Id.should == 1
|
35
|
+
subject.page.Width.should == 674
|
36
|
+
subject.page.Height.should == 596
|
37
|
+
end
|
38
|
+
end
|
30
39
|
end
|
@@ -8,9 +8,9 @@
|
|
8
8
|
"type": "delete",
|
9
9
|
"page":
|
10
10
|
{
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"
|
11
|
+
"Id": 1,
|
12
|
+
"Width": 612,
|
13
|
+
"Height": 792
|
14
14
|
},
|
15
15
|
"box":
|
16
16
|
{
|
@@ -26,9 +26,9 @@
|
|
26
26
|
"type": "insert",
|
27
27
|
"page":
|
28
28
|
{
|
29
|
-
"
|
30
|
-
"
|
31
|
-
"
|
29
|
+
"Id": 2,
|
30
|
+
"Width": 612,
|
31
|
+
"Height": 792
|
32
32
|
},
|
33
33
|
"box":
|
34
34
|
{
|
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.
|
4
|
+
version: 2.1.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-
|
12
|
+
date: 2015-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -380,6 +380,7 @@ files:
|
|
380
380
|
- lib/groupdocs/document/field.rb
|
381
381
|
- lib/groupdocs/document/metadata.rb
|
382
382
|
- lib/groupdocs/document/option.rb
|
383
|
+
- lib/groupdocs/document/page.rb
|
383
384
|
- lib/groupdocs/document/rectangle.rb
|
384
385
|
- lib/groupdocs/document/style.rb
|
385
386
|
- lib/groupdocs/document/view.rb
|
@@ -638,9 +639,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
638
639
|
version: '0'
|
639
640
|
requirements: []
|
640
641
|
rubyforge_project:
|
641
|
-
rubygems_version: 1.8.
|
642
|
+
rubygems_version: 1.8.29
|
642
643
|
signing_key:
|
643
644
|
specification_version: 3
|
644
645
|
summary: Ruby SDK for GroupDocs REST API
|
645
646
|
test_files: []
|
646
|
-
has_rdoc:
|