Class: ActiveCMIS::Folder

Inherits:
Object
  • Object
show all
Defined in:
lib/active_cmis/folder.rb

Instance Attribute Summary

Attributes inherited from Object

#key, #repository, #updated_attributes

Instance Method Summary collapse

Methods inherited from Object

#acl, #allowable_actions, #attribute, attributes, #attributes, #destroy, #file, from_atom_entry, from_parameters, #id, #initialize, #inspect, key, #method_missing, #name, #parent_folders, #reload, #save, #source_relations, #target_relations, #unfile, #update

Methods included from Internal::Caching

included

Constructor Details

This class inherits a constructor from ActiveCMIS::Object

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveCMIS::Object

Instance Method Details

#allowed_object_typesObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/active_cmis/folder.rb', line 12

def allowed_object_types
  if attributes["cmis:allowedChildObjectTypeIds"].empty?
    repository.types.select { |type| type.fileable }
  else
    # TODO: it is repository specific if subtypes of the allowed types MAY be filed (line 976)
    #
    # There is as far as I can see no other mention of this possibility in the spec, no way to
    # check if this is so for any specific repository. In addition there is in a few places a
    # requirement that an error is thrown if the cmis:objectTypeId is not in the list of allowed
    # values. So for now this is not supported at all.
    attributes["cmis:allowedChildObjectTypeIds"].map { |type_id| repository.type_by_id(type_id) }
  end
end

#itemsCollection<Document,Folder,Policy>

Returns a collection of all items contained in this folder (1 level deep)



5
6
7
8
9
# File 'lib/active_cmis/folder.rb', line 5

def items
  item_feed = Internal::Utils.extract_links(data, 'down', 'application/atom+xml','type' => 'feed')
  raise "No child feed link for folder" if item_feed.empty?
  Collection.new(repository, item_feed.first)
end