| | 42 | |
| | 43 | === Ldap !#1 === |
| | 44 | __Relationship betwen ldap Type <=> Ebox::Type__ |
| | 45 | |
| | 46 | * Templates to create ''attributetype'' of some concrete SYNTAX. |
| | 47 | * Definition |
| | 48 | {{{ |
| | 49 | AttributeTypeDescription = "(" 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 | {{{ |
| | 86 | attributetype ( __OID__ NAME '__NAME__' |
| | 87 | ___OPTIONS___ |
| | 88 | ) |
| | 89 | |
| | 90 | OPTIONS depends on which type we want to represent: |
| | 91 | |
| | 92 | Boolean |
| | 93 | EQUALITY booleanMatch |
| | 94 | SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 |
| | 95 | |
| | 96 | String (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 | |
| | 102 | Integer |
| | 103 | EQUALITY integerMatch |
| | 104 | ORDERING integerOrderingMatch |
| | 105 | SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 |
| | 106 | |
| | 107 | |
| | 108 | Float |
| | 109 | There is no standard for saving them, so save them as String |
| | 110 | |
| | 111 | Datetime |
| | 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 | |
| | 126 | Every ''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 | |
| | 128 | e.g.: |
| | 129 | {{{ |
| | 130 | package EBox::Type::Boolean; |
| | 131 | |
| | 132 | sub description() { |
| | 133 | my $self = shift; |
| | 134 | return { |
| | 135 | $self->fieldName() => EBox::Ldap::Types::Boolean |
| | 136 | }; |
| | 137 | } |
| | 138 | }}} |
| | 139 | {{{ |
| | 140 | package EBox::Type::Port; |
| | 141 | |
| | 142 | sub 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 | ---- |