5.1 Adding an attribute field to Profiles 
|
|
Previous | Next
Adding an attribute to profiles is often required by organizations deploying IBM Connections. In this example scenario, many of the staff in the organization are contract staff, and the attribute of Contract Agency is to be added to the Profiles pages. A second example is to add a Job Category attribute to profiles.
The basic steps that are required to add an attribute to Profiles are:
- Check out the Profiles configuration file.
- Define the new attribute.
- Place the field on a layout.
- Check in the Profiles configuration file.
- Restart the Profiles application.
- Test the new attribute.
Procedure
- Check out the Profiles configuration file.
The general process for checking out and checking in the configuration files is described in 1.4 Publishing customizations with the wsadmin tool.
Adapt the following example commands for your system:
cd e:\IBM\WebSphere\AppServer\profiles\Dmgr01\bin
wsadmin -lang jython -user wasmgr -password d3moL0tus
execfile("profilesAdmin.py")
ProfilesConfigService.checkOutConfig("f:/temp", AdminControl.getCell() )
Remember to leave the wsadmin session open to check in the file in a later step.
- Define the new attribute.
- Open profiles-config.xml in a text editor.
The file found in the location where it was checked out to.
- Find the section <profileExtensionAttributes>.
- Add a new line just before the closing </profileExtensionAttributes>
<simpleAttribute extensionId="contractAgency" length="80" />

- Place the field on a layout.
The ordering and visibility of attributes on Profiles screens are controlled by the layout definitions in the same profiles-config.xml file. To place the field on a layout, perform these steps:
- Find the section <profileLayout profileType=”default”>.
- Add a new line in the ContactInformation section to place the extension attribute:
<extensionAttribute showLabel="false" editable="true" extensionIdRef="contractAgency" />
Add the line immediately after the displayName attribute.

- Check in the Profiles configuration file.
In the same wsadmin session, check in the profiles configuration file using the following command:
ProfilesConfigService.checkInConfig()
- Restart the Profiles application.
This is necessary for Profiles to pick up the new configuration.
The Profiles application can be stopped and started from the WebSphere Application Server Integrated Solution Console.
- Test the new attribute.
- Log into IBM Connections and navigate to My Profile.
- Edit My profile, and this should show partial success: a new field with an error on the Label name.
Entering test data here is helpful.

Notice that when the new attribute is displayed, the showLabel=false property is honored, but a label is needed for edit mode.
Next Steps
Although you created a field in the procedure, the field label does not appear correctly. Refer to 5.2 Specifying labels for attributes
Parent topic: 5.0 Customizing Profiles
|
|
|
|
| Version 1 |
November 21, 2011 |
12:34:49 PM |
by Amanda J Bauman  |
|
|