ConfigService service

This page describes the ConfigService custom service.

Get service

oimClient.getService(ConfigServiceIntf.class);

Manage categories

Print category

Example print out category definition used in other examples.

CategoryDefinition cd = ...;
for (String categoryName : categories.keySet()) {
  System.out.println(categoryName);
  CategoryDefinition cd = categories.get(categoryName);
  // The null category definition happens for organizations :-(
  if(cd != null)
    System.out.println("  attributes: "
                       + cd.getAttributes() + "\n");
}

List

List user categories.

ConfigServiceIntf service = getConfigService();
Map<String, CategoryDefinition> categories = service.getCategories(Constants.Entity.USER.name());
... print categories

prints

Basic User Information
  attributes: [First Name, Middle Name, Last Name, Xellerate Type, Email, usr_manager_key, act_key, Role, Full Name, Display Name]

Account Settings
  attributes: [User Login, usr_password, Status, usr_locked, usr_key]

Account Effective Dates
  attributes: [Start Date, End Date]

Provisioning Dates
  attributes: [usr_provisioning_date, usr_deprovisioning_date]

Lifecycle
  attributes: [Manually Locked, Locked On, Automatically Delete On]

System
  attributes: [usr_provisioned_date, usr_deprovisioned_date, usr_login_attempts_ctr, usr_create, usr_update, usr_pwd_cant_change, usr_pwd_must_change, usr_pwd_never_expires, usr_pwd_expire_date, usr_pwd_warn_date, usr_pwd_expired, usr_pwd_warned, usr_pwd_reset_attempts_ctr, usr_change_pwd_at_next_logon, usr_pwd_min_age_date, usr_createby, usr_updateby, usr_created, usr_policy_update, Password Generated, usr_data_level]

Other User Attributes
  attributes: [Country, Department Number, Description, Common Name, Employee Number, Fax, Generation Qualifier, Hire Date, Home Phone, Locality Name, Mobile, Pager, Home Postal Address, Postal Address, Postal Code, PO Box, State, Street, Telephone Number, Title, Initials, LDAP Organization, LDAP Organization Unit, LDAP GUID, LDAP DN]

CustomAttributes
  attributes: [NsuniqueID]

Preferences
  attributes: [usr_locale, usr_timezone, Number Format, Currency, Date Format, Time Format, Accessibility Mode, Color Contrast, Font Size, Embedded Help, FA Language, FA Territory]

List organization categories:

ConfigServiceIntf service = getConfigService();
Map<String, CategoryDefinition> categories = service.getCategories(Constants.Entity.ORGANIZATION.name());
... print categories

prints

Basic Organization Information
  attributes: [Organization Name, Organization Customer Type, Parent Organization Name, Organization Status]

Custom Attributes

Add

Define a new category for USER entity type named "MyCategoryName".

CategoryDefinition categoryDefinition = new CategoryDefinition("MyCategoryName");
configService.addCategory(Constants.Entity.USER.name(), categoryDefinition);

Get

Get user-defined category for USER entity type named "MyCategoryName".

CategoryDefinition categoryDefinition = configService.getCategory(Constants.Entity.USER.name(), "MyCategoryName");

Delete

Delete a category for USER entity type named "MyCategoryName".

configService.deleteCategory(Constants.Entity.USER.name(), "MyCategoryName");

Update

Update a category for USER entity type named "MyCategoryName".

CategoryDefinition categoryDefinition = new CategoryDefinition("MyCategoryName");
// ...change category attribute set here
configService.updateCategory(Constants.Entity.USER.name(), categoryDefinition);

Move the attribute "Country" from the "Other User Attributes" category to the "Preferences" category.

String USER = Constants.Entity.USER.name();
CategoryDefinition sourceCategory = service.getCategory(USER, "Other User Attributes");
String attributeName = "Country";
sourceCategory.getAttributes().remove(attributeName);
service.updateCategory(USER, sourceCategory);
 
CategoryDefinition destCategory = service.getCategory(USER, "Preferences");
destCategory.addAttribute(attributeName);
service.updateCategory(USER, destCategory);

Manage user-defined attributes

