Class: PuavoRest::ExternalFile

Inherits:
LdapModel show all
Defined in:
resources/external_files.rb

Constant Summary

Constant Summary

Constants inherited from LdapModel

LdapModel::ESCAPES, LdapModel::ESCAPE_RE, LdapModel::KRB_LOCK, LdapModel::PROF

Instance Attribute Summary

Attributes inherited from LdapModel

#ldap_attr_store, #serialize_attrs

Class Method Summary (collapse)

Methods inherited from LdapModel

#[], #[]=, _class_store, #add, #add_validation_error, after, #as_json, #assert_validation, base_filter, before, by_attr, by_attr!, by_dn, by_dn!, by_dn_array, by_id, by_id!, by_ldap_attr, by_ldap_attr!, callable_from_instance, #changed?, class_store, clear_setup, computed_attr, connection, #create!, create_connection, create_filter_lambda, #dirty?, dn_bind, #empty?, escape, filter, from_ldap_hash, #get_own, #get_raw, inherited, #initialize, is_dn, is_not_found?, ldap_attrs, ldap_map, #ldap_merge!, ldap_op, #ldap_set, #link, #merge, #new?, #object_model, organisation, organisation?, pretty_attrs_to_ldap, raw_by_dn, raw_filter, sasl_bind, #save!, search, search_filters, #set, settings, settings=, setup, skip_serialize, #to_hash, #to_json, #to_ldap_hash, #transform, #update!, #validate, #validate!, #validate_unique, #write_raw

Constructor Details

This class inherits a constructor from LdapModel

Class Method Details

+ (Object) all



12
13
14
# File 'resources/external_files.rb', line 12

def self.all
  filter("(&(objectClass=top)(objectClass=puavoFile))")
end

+ (Object) data_only(name)

return file contents for file name



26
27
28
# File 'resources/external_files.rb', line 26

def self.data_only(name)
  raw_filter(ldap_base, file_filter(name), ["puavoData"]).first["puavoData"]
end

+ (Object) file_filter(name)



16
17
18
# File 'resources/external_files.rb', line 16

def self.file_filter(name)
  "(&(cn=#{ escape name })(objectClass=top)(objectClass=puavoFile))"
end

+ (Object) ldap_base



8
9
10
# File 'resources/external_files.rb', line 8

def self.ldap_base
  "ou=Files,ou=Desktops,#{ organisation["base"] }"
end

+ (Object) metadata(name)

return file metadata for file name



21
22
23
# File 'resources/external_files.rb', line 21

def self.(name)
  filter(file_filter(name)).first
end