ShowTable of Contents
Previous |
Next
In the Contract Agency example, an Extension Attribute (new field) has been added, and made available to all users. Whilst this is very useful, the new attribute is unnecessary for Permanent Staff. Profiles allows for different layouts to be used for different profile types. In the Contract Agency example, the layout for "Profile Type=Contractor" includes the Agency attribute, however, the layout "Profile Type=default" will not show the field.
The profile types and layouts are not restricted to extended attributes. In another example of a College, the students and staff may have different profile types, allowing staff to modify most of their attributes, but making most Student attributes read-only.
In addition to controlling attribute layout, the you can use the profile type to control widget layout in Profiles. In the Contractor example, it is assumed that the contract staff do not have a normal management reporting chain and that the "Reports Chain" widget is unhelpful when displaying contractor profiles. A procedure later in this article shows how the widget layout for ProfileType=Contractor can be modified to remove the Reports To widget.
Profile Type is itself an attribute in the Profiles database, but it cannot be modified through the browser interface or the API. The Profile Type attribute is modified either through Tivoli Directory Integrator, or through the new Profiles Administration API. The Profile Type is a fundamental concept in Profiles, so it makes sense that the attribute cannot be modified on a whim by the users themselves.
Using Tivoli Directory Integrator to populate Profiles is described in
4.0 Tivoli Directory Integrator, and the Profiles Administration API is described in
9.7 Using Profiles Administration APIs.
Using Profile Type to control attribute layout
Attribute layout by Profile Type is controlled by the
profiles-config.xml file. The steps required to create the additional layouts for the Contractor example are:
- Check out the profiles-config.xml configuration file.
- Edit the file to create the new layouts.
- Check in the file.
- Restart the Profiles application.
- Test changes.
Before you begin
Ensure that you have added and tested a new profiles field. For more information, see
5.1 Adding a field (custom extension attribute) to Profiles
.
Procedure
- Check out the profiles-config.xml configuration file.
The general process of checking out and checking in config 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.
- Open the profiles-config.xml file in a text editor.
The graphic below shows the structure of the layoutConfiguration for Profiles:

This graphic shows how duplicate layouts have been created for Contractor staff:

In the Contractor example, make sure that the layout for the profileType="default" does not contain the extra line for the External Attribute ContractAgency, and that the layout profileType="Contractor" does include the extra line.
- Check in the 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 changes.
Related tasks
- The procedure above changed the main Profiles page layout. This link shows how the search page layouts can also be changed: 5.9 Customizing Profiles search
Using profile type to control widget layout
In the Contractor example, or the College Staff/Student example, there may be widgets that are not useful or appropriate. the Widget Layouts are used to Control the placement of widgets, and can be used with profile types hide/show widgets differently for the different types.
The basic steps are:
- Check out the widgets-config.xml file.
- Create and modify layouts by editing the configuration file.
- Check in the configuration file.
- Test the changes.
Procedure
The step details are:
- Check out the widgets-config.xml file.
The general process of checking out and checking in config 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.
- Create and modify widget layouts:
The graphic below shows a collapsed version of the widgets-config.xml file. It illustrates that the configuration file is used by the following:
• Profiles
• Communities
It further shows that the file is used for:
• Widget definition
• Layout

For the Contractor example, a second layout is required specifically for the Profile type of Contractor. However, for the widgets configuration file, this is called resourceSubType. Hiding the Report to Chain widget for the Contractors is simply a matter of commenting it out in the specific layout section as shown in this graphic:

- Check in the 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 changes.
Related tasks
- This section has shown some possibilities of removing or moving widgets within layouts. It is also possible to add custom widgets to Profiles layouts 5.7 Adding widgets
- You can use the profile types in Profiles to control attribute layout 5.6 Adding profile types
Parent topic:
5.0 Customizing Profiles