As a general rule, the Profiles attributes can be set as editable or read-only. However, there are a number of fundamental fields that cannot be edited. These fields are specified in the table in product documentation Profiles Attributes
Read Only attributes
The read-only fields are enabled using this syntax:
<attribute> mobileNumber </attribute>
Attributes enabled in this way appear on a profile display forms, but do not appear on the "Edit my profile form".
Attributes that IBM has determined as read only cannot be set as editable.
The editable fields are enabled using this syntax:
<editableAttribute> mobileNumber </editableAttribute>
The editable attributes enabled in this way appear on a profile display forms, and also appear on the "Edit my profile" form for modification.
Attributes that IBM has determined as editable can also be set to as read only. Using the <attribute> syntax.
You can force an attribute to be displayed on the "Edit my profile" form as a read-only attribute using the disabled=true
<editableAttribute disabled=true"> mobileNumber </editableAttribute>
Making a field required is a little more involved than other tasks as files deep in the WebSphere folder tree need to be modified. In one of the example scenarios, Job Category is a required field. Use the required attribute only for attributes common to all profile types. Attribute validation works with all attributes in all layouts for all profile types. For example, requiring the Contract Agency field makes sense with a contractor profile, but not with a default profile because users with a default profile cannot see or edit the Contract Agency field.
IBM Connections uses the Struts framework and validator plug-in. Individual attribute validation is defined in the file validation.xml
The detailed procedure follows, but the basic steps are:
1. Modify the validation.xml
2. Add an additional label to the profiles user interface properties file.
3. Restart the Profiles application.
Before you begin
- Navigate to the validation.xml file in the source application directory. <WAS_home>\profiles\<profile_name>\installedApps\<cell_name>\profiles.ear\lc.profiles.app.war\WEB-INF\lib\.
For example on Microsoft Windows C:\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\renconCell01\Profiles.ear\lc.profiles.app.war\WEB-INF\validation.xml.
Open the validation.xml file with a text editor.
- Add the validation lines to the file.
- Find the section <form name="editProfileForm">.
- Paste these lines in the validation.xml file at the start of the section as the first field:
<field property="attribute(contactInformation.extattr.jobCategory)" depends="required">
<msg name="required" key="errors.required" />
<arg position="0" name="required" key="label.editprofile.contactinformation.jobCategory" />
- Save the validation.xml file.
- Extract the properties JAR file. For more information about the properties files, see 2.2 Customizing product strings.
- Navigate to the lc.profiles.web.app-3.0.jar file in the source application directory, <WAS_HOME>\profiles.ear\lc.profiles.app.war\WEB-INF\lib\lc.profiles.web.app-3.0.jar.
For example on Microsoft Windows C:\IBM\WebSphere\AppServer\profiles\AppSrv01\installedApps\renconCell01\Profiles.ear\lc.profiles.app.war\WEB-INF\lib\lc.profiles.web.app-3.0.jar.
- Back up the lc.profiles.web.app-3.0.jar file to another location. (Do not leave your backup copy in the same directory: It causes problems when Profiles loads classes.)
- Extract the JAR file to a temporary directory. If your compression utility does not recognize the JAR file as a compressed format, rename the extension to a .zip.
- Modify the properties file.
- Navigate to the temporary directory.
- Open the ui.properties file in com\ibm\lconn\profiles\strings directory with a text editor.
- Add this key-value string pair line near other similar lines in the ui.properties file on its own line:
- Save the ui.properties file.
- Save the changed information to the application source directory:
- Compress the files that you extracted and save with a .jar extension. If your compression utility does not recognize the JAR file as a compressed format, compress the files as lc.profiles.web.app-3.0.zip, then change the extension to .jar.
- Delete the installed lc.profiles.web.app-3.0.jar file from the source directory, <WAS_HOME>\profiles.ear\lc.profiles.app.war\WEB-INF\lib\. Do not leave a backup of the installed JAR files in this directory because doing so can cause issues with the Profiles application.
- Copy the modified lc.profiles.web.app-3.0.jar file to <WAS_HOME>\profiles.ear\lc.profiles.app.war\WEB-INF\lib\.
Important: In IBM Connections 3.0.1, you must modify the Profiles properties file in the source application directory. Do not follow the standard customization procedure for product strings. IBM Connections does not load Profiles validation label strings from the customization directory.
- Restart the Profiles application.
- Test your changes:
- Clear your browser cache.
- Navigate to the Profiles application and Edit My Profile.
- Make a change to the profile - perhaps a telephone number, but do not enter a Job Category.
- When trying to save the profile, the error message is displayed as shown below:
Parent topic: 5.0 Customizing Profiles