DirectoryObject.addProperty()
The method adds or updates the value for the specified property.
- Availability
-
IBM® Tivoli® Identity Manager 5.x
IBM Security Identity Manager 6.x
IBM Security Identity Manager 7.0.
- Synopsis
directoryObject.addProperty(name, value)
- Arguments
-
- name
- String representing the name of the property to be created or modified.
- value
- The value to add to the property.
- 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. For multivalued objects,
addProperty()
adds the values to the specified property in the directory object and does not replace them. 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 addProperty(String name, Collection value);
void addProperty(String name, Date value);
void addProperty(String name, Map value);
void addProperty(String name, boolean value);
void addProperty(String name, byte value);
void addProperty(String name, String value);
void addProperty(String name, number value);
void addProperty(String name, char value);
- Usage
-
directoryObject.addProperty("eruid", "jdoe");
The
getProperty
method returns a Java™ array of objects that is stored in a JavaScriptJavaArray
object. Unlike a standard JavaScript array,JavaArray
objects are used to access members of a Java array. Because Java arrays cannot be resized, the size of aJavaArray
object cannot be changed. Also,JavaArray
objects are typed. Setting aJavaArray
element to the wrong type throws a JavaScript error.In Identity Manager, a
JavaArray
object cannot be passed directly back into aaddProperty
method. TheJavaArray
array might be converted 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.addProperty("eraliases", jsAliases); person.set(myPerson);