yaccl 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile +1 -1
- data/lib/yaccl/model/object.rb +7 -3
- data/lib/yaccl/model/object_factory.rb +6 -2
- data/lib/yaccl/services/acl_services.rb +6 -4
- data/lib/yaccl/services/discovery_services.rb +6 -4
- data/lib/yaccl/services/internal/browser_binding_service.rb +5 -4
- data/lib/yaccl/services/multi_filing_services.rb +6 -4
- data/lib/yaccl/services/navigation_services.rb +18 -12
- data/lib/yaccl/services/object_services.rb +56 -38
- data/lib/yaccl/services/policy_services.rb +9 -6
- data/lib/yaccl/services/relationship_services.rb +3 -2
- data/lib/yaccl/services/repository_services.rb +22 -15
- data/lib/yaccl/services/versioning_services.rb +18 -12
- data/lib/yaccl/services.rb +4 -1
- data/lib/yaccl/version.rb +1 -1
- data/lib/yaccl.rb +2 -1
- data/spec/services/navigation_services_spec.rb +5 -5
- data/spec/services/object_services_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2QxNWQ3ZjQzNDI1NWYwYTAxNTU0MTkzODc1MzI3Yzc1NGUxYzRhNA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmEwYWNiNzc3ZjUwYWE0ZDQzNzcyZTM0MWE0ZmM3Y2UxZTRmYjQ2Mw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTc2ZWRlMDA3ZmUzMzIxZmJmYzUzYzExYWE1ZWRlYzZiZmM1NjE0ZTdhMjk0
|
10
|
+
ZmI0NjUwOTcyM2RmZjZmNWVhYTc0MjY5ODcyYjgyY2MwMzBkMTMzMzQyODA4
|
11
|
+
NDIxYTg0ZDhmYzUxNjJiZjhiYmFiYzY0NjQ4OTM4MzIzYTZkYTQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NWQ5MmQ3MDgyYWZhZDk4Njk1ODU3MTg1MWEwMTdlNjY0MzYwNGQzYzcyMzIz
|
14
|
+
ZWYyYTM2YTg4ZmE3ODNhMmI1ZGIyYWIyMTNlY2I4ZWI1MzJlMGYxOGQ1MDFi
|
15
|
+
MDA1MTQ5MTc4YmU3NzNiNGE1MWIyODZhZDJkYTExZmUzZDM0NjM=
|
data/Gemfile
CHANGED
data/lib/yaccl/model/object.rb
CHANGED
@@ -102,9 +102,13 @@ module YACCL
|
|
102
102
|
private
|
103
103
|
|
104
104
|
def get_properties_map(raw)
|
105
|
-
|
106
|
-
|
107
|
-
|
105
|
+
if raw[:succinctProperties]
|
106
|
+
raw[:succinctProperties]
|
107
|
+
elsif raw[:properties]
|
108
|
+
raw[:properties].reduce({}) { |h, (k, v)| h.merge(k => v[:value]) }
|
109
|
+
else
|
110
|
+
{}
|
111
|
+
end
|
108
112
|
end
|
109
113
|
end
|
110
114
|
end
|
@@ -2,8 +2,12 @@ module YACCL
|
|
2
2
|
module Model
|
3
3
|
class ObjectFactory
|
4
4
|
def self.create(repository_id, raw)
|
5
|
-
|
6
|
-
|
5
|
+
base_type_id = if raw[:properties]
|
6
|
+
raw[:properties][:'cmis:baseTypeId'][:value]
|
7
|
+
else
|
8
|
+
raw[:succinctProperties][:'cmis:baseTypeId']
|
9
|
+
end
|
10
|
+
|
7
11
|
case base_type_id
|
8
12
|
when 'cmis:folder' then Folder.new(repository_id, raw)
|
9
13
|
when 'cmis:document' then Document.new(repository_id, raw)
|
@@ -1,15 +1,17 @@
|
|
1
1
|
module YACCL
|
2
2
|
module ACLServices
|
3
|
-
def get_acl(repository_id, object_id, only_basic_permissions,
|
4
|
-
required = {
|
3
|
+
def get_acl(repository_id, object_id, only_basic_permissions, succinct=false)
|
4
|
+
required = {succinct: succinct,
|
5
|
+
cmisselector: 'acl',
|
5
6
|
repositoryId: repository_id,
|
6
7
|
objectId: object_id}
|
7
8
|
optional = {onlyBasicPermissions: only_basic_permissions}
|
8
9
|
perform_request(required, optional)
|
9
10
|
end
|
10
11
|
|
11
|
-
def apply_acl(repository_id, object_id, add_aces, remove_aces, acl_propagation,
|
12
|
-
required = {
|
12
|
+
def apply_acl(repository_id, object_id, add_aces, remove_aces, acl_propagation, succinct=false)
|
13
|
+
required = {succinct: succinct,
|
14
|
+
cmisaction: 'applyACL',
|
13
15
|
repositoryId: repository_id,
|
14
16
|
objectId: object_id}
|
15
17
|
optional = {addACEs: add_aces,
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module YACCL
|
2
2
|
module DiscoveryServices
|
3
|
-
def query(repository_id, statement, search_all_versions, include_relationships, rendition_filter, include_allowable_actions, max_items, skip_count,
|
4
|
-
required = {
|
3
|
+
def query(repository_id, statement, search_all_versions, include_relationships, rendition_filter, include_allowable_actions, max_items, skip_count, succinct=false)
|
4
|
+
required = {succinct: succinct,
|
5
|
+
cmisselector: 'query',
|
5
6
|
repositoryId: repository_id,
|
6
7
|
q: statement}
|
7
8
|
optional = {searchAllVersions: search_all_versions,
|
@@ -13,8 +14,9 @@ module YACCL
|
|
13
14
|
perform_request(required, optional)
|
14
15
|
end
|
15
16
|
|
16
|
-
def get_content_changes(repository_id, change_log_token, include_properties, include_policy_ids, include_acl, max_items,
|
17
|
-
required = {
|
17
|
+
def get_content_changes(repository_id, change_log_token, include_properties, include_policy_ids, include_acl, max_items, succinct=false)
|
18
|
+
required = {succinct: succinct,
|
19
|
+
cmisselector: 'contentChanges',
|
18
20
|
repositoryId: repository_id}
|
19
21
|
optional = {changeLogToken: change_log_token,
|
20
22
|
includeProperties: include_properties,
|
@@ -9,10 +9,11 @@ module YACCL
|
|
9
9
|
|
10
10
|
module Internal
|
11
11
|
class BrowserBindingService
|
12
|
-
def initialize(service_url, basic_auth_username=nil, basic_auth_password=nil)
|
12
|
+
def initialize(service_url, basic_auth_username=nil, basic_auth_password=nil, succinct_properties=true)
|
13
13
|
@service_url = service_url
|
14
14
|
@basic_auth_username = basic_auth_username
|
15
15
|
@basic_auth_password = basic_auth_password
|
16
|
+
@succinct_properties = succinct_properties
|
16
17
|
|
17
18
|
@repository_urls = LRUCache.new(ttl: 3600)
|
18
19
|
@root_folder_urls = LRUCache.new(ttl: 3600)
|
@@ -21,7 +22,9 @@ module YACCL
|
|
21
22
|
def perform_request(required_params={}, optional_params={})
|
22
23
|
url = get_url(required_params.delete(:repositoryId), required_params[:objectId])
|
23
24
|
|
25
|
+
required_params[:succinct] ||= @succinct_properties
|
24
26
|
optional_params.reject! { |_, v| v.nil? }
|
27
|
+
|
25
28
|
params = transform_hash(required_params.merge(optional_params))
|
26
29
|
|
27
30
|
check(params)
|
@@ -108,9 +111,7 @@ module YACCL
|
|
108
111
|
url = URI.parse(url)
|
109
112
|
req = Net::HTTP::Post::Multipart.new(url.path, options)
|
110
113
|
req.basic_auth @basic_auth_username, @basic_auth_password unless @basic_auth_username.nil?
|
111
|
-
Net::HTTP.start(url.host, url.port)
|
112
|
-
http.request(req)
|
113
|
-
end
|
114
|
+
Net::HTTP.start(url.host, url.port) { |http| http.request(req) }
|
114
115
|
end
|
115
116
|
end
|
116
117
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module YACCL
|
2
2
|
module MultiFilingServices
|
3
|
-
def add_object_to_folder(repository_id, object_id, folder_id, all_versions,
|
4
|
-
required = {
|
3
|
+
def add_object_to_folder(repository_id, object_id, folder_id, all_versions, succinct=false)
|
4
|
+
required = {succinct: succinct,
|
5
|
+
cmisaction: 'addObjectToFolder',
|
5
6
|
repositoryId: repository_id,
|
6
7
|
objectId: object_id,
|
7
8
|
folderId: folder_id}
|
@@ -9,8 +10,9 @@ module YACCL
|
|
9
10
|
perform_request(required, optional)
|
10
11
|
end
|
11
12
|
|
12
|
-
def remove_object_from_folder(repository_id, object_id, folder_id,
|
13
|
-
required = {
|
13
|
+
def remove_object_from_folder(repository_id, object_id, folder_id, succinct=false)
|
14
|
+
required = {succinct: succinct,
|
15
|
+
repositoryId: repository_id,
|
14
16
|
cmisaction: 'removeObjectFromFolder',
|
15
17
|
objectId: object_id}
|
16
18
|
optional = {folderId: folder_id}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module YACCL
|
2
2
|
module NavigationServices
|
3
|
-
def get_children(repository_id, folder_id, filter, order_by, include_allowable_actions, include_relationships, rendition_filter, include_path_segment, max_items, skip_count,
|
4
|
-
required = {
|
3
|
+
def get_children(repository_id, folder_id, filter, order_by, include_allowable_actions, include_relationships, rendition_filter, include_path_segment, max_items, skip_count, succinct=false)
|
4
|
+
required = {succinct: succinct,
|
5
|
+
cmisselector: 'children',
|
5
6
|
repositoryId: repository_id,
|
6
7
|
objectId: folder_id}
|
7
8
|
optional = {filter: filter,
|
@@ -15,8 +16,9 @@ module YACCL
|
|
15
16
|
perform_request(required, optional)
|
16
17
|
end
|
17
18
|
|
18
|
-
def get_descendants(repository_id, folder_id, depth, filter, include_allowable_actions, include_relationships, rendition_filter, include_path_segment,
|
19
|
-
required = {
|
19
|
+
def get_descendants(repository_id, folder_id, depth, filter, include_allowable_actions, include_relationships, rendition_filter, include_path_segment, succinct=false)
|
20
|
+
required = {succinct: succinct,
|
21
|
+
cmisselector: 'descendants',
|
20
22
|
repositoryId: repository_id,
|
21
23
|
objectId: folder_id}
|
22
24
|
optional = {depth: depth,
|
@@ -28,8 +30,9 @@ module YACCL
|
|
28
30
|
perform_request(required, optional)
|
29
31
|
end
|
30
32
|
|
31
|
-
def get_folder_tree(repository_id, folder_id, depth, filter, include_allowable_actions, include_relationships, rendition_filter, include_path_segment,
|
32
|
-
required = {
|
33
|
+
def get_folder_tree(repository_id, folder_id, depth, filter, include_allowable_actions, include_relationships, rendition_filter, include_path_segment, succinct=false)
|
34
|
+
required = {succinct: succinct,
|
35
|
+
cmisselector: 'folderTree',
|
33
36
|
repositoryId: repository_id,
|
34
37
|
objectId: folder_id}
|
35
38
|
optional = {depth: depth,
|
@@ -41,16 +44,18 @@ module YACCL
|
|
41
44
|
perform_request(required, optional)
|
42
45
|
end
|
43
46
|
|
44
|
-
def get_folder_parent(repository_id, folder_id, filter,
|
45
|
-
required = {
|
47
|
+
def get_folder_parent(repository_id, folder_id, filter, succinct=false)
|
48
|
+
required = {succinct: succinct,
|
49
|
+
cmisselector: 'parent',
|
46
50
|
repositoryId: repository_id,
|
47
51
|
objectId: folder_id}
|
48
52
|
optional = {filter: filter}
|
49
53
|
perform_request(required, optional)
|
50
54
|
end
|
51
55
|
|
52
|
-
def get_object_parents(repository_id, object_id, filter, include_allowable_actions, include_relationships, rendition_filter, include_relative_path_segment,
|
53
|
-
required = {
|
56
|
+
def get_object_parents(repository_id, object_id, filter, include_allowable_actions, include_relationships, rendition_filter, include_relative_path_segment, succinct=false)
|
57
|
+
required = {succinct: succinct,
|
58
|
+
cmisselector: 'parents',
|
54
59
|
repositoryId: repository_id,
|
55
60
|
objectId: object_id}
|
56
61
|
optional = {filter: filter,
|
@@ -61,8 +66,9 @@ module YACCL
|
|
61
66
|
perform_request(required, optional)
|
62
67
|
end
|
63
68
|
|
64
|
-
def get_checked_out_docs(repository_id, folder_id, filter, order_by, include_allowable_actions, include_relationships, rendition_filter, max_items, skip_count,
|
65
|
-
required = {
|
69
|
+
def get_checked_out_docs(repository_id, folder_id, filter, order_by, include_allowable_actions, include_relationships, rendition_filter, max_items, skip_count, succinct=false)
|
70
|
+
required = {succinct: succinct,
|
71
|
+
cmisselector: 'checkedout',
|
66
72
|
repositoryId: repository_id}
|
67
73
|
optional = {objectId: folder_id,
|
68
74
|
filter: filter,
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module YACCL
|
2
2
|
module ObjectServices
|
3
|
-
def get_object(repository_id, object_id, filter, include_allowable_actions, include_relationships, rendition_filter, include_policy_ids, include_acl,
|
4
|
-
required = {
|
3
|
+
def get_object(repository_id, object_id, filter, include_allowable_actions, include_relationships, rendition_filter, include_policy_ids, include_acl, succinct=false)
|
4
|
+
required = {succinct: succinct,
|
5
|
+
cmisselector: 'object',
|
5
6
|
repositoryId: repository_id,
|
6
7
|
objectId: object_id}
|
7
8
|
optional = {filter: filter,
|
@@ -13,16 +14,18 @@ module YACCL
|
|
13
14
|
perform_request(required, optional)
|
14
15
|
end
|
15
16
|
|
16
|
-
def get_properties(repository_id, object_id, filter,
|
17
|
-
required = {
|
17
|
+
def get_properties(repository_id, object_id, filter, succinct=false)
|
18
|
+
required = {succinct: succinct,
|
19
|
+
cmisselector: 'properties',
|
18
20
|
repositoryId: repository_id,
|
19
21
|
objectId: object_id}
|
20
22
|
optional = {filter: filter}
|
21
23
|
perform_request(required, optional)
|
22
24
|
end
|
23
25
|
|
24
|
-
def create_document(repository_id, properties, folder_id, content, versioning_state, policies, add_aces, remove_aces,
|
25
|
-
required = {
|
26
|
+
def create_document(repository_id, properties, folder_id, content, versioning_state, policies, add_aces, remove_aces, succinct=false)
|
27
|
+
required = {succinct: succinct,
|
28
|
+
cmisaction: 'createDocument',
|
26
29
|
repositoryId: repository_id,
|
27
30
|
properties: properties,
|
28
31
|
objectId: folder_id}
|
@@ -35,8 +38,9 @@ module YACCL
|
|
35
38
|
perform_request(required, optional)
|
36
39
|
end
|
37
40
|
|
38
|
-
def create_document_from_source(repository_id, source_id, properties, folder_id, versioning_state, policies, add_aces, remove_aces,
|
39
|
-
required = {
|
41
|
+
def create_document_from_source(repository_id, source_id, properties, folder_id, versioning_state, policies, add_aces, remove_aces, succinct=false)
|
42
|
+
required = {succinct: succinct,
|
43
|
+
cmisaction: 'createDocument',
|
40
44
|
repositoryId: repository_id,
|
41
45
|
sourceId: source_id}
|
42
46
|
optional = {properties: properties,
|
@@ -48,8 +52,9 @@ module YACCL
|
|
48
52
|
perform_request(required, optional)
|
49
53
|
end
|
50
54
|
|
51
|
-
def create_folder(repository_id, properties, folder_id, policies, add_aces, remove_aces,
|
52
|
-
required = {
|
55
|
+
def create_folder(repository_id, properties, folder_id, policies, add_aces, remove_aces, succinct=false)
|
56
|
+
required = {succinct: succinct,
|
57
|
+
cmisaction: 'createFolder',
|
53
58
|
repositoryId: repository_id,
|
54
59
|
properties: properties,
|
55
60
|
objectId: folder_id}
|
@@ -59,8 +64,9 @@ module YACCL
|
|
59
64
|
perform_request(required, optional)
|
60
65
|
end
|
61
66
|
|
62
|
-
def create_relationship(repository_id, properties, policies, add_aces, remove_aces,
|
63
|
-
required = {
|
67
|
+
def create_relationship(repository_id, properties, policies, add_aces, remove_aces, succinct=false)
|
68
|
+
required = {succinct: succinct,
|
69
|
+
cmisaction: 'createRelationship',
|
64
70
|
repositoryId: repository_id,
|
65
71
|
properties: properties}
|
66
72
|
optional = {policies: policies,
|
@@ -69,8 +75,9 @@ module YACCL
|
|
69
75
|
perform_request(required, optional)
|
70
76
|
end
|
71
77
|
|
72
|
-
def create_policy(repository_id, properties, folder_id, policies, add_aces, remove_aces,
|
73
|
-
required = {
|
78
|
+
def create_policy(repository_id, properties, folder_id, policies, add_aces, remove_aces, succinct=false)
|
79
|
+
required = {succinct: succinct,
|
80
|
+
cmisaction: 'createPolicy',
|
74
81
|
repositoryId: repository_id,
|
75
82
|
properties: properties}
|
76
83
|
optional = {objectId: folder_id,
|
@@ -80,8 +87,9 @@ module YACCL
|
|
80
87
|
perform_request(required, optional)
|
81
88
|
end
|
82
89
|
|
83
|
-
def create_item(repository_id, properties, folder_id, policies, add_aces, remove_aces,
|
84
|
-
required = {
|
90
|
+
def create_item(repository_id, properties, folder_id, policies, add_aces, remove_aces, succinct=false)
|
91
|
+
required = {succinct: succinct,
|
92
|
+
cmisaction: 'createItem',
|
85
93
|
repositoryId: repository_id,
|
86
94
|
properties: properties}
|
87
95
|
optional = {objectId: folder_id,
|
@@ -91,15 +99,17 @@ module YACCL
|
|
91
99
|
perform_request(required, optional)
|
92
100
|
end
|
93
101
|
|
94
|
-
def get_allowable_actions(repository_id, object_id,
|
95
|
-
required = {
|
102
|
+
def get_allowable_actions(repository_id, object_id, succinct=false)
|
103
|
+
required = {succinct: succinct,
|
104
|
+
cmisselector: 'allowableActions',
|
96
105
|
repositoryId: repository_id,
|
97
106
|
objectId: object_id}
|
98
107
|
perform_request(required)
|
99
108
|
end
|
100
109
|
|
101
|
-
def get_renditions(repository_id, object_id, rendition_filter, max_items, skip_count,
|
102
|
-
required = {
|
110
|
+
def get_renditions(repository_id, object_id, rendition_filter, max_items, skip_count, succinct=false)
|
111
|
+
required = {succinct: succinct,
|
112
|
+
cmisselector: 'renditions',
|
103
113
|
repositoryId: repository_id,
|
104
114
|
objectId: object_id}
|
105
115
|
optional = {renditionFilter: rendition_filter,
|
@@ -108,12 +118,13 @@ module YACCL
|
|
108
118
|
perform_request(required, optional)
|
109
119
|
end
|
110
120
|
|
111
|
-
def get_object_by_path(repository_id, path, filter, include_allowable_actions, include_relationships, rendition_filter, include_policy_ids, include_acl,
|
121
|
+
def get_object_by_path(repository_id, path, filter, include_allowable_actions, include_relationships, rendition_filter, include_policy_ids, include_acl, succinct=false)
|
112
122
|
raise 'Not supported.'
|
113
123
|
end
|
114
124
|
|
115
|
-
def get_content_stream(repository_id, object_id, stream_id, offset, length,
|
116
|
-
required = {
|
125
|
+
def get_content_stream(repository_id, object_id, stream_id, offset, length, succinct=false)
|
126
|
+
required = {succinct: succinct,
|
127
|
+
cmisselector: 'content',
|
117
128
|
repositoryId: repository_id,
|
118
129
|
objectId: object_id}
|
119
130
|
optional = {streamId: stream_id,
|
@@ -122,8 +133,9 @@ module YACCL
|
|
122
133
|
perform_request(required, optional)
|
123
134
|
end
|
124
135
|
|
125
|
-
def update_properties(repository_id, object_id, change_token, properties,
|
126
|
-
required = {
|
136
|
+
def update_properties(repository_id, object_id, change_token, properties, succinct=false)
|
137
|
+
required = {succinct: succinct,
|
138
|
+
cmisaction: 'update',
|
127
139
|
repositoryId: repository_id,
|
128
140
|
objectId: object_id,
|
129
141
|
properties: properties}
|
@@ -131,12 +143,13 @@ module YACCL
|
|
131
143
|
perform_request(required, optional)
|
132
144
|
end
|
133
145
|
|
134
|
-
def bulk_update_properties(repository_id, object_ids_and_change_tokens, properties, add_secondary_type_ids, remove_secondary_type_ids,
|
146
|
+
def bulk_update_properties(repository_id, object_ids_and_change_tokens, properties, add_secondary_type_ids, remove_secondary_type_ids, succinct=false)
|
135
147
|
# TODO
|
136
148
|
end
|
137
149
|
|
138
|
-
def move_object(repository_id, object_id, target_folder_id, source_folder_id,
|
139
|
-
required = {
|
150
|
+
def move_object(repository_id, object_id, target_folder_id, source_folder_id, succinct=false)
|
151
|
+
required = {succinct: succinct,
|
152
|
+
cmisaction: 'move',
|
140
153
|
repositoryId: repository_id,
|
141
154
|
objectId: object_id,
|
142
155
|
targetFolderId: target_folder_id,
|
@@ -144,16 +157,18 @@ module YACCL
|
|
144
157
|
perform_request(required)
|
145
158
|
end
|
146
159
|
|
147
|
-
def delete_object(repository_id, object_id, all_versions,
|
148
|
-
required = {
|
160
|
+
def delete_object(repository_id, object_id, all_versions, succinct=false)
|
161
|
+
required = {succinct: succinct,
|
162
|
+
cmisaction: 'delete',
|
149
163
|
repositoryId: repository_id,
|
150
164
|
objectId: object_id}
|
151
165
|
optional = {allVersions: all_versions}
|
152
166
|
perform_request(required, optional)
|
153
167
|
end
|
154
168
|
|
155
|
-
def delete_tree(repository_id, folder_id, all_versions, unfile_objects, continue_on_failure,
|
156
|
-
required = {
|
169
|
+
def delete_tree(repository_id, folder_id, all_versions, unfile_objects, continue_on_failure, succinct=false)
|
170
|
+
required = {succinct: succinct,
|
171
|
+
cmisaction: 'deleteTree',
|
157
172
|
repositoryId: repository_id,
|
158
173
|
objectId: folder_id}
|
159
174
|
optional = {allVersions: all_versions,
|
@@ -162,8 +177,9 @@ module YACCL
|
|
162
177
|
perform_request(required, optional)
|
163
178
|
end
|
164
179
|
|
165
|
-
def set_content_stream(repository_id, object_id, overwrite_flag, change_token, content,
|
166
|
-
required = {
|
180
|
+
def set_content_stream(repository_id, object_id, overwrite_flag, change_token, content, succinct=false)
|
181
|
+
required = {succinct: succinct,
|
182
|
+
cmisaction: 'setContent',
|
167
183
|
repositoryId: repository_id,
|
168
184
|
objectId: object_id,
|
169
185
|
content: content}
|
@@ -172,16 +188,18 @@ module YACCL
|
|
172
188
|
perform_request(required, optional)
|
173
189
|
end
|
174
190
|
|
175
|
-
def delete_content_stream(repository_id, object_id, change_token,
|
176
|
-
required = {
|
191
|
+
def delete_content_stream(repository_id, object_id, change_token, succinct=false)
|
192
|
+
required = {succinct: succinct,
|
193
|
+
cmisaction: 'deleteContent',
|
177
194
|
repositoryId: repository_id,
|
178
195
|
objectId: object_id}
|
179
196
|
optional = {changeToken: change_token}
|
180
197
|
perform_request(required, optional)
|
181
198
|
end
|
182
199
|
|
183
|
-
def append_content_stream(repository_id, object_id, change_token, content, is_last_chunk,
|
184
|
-
required = {
|
200
|
+
def append_content_stream(repository_id, object_id, change_token, content, is_last_chunk, succinct=false)
|
201
|
+
required = {succinct: succinct,
|
202
|
+
cmisaction: 'appendContent',
|
185
203
|
repositoryId: repository_id,
|
186
204
|
objectId: object_id,
|
187
205
|
content: content}
|
@@ -1,23 +1,26 @@
|
|
1
1
|
module YACCL
|
2
2
|
module PolicyServices
|
3
|
-
def apply_policy(repository_id, policy_id, object_id,
|
4
|
-
required = {
|
3
|
+
def apply_policy(repository_id, policy_id, object_id, succinct=false)
|
4
|
+
required = {succinct: succinct,
|
5
|
+
cmisaction: 'applyPolicy',
|
5
6
|
repositoryId: repository_id,
|
6
7
|
policyId: policy_id,
|
7
8
|
objectId: object_id}
|
8
9
|
perform_request(required)
|
9
10
|
end
|
10
11
|
|
11
|
-
def remove_policy(repository_id, policy_id, object_id,
|
12
|
-
required = {
|
12
|
+
def remove_policy(repository_id, policy_id, object_id, succinct=false)
|
13
|
+
required = {succinct: succinct,
|
14
|
+
cmisaction: 'removePolicy',
|
13
15
|
repositoryId: repository_id,
|
14
16
|
policyId: policy_id,
|
15
17
|
objectId: object_id}
|
16
18
|
perform_request(required)
|
17
19
|
end
|
18
20
|
|
19
|
-
def get_applied_policies(repository_id, object_id, filter,
|
20
|
-
required = {
|
21
|
+
def get_applied_policies(repository_id, object_id, filter, succinct=false)
|
22
|
+
required = {succinct: succinct,
|
23
|
+
cmisselector: 'policies',
|
21
24
|
repositoryId: repository_id,
|
22
25
|
objectId: object_id}
|
23
26
|
optional = {filter: filter}
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module YACCL
|
2
2
|
module RelationshipServices
|
3
|
-
def get_object_relationships(repository_id, object_id, include_sub_relationship_types, relationship_direction, type_id, filter, include_allowable_actions, max_items, skip_count,
|
4
|
-
required = {
|
3
|
+
def get_object_relationships(repository_id, object_id, include_sub_relationship_types, relationship_direction, type_id, filter, include_allowable_actions, max_items, skip_count, succinct=false)
|
4
|
+
required = {succinct: succinct,
|
5
|
+
cmisselector: 'relationships',
|
5
6
|
repositoryId: repository_id,
|
6
7
|
objectId: object_id}
|
7
8
|
optional = {includeSubRelationshipTypes: include_sub_relationship_types,
|
@@ -1,17 +1,19 @@
|
|
1
1
|
module YACCL
|
2
2
|
module RepositoryServices
|
3
|
-
def get_repositories
|
3
|
+
def get_repositories
|
4
4
|
perform_request
|
5
5
|
end
|
6
6
|
|
7
|
-
def get_repository_info(repository_id,
|
8
|
-
required = {
|
7
|
+
def get_repository_info(repository_id, succinct=false)
|
8
|
+
required = {succinct: succinct,
|
9
|
+
cmisselector: 'repositoryInfo',
|
9
10
|
repositoryId: repository_id}
|
10
11
|
perform_request(required)
|
11
12
|
end
|
12
13
|
|
13
|
-
def get_type_children(repository_id, type_id, include_property_definitions, max_items, skip_count,
|
14
|
-
required = {
|
14
|
+
def get_type_children(repository_id, type_id, include_property_definitions, max_items, skip_count, succinct=false)
|
15
|
+
required = {succinct: succinct,
|
16
|
+
cmisselector: 'typeChildren',
|
15
17
|
repositoryId: repository_id}
|
16
18
|
optional = {typeId: type_id,
|
17
19
|
includePropertyDefinitions: include_property_definitions,
|
@@ -20,8 +22,9 @@ module YACCL
|
|
20
22
|
perform_request(required, optional)
|
21
23
|
end
|
22
24
|
|
23
|
-
def get_type_descendants(repository_id, type_id, depth, include_property_definitions,
|
24
|
-
required = {
|
25
|
+
def get_type_descendants(repository_id, type_id, depth, include_property_definitions, succinct=false)
|
26
|
+
required = {succinct: succinct,
|
27
|
+
cmisselector: 'typeDescendants',
|
25
28
|
repositoryId: repository_id}
|
26
29
|
optional = {typeId: type_id,
|
27
30
|
depth: depth,
|
@@ -29,29 +32,33 @@ module YACCL
|
|
29
32
|
perform_request(required, optional)
|
30
33
|
end
|
31
34
|
|
32
|
-
def get_type_definition(repository_id, type_id,
|
33
|
-
required = {
|
35
|
+
def get_type_definition(repository_id, type_id, succinct=false)
|
36
|
+
required = {succinct: succinct,
|
37
|
+
cmisselector: 'typeDefinition',
|
34
38
|
repositoryId: repository_id,
|
35
39
|
typeId: type_id}
|
36
40
|
perform_request(required)
|
37
41
|
end
|
38
42
|
|
39
|
-
def create_type(repository_id, type,
|
40
|
-
required = {
|
43
|
+
def create_type(repository_id, type, succinct=false)
|
44
|
+
required = {succinct: succinct,
|
45
|
+
cmisaction: 'createType',
|
41
46
|
repositoryId: repository_id,
|
42
47
|
type: MultiJson.dump(type)}
|
43
48
|
perform_request(required)
|
44
49
|
end
|
45
50
|
|
46
|
-
def update_type(type,
|
47
|
-
required = {
|
51
|
+
def update_type(type, succinct=false)
|
52
|
+
required = {succinct: succinct,
|
53
|
+
cmisaction: 'updateType',
|
48
54
|
repositoryId: repository_id,
|
49
55
|
type: MultiJson.dump(type)}
|
50
56
|
perform_request(required)
|
51
57
|
end
|
52
58
|
|
53
|
-
def delete_type(repository_id, type_id,
|
54
|
-
required = {
|
59
|
+
def delete_type(repository_id, type_id, succinct=false)
|
60
|
+
required = {succinct: succinct,
|
61
|
+
cmisaction: 'deleteType',
|
55
62
|
repositoryId: repository_id,
|
56
63
|
typeId: type_id}
|
57
64
|
perform_request(required)
|
@@ -1,21 +1,24 @@
|
|
1
1
|
module YACCL
|
2
2
|
module VersioningServices # TODO Check 'version_series_id' confusion.
|
3
|
-
def check_out(repository_id, object_id,
|
4
|
-
required = {
|
3
|
+
def check_out(repository_id, object_id, succinct=false)
|
4
|
+
required = {succinct: succinct,
|
5
|
+
cmisaction: 'checkOut',
|
5
6
|
repositoryId: repository_id,
|
6
7
|
objectId: object_id}
|
7
8
|
perform_request(required)
|
8
9
|
end
|
9
10
|
|
10
|
-
def cancel_check_out(repository_id, object_id,
|
11
|
-
required = {
|
11
|
+
def cancel_check_out(repository_id, object_id, succinct=false)
|
12
|
+
required = {succinct: succinct,
|
13
|
+
cmisaction: 'cancelCheckOut',
|
12
14
|
repositoryId: repository_id,
|
13
15
|
objectId: object_id}
|
14
16
|
perform_request(required)
|
15
17
|
end
|
16
18
|
|
17
|
-
def check_in(repository_id, object_id, major, properties, content, checkin_comment, policies, add_aces, remove_aces,
|
18
|
-
required = {
|
19
|
+
def check_in(repository_id, object_id, major, properties, content, checkin_comment, policies, add_aces, remove_aces, succinct=false)
|
20
|
+
required = {succinct: succinct,
|
21
|
+
cmisaction: 'checkIn',
|
19
22
|
repositoryId: repository_id,
|
20
23
|
objectId: object_id}
|
21
24
|
optional = {major: major,
|
@@ -28,8 +31,9 @@ module YACCL
|
|
28
31
|
perform_request(required, optional)
|
29
32
|
end
|
30
33
|
|
31
|
-
def get_object_of_latest_version(repository_id, version_series_id, major, filter, include_allowable_actions, include_relationships, rendition_filter, include_policy_ids, include_acl,
|
32
|
-
required = {
|
34
|
+
def get_object_of_latest_version(repository_id, version_series_id, major, filter, include_allowable_actions, include_relationships, rendition_filter, include_policy_ids, include_acl, succinct=false)
|
35
|
+
required = {succinct: succinct,
|
36
|
+
cmisselector: 'object',
|
33
37
|
repositoryId: repository_id,
|
34
38
|
objectId: version_series_id}
|
35
39
|
optional = {major: major,
|
@@ -42,8 +46,9 @@ module YACCL
|
|
42
46
|
perform_request(required, optional)
|
43
47
|
end
|
44
48
|
|
45
|
-
def get_properties_of_latest_version(repository_id, version_series_id, major, filter,
|
46
|
-
required = {
|
49
|
+
def get_properties_of_latest_version(repository_id, version_series_id, major, filter, succinct=false)
|
50
|
+
required = {succinct: succinct,
|
51
|
+
cmisselector: 'properties',
|
47
52
|
repositoryId: repository_id,
|
48
53
|
objectId: version_series_id}
|
49
54
|
optional = {major: major,
|
@@ -51,8 +56,9 @@ module YACCL
|
|
51
56
|
perform_request(required, optional)
|
52
57
|
end
|
53
58
|
|
54
|
-
def get_all_versions(repository_id, version_series_id, filter, include_allowable_actions,
|
55
|
-
required = {
|
59
|
+
def get_all_versions(repository_id, version_series_id, filter, include_allowable_actions, succinct=false)
|
60
|
+
required = {succinct: succinct,
|
61
|
+
cmisselector: 'versions',
|
56
62
|
repositoryId: repository_id,
|
57
63
|
objectId: version_series_id}
|
58
64
|
optional = {filter: filter,
|
data/lib/yaccl/services.rb
CHANGED
@@ -13,7 +13,10 @@ module YACCL
|
|
13
13
|
module Services
|
14
14
|
class << self
|
15
15
|
def perform_request(*params)
|
16
|
-
service = Internal::BrowserBindingService.new(YACCL::SERVICE_URL,
|
16
|
+
service = Internal::BrowserBindingService.new(YACCL::SERVICE_URL,
|
17
|
+
YACCL::BASIC_AUTH_USERNAME,
|
18
|
+
YACCL::BASIC_AUTH_PASSWORD,
|
19
|
+
YACCL::SUCCINCT_PROPERTIES)
|
17
20
|
service.perform_request(*params)
|
18
21
|
end
|
19
22
|
|
data/lib/yaccl/version.rb
CHANGED
data/lib/yaccl.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module YACCL
|
2
|
-
def self.init(service_url, basic_auth_username=nil, basic_auth_password=nil)
|
2
|
+
def self.init(service_url, basic_auth_username=nil, basic_auth_password=nil, succint_properties=true)
|
3
3
|
YACCL.const_set('SERVICE_URL', service_url)
|
4
4
|
YACCL.const_set('BASIC_AUTH_USERNAME', basic_auth_username)
|
5
5
|
YACCL.const_set('BASIC_AUTH_PASSWORD', basic_auth_password)
|
6
|
+
YACCL.const_set('SUCCINCT_PROPERTIES', succint_properties)
|
6
7
|
end
|
7
8
|
end
|
8
9
|
|
@@ -16,7 +16,7 @@ describe YACCL::NavigationServices do
|
|
16
16
|
|
17
17
|
root_children = YACCL::Services.get_children('testrepo', root.object_id, nil, nil, nil, nil, nil, nil, nil, nil)
|
18
18
|
root_children[:objects].length.should be 1
|
19
|
-
root_children[:objects].first[:object][:
|
19
|
+
root_children[:objects].first[:object][:succinctProperties][:'cmis:objectId'].should eq f1.object_id
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'folder in folder - get parents' do
|
@@ -25,12 +25,12 @@ describe YACCL::NavigationServices do
|
|
25
25
|
f1 = create_folder(root)
|
26
26
|
f1_parents = YACCL::Services.get_object_parents('testrepo', f1.object_id, nil, nil, nil, nil, nil)
|
27
27
|
f1_parents.length.should eq 1
|
28
|
-
f1_parents.first[:object][:
|
28
|
+
f1_parents.first[:object][:succinctProperties][:'cmis:objectId'].should eq root.object_id
|
29
29
|
|
30
30
|
f2 = create_folder(f1)
|
31
31
|
f2_parents = YACCL::Services.get_object_parents('testrepo', f2.object_id, nil, nil, nil, nil, nil)
|
32
32
|
f2_parents.length.should eq 1
|
33
|
-
f2_parents.first[:object][:
|
33
|
+
f2_parents.first[:object][:succinctProperties][:'cmis:objectId'].should eq f1.object_id
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'document in folder - get parents' do
|
@@ -39,12 +39,12 @@ describe YACCL::NavigationServices do
|
|
39
39
|
f1 = create_folder(root)
|
40
40
|
f1_parents = YACCL::Services.get_object_parents('testrepo', f1.object_id, nil, nil, nil, nil, nil)
|
41
41
|
f1_parents.length.should eq 1
|
42
|
-
f1_parents.first[:object][:
|
42
|
+
f1_parents.first[:object][:succinctProperties][:'cmis:objectId'].should eq root.object_id
|
43
43
|
|
44
44
|
doc = create_document(f1)
|
45
45
|
doc_parents = YACCL::Services.get_object_parents('testrepo', doc.object_id, nil, nil, nil, nil, nil)
|
46
46
|
doc_parents.length.should eq 1
|
47
|
-
doc_parents.first[:object][:
|
47
|
+
doc_parents.first[:object][:succinctProperties][:'cmis:objectId'].should eq f1.object_id
|
48
48
|
end
|
49
49
|
|
50
50
|
def create_folder(folder)
|
@@ -26,7 +26,7 @@ describe YACCL::NavigationServices do
|
|
26
26
|
properties = {'cmis:objectTypeId' => 'cmis:document', 'cmis:name' => 'document'}
|
27
27
|
content = { stream: StringIO.new('Apples are green.'), mime_type: 'text/plain', filename: 'apples.txt' }
|
28
28
|
doc = YACCL::Services.create_document('testrepo', properties, root.object_id, content, nil, nil, nil, nil)
|
29
|
-
doc_id = doc[:
|
29
|
+
doc_id = doc[:succinctProperties][:'cmis:objectId']
|
30
30
|
|
31
31
|
YACCL::Services.get_content_stream('testrepo', doc_id, nil, nil, nil).should eq 'Apples are green.'
|
32
32
|
end
|
@@ -36,7 +36,7 @@ describe YACCL::NavigationServices do
|
|
36
36
|
|
37
37
|
properties = {'cmis:objectTypeId' => 'cmis:document', 'cmis:name' => 'document'}
|
38
38
|
doc = YACCL::Services.create_document('testrepo', properties, root.object_id, nil, nil, nil, nil, nil)
|
39
|
-
doc_id = doc[:
|
39
|
+
doc_id = doc[:succinctProperties][:'cmis:objectId']
|
40
40
|
|
41
41
|
lambda { YACCL::Services.get_content_stream('testrepo', doc_id, nil, nil, nil) }.should raise_exception
|
42
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaccl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
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: 2013-
|
12
|
+
date: 2013-04-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|