UCS 3.0 Univention Directory Manager Modules
From Univention Wiki
The Univention Directory Manager modules are still part of UCS 3.0 management system. Only the frontend to access the functionality is moved to the Univention Management Console.
For a better integration and to increase the performance a few minor changes were made to the API of UDM modules. This page will describe the required and optional changes that need to be implemented to make a UDM module compatible with UCS 3.0
Required (API changes)
- Constructor of class object
The contructor of the class has now another optional parameter called attributes that replaces the parameter arg. It may contain the attributes of an existing LDAP object. In most cases the constructor of the base class simpleLdap is called within these constructor of the module. In that case the parameter attributes must be passed on to the base class.
def __init__(self, co, lo, position, dn=, superordinate=None, attributes = ):
- function univention.admin.objects.get
As the previously mentioned contructor this function as the same new optional parameter called attributes that replaces the parameter arg.
- Optimizing the lookup function
Currently most implementations of the lookup functions use searchDn to retrieve the list of LDAP-DNs and passes these to object instances that will search for the object again to retrieve the attributes.
for dn in lo.searchDn(unicode(filter), base, scope, unique, required, timeout, sizelimit): res.append( object( co, lo, None, dn ) )
A fast way is to search for the object just once and passing the attributes directly to the newly created object instance.
for dn, attrs in lo.search(unicode(filter), base, scope, , unique, required, timeout, sizelimit): res.append( object( co, lo, None, dn, attributes = attrs ) )