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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2E0ZDM4YmRmOWZjOWJkYWE5NTI4NDY5MWVlNGIyNWMyZDRlN2RlOA==
4
+ M2QxNWQ3ZjQzNDI1NWYwYTAxNTU0MTkzODc1MzI3Yzc1NGUxYzRhNA==
5
5
  data.tar.gz: !binary |-
6
- OTRmOWU4NjFiYzkxYWJhZmMwNWIzNzRlMmQ4MTcyN2JhM2QyYmJmNw==
6
+ NmEwYWNiNzc3ZjUwYWE0ZDQzNzcyZTM0MWE0ZmM3Y2UxZTRmYjQ2Mw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjBmNWQyY2I3NTA2YWVjNzlmZDFkMTNkMWQ5MzBmYWYwYTE0MjRmZDY0ZTY2
10
- MmUwYmViNTEwMGQ3YjJlZGZhMTBiYmNkMTY5ZjRlMjNjZDQ2MDliNGJkNTNl
11
- ZjljYmJjZTBjNjUzN2QyY2VhMmYxZGEyMzk1NGEwMGQzZjRkODc=
9
+ OTc2ZWRlMDA3ZmUzMzIxZmJmYzUzYzExYWE1ZWRlYzZiZmM1NjE0ZTdhMjk0
10
+ ZmI0NjUwOTcyM2RmZjZmNWVhYTc0MjY5ODcyYjgyY2MwMzBkMTMzMzQyODA4
11
+ NDIxYTg0ZDhmYzUxNjJiZjhiYmFiYzY0NjQ4OTM4MzIzYTZkYTQ=
12
12
  data.tar.gz: !binary |-
13
- MjFkYzUwMzUzNmQ5ZmNjNmI2M2ZjNjdkZmQ5ODdkMTU1NmI3ZWNkMDEzZGU3
14
- YjhjNGM1YzEwMzk5NTQ2NzVmZTFmM2RiMDk0YjdiZmFmMmQzZWJlYThkZWY5
15
- ZDc1MDU5NjJmNzgxOGJkY2M4NTExZjA0NmEyOTkzZjdmOTgxNDg=
13
+ NWQ5MmQ3MDgyYWZhZDk4Njk1ODU3MTg1MWEwMTdlNjY0MzYwNGQzYzcyMzIz
14
+ ZWYyYTM2YTg4ZmE3ODNhMmI1ZGIyYWIyMTNlY2I4ZWI1MzJlMGYxOGQ1MDFi
15
+ MDA1MTQ5MTc4YmU3NzNiNGE1MWIyODZhZDJkYTExZmUzZDM0NjM=
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
@@ -102,9 +102,13 @@ module YACCL
102
102
  private
103
103
 
104
104
  def get_properties_map(raw)
105
- raw_properties = raw[:properties]
106
- return {} if raw_properties.nil?
107
- raw_properties.reduce({}) { |h, (k, v)| h.merge(k => v[:value]) }
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
- properties = raw[:properties]
6
- base_type_id = properties[:'cmis:baseTypeId'][:value]
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, extension={})
4
- required = {cmisselector: 'acl',
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, extension={})
12
- required = {cmisaction: 'applyACL',
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, extension={})
4
- required = {cmisselector: 'query',
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, extension={})
17
- required = {cmisselector: 'contentChanges',
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) do |http|
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, extension={})
4
- required = {cmisaction: 'addObjectToFolder',
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, extension={})
13
- required = {repositoryId: repository_id,
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, extension={})
4
- required = {cmisselector: 'children',
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, extension={})
19
- required = {cmisselector: 'descendants',
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, extension={})
32
- required = {cmisselector: 'folderTree',
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, extension={})
45
- required = {cmisselector: 'parent',
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, extension={})
53
- required = {cmisselector: 'parents',
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, extension={})
65
- required = {cmisselector: 'checkedout',
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, extension={})
4
- required = {cmisselector: 'object',
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, extension={})
17
- required = {cmisselector: 'properties',
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, extension={})
25
- required = {cmisaction: 'createDocument',
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, extension={})
39
- required = {cmisaction: 'createDocument',
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, extension={})
52
- required = {cmisaction: 'createFolder',
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, extension={})
63
- required = {cmisaction: 'createRelationship',
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, extension={})
73
- required = {cmisaction: 'createPolicy',
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, extension={})
84
- required = {cmisaction: 'createItem',
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, extension={})
95
- required = {cmisselector: 'allowableActions',
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, extension={})
102
- required = {cmisselector: 'renditions',
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, extension={})
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, extension={})
116
- required = {cmisselector: 'content',
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, extension={})
126
- required = {cmisaction: 'update',
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, extension={})
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, extension={})
139
- required = {cmisaction: 'move',
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, extension={})
148
- required = {cmisaction: 'delete',
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, extension={})
156
- required = {cmisaction: 'deleteTree',
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, extension={})
166
- required = {cmisaction: 'setContent',
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, extension={})
176
- required = {cmisaction: 'deleteContent',
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, extension={})
184
- required = {cmisaction: 'appendContent',
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, extension={})
4
- required = {cmisaction: 'applyPolicy',
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, extension={})
12
- required = {cmisaction: 'removePolicy',
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, extension={})
20
- required = {cmisselector: 'policies',
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, extension={})
4
- required = {cmisselector: 'relationships',
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(extension={})
3
+ def get_repositories
4
4
  perform_request
5
5
  end
6
6
 
7
- def get_repository_info(repository_id, extension={})
8
- required = {cmisselector: 'repositoryInfo',
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, extension={})
14
- required = {cmisselector: 'typeChildren',
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, extension={})
24
- required = {cmisselector: 'typeDescendants',
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, extension={})
33
- required = {cmisselector: 'typeDefinition',
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, extension={})
40
- required = {cmisaction: 'createType',
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, extension={})
47
- required = {cmisaction: 'updateType',
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, extension={})
54
- required = {cmisaction: 'deleteType',
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, extension={})
4
- required = {cmisaction: 'checkOut',
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, extension={})
11
- required = {cmisaction: 'cancelCheckOut',
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, extension={})
18
- required = {cmisaction: 'checkIn',
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, extension={})
32
- required = {cmisselector: 'object',
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, extension={})
46
- required = {cmisselector: 'properties',
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, extension={})
55
- required = {cmisselector: 'versions',
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,
@@ -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, YACCL::BASIC_AUTH_USERNAME, YACCL::BASIC_AUTH_PASSWORD)
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
@@ -1,3 +1,3 @@
1
1
  module YACCL
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
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][:properties][:'cmis:objectId'][:value].should eq f1.object_id
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][:properties][:'cmis:objectId'][:value].should eq root.object_id
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][:properties][:'cmis:objectId'][:value].should eq f1.object_id
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][:properties][:'cmis:objectId'][:value].should eq root.object_id
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][:properties][:'cmis:objectId'][:value].should eq f1.object_id
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[:properties][:'cmis:objectId'][:value]
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[:properties][:'cmis:objectId'][:value]
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.7
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-03-28 00:00:00.000000000 Z
12
+ date: 2013-04-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty