Changes between Version 5 and Version 6 of Document/Development/Design/LdapBackend

Show
Ignore:
Timestamp:
10/14/08 12:18:59 (5 years ago)
Author:
jgarcia@… (IP: 88.26.177.14)
Comment:

information for both ldap #1 and ldap #2

Legend:

Unmodified
Added
Removed
Modified
  • Document/Development/Design/LdapBackend

    v5 v6  
    3737 * ''More stuff to come...'' 
    3838 
     39---- 
     40 
    3941== Work in progress == 
     42 
     43=== Ldap !#1 === 
     44__Relationship betwen ldap Type <=> Ebox::Type__ 
     45 
     46 * Templates to create ''attributetype'' of some concrete SYNTAX.  
     47   * Definition 
     48{{{ 
     49AttributeTypeDescription = "(" whsp 
     50   numericoid whsp     ; AttributeType identifier 
     51 [ "NAME" qdescrs ]             ; name used in AttributeType 
     52 [ "DESC" qdstring ]            ; description 
     53 [ "OBSOLETE" whsp ] 
     54 [ "SUP" woid ]                 ; derived from this other 
     55                                ; AttributeType 
     56 [ "EQUALITY" woid              ; Matching Rule name 
     57 [ "ORDERING" woid              ; Matching Rule name 
     58 [ "SUBSTR" woid ]              ; Matching Rule name 
     59 [ "SYNTAX" whsp noidlen whsp ] ; Syntax OID 
     60 [ "SINGLE-VALUE" whsp ]        ; default multi-valued 
     61 [ "COLLECTIVE" whsp ]          ; default not collective 
     62 [ "NO-USER-MODIFICATION" whsp ]; default user modifiable 
     63 [ "USAGE" whsp AttributeUsage ]; default userApplications 
     64 whsp ")" 
     65}}} 
     66     * Matching rules  
     67       * Needed for: 
     68         * EQUALITY neccesary for = 
     69         * ORDERING neccesary for <, > 
     70         * SUBSTR neccesary for * (different of ~= operator) 
     71       * Get all of them 
     72         * ldapsearch -H ldap://localhost -x -s base -b "cn=subschema" "(objectclass=*)" matchingrules 
     73         * http://tools.ietf.org/html/rfc2252#section-4.5 
     74     * Syntaxes 
     75       * Get all of them 
     76         * ldapsearch -H ldap://localhost -x -s base -b "cn=subschema" "(objectclass=*)" ldapsyntaxes 
     77         * http://tools.ietf.org/html/rfc2252#section-6 
     78   * Types supported 
     79     * Boolean 
     80     * String 
     81     * Integer 
     82     * Float 
     83     * Datetime 
     84   * Templates 
     85{{{ 
     86attributetype ( __OID__ NAME '__NAME__' 
     87 ___OPTIONS___ 
     88) 
     89 
     90OPTIONS depends on which type we want to represent: 
     91 
     92Boolean 
     93  EQUALITY booleanMatch 
     94  SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 
     95 
     96String (DirectoryString) UTF-8 encoding of ISO-10646 (Unicode) 
     97  EQUALITY caseIgnoreMatch 
     98  SUBSTR caseIgnoreSubstringsMatch 
     99  ORDERING caseIgnoreOrderingMatch 
     100  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{__MAX__} 
     101 
     102Integer 
     103  EQUALITY integerMatch 
     104  ORDERING integerOrderingMatch 
     105  SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 
     106 
     107 
     108Float 
     109  There is no standard for saving them, so save them as String 
     110 
     111Datetime 
     112    EQUALITY generalizedTimeMatch 
     113    ORDERING generalizedTimeOrderingMatch 
     114    SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 
     115}}} 
     116 * Every Ebox's Types has a method (see Ldap #2 ) description() with a hash with tuples name => type 
     117 * A function "somewhere" gets a EBox::Type (and a Module and Model name) and generates the attributetype schema definitions 
     118   * For types that have more than one field (e.g. PortRange) the function generates more than one attributetype 
     119   * Special cases will be: 
     120     * Composite: do nothing 
     121     * HasMany: No need for declare an attributetype, a hasmany field in a model, means a eboxModel as a may-attribute 
     122 
     123=== Ldap !#2 === 
     124__''New Types? Automatic or manual generation''__ 
     125 
     126Every ''EBox::Type'' has to implement a ''description()'' method. With this information (how the type need to be stored), we'll be able to generate schemas for every possible type created 
     127 
     128e.g.: 
     129{{{ 
     130package EBox::Type::Boolean; 
     131 
     132sub description() { 
     133    my $self = shift; 
     134    return {  
     135        $self->fieldName() => EBox::Ldap::Types::Boolean  
     136    }; 
     137} 
     138}}} 
     139{{{ 
     140package EBox::Type::Port; 
     141 
     142sub description() { 
     143    my $self = shift; 
     144    return { 
     145        'initial' => EBox::Ldap::Types::Integer, 
     146        'end'     => EBox::Ldap::Types::Integer, 
     147        'type'    => EBox::Ldap::Types::String 
     148    }; 
     149} 
     150}}} 
     151 
     152=== Ldap !#3 === 
     153 
     154=== Ldap !#4 === 
     155 
     156=== Ldap !#5 === 
     157 
     158=== Ldap !#6 === 
     159 
     160=== Ldap !#7 === 
     161 
     162 
     163---- 
    40164 
    41165== Guides and stuff ==