cmis-ruby 0.5.11 → 0.5.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cmis/exceptions.rb +14 -14
- data/lib/cmis/object.rb +11 -7
- data/lib/cmis/repository.rb +1 -5
- data/lib/cmis/type.rb +12 -1
- data/lib/cmis/version.rb +1 -1
- data/spec/cmis-ruby/object_spec.rb +4 -2
- data/spec/cmis-ruby/repository_spec.rb +7 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8730379664b933adbdf0a0c3315a59986548966b
|
4
|
+
data.tar.gz: d7b5e6e1a2a37f8e1a910d7f3277251a0600819e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fa75b47da1f042b3d01f3ec68b31854478d22a49721df0eaca54bfd2d45011ab9e95f00d50adef63409e511455c0b58f9ab2581293eda55172eb40813ffb4bc
|
7
|
+
data.tar.gz: 20b1cc0cc493a193fbe99185845e36f75838bbcceccadfc244e5a6e21102101466959db1b6cd62e5e14683a5f2cec1d3f7c0c287a2fb86467f029bd710f140a1
|
data/lib/cmis/exceptions.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
module CMIS
|
2
2
|
module Exceptions
|
3
|
-
InvalidArgument = Class.new(
|
4
|
-
NotSupported = Class.new(
|
5
|
-
ObjectNotFound = Class.new(
|
6
|
-
PermissionDenied = Class.new(
|
7
|
-
Runtime = Class.new(
|
8
|
-
Constraint = Class.new(
|
9
|
-
ContentAlreadyExists = Class.new(
|
10
|
-
FilterNotValid = Class.new(
|
11
|
-
NameConstraintViolation = Class.new(
|
12
|
-
Storage = Class.new(
|
13
|
-
StreamNotSupported = Class.new(
|
14
|
-
UpdateConflict = Class.new(
|
15
|
-
Versioning = Class.new(
|
3
|
+
InvalidArgument = Class.new(StandardError)
|
4
|
+
NotSupported = Class.new(StandardError)
|
5
|
+
ObjectNotFound = Class.new(StandardError)
|
6
|
+
PermissionDenied = Class.new(StandardError)
|
7
|
+
Runtime = Class.new(StandardError)
|
8
|
+
Constraint = Class.new(StandardError)
|
9
|
+
ContentAlreadyExists = Class.new(StandardError)
|
10
|
+
FilterNotValid = Class.new(StandardError)
|
11
|
+
NameConstraintViolation = Class.new(StandardError)
|
12
|
+
Storage = Class.new(StandardError)
|
13
|
+
StreamNotSupported = Class.new(StandardError)
|
14
|
+
UpdateConflict = Class.new(StandardError)
|
15
|
+
Versioning = Class.new(StandardError)
|
16
16
|
|
17
17
|
# Non-CMIS
|
18
|
-
Unauthorized = Class.new(
|
18
|
+
Unauthorized = Class.new(StandardError)
|
19
19
|
end
|
20
20
|
end
|
data/lib/cmis/object.rb
CHANGED
@@ -35,13 +35,17 @@ module CMIS
|
|
35
35
|
delete(opts)
|
36
36
|
end
|
37
37
|
|
38
|
-
def update_properties(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
38
|
+
def update_properties(props, opts = {})
|
39
|
+
if detached?
|
40
|
+
properties.merge!(props)
|
41
|
+
else
|
42
|
+
with_change_token do
|
43
|
+
server.execute!({ cmisaction: 'update',
|
44
|
+
repositoryId: repository.id,
|
45
|
+
objectId: cmis_object_id,
|
46
|
+
properties: props,
|
47
|
+
changeToken: change_token }, opts)
|
48
|
+
end
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|
data/lib/cmis/repository.rb
CHANGED
@@ -80,11 +80,7 @@ module CMIS
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def create_type(type, opts = {})
|
83
|
-
|
84
|
-
repositoryId: id,
|
85
|
-
type: JSON.generate(type.to_hash) }, opts)
|
86
|
-
|
87
|
-
Type.new(result, self)
|
83
|
+
type.create(opts)
|
88
84
|
end
|
89
85
|
|
90
86
|
def create_relationship(object, opts = {})
|
data/lib/cmis/type.rb
CHANGED
@@ -31,11 +31,21 @@ module CMIS
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def create(opts = {})
|
34
|
-
|
34
|
+
opts.symbolize_keys!
|
35
|
+
|
36
|
+
type_hash = to_hash
|
37
|
+
type_hash.merge!(opts.delete(:extensions) || {})
|
38
|
+
|
39
|
+
result = server.execute!({ cmisaction: 'createType',
|
40
|
+
repositoryId: repository.id,
|
41
|
+
type: JSON.generate(type_hash) }, opts)
|
42
|
+
|
43
|
+
Type.new(result, repository)
|
35
44
|
end
|
36
45
|
|
37
46
|
def update(changed_property_defs, opts = {})
|
38
47
|
changed_property_defs.map!(&:deep_stringify_keys)
|
48
|
+
opts.symbolize_keys!
|
39
49
|
|
40
50
|
new_defs = changed_property_defs.map(&:to_hash).reduce({}) do |result, element|
|
41
51
|
result[element['id']] = element
|
@@ -44,6 +54,7 @@ module CMIS
|
|
44
54
|
|
45
55
|
hash = to_hash
|
46
56
|
hash['propertyDefinitions'] = new_defs
|
57
|
+
hash.merge!(opts.delete(:extensions) || {})
|
47
58
|
|
48
59
|
result = server.execute!({ cmisaction: 'updateType',
|
49
60
|
repositoryId: repository.id,
|
data/lib/cmis/version.rb
CHANGED
@@ -59,8 +59,10 @@ module CMIS
|
|
59
59
|
|
60
60
|
describe '#unfile' do
|
61
61
|
it 'unfiles it from the parent folder' do
|
62
|
-
|
63
|
-
|
62
|
+
if repository.capabilities['capabilityUnfiling']
|
63
|
+
@document.unfile
|
64
|
+
expect(@document.parents).to be_empty
|
65
|
+
end
|
64
66
|
end
|
65
67
|
end
|
66
68
|
|
@@ -1,11 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
module CMIS
|
4
|
-
PRIMARY_BASE_TYPES =
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
PRIMARY_BASE_TYPES = [
|
5
|
+
'cmis:document',
|
6
|
+
'cmis:folder',
|
7
|
+
'cmis:relationship',
|
8
|
+
# 'cmis:policy',
|
9
|
+
'cmis:item'
|
10
|
+
]
|
9
11
|
|
10
12
|
describe Repository do
|
11
13
|
it 'is supported by the library' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmis-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenneth Geerts
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-08-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|