[Kolab-devel] Webadmin: object type attributes definition

Aleksander Machniak machniak at kolabsys.com
Fri Sep 28 15:10:03 CEST 2012


I'm working on types management and see that attributes definition could
be clearer. I propose some simplifications.

1. I think all these three arrays (auto_form_fields, form_fields,
fields) should be merged into one 'attributes' hash.

'attributes' => array(
  'auto_form_fields' => array (
     'cn' => array (
        'data' => array (
            0 => 'givenname',
            1 => 'sn',
          ),
        ),

would be changed to

'attributes' => array(
  'cn' => array(
    'auto' => true,
  ),

One issue to resolve will be the way to define which of auto-fields can
be editable. Before, it was done by adding attribute to form_fields and
auto_form_fields. Now, it could be just 'readonly' attribute.

2. As you see above I removed also 'data' definition. The list of
attributes used for auto-generation of attribute values is hardcoded in
API code. It means we cannot change this. So, the 'data' array for each
auto-generated attribute should be added when type definition is
requested not when saved into database.

This could be
'auto' => true,
for fields like user password or
'auto' => (
  0 => 'givenname',
  1 => 'sn',
),
for fields that require some input data

3. The same for 'fields'

'attributes' => array(
  'fields' => array (
     'mailquota' => '131072',
     'objectclass' => array (
          0 => 'top',
          1 => 'inetorgperson',
          2 => 'kolabinetorgperson'
        ),
      ),

would become

'attributes' => array(
  'mailquota' => array(
    'static' => '131072'
  ),
  'objectclass' => array(
    'static' => array(
        0 => 'top',
        1 => 'inetorgperson',
        2 => 'kolabinetorgperson'
    ),
  ),

4. In mean time I got a request to add a possibility to mark some of
auto-fields as hidden, so they would become hidden in the form. This can
be useful in signup form. I propose to just add 'hidden' flag.

5. There's 'maxcount' value limiting list elements size. It's used only
with 'alias' attribute. Should it be still user-configurable or this
should be also moved to the API?

-- 
Aleksander Machniak
Web Developer, Kolab Systems AG
-------------------------------------------------------
PGP:19359DC1 - http://www.kolabsys.com - http://alec.pl




More information about the devel mailing list