Extension properties in the data model
You can define a set of custom extension properties to further customize Profiles for your deployment’s unique needs.
Extension properties
Each extension property is defined using a unique identifier.
Declare extension properties in the profileExtensionAttributes
section
of the profiles-config.xml
file.
- Simple properties – a string value in the range of 0-256 bytes
- Rich text properties – a rich text value in the range of 0-1,000,000 bytes
- XML properties – an XML blob; if the attribute is marked for full text search then a series of 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.
Samples – Property declaration | Description |
---|---|
|
Defines a custom string property with the college identifier whose maximum length is 256 bytes. |
|
Defines a rich text property with the publications identifier whose maximum length is 1,000,000 bytes. |
|
Defines a 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 the Connections-config/profiles-extensions directory. 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. |
You can also add a new extension field. In the following example a new extension field (preferredFrenchName) is defined that can 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 the profiles-config.xml file and the tdi-profiles-config.xml to
add the new extension field as follows:
<simpleAttribute extensionId="preferredFrenchName" length="64" sourceKey="LDAP-attribute-name"/>
- Modify the profiles-types.xml file to add preferredFirstName and
the extension field to the default profile-type as in the following
example:Note: If you are using TDI, you must make this update to the profiles-types.xml file in your TDI solution directory.
<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>
- 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 as
follows:
<@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.