Note: due to a bug in OIM 11.1.1.3 you can only create/delete custom attributes for users. If you try to create attributes for other entities, the corresponding database column is always created/in the USR table regardless of the entity specified, This bug was fixed in OIM 11.1.1.5.

List

List all attributes for USER entity.

Map<String, AttributeDefinition> attributeDefinitions = configService.getAttributes(Constants.Entity.USER.name());
System.out.println(attributeDefinitions);

Add

Add an attribute for USER entity type named "MyAttribute". See User-defined attribute validation for restrictions on attribute values.

AttributeDefinition attributeDefinition = new AttributeDefinition("MyAttribute");
// Required attributes
attributeDefinition.setCategory("MyCategoryName");
attributeDefinition.setBackendName("usr_udf_my_attribute");
attributeDefinition.setDisplayType("DATE_ONLY");
attributeDefinition.setBackendType("date");
attributeDefinition.setEncryption(Constants.Encryption.CLEAR);
 
// Optional
attributeDefinition.setSearchable(true);
attributeDefinition.setUserSearchable(true);
attributeDefinition.setBulkUpdatable(true);
attributeDefinition.setVisible(true);
attributeDefinition.setMultilingual(false);
attributeDefinition.setDescription(null);
attributeDefinition.setMaxSize(1);
attributeDefinition.setType("date");
attributeDefinition.setMultiValued(false);
attributeDefinition.setReadOnly(false);
attributeDefinition.setBackendRequired(false);
attributeDefinition.setSystemControlled(false);
attributeDefinition.setCustomAttribute(true);
attributeDefinition.setLookupQuery(null);
attributeDefinition.setLookupQueryDisplayColumn(null);
attributeDefinition.setLookupQuerySaveColumn(null);
 
configService.addAttribute(Constants.Entity.USER.name(), attributeDefinition);

Update

Change an attribute for USER entity type named "MyAttribute".

AttributeDefinition attributeDefinition = new AttributeDefinition("MyAttribute");
// ...change some attribute values here
configService.updateAttribute(Constants.Entity.USER.name(), attributeDefinition);

Delete

Delete an attribute for USER entity type named "MyAttribute".

configService.deleteAttribute(Constants.Entity.USER.name(), "MyAttribute");

Find

Get the attribute definition for USER entity type named "MyAttribute".

AttributeDefinition attributeDefinition = configService.getAttribute(Constants.Entity.USER.name(), "MyAttribute");
System.out.println(attributeDefinition);

Convert a system attribute to a custom one

OIM provides a bunch of built-in (or system) attributes for user and organization records. Sometime you need to change some properties of these attributes to suit to the needs of your project. For example, the maximum length of the "Telephone Number" attribute is only 20 characters, and this restriction does not allow you to store several phone numbers in this field. The problem is OIM does not allow you to change system attributes.

To solve the problem you have to convert this system attribute to a custom attribute first. The tricky part is that, unlike system attributes, OIM keeps definitions for custom attributes in the SDC table. So first, you have to insert a record into the SDC table. For example, to change the maximum field length for the "Telephone Number" to 123 characters, execute the following:

insert into sdc
 (sdc_key, sdk_key, sdc_name, sdc_variant_type, sdc_sql_length,sdc_create,sdc_createby,sdc_rowver,sdc_update,sdc_updateby)
values
 (sdc_seq.nextval, 3, 'USR_TELEPHONE_NUMBER', 'String', 123, sysdate, 1, HEXTORAW('000000000000'),sysdate,1);

And then update the attribute definition in OIM, convert it to custom and adjust the maximum size:

AttributeDefinition attributeDefinition = configService.getAttribute(Constants.Entity.USER.name(), "Telephone Number");
attributeDefinition.setMaxSize(123);
attributeDefinition.setCustomAttribute(true);
configService.updateAttribute(USER, attributeDefinition);

Now, once the attribute is custom, you can use OIM Advanced Administration WEB console to change all its attributes.

Screenshots

On the screenshot below is the OIM "New Organization" tab after a new UDF category "FTS" along with 3 UDFs have been added to the OIM Organization:

create-organization-form.png
udf
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License