Class: CMIS::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/cmis/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Server

Returns a new instance of Server.



5
6
7
# File 'lib/cmis/server.rb', line 5

def initialize(options = {})
  @connection = Connection.new(options)
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



3
4
5
# File 'lib/cmis/server.rb', line 3

def connection
  @connection
end

Instance Method Details

#has_repository?(repository_id) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
# File 'lib/cmis/server.rb', line 24

def has_repository?(repository_id)
  repository(repository_id)
  true
rescue Exceptions::ObjectNotFound
  false
end

#repositories(opts = {}) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/cmis/server.rb', line 9

def repositories(opts = {})
  result = connection.execute!({}, opts)

  result.values.map do |r|
    Repository.new(r, connection)
  end
end

#repository(repository_id, opts = {}) ⇒ Object



17
18
19
20
21
22
# File 'lib/cmis/server.rb', line 17

def repository(repository_id, opts = {})
  result = connection.execute!({ cmisselector: 'repositoryInfo',
                                 repositoryId: repository_id }, opts)

  Repository.new(result[repository_id], connection)
end