DirectoryObject.setProperty()

The method sets the value of the specified property.

Availability
IBM Security Identity Manager 7.0.

Synopsis
directoryObject.setProperty(name, value)

Arguments

name
String representing the name of the property to be created or modified.

value
The value to set the property to.

Description
This method changes the value of the specified property, or adds the specified property if it does not exist. This change is made locally to the script environment, not to the data store. The value can be a single value object or an array of objects. The value type (syntax) of object must be compatible with the syntax of the specified property. This method is available for the following data types:
  • void setProperty(String name, Collection value);
  • void setProperty(String name, Date value);
  • void setProperty(String name, Map value);
  • void setProperty(String name, boolean value);
  • void setProperty(String name, byte value);
  • void setProperty(String name, String value);
  • void setProperty(String name, number value);
  • void setProperty(String name, char value);

Usage
directoryObject.setProperty("eruid", "jdoe");

The getProperty method returns a Java™ array of objects that is stored in a JavaScript JavaArray object. Unlike a standard JavaScript array, JavaArray objects are used to access members of a Java array. Since Java arrays cannot be resized, the size of a JavaArray object cannot be changed. Also, JavaArray objects are typed. Setting a JavaArray element to the wrong type throws a JavaScript error. In IBM Security Identity Manager, a JavaArray object cannot be passed directly back into a setProperty method. The JavaArray array into a standard JavaScript array as follows:

    jsAliases = new Array(); myPerson = person.get(); aliases = myPerson.getProperty("eraliases"); for (i=0; i < aliases.length; i++) { jsAliases[i] = aliases[i]; }jsAliases[aliases.length] = "myNewAlias"; myPerson.setProperty("eraliases", jsAliases); person.set(myPerson);

Parent topic: DirectoryObject