Extension properties in the data model
We can define a set of custom extension properties to further customize Profiles.Each extension property is defined using a unique identifier. Declare extension properties in the profileExtensionAttributes section of profiles-config.xml.
The following extension properties types are supported:
Simple properties String value in the range of 0-256 bytes Rich text properties Rich text value in the range of 0-1,000,000 bytes XML properties XML blob. If the attribute is marked for full text search, element and attribute values may be defined for inclusion in the search index
The application will resolve all simple and rich text extension fields for the Profile. XML extension fields are not currently made available to the template author.
Examples of declaring an extension attribute for each type.
Property declaration Description <profileExtensionAttributes> <simpleAttribute extensionId=”college” length=”256”/> </profilesExtensionAttributes>Custom string property with the college identifier whose maximum length is 256 bytes. <profileExtensionAttributes> <richtextAttribute extensionId=”publications” maxBytes=”1000000”/> </profilesExtensionAttributes>Rich text property with the publications identifier whose maximum length is 1,000,000 bytes. <profileExtensionAttributes> <xmlFileAttribute extensionId=”catalog” schemaFile=”catalog.xsd” indexBindingExpr=”/catalog/entry/@name” <indexFields> <indexField fieldName=”catalogName” fieldExpr=”/catalog/entry/@name”/> /xmlFileAttribute> </profilesExtensionAttributes>Custom XML property with the catalog identifier. Instances of this property must validate against the supplied XSD file catalog.xsd. The administrator must place the catalog.xsd file in directory... Connections-config/profiles-extensions
In this example, a specific section is requested to be included in the Profiles search index with the field name catalogName. The value of the field, is resolved by the supplied XPath expression.
These examples are assumed to be in the namespace...
http://www.ibm.com/profiles-config
We can also add a new extension field. In the following example a new extension field, preferredFrenchName, is defined to be used as an additional given name or surname during directory search from within the Profiles application. The additional searchable name would be the value of the preferredFrenchName field.
- Stop the server.
- Modify profiles-config.xml and the tdi-profiles-config.xml to add the new extension field:
<simpleAttribute extensionId="preferredFrenchName" length="64" sourceKey="LDAP-attribute-name"/>
- Modify profiles_types.xml.to add preferredFirstName and the extension field to the default profile-type...
<property> <ref>preferredFirstName</ref> <updatability>readwrite</updatability> <hidden>false</hidden> <mapToNameTable>givenName</mapToNameTable> </property> <property> <ref>preferredFrenchName</ref> <updatability>readwrite</updatability> <hidden>false</hidden> <mapToNameTable>surname</mapToNameTable> </property>For TDI, make this update to profiles_types.xml.in the TDI solution directory.
- Modify...
LotusConnections-config/profiles/templates/resources/nls/template_en.properties
...to add a new field label for preferredFrenchName as follows...
label.preferredFrenchName=Preferred French name
- Add the two new fields to the profileEdit.ftl :
<@util.renderFormControl ref="preferredFirstName" singleColumnLayout=false nlsKey="label.preferredFirstName"/> <@util.renderFormControl ref="preferredFrenchName" singleColumnLayout=false nlsKey="label.preferredFrenchName"/>
- Restart the server.
- To test, edit a user profile and set values for the person’s preferredFirstName and preferredFrenchName.
In Profiles, click the Directory tab and perform a search on the person’s preferredFirstName and preferredFrenchName name.
See
Parent topic:
Customize the Profiles data model
Related:
Customize Profiles
Map fields
Create a simple profile data model and template customization
Specify properties to expose in the search index
Profile-types