Configuring a Dynamic Organization Model Extension Point — Service Connector API Example (Java)

Example code is provided that illustrates configuring a dynamic organization model extension point using method calls available in the Service Connector API.

The step numbers in the comments correspond to the steps in the illustration in the Configuring a Dynamic Organization Model Extension Point topic.

public void setExtensionPoints(int aModelVersion)
                    throws DirectoryEngineFault, SecurityFault
    {
        // Step 1: get details of all model entities in given major version
        // including extension points and model templates
        GetOrgModelResponse model = getOrgModelService().getOrgModel(aModelVersion, false, false, false, true);
        // find org-unit designated as the extension point
        XmlOrgUnit orgUnit = findOrgUnit(model, "Branches");
        if (orgUnit != null)
        {
            // Step 2: set the extension point configuration
            XmlExtensionPointAssignment[] settings = new XmlExtensionPointAssignment[1];
            settings[0].setModelVersion(aModelVersion);
            settings[0].setExtPointGuid(orgUnit.getGuid());
            settings[0].setLdapAlias("easyAs");
            settings[0].setBaseDn("ou=AllEmployees");
            settings[0].setQuery("(objectclass=organizationalUnit)");
            settings[0].setSearchScope(XmlLdapSearchScope.SUBTREE);
            settings[0].setLdapAttribute("ou");
            XmlModelInstanceIdAttribute instanceIdAttr =
                  settings[0].addNewInstanceIdAttr();
            instanceIdAttr.setName("Town");
            instanceIdAttr.setLdapAttribute("location");
            instanceIdAttr = settings[0].addNewInstanceIdAttr();
            instanceIdAttr.setName("County");
            instanceIdAttr.setLdapAttribute("county");
            instanceIdAttr = settings[0].addNewInstanceIdAttr();
            instanceIdAttr.setName("PostCode");
            instanceIdAttr.setLdapAttribute("zip");
            getOrgModelService().setExtensionPoints(settings);
        }
    }