Oracle Waveset 8.1.1 Deployment Reference

Testing if an Object or User Exists

You might want to check whether an object exists before performing an action. For example, you could look to see if a user name exists in Waveset before creating a new user, or validate whether a manager name entered in a field is valid.

To test if an object exists, use the testObject method. To specify an object type when using this method, use the object types listed in the section titled Retrieving a List of Accessible Object Types. In the following example, the user type is identified as <s>User</s>. The second string gives the value of the object type (in this example, jdoe).

Example:

<invoke name=’testObject’ class=’com.waveset.ui.FormUtil’>
   <ref>:display.session</ref>
   <s>User:</s>
   <s>jdoe</s>
</invoke>

The testObject method returns true on successful find of an object. Otherwise, this method returns null.

To test if a user exists, use the testUser method. The <s> element identifies the name of the user object to find. Example:

<invoke name=’testUser’ class=’com.waveset.ui.FormUtil’>
   <ref>:display.session</ref>
   <s>jdoe</s>
</invoke>

This method returns true on successful find. Otherwise, this method returns null.