Customize directory search results
Configure the profiles-config.xml file to specify the fields that you want to include in the results page that displays after users perform a directory search in Profiles. The search results page can be configured for all types of search.
Before starting
To edit configuration files, use the wsadmin client. See Starting the wsadmin client for information about how to start the wsadmin command-line tool.
About this task
The Profiles search results page is organized into three columns. You can configure the profiles-config.xml file to specify which fields you want to display in each of the three columns. For example, if you have configured your deployment so that email addresses are hidden to protect the privacy of your users, you might want to remove any email-related fields from the search results page. For more information about hiding email addresses, see Hiding email addresses.Each column can take attributes of type attribute (predefined attributes) and extensionAttribute (custom extension attributes).
Procedure
To configure the search results page to display the way that you want...
- From the dmgr host:
cd $DMGR_PROFILE/bin
./wsadmin.sh -jython
execfile("profilesAdmin.py")If prompted to specify a service to connect to, type 1 to pick the first node in the list. Most commands can run on any node. If the command writes or reads information to or from a file using a local file path, pick the node where the file is stored.
- Check out the Profiles configuration files:
ProfilesConfigService.checkOutConfig("<working_directory>", "<cell_name>")where:
- <working_directory> is the temporary working directory to which the configuration XML and XSD files are copied and are stored while you make changes to them. Use forward slashes (/) to separate directories in the file path, even if you are using the Microsoft Windows operating system.
Note: AIX and Linux only: The directory must grant write permissions or the command does not complete successfully.
- <cell_name> is the name of the WAS cell hosting the Profiles application. This argument is required. It is also case-sensitive, so type it with care. If you do not know the cell name, you can determine it by typing the following command in the wsadmin command processor: print AdminControl.getCell()
For example:
- AIX or Linux:
ProfilesConfigService.checkOutConfig("/opt/prof/temp","foo01Cell01")
- Microsoft Windows:
ProfilesConfigService.checkOutConfig("c:/prof/temp","foo01Cell01")
Open the profiles-config.xml file in a text editor. Locate the <searchResultsLayout> element and edit it as required.
- To add a predefined attribute to one of the columns, include the following code:
<attribute showLabel="false" prependHtml="" appendHtml="" hideIfEmpty="true"><attribute_name></attribute>
For a complete list of the attributes that you can add to the search results page, see Directory search result attributes. To add a custom extension attribute to one of the columns, include the following code: <extensionAttribute showLabel="true" prependHtml="<strong>" appendHtml="</strong>" hideIfEmpty="true" extensionIdRef="<extension_id>" />
For example:
<searchResultsLayout profileType="default"> <column> <attribute hideIfEmpty="true" photo="true" showLabel="false" uid="key">profilePicture</attribute> </column> <column> <attribute hcard="true" hideIfEmpty="true" showLabel="false" uid="key" userid="userid">displayName</attribute> <attribute appendHtml="" hideIfEmpty="true" prependHtml="" showLabel="false">jobResp</attribute> <attribute appendHtml="" hideIfEmpty="true" prependHtml="" showLabel="false">organizationTitle</attribute> <attribute appendHtml="" hideIfEmpty="true" prependHtml="" showLabel="false">workLocation.city</attribute> <attribute appendHtml="" hideIfEmpty="true" prependHtml="" showLabel="false">workLocation.state</attribute> <attribute appendHtml="" hideIfEmpty="true" prependHtml="" showLabel="false">countryDisplayValue</attribute> <attribute appendHtml="" hideIfEmpty="true" prependHtml="" showLabel="false">mobileNumber</attribute> </column> <column> <attribute appendHtml="</strong>" hideIfEmpty="true" prependHtml="<strong>"showLabel="true">telephoneNumber</attribute> <attribute appendHtml="</strong>" email="true" hideIfEmpty="true" prependHtml="<strong>" showLabel="true">email</attribute> <attribute appendHtml="</strong>" email="true" hideIfEmpty="true" prependHtml="<strong>" showLabel="true">groupwareEmail</attribute> <extensionAttribute showLabel="true" prependHtml="<strong>" appendHtml="<strong>" hideIfEmpty="true" extensionIdRef="spoken_Lang" /> </column> </searchResultsLayout>
After making changes, check the configuration files back in, and do so during the same wsadmin session in which you checked them out for the changes to take effect. See Apply property changes in Profiles for information about how to save and apply your changes.
Directory search result attributes
Directory search result attributes are limited to the attributes listed in the following table. An error occurs if an attempt is made to add an unsupported attribute.
Parent topic
Customize Profiles searchRelated concepts
Add custom extension attributes for Profiles
Related tasks
Hiding email addresses
Apply property changes in Profiles
});