IBM Connections – HowTo create a custom profile type for external users

IBM Connections – HowTo create a custom profile type for external users

Hi all,

when you deploy IBM Connections your customer might have requirements of a custom Profile view (different / additional attributes, design changes, different profile types …).

But as soon as you enable IBM Connections for external users, you might run into trouble. Because profile views for internal users might not match for externals (e.g. the internal user has a custom editable attribute: GlobalUserID … the external user does not use this attribute). Also the fact that external users can only see the business card of internal users (not the full profile) makes a customization (with separation into internal / external user) of the business card useful.

I thought about this topic and found a solution by providing different profile types for internal and external users. This is how I configured the environment:

I will not go into detail how to use extension attributes… This is a lot of good documentation for this

Profile Changes:

1. Define an additional profile type in the file profile-types.xml (cell/cellName/LotusConnections-config/profile-types.xml)

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright IBM Corp. 2011, 2014  All Rights Reserved.              -->
<config xmlns="http://www.ibm.com/profiles-types" xmlns:pt="http://www.ibm.com/profiles-types"
        xmlns:tns="http://www.ibm.com/profiles-config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        id="profiles-types" xsi:schemaLocation="http://www.ibm.com/profiles-types profiles-types.xsd">
        <type>
                <parentId>snx:person</parentId>
                <id>default</id>
                <property>
                        <ref>jobResp</ref>
                        <updatability>readwrite</updatability>
                        <hidden>false</hidden>
                </property>
                <property>
                        <ref>bldgId</ref>
                        <updatability>read</updatability>
                        <hidden>false</hidden>
                </property>
                <property>
                        <ref>ext_gis_globaluserid</ref>
                        <updatability>read</updatability>
                        <hidden>false</hidden>
                </property>
                  ...
        </type>
        <type>
                <parentId>snx:person</parentId>
                <id>external</id>
                <property>
                        <ref>jobResp</ref>
                        <updatability>readwrite</updatability>
                        <hidden>false</hidden>
                </property>
                <property>
                        <ref>ext_user_projectreference</ref>
                        <updatability>read</updatability>
                        <hidden>false</hidden>
                </property>

                  ...
        </type>
</config>

2. Define the attributes that should be editable in the file profileEdit.ftl (cell/cellName/LotusConnections-config/profiles/templates/profileEdit.ftl)

<#-- ***************************************************************** -->
<#-- -->
<#-- Licensed Materials - Property of IBM -->
<#-- -->
<#-- 5724-S68 -->
<#-- -->
<#-- Copyright IBM Corp. 2011, 2014All Rights Reserved. -->
<#-- -->
<#-- US Government Users Restricted Rights - Use, duplication or -->
<#-- disclosure restricted by GSA ADP Schedule Contract with -->
<#-- IBM Corp. -->
<#-- -->
<#-- ***************************************************************** -->
<#-- ***************************************************************** -->
<#-- Template: profileEdit.ftl -->
<#-- -->
<#-- This template is used to render a profile edit form. -->
<#-- -->
<#-- Each form area is identified by the following section labels: -->
<#-- "contactInformation"= the contact information tab -->
<#-- "associatedInformation"= the about me information tab -->
<#-- Validation rules foran attribute are defined in -->
<#-- WEB-INF/validation.xml. For validation rules to be picked up the -->
<#-- sectionLabel specified here must correspond to a subEditForm -->
<#-- value in validation.xml -->
<#-- ***************************************************************** -->

<#import"commonUtil.ftl"as util>
<#compress>
<@util.renderSection sectionLabel="contactInformation">
    <#-- <@util.renderFormControl ref="displayName"isDisabled=truesingleColumnLayout=falsenlsKey="label.displayName"isBidiTextDir=true/>
    ...
    <#-- <@util.renderFormControl ref="groupwareEmail"singleColumnLayout=falsenlsKey="label.groupwareEmail"/> -->
    <#-- <@util.renderFormControl ref="blogUrl"singleColumnLayout=falsenlsKey="label.blogUrl"/> -->
    <#if !(profile["profileType"])?contains("external")>
        <@util.renderFormControl ref="ext_gis_globaluserid"singleColumnLayout=falsenlsBundle="labels"nlsKey="ext_gis_globaluserid"/>
    </#if>
        <#if (profile["profileType"])?contains("external")>         
        <@util.renderFormControl ref="ext_user_projectreference"singleColumnLayout=false nlsBundle="labels" nlsKey="ext_user_projectreference"/>
   </#if>
<@util.renderBidiEnforce />

check if the current profileType is NOT “external” and only then display the field for editing

<#if !(profile["profileType"])?contains("external")>
        <@util.renderFormControl ref="ext_gis_empnumber" singleColumnLayout=false nlsBundle="labels" nlsKey="ext_gis_empnumber"/>
</#if>


check if the current profileType is “external” and only then display the field for editing.
….

<#if (profile["profileType"])?contains("external")>
        <@util.renderFormControl ref="ext_user_projectreference" singleColumnLayout=false nlsBundle="labels" nlsKey="ext_user_projectreference"/>
</#if>

