Class: YACCL::Model::Object
- Inherits:
-
Object
- Object
- YACCL::Model::Object
- Defined in:
- lib/yaccl/model/object.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#base_type_id ⇒ Object
readonly
Returns the value of attribute base_type_id.
-
#change_token ⇒ Object
readonly
Returns the value of attribute change_token.
-
#created_by ⇒ Object
readonly
Returns the value of attribute created_by.
-
#creation_date ⇒ Object
readonly
Returns the value of attribute creation_date.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#last_modification_date ⇒ Object
readonly
Returns the value of attribute last_modification_date.
-
#last_modified_by ⇒ Object
readonly
Returns the value of attribute last_modified_by.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object_id ⇒ Object
readonly
Returns the value of attribute object_id.
-
#object_type_id ⇒ Object
Returns the value of attribute object_type_id.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#repository_id ⇒ Object
readonly
Returns the value of attribute repository_id.
-
#secondary_object_type_ids ⇒ Object
readonly
Returns the value of attribute secondary_object_type_ids.
Instance Method Summary collapse
- #acls ⇒ Object
- #add_aces(aces) ⇒ Object
- #allowable_actions ⇒ Object
- #delete ⇒ Object
-
#initialize(repository_id, raw = {}) ⇒ Object
constructor
A new instance of Object.
- #object_type ⇒ Object
- #parents ⇒ Object
- #policies ⇒ Object
- #relationships(direction = :either) ⇒ Object
- #remove_aces(aces) ⇒ Object
- #repository ⇒ Object
-
#unfile ⇒ Object
remove from all folders.
- #update_properties(properties) ⇒ Object
Constructor Details
#initialize(repository_id, raw = {}) ⇒ Object
Returns a new instance of Object.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/yaccl/model/object.rb', line 18 def initialize(repository_id, raw={}) @repository_id = repository_id @properties = get_properties_map(raw) @properties[:'cmis:creationDate'] = Time.at(@properties[:'cmis:creationDate'] / 1000) unless @properties[:'cmis:creationDate'].nil? @properties[:'cmis:lastModificationDate'] = Time.at(@properties[:'cmis:lastModificationDate'] / 1000) unless @properties[:'cmis:lastModificationDate'].nil? @object_id = @properties[:'cmis:objectId'] @base_type_id = @properties[:'cmis:baseTypeId'] @object_type_id = @properties[:'cmis:objectTypeId'] @secondary_object_type_ids = @properties[:'cmis:secondaryObjectTypeId'] @name = @properties[:'cmis:name'] @description = @properties[:'cmis:description'] @created_by = @properties[:'cmis:createdBy'] @creation_date = @properties[:'cmis:creationDate'] @last_modified_by = @properties[:'cmis:lastModifiedBy'] @last_modification_date = @properties[:'cmis:lastModificationDate'] @change_token = @properties[:'cmis:changeToken'] end |
Instance Attribute Details
#base_type_id ⇒ Object (readonly)
Returns the value of attribute base_type_id.
6 7 8 |
# File 'lib/yaccl/model/object.rb', line 6 def base_type_id @base_type_id end |
#change_token ⇒ Object (readonly)
Returns the value of attribute change_token.
15 16 17 |
# File 'lib/yaccl/model/object.rb', line 15 def change_token @change_token end |
#created_by ⇒ Object (readonly)
Returns the value of attribute created_by.
11 12 13 |
# File 'lib/yaccl/model/object.rb', line 11 def created_by @created_by end |
#creation_date ⇒ Object (readonly)
Returns the value of attribute creation_date.
12 13 14 |
# File 'lib/yaccl/model/object.rb', line 12 def creation_date @creation_date end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
10 11 12 |
# File 'lib/yaccl/model/object.rb', line 10 def description @description end |
#last_modification_date ⇒ Object (readonly)
Returns the value of attribute last_modification_date.
14 15 16 |
# File 'lib/yaccl/model/object.rb', line 14 def last_modification_date @last_modification_date end |
#last_modified_by ⇒ Object (readonly)
Returns the value of attribute last_modified_by.
13 14 15 |
# File 'lib/yaccl/model/object.rb', line 13 def last_modified_by @last_modified_by end |
#name ⇒ Object
Returns the value of attribute name.
9 10 11 |
# File 'lib/yaccl/model/object.rb', line 9 def name @name end |
#object_id ⇒ Object (readonly)
Returns the value of attribute object_id.
5 6 7 |
# File 'lib/yaccl/model/object.rb', line 5 def object_id @object_id end |
#object_type_id ⇒ Object
Returns the value of attribute object_type_id.
7 8 9 |
# File 'lib/yaccl/model/object.rb', line 7 def object_type_id @object_type_id end |
#properties ⇒ Object
Returns the value of attribute properties.
16 17 18 |
# File 'lib/yaccl/model/object.rb', line 16 def properties @properties end |
#repository_id ⇒ Object (readonly)
Returns the value of attribute repository_id.
4 5 6 |
# File 'lib/yaccl/model/object.rb', line 4 def repository_id @repository_id end |
#secondary_object_type_ids ⇒ Object (readonly)
Returns the value of attribute secondary_object_type_ids.
8 9 10 |
# File 'lib/yaccl/model/object.rb', line 8 def secondary_object_type_ids @secondary_object_type_ids end |
Instance Method Details
#acls ⇒ Object
80 81 82 |
# File 'lib/yaccl/model/object.rb', line 80 def acls Services.get_acl(repository_id, object_id, nil) end |
#add_aces(aces) ⇒ Object
84 85 86 |
# File 'lib/yaccl/model/object.rb', line 84 def add_aces(aces) Services.apply_acl(repository_id, object_id, aces, nil, nil) end |
#allowable_actions ⇒ Object
60 61 62 |
# File 'lib/yaccl/model/object.rb', line 60 def allowable_actions Services.get_allowable_actions(repository_id, object_id) end |
#delete ⇒ Object
46 47 48 |
# File 'lib/yaccl/model/object.rb', line 46 def delete Services.delete_object(repository_id, object_id, true) end |
#object_type ⇒ Object
42 43 44 |
# File 'lib/yaccl/model/object.rb', line 42 def object_type repository.type(object_type_id) end |
#parents ⇒ Object
54 55 56 57 58 |
# File 'lib/yaccl/model/object.rb', line 54 def parents Services.get_object_parents(repository_id, object_id, nil, nil, nil, nil, nil).map do |o| ObjectFactory.create(repository_id, o[:object]) end end |
#policies ⇒ Object
69 70 71 72 73 |
# File 'lib/yaccl/model/object.rb', line 69 def policies Services.get_applied_policies(repository_id, object_id, nil).map do |policy| Policy.create(repository_id, policy) end end |
#relationships(direction = :either) ⇒ Object
64 65 66 67 |
# File 'lib/yaccl/model/object.rb', line 64 def relationships(direction=:either) result = Services.get_object_relationships(repository_id, object_id, nil, direction, nil, nil, false, nil, nil) result[:objects].map { |r| Relationship.create(repository_id, r) } end |
#remove_aces(aces) ⇒ Object
88 89 90 |
# File 'lib/yaccl/model/object.rb', line 88 def remove_aces(aces) Services.apply_acl(repository_id, object_id, nil, aces, nil) end |
#repository ⇒ Object
38 39 40 |
# File 'lib/yaccl/model/object.rb', line 38 def repository Server.repository(repository_id) end |
#unfile ⇒ Object
remove from all folders
76 77 78 |
# File 'lib/yaccl/model/object.rb', line 76 def unfile Services.remove_object_from_folder(repository_id, object_id, nil) end |
#update_properties(properties) ⇒ Object
50 51 52 |
# File 'lib/yaccl/model/object.rb', line 50 def update_properties(properties) Services.update_properties(repository_id, object_id, nil, properties) end |