yaccl 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +6 -0
- data/Rakefile +7 -0
- data/examples/create_type_manual.rb +40 -0
- data/lib/yaccl.rb +10 -0
- data/lib/yaccl/model.rb +10 -0
- data/lib/yaccl/model/document.rb +63 -0
- data/lib/yaccl/model/folder.rb +66 -0
- data/lib/yaccl/model/item.rb +9 -0
- data/lib/yaccl/model/object.rb +98 -0
- data/lib/yaccl/model/object_factory.rb +18 -0
- data/lib/yaccl/model/policy.rb +20 -0
- data/lib/yaccl/model/relationship.rb +22 -0
- data/lib/yaccl/model/repository.rb +106 -0
- data/lib/yaccl/model/server.rb +13 -0
- data/lib/yaccl/model/type.rb +88 -0
- data/lib/yaccl/services.rb +31 -0
- data/lib/yaccl/services/acl_services.rb +21 -0
- data/lib/yaccl/services/discovery_services.rb +27 -0
- data/lib/yaccl/services/internal/browser_binding_service.rb +99 -0
- data/lib/yaccl/services/multi_filing_services.rb +20 -0
- data/lib/yaccl/services/navigation_services.rb +78 -0
- data/lib/yaccl/services/object_services.rb +192 -0
- data/lib/yaccl/services/policy_services.rb +27 -0
- data/lib/yaccl/services/relationship_services.rb +17 -0
- data/lib/yaccl/services/repository_services.rb +60 -0
- data/lib/yaccl/services/versioning_services.rb +21 -0
- data/readme.md +21 -0
- data/spec/helper.rb +19 -0
- data/spec/model/document_spec.rb +44 -0
- data/spec/model/folder_spec.rb +73 -0
- data/spec/model/object_spec.rb +103 -0
- data/spec/model/repository_spec.rb +134 -0
- data/spec/model/server_spec.rb +16 -0
- data/yaccl.gemspec +23 -0
- metadata +136 -0
@@ -0,0 +1,13 @@
|
|
1
|
+
module YACCL
|
2
|
+
module Model
|
3
|
+
class Server
|
4
|
+
def self.repositories
|
5
|
+
Services.get_repositories.values.map { |r| Repository.create(r) }
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.repository(repository_id)
|
9
|
+
Repository.create(Services.get_repository_info(repository_id).values.first)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module YACCL
|
2
|
+
module Model
|
3
|
+
class Type
|
4
|
+
attr_accessor :id
|
5
|
+
attr_accessor :local_name
|
6
|
+
attr_accessor :local_namespace
|
7
|
+
attr_accessor :query_name
|
8
|
+
attr_accessor :display_name
|
9
|
+
attr_accessor :base_id
|
10
|
+
attr_accessor :parent_id
|
11
|
+
attr_accessor :description
|
12
|
+
attr_accessor :creatable
|
13
|
+
attr_accessor :fileable
|
14
|
+
attr_accessor :queryable
|
15
|
+
attr_accessor :controllable_policy
|
16
|
+
attr_accessor :controllable_acl
|
17
|
+
attr_accessor :fulltext_indexed
|
18
|
+
attr_accessor :included_in_supertype_query
|
19
|
+
attr_accessor :property_definitions
|
20
|
+
# document type
|
21
|
+
attr_accessor :versionable
|
22
|
+
attr_accessor :content_stream_allowed
|
23
|
+
# relationship type
|
24
|
+
attr_accessor :allowed_source_types
|
25
|
+
attr_accessor :allowed_target_types
|
26
|
+
|
27
|
+
def self.create(raw)
|
28
|
+
Type.new(raw)
|
29
|
+
end
|
30
|
+
|
31
|
+
def initialize(hash={})
|
32
|
+
@id = hash[:id]
|
33
|
+
@local_name = hash[:localName]
|
34
|
+
@local_namespace = hash[:localNamespace]
|
35
|
+
@query_name = hash[:queryName]
|
36
|
+
@display_name = hash[:displayName]
|
37
|
+
@base_id = hash[:baseId]
|
38
|
+
@parent_id = hash[:parentId]
|
39
|
+
@description = hash[:description]
|
40
|
+
@creatable = hash[:creatable]
|
41
|
+
@fileable = hash[:fileable]
|
42
|
+
@queryable = hash[:queryable]
|
43
|
+
@controllable_policy = hash[:controllablePolicy]
|
44
|
+
@controllable_acl = hash[:controllableACL]
|
45
|
+
@fulltext_indexed = hash[:fulltextIndexed]
|
46
|
+
@included_in_supertype_query = hash[:includedInSupertype_query]
|
47
|
+
@property_definitions = hash[:propertyDefinitions] || {}
|
48
|
+
# document type
|
49
|
+
@versionable = hash[:versionable]
|
50
|
+
@content_stream_allowed = hash[:contentStreamAllowed]
|
51
|
+
# relationship type
|
52
|
+
@allowed_source_types = hash[:allowedSourceTypes]
|
53
|
+
@allowed_target_types = hash[:allowedTargetTypes]
|
54
|
+
end
|
55
|
+
|
56
|
+
def add_property_definition(property)
|
57
|
+
@property_definitions[property[:id]] = property
|
58
|
+
end
|
59
|
+
|
60
|
+
def to_hash
|
61
|
+
hash = {}
|
62
|
+
hash[:id] = id
|
63
|
+
hash[:localName] = local_name
|
64
|
+
hash[:localNamespace] = local_namespace
|
65
|
+
hash[:queryName]= query_name
|
66
|
+
hash[:displayName]= display_name
|
67
|
+
hash[:baseId]= base_id
|
68
|
+
hash[:parentId]= parent_id
|
69
|
+
hash[:description]= description
|
70
|
+
hash[:creatable]= creatable
|
71
|
+
hash[:fileable]= fileable
|
72
|
+
hash[:queryable]= queryable
|
73
|
+
hash[:controllablePolicy]= controllable_policy
|
74
|
+
hash[:controllableACL]= controllable_acl
|
75
|
+
hash[:fulltextIndexed]= fulltext_indexed
|
76
|
+
hash[:includedInSupertypeQuery]= included_in_supertype_query
|
77
|
+
hash[:propertyDefinitions]= property_definitions
|
78
|
+
# document type
|
79
|
+
hash[:versionable] = versionable unless versionable.nil?
|
80
|
+
hash[:contentStreamAllowed] = content_stream_allowed unless content_stream_allowed.nil?
|
81
|
+
# relationship type
|
82
|
+
hash[:allowedSourceTypes] = allowed_source_types unless allowed_source_types.nil?
|
83
|
+
hash[:allowedTargetTypes] = allowed_target_types unless allowed_target_types.nil?
|
84
|
+
hash
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'yaccl/services/internal/browser_binding_service'
|
2
|
+
require 'yaccl/services/repository_services'
|
3
|
+
require 'yaccl/services/navigation_services'
|
4
|
+
require 'yaccl/services/object_services'
|
5
|
+
require 'yaccl/services/multi_filing_services'
|
6
|
+
require 'yaccl/services/discovery_services'
|
7
|
+
require 'yaccl/services/versioning_services'
|
8
|
+
require 'yaccl/services/relationship_services'
|
9
|
+
require 'yaccl/services/policy_services'
|
10
|
+
require 'yaccl/services/acl_services'
|
11
|
+
|
12
|
+
module YACCL
|
13
|
+
module Services
|
14
|
+
class << self
|
15
|
+
def perform_request(*params)
|
16
|
+
service = Internal::BrowserBindingService.new(YACCL::SERVICE_URL)
|
17
|
+
service.perform_request(*params)
|
18
|
+
end
|
19
|
+
|
20
|
+
include RepositoryServices
|
21
|
+
include NavigationServices
|
22
|
+
include ObjectServices
|
23
|
+
include MultiFilingServices
|
24
|
+
include DiscoveryServices
|
25
|
+
include VersioningServices
|
26
|
+
include RelationshipServices
|
27
|
+
include PolicyServices
|
28
|
+
include ACLServices
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module YACCL
|
2
|
+
module ACLServices
|
3
|
+
def get_acl(repository_id, object_id, only_basic_permissions, extension={})
|
4
|
+
required = {cmisselector: 'acl',
|
5
|
+
repositoryId: repository_id,
|
6
|
+
objectId: object_id}
|
7
|
+
optional = {onlyBasicPermissions: only_basic_permissions}
|
8
|
+
perform_request(required, optional)
|
9
|
+
end
|
10
|
+
|
11
|
+
def apply_acl(repository_id, object_id, add_aces, remove_aces, acl_propagation, extension={})
|
12
|
+
required = {cmisaction: 'applyACL',
|
13
|
+
repositoryId: repository_id,
|
14
|
+
objectId: object_id}
|
15
|
+
optional = {addACEs: add_aces,
|
16
|
+
removeACEs: remove_aces,
|
17
|
+
ACLPropagation: acl_propagation}
|
18
|
+
perform_request(required, optional)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module YACCL
|
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',
|
5
|
+
repositoryId: repository_id,
|
6
|
+
q: statement}
|
7
|
+
optional = {searchAllVersions: search_all_versions,
|
8
|
+
includeRelationships: include_relationships,
|
9
|
+
renditionFilter: rendition_filter,
|
10
|
+
includeAllowableActions: include_allowable_actions,
|
11
|
+
maxItems: max_items,
|
12
|
+
skipCount: skip_count}
|
13
|
+
perform_request(required, optional)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get_content_changes(repository_id, change_log_token, include_properties, include_policy_ids, include_acl, max_items, extension={})
|
17
|
+
required = {cmisselector: 'contentChanges',
|
18
|
+
repositoryId: repository_id}
|
19
|
+
optional = {changeLogToken: change_log_token,
|
20
|
+
includeProperties: include_properties,
|
21
|
+
includePolicyIds: include_policy_ids,
|
22
|
+
includeAcl: include_acl,
|
23
|
+
maxItems: max_items}
|
24
|
+
perform_request(required, optional)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
require 'net/http/post/multipart'
|
3
|
+
require 'multi_json'
|
4
|
+
|
5
|
+
module YACCL
|
6
|
+
module Services
|
7
|
+
class CMISRequestError < RuntimeError; end
|
8
|
+
|
9
|
+
module Internal
|
10
|
+
class BrowserBindingService
|
11
|
+
def initialize(service_url)
|
12
|
+
@service_url = service_url
|
13
|
+
end
|
14
|
+
|
15
|
+
def perform_request(required_params={}, optional_params={})
|
16
|
+
url = get_url(required_params.delete(:repositoryId), required_params[:objectId])
|
17
|
+
|
18
|
+
optional_params.reject! { |_, v| v.nil? }
|
19
|
+
params = transform_hash(required_params.merge(optional_params))
|
20
|
+
|
21
|
+
check(params)
|
22
|
+
|
23
|
+
response = if params.has_key?(:cmisaction)
|
24
|
+
if params.has_key?(:content)
|
25
|
+
Basement.multipart_post(url, params)
|
26
|
+
else
|
27
|
+
Basement.post(url, body: params)
|
28
|
+
end
|
29
|
+
else
|
30
|
+
Basement.get(url, query: params)
|
31
|
+
end
|
32
|
+
|
33
|
+
result = response.body
|
34
|
+
if response.content_type == 'application/json'
|
35
|
+
result = MultiJson.load(result, symbolize_keys: true)
|
36
|
+
if result.is_a?(Hash) && result.has_key?(:exception)
|
37
|
+
raise CMISRequestError, "#{result[:exception]} -- #{result[:message]}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
result
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
44
|
+
|
45
|
+
def get_url(repository_id, object_id)
|
46
|
+
if repository_id.nil?
|
47
|
+
@service_url
|
48
|
+
else
|
49
|
+
repository_info = Basement.get(@service_url)[repository_id]
|
50
|
+
repository_info[object_id.nil? ? 'repositoryUrl' : 'rootFolderUrl']
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def check(hash)
|
55
|
+
check_in(hash, :includeRelationships, [:none, :source, :target, :both])
|
56
|
+
end
|
57
|
+
|
58
|
+
def check_in(hash, key, arr)
|
59
|
+
value = hash[key]
|
60
|
+
unless value.nil?
|
61
|
+
unless arr.include?(value)
|
62
|
+
raise ArgumentError, "#{key} must be one of #{arr}."
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def transform_hash(hash)
|
68
|
+
if hash.has_key?(:content)
|
69
|
+
content = hash.delete(:content)
|
70
|
+
hash[:content] = UploadIO.new(content[:stream],
|
71
|
+
content[:mime_type],
|
72
|
+
content[:filename])
|
73
|
+
end
|
74
|
+
if hash.has_key?(:properties)
|
75
|
+
props = hash.delete(:properties)
|
76
|
+
if props.is_a?(Hash)
|
77
|
+
props.each_with_index do |(id, value), index|
|
78
|
+
hash.merge!("propertyId[#{index}]" => id,
|
79
|
+
"propertyValue[#{index}]" => value)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
hash
|
84
|
+
end
|
85
|
+
|
86
|
+
class Basement
|
87
|
+
include HTTParty
|
88
|
+
|
89
|
+
def self.multipart_post(url, options)
|
90
|
+
url = URI.parse(url)
|
91
|
+
Net::HTTP.start(url.host, url.port) do |http|
|
92
|
+
http.request(Net::HTTP::Post::Multipart.new(url.path, options))
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module YACCL
|
2
|
+
module MultiFilingServices
|
3
|
+
def add_object_to_folder(repository_id, object_id, folder_id, all_versions, extension={})
|
4
|
+
required = {cmisaction: 'addObjectToFolder',
|
5
|
+
repositoryId: repository_id,
|
6
|
+
objectId: object_id,
|
7
|
+
folderId: folder_id}
|
8
|
+
optional = {allVersions: all_versions}
|
9
|
+
perform_request(required, optional)
|
10
|
+
end
|
11
|
+
|
12
|
+
def remove_object_from_folder(repository_id, object_id, folder_id, extension={})
|
13
|
+
required = {repositoryId: repository_id,
|
14
|
+
cmisaction: 'removeObjectFromFolder',
|
15
|
+
objectId: object_id}
|
16
|
+
optional = {folderId: folder_id}
|
17
|
+
perform_request(required, optional)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module YACCL
|
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',
|
5
|
+
repositoryId: repository_id,
|
6
|
+
objectId: folder_id}
|
7
|
+
optional = {filter: filter,
|
8
|
+
orderBy: order_by,
|
9
|
+
includeAllowableActions: include_allowable_actions,
|
10
|
+
includeRelationships: include_relationships,
|
11
|
+
renditionFilter: rendition_filter,
|
12
|
+
includePathSegment: include_path_segment,
|
13
|
+
maxItems: max_items,
|
14
|
+
skipCount: skip_count}
|
15
|
+
perform_request(required, optional)
|
16
|
+
end
|
17
|
+
|
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',
|
20
|
+
repositoryId: repository_id,
|
21
|
+
objectId: folder_id}
|
22
|
+
optional = {depth: depth,
|
23
|
+
filter: filter,
|
24
|
+
includeAllowableActions: include_allowable_actions,
|
25
|
+
includeRelationships: include_relationships,
|
26
|
+
renditionFilter: rendition_filter,
|
27
|
+
includePathSegment: include_path_segment}
|
28
|
+
perform_request(required, optional)
|
29
|
+
end
|
30
|
+
|
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
|
+
repositoryId: repository_id,
|
34
|
+
objectId: folder_id}
|
35
|
+
optional = {depth: depth,
|
36
|
+
filter: filter,
|
37
|
+
includeAllowableActions: include_allowable_actions,
|
38
|
+
includeRelationships: include_relationships,
|
39
|
+
renditionFilter: rendition_filter,
|
40
|
+
includePathSegment: include_path_segment}
|
41
|
+
perform_request(required, optional)
|
42
|
+
end
|
43
|
+
|
44
|
+
def get_folder_parent(repository_id, folder_id, filter, extension={})
|
45
|
+
required = {cmisselector: 'parent',
|
46
|
+
repositoryId: repository_id,
|
47
|
+
objectId: folder_id}
|
48
|
+
optional = {filter:filter}
|
49
|
+
perform_request(required, optional)
|
50
|
+
end
|
51
|
+
|
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',
|
54
|
+
repositoryId: repository_id,
|
55
|
+
objectId: object_id}
|
56
|
+
optional = {filter: filter,
|
57
|
+
includeAllowableActions: include_allowable_actions,
|
58
|
+
includeRelationships: include_relationships,
|
59
|
+
renditionFilter: rendition_filter,
|
60
|
+
includePathSegment: include_path_segment}
|
61
|
+
perform_request(required, optional)
|
62
|
+
end
|
63
|
+
|
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',
|
66
|
+
repositoryId: repository_id}
|
67
|
+
optional = {objectId: folder_id,
|
68
|
+
filter: filter,
|
69
|
+
orderBy: order_by,
|
70
|
+
includeAllowableActions: include_allowable_actions,
|
71
|
+
includeRelationships: include_relationships,
|
72
|
+
renditionFilter: rendition_filter,
|
73
|
+
maxItems: max_items,
|
74
|
+
skipCount: skip_count}
|
75
|
+
perform_request(required, optional)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,192 @@
|
|
1
|
+
module YACCL
|
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',
|
5
|
+
repositoryId: repository_id,
|
6
|
+
objectId: object_id}
|
7
|
+
optional = {filter: filter,
|
8
|
+
includeAllowableActions: include_allowable_actions,
|
9
|
+
includeRelationships: include_relationships,
|
10
|
+
renditionFilter: rendition_filter,
|
11
|
+
includePolicyIds: include_policy_ids,
|
12
|
+
includeAcl: include_acl}
|
13
|
+
perform_request(required, optional)
|
14
|
+
end
|
15
|
+
|
16
|
+
def get_properties(repository_id, object_id, filter, extension={})
|
17
|
+
required = {cmisselector: 'properties',
|
18
|
+
repositoryId: repository_id,
|
19
|
+
objectId: object_id}
|
20
|
+
optional = {filter: filter}
|
21
|
+
perform_request(required, optional)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_document(repository_id, properties, folder_id, content, versioning_state, policies, add_aces, remove_aces, extension={})
|
25
|
+
required = {cmisaction: 'createDocument',
|
26
|
+
repositoryId: repository_id,
|
27
|
+
properties: properties}
|
28
|
+
optional = {objectId: folder_id,
|
29
|
+
content: content,
|
30
|
+
versioningState: versioning_state,
|
31
|
+
policies: policies,
|
32
|
+
addACEs: add_aces,
|
33
|
+
removeACEs: remove_aces}
|
34
|
+
perform_request(required, optional)
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_document_from_source(repository_id, source_id, properties, folder_id, versioning_state, policies, add_aces, remove_aces, extension={})
|
38
|
+
required = {cmisaction: 'createDocument',
|
39
|
+
repositoryId: repository_id,
|
40
|
+
sourceId: source_id}
|
41
|
+
optional = {properties: properties,
|
42
|
+
objectId: folder_id,
|
43
|
+
versioningState: versioning_state,
|
44
|
+
policies: policies,
|
45
|
+
addACEs: add_aces,
|
46
|
+
removeACEs: remove_aces}
|
47
|
+
perform_request(required, optional)
|
48
|
+
end
|
49
|
+
|
50
|
+
def create_folder(repository_id, properties, folder_id, policies, add_aces, remove_aces, extension={})
|
51
|
+
required = {cmisaction: 'createFolder',
|
52
|
+
repositoryId: repository_id,
|
53
|
+
properties: properties,
|
54
|
+
objectId: folder_id}
|
55
|
+
optional = {policies: policies,
|
56
|
+
addACEs: add_aces,
|
57
|
+
removeACEs: remove_aces}
|
58
|
+
perform_request(required, optional)
|
59
|
+
end
|
60
|
+
|
61
|
+
def create_relationship(repository_id, properties, policies, add_aces, remove_aces, extension={})
|
62
|
+
required = {cmisaction: 'createRelationship',
|
63
|
+
repositoryId: repository_id,
|
64
|
+
properties: properties}
|
65
|
+
optional = {policies: policies,
|
66
|
+
addACEs: add_aces,
|
67
|
+
removeACEs: remove_aces}
|
68
|
+
perform_request(required, optional)
|
69
|
+
end
|
70
|
+
|
71
|
+
def create_policy(repository_id, properties, folder_id, policies, add_aces, remove_aces, extension={})
|
72
|
+
required = {cmisaction: 'createPolicy',
|
73
|
+
repositoryId: repository_id,
|
74
|
+
properties: properties}
|
75
|
+
optional = {objectId: folder_id,
|
76
|
+
policies: policies,
|
77
|
+
addACEs: add_aces,
|
78
|
+
removeACEs: remove_aces}
|
79
|
+
perform_request(required, optional)
|
80
|
+
end
|
81
|
+
|
82
|
+
def create_item(repository_id, properties, folder_id, policies, add_aces, remove_aces, extension={})
|
83
|
+
required = {cmisaction: 'createItem',
|
84
|
+
repositoryId: repository_id,
|
85
|
+
properties: properties}
|
86
|
+
optional = {objectId: folder_id,
|
87
|
+
policies: policies,
|
88
|
+
addACEs: add_aces,
|
89
|
+
removeACEs: remove_aces}
|
90
|
+
perform_request(required, optional)
|
91
|
+
end
|
92
|
+
|
93
|
+
def get_allowable_actions(repository_id, object_id, extension={})
|
94
|
+
required = {cmisselector: 'allowableActions',
|
95
|
+
repositoryId: repository_id,
|
96
|
+
objectId: object_id}
|
97
|
+
perform_request(required)
|
98
|
+
end
|
99
|
+
|
100
|
+
def get_renditions(repository_id, object_id, rendition_filter, max_items, skip_count, extension={})
|
101
|
+
required = {cmisselector: 'renditions',
|
102
|
+
repositoryId: repository_id,
|
103
|
+
objectId: object_id}
|
104
|
+
optional = {renditionFilter: rendition_filter,
|
105
|
+
maxItems: max_items,
|
106
|
+
skipCount: skip_count}
|
107
|
+
perform_request(required, optional)
|
108
|
+
end
|
109
|
+
|
110
|
+
def get_object_by_path(repository_id, path, filter, include_allowable_actions, include_relationships, rendition_filter, include_policy_ids, include_acl, extension={})
|
111
|
+
raise 'Not supported.'
|
112
|
+
end
|
113
|
+
|
114
|
+
def get_content_stream(repository_id, object_id, stream_id, offset, length, extension={})
|
115
|
+
required = {cmisselector: 'content',
|
116
|
+
repositoryId: repository_id,
|
117
|
+
objectId: object_id}
|
118
|
+
optional = {streamId: stream_id,
|
119
|
+
offset: offset,
|
120
|
+
length: length}
|
121
|
+
perform_request(required, optional)
|
122
|
+
end
|
123
|
+
|
124
|
+
def update_properties(repository_id, object_id, change_token, properties, extension={})
|
125
|
+
required = {cmisaction: 'update',
|
126
|
+
repositoryId: repository_id,
|
127
|
+
objectId: object_id,
|
128
|
+
properties: properties}
|
129
|
+
optional = {changeToken: change_token}
|
130
|
+
perform_request(required, optional)
|
131
|
+
end
|
132
|
+
|
133
|
+
def bulk_update_properties(repository_id, object_ids_and_change_tokens, properties, add_secondary_type_ids, remove_secondary_type_ids, extension={})
|
134
|
+
# TODO
|
135
|
+
end
|
136
|
+
|
137
|
+
def move_object(repository_id, object_id, target_folder_id, source_folder_id, extension={})
|
138
|
+
required = {cmisaction: 'move',
|
139
|
+
repositoryId: repository_id,
|
140
|
+
objectId: object_id,
|
141
|
+
targetFolderId: target_folder_id,
|
142
|
+
sourceFolderId: source_folder_id}
|
143
|
+
perform_request(required)
|
144
|
+
end
|
145
|
+
|
146
|
+
def delete_object(repository_id, object_id, all_versions, extension={})
|
147
|
+
required = {cmisaction: 'delete',
|
148
|
+
repositoryId: repository_id,
|
149
|
+
objectId: object_id}
|
150
|
+
optional = {allVersions: all_versions}
|
151
|
+
perform_request(required, optional)
|
152
|
+
end
|
153
|
+
|
154
|
+
def delete_tree(repository_id, folder_id, all_versions, unfile_objects, continue_on_failure, extension={})
|
155
|
+
required = {cmisaction: 'deleteTree',
|
156
|
+
repositoryId: repository_id,
|
157
|
+
objectId: folder_id}
|
158
|
+
optional = {allVersions: all_versions,
|
159
|
+
unfileObjects: unfile_objects,
|
160
|
+
continueOnFailure: continue_on_failure}
|
161
|
+
perform_request(required, optional)
|
162
|
+
end
|
163
|
+
|
164
|
+
def set_content_stream(repository_id, object_id, overwrite_flag, change_token, content, extension={})
|
165
|
+
required = {cmisaction: 'setContent',
|
166
|
+
repositoryId: repository_id,
|
167
|
+
objectId: object_id,
|
168
|
+
content: content}
|
169
|
+
optional = {overwriteFlag: overwrite_flag,
|
170
|
+
changeToken:change_token}
|
171
|
+
perform_request(required, optional)
|
172
|
+
end
|
173
|
+
|
174
|
+
def delete_content_stream(repository_id, object_id, change_token, extension={})
|
175
|
+
required = {cmisaction: 'deleteContent',
|
176
|
+
repositoryId: repository_id,
|
177
|
+
objectId: object_id}
|
178
|
+
optional = {changeToken: change_token}
|
179
|
+
perform_request(required, optional)
|
180
|
+
end
|
181
|
+
|
182
|
+
def append_content_stream(repository_id, object_id, change_token, content, is_last_chunk, extension={})
|
183
|
+
required = {cmisaction: 'appendContent',
|
184
|
+
repositoryId: repository_id,
|
185
|
+
objectId: object_id,
|
186
|
+
content: content}
|
187
|
+
optional = {isLastChunk: is_last_chunk,
|
188
|
+
changeToken: change_token}
|
189
|
+
perform_request(required, optional)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|