3. Define the attributes that displayed in the file profileDetails.ftl (cell/cellName/LotusConnections-config/profiles/templates/profileDetails.ftl)

<#-- ***************************************************************** -->
<#-- ***************************************************************** -->
<#-- Template: profileDetails.ftl                                      -->
<#--                                                                   -->
<#-- This template is used to render fields on the profile page.       -->
<#--                                                                   -->
<#-- Each view is identified by one of the following section labels:   -->
<#--    "jobInformation" = main profile page data section              -->
<#--    "contactInformation" = Contact Information widget data         -->
<#--    "associatedInformation" = Background widget data               -->
<#--                                                                   -->
<#-- If a customer wants to support an additional template based       -->
<#-- widget, see InfoCenter for more information on required steps.    -->
<#--                                                                   -->
<#-- ***************************************************************** -->
<#import "commonUtil.ftl" as util>
<#compress>
<@util.renderSection sectionLabel="jobInformation">
<@util.renderProperty ref="jobResp" nlsKey="label.jobResp" hideIfEmpty=true ;  ref, dataId, dataKey, nlsKey, nlsBundle>
<strong class="bidiAware">
<@util.renderValue ref=ref/>
</strong><br/>
</@util.renderProperty>
<@util.renderProperty ref="orgId" dataId="organization" dataKey="organizationTitle" nlsKey="label.organizationTitle" hideIfEmpty=true ;  ref, dataId, dataKey, nlsKey, nlsBundle>
<@util.renderValue ref=ref dataId=dataId dataKey=dataKey/>
<br/>
</@util.renderProperty>
<@util.renderProperty ref="email" nlsKey="label.email" hideIfEmpty=true ;  ref, dataId, dataKey, nlsKey, nlsBundle>
<@util.renderValue ref=ref renderAs="email"/>
<br/>
</@util.renderProperty>

<#if  !(profile["profileType"])?contains("external")>
<@util.renderProperty ref="ext_gis_globaluserid" nlsBundle="labels" nlsKey="ext_gis_globaluserid" hideIfEmpty=true ; ref, dataId, dataKey, nlsKey, nlsBundle>
<tr>
<th scope="row">
<@util.renderNls nlsKey=nlsKey nlsBundle=nlsBundle/>
</th>
<td>
<@util.renderValue ref=ref/>
</td>
</tr>
</@util.renderProperty>
</#if>

<#if (profile["profileType"])?contains("external")>
<@util.renderProperty ref="ext_user_projectreference" nlsBundle="labels" nlsKey="ext_user_projectreference" hideIfEmpty=true ; ref, dataId, dataKey, nlsKey, nlsBundle>
<tr>
<th scope="row">
<@util.renderNls nlsKey=nlsKey nlsBundle=nlsBundle/>
</th>
<td>
<@util.renderValue ref=ref/>
</td>
</tr>
</@util.renderProperty>
</#if>

...
</@util.renderSection>
...

The same as above… check that the profileType is NOT external and then display the attribute – otherwise do not display the attribute.

4. Now you can also make changes to the businessCardInfo.ftl … the same rules apply as above

5. You have to make some changes to your external tdisol in order to make this work…

6. Change the tdisol_ext/map_dbrepos_from_source.properties file

#profileType corresponds to the layout sections in profiles-config.xml
profileType={func_gis_profileType}
#$secretary_uid represents lookup of UID of secretary using DN in secretary field
secretaryUid=$secretary_uid
shift=null
surname=sn
surnames=sn

7. Add the above function to the file tdisol_ext/profile_functions.js

//Setting the profileType external for all external users
function func_gis_profileType(fieldname) {
        return "external";
}

This function always returns the string external. This value is written into the PROF_TYPE column of the EMPINST.EMPLOYEE table

8. Open the file …/tdisol_ext/conf/LotusConnections-config/tdi-profiles-config.xml and add your extension attributes as well as your sourceKey

9. Open the file …/tdisol_ext/conf/LotusConnections-config/profiles-types.xml and add the definition for external users… (You do not need to specify the default profile here, as it is not used for external users)

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright IBM Corp. 2011, 2014  All Rights Reserved.              -->
<config xmlns="http://www.ibm.com/profiles-types" xmlns:pt="http://www.ibm.com/profiles-types"
        xmlns:tns="http://www.ibm.com/profiles-config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        id="profiles-types" xsi:schemaLocation="http://www.ibm.com/profiles-types profiles-types.xsd">
        <type>
                <parentId>snx:person</parentId>
                <id>external</id>
                <property>
                        <ref>jobResp</ref>
                        <updatability>readwrite</updatability>
                        <hidden>false</hidden>
                </property>
                <property>
                        <ref>ext_user_projectreference</ref>
                        <updatability>read</updatability>
                        <hidden>false</hidden>
                </property>
                  …
        </type>
</config>

11. Execute “sync_all_dns.sh”

12. The result is then:

INTERNAL USER (can edit the Global UserId but cannot edit project reference):

extProfile1

EXTERNAL USER (can edit project reference but not Global UserId):

extProfile3

One thought on “IBM Connections – HowTo create a custom profile type for external users

Leave a Reply

Your email address will not be published. Required fields are marked *