Home

 

Enable custom extension attributes for Profiles


Overview

Extend the Profiles feature by adding custom extension attributes.

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

In addition to different attribute layouts, Profiles supports extension attributes for every profile type. Because all profiles share one schema, an extension attribute, such as customers, has the same semantic meaning for all profile types. However, you can choose to associate a particular attribute with a profile based on profile type. The user interface configuration, including display characteristics and whether an attribute can be edited, is also configurable for extension attributes based on profile type.

You can enable custom extension attributes by adding them to the My Profile page. The attributes that display on the My Profile page are specified in...

Although changes to profiles-config.xml should generally be made using wsadmin client scripting, there are no wsadmin commands to modify the profilesDataModel, so you can make changes to the profilesDataModel using a text editor.

There are three child elements under the profileDataModel element that correspond to the three sections in the My Profile page in Profiles:

The order in which the attributes display in the file reflects the order in which they display in the form. This correspondence means that you can easily reorder the attributes without needing to modify any JSP files.


Add a custom extension attribute to the My Profile page

  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")

      • Microsoft Windows:

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

  2. Save a copy of the profiles-config.xml file.

  3. Open the file in a text editor.

  4. To define the extension attribute, add it to the <profileExtensionAttributes> element under <profileDataModels> as follows:

      <profileDataModels>	
        <profileExtensionAttributes>
          <simpleAttribute extensionId="<property1>" length="64"/>
          <simpleAttribute extensionId="<property2>" length="64"/>
          <simpleAttribute extensionId="<property3>" length="64"/>
        </profileExtensionAttributes>
      
        <profileDataModel>
      ...
        </profileDataModel>
      ...
      </profileDataModels>
      

    For example:

      <profileDataModels>
        <profileExtensionAttributes>
         ...
          <simpleAttribute extensionId="spokenLang" length="64" />
          <simpleAttribute extensionId="TechExperience" length="64" />
          <simpleAttribute extensionId="officeAddress" length="64" />
          <simpleAttribute extensionId="homeAddress" length="64" />
      
        </profileExtensionAttributes>
      </profileDataModels>
      

  5. To display the extension attribute, you need to associate it with a profile type. To do this, add the following line of code as a child element under the relevant profileType element, and under the appropriate page section, jobInformation, contactInformation, or associatedInformation:

      <extensionAttribute showLabel="true" editable="true" extensionIdRef="<extension_attribute_name>"/>

    The following table displays the XML attributes associated with the extensionAttribute element.


    XML attributes associated with extensionAttribute

    Attribute Description
    editable Specifies if the extension attribute can be edited by users. This attribute takes a Boolean value.
    showLabel Specifies whether to display a label for the extension attribute in the user interface. The attribute takes a Boolean value.
    hideIfEmpty Specifies whether to hide the attribute if it does not have a value. This attribute takes a Boolean value.
    link This attribute takes a Boolean value.
    extensionIdRef The ID of the extension. This ID is associated with the property key in the resource file. This attribute takes a string value.

    For example, to display the officeAddress and homeAddress extension attributes in the Contact Information section of the page:

      <layoutConfiguration>
          <profileLayout profileType="student">
              <contactInformation>
                 <extensionAttribute showLabel="true" editable="true" extensionIdRef="officeAddress"/>
                 <extensionAttribute showLabel="true" editable="true" extensionIdRef="homeAddress" />
           ...
              </contactInformation>
          </profileLayout>
      </layoutConfiguration>
      

  6. To label the extension attribute, you need to add a resource string to the Profiles application. For more information, see Adding custom strings to Lotus Connections. Apply property changes


Add custom extension attributes for Profiles

 

Related tasks

Apply property changes

Add custom strings to Communities and Profiles


+

Search Tips   |   Advanced Search