Express (Distributed operating systems), v8.0 > Secure applications and their environment > Authenticate users > Select a registry or repository > Manage realms in a federated repository > Virtual member manager > Troubleshoot and Support > Support issues and limitations > Virtual member manager schema issues and limitations


Boolean or Integer property not updated with default value

Follow the steps listed here as workaround when an extended property of boolean or integer data type is not updated when set to the default value.


Problem

If you try to set the value of an extended property of single-valued boolean or integer data type to its default value, the property does not get updated. For example, if you try to set the value of a single-valued integer data type to any value other than 0, which is the default value, the update is performed successfully. However, if you try to set it to its default value 0, the property value does not get updated. Similarly, if you try to set the value of an extended property of boolean data type to true, the update is performed successfully. However if you try to set the property to its default value of false, the value does not get updated.

This happens only when the extended property is defined as single-valued. This is an EMF limitation.


Work around

Complete the following steps to work around this problem.

Before using the sample code snippets in the application, ensure that we have read the information and completed the steps described in the topic, Program prerequisites.

  1. Use the createSchema() method in the application code to create a new extended property of boolean or integer data type with multi-valued set to true.

    For details, see Sample code for extending schema in the file repository, Sample code for extending the schema in the property extension repository, and Sample code for extending the schema in an LDAP repository.

    We can also use the addIdMgrPropertyToEntityTypes wsadmin command to create a new extended property of boolean or integer data type with multi-valued set to true.

    We can also change the definition of an existing extended property from single-valued to multi-valued, by directly editing the wimxmlextension.xml file, though this is not recommended.

  2. Use the create() or update() methods to specify the value of the new property as its default value, that is, false for boolean or 0 for integer. The property value should get updated successfully.

    The following sample code is an example of how to use the create() method to set the default value 0 for a multi-valued property of integer data type:

    DataObject root = SDOHelper.createRootDataObject();
    DataObject entity = SDOHelper.createEntityDataObject(root, null, SchemaConstants.DO_PERSON_ACCOUNT);
    // Set the properties of the person
    entity.set("uid", uid);
    entity.set("cn", cn);
    entity.set("sn", sn);
    // Create a new array list of size one List lst = new ArrayList();
    lst.add(0);
    entity.set("jersyNumber", lst );
    System.out.println("Input datagraph before creating user"+ printDO(root));
    // Create the PersonAccount entity
    root = service.create(root);
    // Print the output datagraph
    System.out.println("Output datagraph after creating user"+ printDO(root));
    return root;
    

Parent topic: Virtual member manager schema issues and limitations



+

Search Tips   |   Advanced Search