<ugm:getUserNamesForGroup> Tag

The <ugm:getUsernamesForGroup> tag retrieves a String array that contains the usernames matching the provided search expression and correspond to members of the provided group. The search expression supports only the asterisk (*) wildcard character, and is case insensitive. As many asterisks as desired may be used in the search expression. This tag has no enclosed body.

Note: All User Management tags send results to the same file. If you are checking for results, include this import statement at the top of the page: <%@ page import="com.bea.p13n.usermgmt.taglib.UserManagementTagConstants" %>

Syntax

<tagName attribute="value" />

Attributes

atnProvider

Optional (String) - The name of the authentication provider to use. The default setting is the WebLogic Server DefaultAuthenticator. The authentication provider must provide write access. See Using Multiple Authentication Providers in Portal Development for more information.

searchExp

Optional (String) - The search expression to apply to the user name search. Defaults to " *". Example: "t*".

groupName

Required (String) - The name of the group whose matching members are sought. Example: "engineering".

userLimit

Optional (String, representing an int) - The maximum number of users to be returned from the search. (String which has a particular Integer.valueOf.) Defaults to 100. If user count exceeds userLimit, the length of the array in id is truncated to the length of userLimit. Example: "500".

id

Required (String) - A variable name to which the resultant user names are assigned. Example: "myUsers".

result

Optional (String) - The name of an Integer variable to which the result of the get usernames for group operation is assigned.

Possible values:


Note: The USER_SEARCH_FAILED value is returned only when a general error occurs while searching for the user, such as a database connection failure. If no user matches the search criteria, the result will not be equal to UserManagementTagConstants.USER_SEARCH_FAILED, but the length returned by the array in id will be zero.

Example

This example shows shows how to use <ugm:getUsernamesForGroup> to retrieve and display usernames that match the provided search expression and correspond to members of the provided group.

<ugm:getUsernamesForGroup groupName="engineering" userLimit="500" searchExp="t*" id="myUsers"/>
<%System.out.println("I found " + myUsers.length + " users in my group.");%>

Related Topics

<ugm:getUserNames> Tag