Class: CmisServer::Folder
- Defined in:
- lib/cmis_server/base_objects/folder.rb
Instance Attribute Summary
Attributes inherited from BaseType
#base_id, #controllable_acl, #controllable_policy, #creatable, #description, #display_name, #fileable, #fulltext_indexed, #id, #included_in_supertype_query, #local_name, #local_namespace, #parent_type, #properties, #property_definitions, #query_name, #queryable
Class Method Summary collapse
Instance Method Summary collapse
-
#is_root? ⇒ Boolean
Return False Is overwrited only for root_folder singleton instance.
- #parent ⇒ Object
- #path ⇒ Object
- #path_slug ⇒ Object
-
#to_plugandwork_object ⇒ Object
def find_slug_in_children(slug) self.class.find(slug)||CmisServer::DocumentAdapter::ClassAdapter.new(context: {current_user: }).find(slug) end.
Methods inherited from BaseType
#==, #adapter, adapter_class, #adapter_class, base_type, #copy_properties_values_of, #initialize, #initialize_properties, parent_id, parent_property_definitions, property, property_definitions, #to_renderable_object, type_definition
Constructor Details
This class inherits a constructor from CmisServer::BaseType
Class Method Details
.base_id ⇒ Object
14 15 16 |
# File 'lib/cmis_server/base_objects/folder.rb', line 14 def base_id id end |
.root_folder ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/cmis_server/base_objects/folder.rb', line 4 def self.root_folder unless @root @root=CmisServer::Folder.new(**CmisServer.configuration.arguments_for_root_folder) @root.define_singleton_method :is_root?, lambda { true } end @root end |
Instance Method Details
#is_root? ⇒ Boolean
Return False Is overwrited only for root_folder singleton instance
48 49 50 |
# File 'lib/cmis_server/base_objects/folder.rb', line 48 def is_root? false end |
#parent ⇒ Object
42 43 44 |
# File 'lib/cmis_server/base_objects/folder.rb', line 42 def parent self.class.find(cmis_parent_id) end |
#path ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/cmis_server/base_objects/folder.rb', line 57 def path if cmis_parent_id && !cmis_parent_id=self.class.root_folder.cmis_object_id "#{parent.path}/#{path_slug}" else '/'+path_slug end end |
#path_slug ⇒ Object
52 53 54 |
# File 'lib/cmis_server/base_objects/folder.rb', line 52 def path_slug self.is_root? ? '' : self.cmis_object_id end |
#to_plugandwork_object ⇒ Object
def find_slug_in_children(slug)
self.class.find(slug)||CmisServer::DocumentAdapter::ClassAdapter.new(context: {current_user: }).find(slug)
end
97 98 99 |
# File 'lib/cmis_server/base_objects/folder.rb', line 97 def to_plugandwork_object Tagset.find_by(id:self.cmis_object_id)||Category.find_by(id: self.cmis_object_id) end |