Class: YACCL::Model::Repository

Inherits:
Object
  • Object
show all
Defined in:
lib/yaccl/model/repository.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Repository

Returns a new instance of Repository.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/yaccl/model/repository.rb', line 24

def initialize(raw)
  @id = raw[:repositoryId]
  @name = raw[:repositoryName]
  @description = raw[:repositoryDescription]
  @root_folder_id = raw[:rootFolderId]
  @capabilities = raw[:capabilities]
  @url = raw[:repositoryUrl]
  @latest_change_log_token = raw[:latestChangeLogToken]
  @vendor_name = raw[:vendorName]
  @cmis_version_supported = raw[:cmisVersionSupported]
  @acl_capabilities = raw[:aclCapabilities]
  @product_name = raw[:productName]
  @product_version = raw[:productVersion]
  @thin_client_uri = raw[:thinClientUri]
  @changes_on_type = raw[:changesOnType]
  @root_folder_url = raw[:rootFolderUrl]
end

Instance Attribute Details

#acl_capabilitiesObject (readonly)

Returns the value of attribute acl_capabilities.



13
14
15
# File 'lib/yaccl/model/repository.rb', line 13

def acl_capabilities
  @acl_capabilities
end

#capabilitiesObject (readonly)

Returns the value of attribute capabilities.



8
9
10
# File 'lib/yaccl/model/repository.rb', line 8

def capabilities
  @capabilities
end

#changes_on_typeObject (readonly)

Returns the value of attribute changes_on_type.



17
18
19
# File 'lib/yaccl/model/repository.rb', line 17

def changes_on_type
  @changes_on_type
end

#cmis_version_supportedObject (readonly)

Returns the value of attribute cmis_version_supported.



12
13
14
# File 'lib/yaccl/model/repository.rb', line 12

def cmis_version_supported
  @cmis_version_supported
end

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/yaccl/model/repository.rb', line 6

def description
  @description
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/yaccl/model/repository.rb', line 4

def id
  @id
end

#latest_change_log_tokenObject (readonly)

Returns the value of attribute latest_change_log_token.



10
11
12
# File 'lib/yaccl/model/repository.rb', line 10

def latest_change_log_token
  @latest_change_log_token
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/yaccl/model/repository.rb', line 5

def name
  @name
end

#product_nameObject (readonly)

Returns the value of attribute product_name.



14
15
16
# File 'lib/yaccl/model/repository.rb', line 14

def product_name
  @product_name
end

#product_versionObject (readonly)

Returns the value of attribute product_version.



15
16
17
# File 'lib/yaccl/model/repository.rb', line 15

def product_version
  @product_version
end

#root_folder_idObject (readonly)

Returns the value of attribute root_folder_id.



7
8
9
# File 'lib/yaccl/model/repository.rb', line 7

def root_folder_id
  @root_folder_id
end

#root_folder_urlObject (readonly)

Returns the value of attribute root_folder_url.



18
19
20
# File 'lib/yaccl/model/repository.rb', line 18

def root_folder_url
  @root_folder_url
end

#thin_client_uriObject (readonly)

Returns the value of attribute thin_client_uri.



16
17
18
# File 'lib/yaccl/model/repository.rb', line 16

def thin_client_uri
  @thin_client_uri
end

#urlObject (readonly)

Returns the value of attribute url.



9
10
11
# File 'lib/yaccl/model/repository.rb', line 9

def url
  @url
end

#vendor_nameObject (readonly)

Returns the value of attribute vendor_name.



11
12
13
# File 'lib/yaccl/model/repository.rb', line 11

def vendor_name
  @vendor_name
end

Class Method Details

.create(raw_repository) ⇒ Object



20
21
22
# File 'lib/yaccl/model/repository.rb', line 20

def self.create(raw_repository)
  Repository.new(raw_repository)
end

Instance Method Details

#content_changes(change_log_token) ⇒ Object



103
104
105
# File 'lib/yaccl/model/repository.rb', line 103

def content_changes(change_log_token)
  Services.get_content_changes(id, change_log_token, nil, nil, nil, nil)
end

#create_type(type) ⇒ Object



83
84
85
# File 'lib/yaccl/model/repository.rb', line 83

def create_type(type)
  Type.create(id, Services.create_type(id, type.to_hash))
end

#delete_type(type_id) ⇒ Object



91
92
93
# File 'lib/yaccl/model/repository.rb', line 91

def delete_type(type_id)
  Services.delete_type(id, type_id)
end

#new_documentObject



46
47
48
# File 'lib/yaccl/model/repository.rb', line 46

def new_document
  Document.new(id)
end

#new_folderObject



42
43
44
# File 'lib/yaccl/model/repository.rb', line 42

def new_folder
  Folder.new(id)
end

#new_itemObject



58
59
60
# File 'lib/yaccl/model/repository.rb', line 58

def new_item
  Item.new(id)
end

#new_policyObject



54
55
56
# File 'lib/yaccl/model/repository.rb', line 54

def new_policy
  Policy.new(id)
end

#new_relationshipObject



50
51
52
# File 'lib/yaccl/model/repository.rb', line 50

def new_relationship
  Relationship.new(id)
end

#object(object_id) ⇒ Object



68
69
70
# File 'lib/yaccl/model/repository.rb', line 68

def object(object_id)
  ObjectFactory.create(id, Services.get_object(id, object_id, nil, false, nil, nil, false, false))
end

#query(statement) ⇒ Object

discovery



97
98
99
100
101
# File 'lib/yaccl/model/repository.rb', line 97

def query(statement)
  Services.query(id, statement, false, nil, nil, nil, nil, nil)[:results].map do |o|
    ObjectFactory.create(id, o)
  end
end

#rootObject

object



64
65
66
# File 'lib/yaccl/model/repository.rb', line 64

def root
  ObjectFactory.create(id, Services.get_object(id, root_folder_id, nil, false, nil, nil, false, false))
end

#type(type_id) ⇒ Object

type



74
75
76
# File 'lib/yaccl/model/repository.rb', line 74

def type(type_id)
  Type.create(id, Services.get_type_definition(id, type_id))
end

#typesObject



78
79
80
# File 'lib/yaccl/model/repository.rb', line 78

def types
  _types(Services.get_type_descendants(id, nil, nil, nil))
end

#update_type(type) ⇒ Object



87
88
89
# File 'lib/yaccl/model/repository.rb', line 87

def update_type(type)
  Type.create(id, Services.update_type(id, type.to_hash))
end