Modifying LDAP attributes

The value of an attribute you retrieve from an LDAP directory may not precisely match what you want to enter in the TM1 security cube.

If so, you must modify certain LDAP attributes before you can run ETLDAP.

For example, you could combine all users from the R&D, Quality Assurance, and Documentation LDAP groups into a single TM1 group named Engineering. To support these requirements, you can extend a Java™ class with a single method you need to override.

The stringFilter class contains one method with the following signature:

String filterString(String attrName, String value)

At run time, this method is passed the name of each LDAP attribute that matches a mapping entry and its value. The String it returns is added to the TM1 database.

The following code demonstrates the implementation of the stringFilter class, combining all users from the R&D, Quality Assurance, and Documentation LDAP groups into a single TM1 group named Engineering.

The stringFilter class looks for instances of the LDAP ou attribute, which is the TM1 Group names field. If the value is R&D, Quality Assurance, or Documentation, it returns Engineering. The users from any of the 3 LDAP groups are added to a single TM1 Engineering group. Any other group value remains unchanged.

// The stringFilter class provides the ability to transform strings
// which are read from the LDAP database before they are inserted into 
// TM1's datastore.
//
// To implement this feature, create a class which extends stringFilter
// and contains a method 'filterString' with the following signature:
//
// String filterString(String attrName, String value)
//
//
public class myStringFilter extends stringFilter
{
    public String filterString(String attrName, String value)
    {
    if (attrName.equals("ou"))
        {
        if ( (attrName.equals("R&D")) ||
           (attrName.equals("Quality Assurance")) ||
           (attrName.equals("Documentation")) )
            return "Engineering";
        else
            return value;
        }
    else
        return value;
    }
}

After you write and compile the Java code, put the class somewhere in your Classpath. Then click Edit > Options and enter its name in the Class Name field.