Class: CmisServer::Repository
- Inherits:
-
Object
- Object
- CmisServer::Repository
- Defined in:
- lib/cmis_server/repository.rb
Defined Under Namespace
Classes: Capabilities
Instance Attribute Summary collapse
-
#capabilities ⇒ Object
Returns the value of attribute capabilities.
-
#cmis_version_supported ⇒ Object
Returns the value of attribute cmis_version_supported.
-
#description ⇒ Object
(also: #repository_description)
Returns the value of attribute description.
-
#id ⇒ Object
(also: #repository_id)
Returns the value of attribute id.
-
#latest_change_log_token ⇒ Object
Returns the value of attribute latest_change_log_token.
-
#name ⇒ Object
(also: #repository_name)
Returns the value of attribute name.
-
#product_name ⇒ Object
Returns the value of attribute product_name.
-
#product_version ⇒ Object
Returns the value of attribute product_version.
-
#root_folder_id ⇒ Object
Returns the value of attribute root_folder_id.
-
#vendor_name ⇒ Object
Returns the value of attribute vendor_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#acl_capabilities ⇒ Object
ACL Capabilities.
-
#extensions ⇒ Object
Extensions du repository (CMIS 1.1).
-
#get_object(object_id) ⇒ Object
Méthode pour récupérer un objet CMIS par son ID.
- #infos ⇒ Object
-
#initialize(attrs = {}) ⇒ Repository
constructor
A new instance of Repository.
-
#repository_specific_information ⇒ Object
Repository specific information.
-
#types ⇒ Object
Types disponibles dans le repository.
Constructor Details
#initialize(attrs = {}) ⇒ Repository
Returns a new instance of Repository.
111 112 113 114 115 |
# File 'lib/cmis_server/repository.rb', line 111 def initialize(attrs={}) attrs.to_h.each do |property, value| self.send(property.to_s+"=", value) end end |
Instance Attribute Details
#capabilities ⇒ Object
Returns the value of attribute capabilities.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def capabilities @capabilities end |
#cmis_version_supported ⇒ Object
Returns the value of attribute cmis_version_supported.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def cmis_version_supported @cmis_version_supported end |
#description ⇒ Object Also known as: repository_description
Returns the value of attribute description.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def description @description end |
#id ⇒ Object Also known as: repository_id
Returns the value of attribute id.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def id @id end |
#latest_change_log_token ⇒ Object
Returns the value of attribute latest_change_log_token.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def latest_change_log_token @latest_change_log_token end |
#name ⇒ Object Also known as: repository_name
Returns the value of attribute name.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def name @name end |
#product_name ⇒ Object
Returns the value of attribute product_name.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def product_name @product_name end |
#product_version ⇒ Object
Returns the value of attribute product_version.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def product_version @product_version end |
#root_folder_id ⇒ Object
Returns the value of attribute root_folder_id.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def root_folder_id @root_folder_id end |
#vendor_name ⇒ Object
Returns the value of attribute vendor_name.
75 76 77 |
# File 'lib/cmis_server/repository.rb', line 75 def vendor_name @vendor_name end |
Class Method Details
.find(id) ⇒ Object
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/cmis_server/repository.rb', line 118 def self.find(id) #Todo this is a mockup repo=self.new(id: id, name: "My Repo", description: "This is my repo !", vendor_name: "AGSI", product_name: "Plugandwork", product_version: "CmisServer Gem v#{CmisServer::VERSION}", root_folder_id: 'root_folder', latest_change_log_token: 0, cmis_version_supported: CmisServer::CMIS_VERSION_SUPPORTED, capabilities: Capabilities.new( # Activer les capacités CMIS 1.1 par défaut create_type: true, bulk_update: true, append_content_stream: true, update_type: true, delete_type: true, bulk_delete_properties: true, bulk_move: true, extended_query: true, extended_acl: false ) ) repo end |
Instance Method Details
#acl_capabilities ⇒ Object
ACL Capabilities
171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/cmis_server/repository.rb', line 171 def acl_capabilities { supported_permissions: ["cmis:read", "cmis:write", "cmis:all"], propagation: "repositorydetermined", permissions: [ { permission: "cmis:read", description: "Read permission" }, { permission: "cmis:write", description: "Write permission" }, { permission: "cmis:all", description: "All permissions" } ] } end |
#extensions ⇒ Object
Extensions du repository (CMIS 1.1)
82 83 84 85 86 87 88 |
# File 'lib/cmis_server/repository.rb', line 82 def extensions { extended_features: ["bulk_operations", "secondary_types", "type_management"], vendor_extensions: {}, namespace: "http://docs.oasis-open.org/ns/cmis/core/200908/" } end |
#get_object(object_id) ⇒ Object
Méthode pour récupérer un objet CMIS par son ID
150 151 152 153 154 |
# File 'lib/cmis_server/repository.rb', line 150 def get_object(object_id) # À implémenter selon votre système de stockage # Cette méthode devrait retourner l'objet CMIS correspondant à l'ID ou nil nil end |
#infos ⇒ Object
145 146 147 |
# File 'lib/cmis_server/repository.rb', line 145 def infos [:repository_id, :repository_name, :repository_description, :vendor_name, :product_name, :product_version, :root_folder_id, :cmis_version_supported].map { |p| [p.to_s.camelize(:lower), self.send(p)] }.to_h end |
#repository_specific_information ⇒ Object
Repository specific information
193 194 195 196 197 198 199 |
# File 'lib/cmis_server/repository.rb', line 193 def repository_specific_information { implementation: "CmisServer Ruby Gem", version: CmisServer::VERSION, core_integration: true } end |
#types ⇒ Object
Types disponibles dans le repository
166 167 168 |
# File 'lib/cmis_server/repository.rb', line 166 def types CmisServer::TypeRegistry.types || {} end |