Home

 

Customizing 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 search in Profiles. The search results page can be configured for all types of search.

To edit configuration files, use the IBM WebSphere Application Server wsadmin client. See Start wsadmin for information about how to start the wsadmin command-line tool.


The 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 e-mail addresses are hidden to protect the privacy of your users, you might want to remove any e-mail-related fields from the search results page. For more information about hiding e-mail addresses, see Hiding e-mail addresses.

Each column can take attributes of type attribute (predefined attributes) and extensionAttribute (custom extension attributes).

To configure the search results page to display the way that you want...

  1. Use wsadmin to access and check out the Profiles configuration files.

    1. Access the Profiles configuration files:

    2. 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.

      • cell_name is the name of the WebSphere Application Server cell hosting the Profiles feature. This argument is required even in stand-alone deployments. This argument is case-sensitive, so type it with care. If you do not know the cell name, do one of the following to determine it:

        • Stand-alone deployment: See:

          WAS_HOME\profiles\profile_name\config\cells\

        • Network deployment: From wsadmin...

          print AdminControl.getCell()

      For example:

      • AIX/Linux:

          ProfilesConfigService.checkOutConfig("/opt/prof/temp","foo01Cell01")
          

    3. Microsoft Windows:

        ProfilesConfigService.checkOutConfig("c:/prof/temp","foo01Cell01")
        

  2. Open the profiles-config.xml file in a text editor.

  3. 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 Advanced search result attributes.

  4. To add a custom extension attribute to one of the columns, include the following code:

      <extensionAttribute showLabel="true" prependHtml="&lt;/strong&gt;" appendHtml="&lt;/strong&gt;" 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="&lt;/strong&gt;" hideIfEmpty="true" prependHtml="&lt;strong&gt;"showLabel="true">telephoneNumber</attribute> 
            <attribute appendHtml="&lt;/strong&gt;" email="true" hideIfEmpty="true" prependHtml="&lt;strong&gt;" showLabel="true">email</attribute> 
            <attribute appendHtml="&lt;/strong&gt;" email="true" hideIfEmpty="true" prependHtml="&lt;strong&gt;" showLabel="true">groupwareEmail</attribute> 
            <extensionAttribute showLabel="true" prependHtml="&lt;/strong&gt;" appendHtml="&lt;strong&gt;" hideIfEmpty="true" extensionIdRef="spoken_Lang" /> 
         </column>
      </searchResultsLayout>
      

    Apply property changes


Customizing Profiles search

Add custom extension attributes for Profiles

 

Related tasks

Hiding e-mail addresses

Apply property changes


+

Search Tips   |   Advanced Search