Adding additional fields in Profiles of Connections 5.5 looks very difficult, but is actually very easy if you follow these steps which incidentally is written for a Windows environment. There is no link with TDI to fill these fields. The fields which we add will be completed and edited by the users themselves.

Data Collection (what do we need?)

Customization location:  \\fileserver\connections55\customization
Properties syntax:  com.company.customizations
Fields: ( example )  Birthdate:  Richtext
 Hobbies:  Normal input
Labels:  What is your birthday?
 What are your hobbies?

 

Labels

First we can enter the labels. Labels are pieces of text that are placed on or above the input fields to describe the entry. The following files are created in the strings directory.

Optional for Dutch:

com.company.customizations_nl.properties

label.company.hobbies=Wat zijn je hobbies?
label.company.birthdate=Wat is je geboortedatum?

 

com.company.customizations.properties & com.company.customizations_en.properties

label.company.hobbies=What are your hobbies?
label.company.birthdate=What’s your birthdate?

 

Connect Resource

Now we can link the label resource and give it a name. This connection takes place in the lotusconnections-config.xml. The correct procedure is to check it out via wsadmin to edit the DMgr01 server, and check it in again.

Beneath is the procedure to accomplish this:

 

  • Goto the bin folder in Dmgr01 profile and start wsadmin:
    CD \IBM\WebSphere\AppServer\profiles\Dmgr01\bin
  • Wsadmin.bat -lang jython
    (If prompted, type in your wasadmin credentials)
  • execfile(“connectionsConfig.py”)
  • LCConfigService.checkOutConfig(“c:/temp”,AdminControl.getCell())

Now we can edit the file LotusConnections-config.xml bewerken in the c:\temp folder.

Insert between <resources> and </resources> the widgetbundle line.

<resources>
<widgetBundle name=”com.company.customizations” prefix=”companycustomizations”/>
</resources>

Save the file and exit the editor.

Now deploy the file back into Connections.

  • LCConfigService.updateConfig(“versionStamp”,””)
  • LCConfigService.checkInConfig()
  • synchAllNodes()

All changes are now synced to the nodes.

Do not exit the wsadmin console.

 

Extend the DataModel

The next step is to extend the data model with the two new input fields. These are called extensionAttributes in Connections.

In wsadmin console:

  • execfile(“profilesAdmin.py”)
  • ProfilesConfigService.checkOutConfig(“c:/temp”,AdminControl.getCell())

Now we can edit the file profiles-config.xml in c:\temp. Add 2 lines after <profileExtensionAttributes>

<!– START PROFILES DATA MODELS SECTION –>
<profileDataModels>
<profileExtensionAttributes>
<richtextAttribute extensionId=”hobbies” maxBytes=”1000000″/>
<simpleAttribute extensionId=”birthdate” length=”10″ sourceKey=”birthdate”/>

 

In the same file you have to add templateNlsBundle for the connections between fields and labels.

<templateConfiguration>
<!– Space-delimited set of identifiers for the custom resource bundles to make available to FTL templates –>

<templateNlsBundles>companycustomizations</templateNlsBundles>

 

Save the file and exit the editor.

Do not exit the wsadmin console.

 

Profile Type

In Connections you have the ability to define multiple user profiles. Think of externals that do not need to see and edit all profile information.
So you can specify which fields per profile herein are active.
Now we can edit the file profiles-types.xml in c: \ temp and add the following lines to the desired profile types. The example below does not include different types. Both fields have the ability to be edited by the user: ReadWrite.

<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>
<property>
<ref>hobbies</ref>
<updatability>readwrite</updatability>
<hidden>false</hidden>
</property>

<property>
<ref>birthdate</ref>
<updatability>readwrite</updatability>
<hidden>false</hidden>
</property>

Save the file and exit the editor.

Do not exit the wsadmin console.

 

Profiles View and Edit mode.

Last 2 steps are very important. Now we have to decide where the fields and labels are placed while Profile is in view or in edit mode.

profileDetails.ftl

This file is used to render the page while Profiles is in View mode.

Edit the file in c:\temp. We can now add birthdate to Profiles. I decided to add it at the bottom of the contactinformation tab.

<@util.renderSection sectionLabel=”contactInformation”>

<@util.renderProperty ref=”birthdate” nlsBundle=”companycustomizations” nlsKey=”label.company.birthdate” hideIfEmpty=true ; ref, dataId, dataKey, nlsKey, nlsBundle>

<tr>
<th scope=”row”>
<br /><@util.renderNls nlsKey=nlsKey nlsBundle=nlsBundle/>
</th>
<td>
<p class=”bidiAware”>
<@util.renderValue ref=ref/>
</p>
</td>
</tr>
</tbody>
</table>
</div>

</@util.renderSection>

 

In that same file you can add the following lines for the field hobbies. In this case….at the top.

<@util.renderSection sectionLabel=”associatedInformation”>

<@util.renderProperty ref=”hobbies” nlsBundle=”companycustomizations” nlsKey=”label.company.hobbies” hideIfEmpty=true ; ref, dataId, dataKey, nlsKey, nlsBundle>

<tr>
<th scope=”row”>
<br /><@util.renderNls nlsKey=nlsKey nlsBundle=nlsBundle/>
</th>
<td>
<p class=”bidiAware”>
<@util.renderValue ref=ref/>
</p>
</td>
</tr>

</@util.renderProperty>

 

Save the file and exit the editor.

Do not exit the wsadmin console.

 

profileEdit.ftl

This file is used to render the page while Profiles is in Editmode.

Edit the file in c:\temp. We can now add birthdate to Profiles. I decided to add it at the bottom of the contactinformation tab. (same location as in View mode)

<@util.renderSection sectionLabel=”contactInformation”>
<@util.renderFormControl ref=”birthdate” singleColumnLayout=true nlsBundle=”companycustomizations” nlsKey=”label.company.birthdate”/><@util.renderBidiEnforce />                                     
</@util.renderSection>  

In that same file you can add the following lines for the field hobbies. In this case….at the top.

<@util.renderSection sectionLabel=”associatedInformation”>
<@util.renderFormControl ref=”hobbies” singleColumnLayout=true nlsBundle=”companycustomizations” nlsKey=”label.company.hobbies”/>

Save the file and exit the editor.

Do not exit the wsadmin console.

All Profile changes are set in the configuration files. Now it’s time to deploy them back into Connections.

  • ProfilesConfigService.checkInConfig(“c:/temp”,AdminControl.getCell())
  • execfile(“connectionsConfig.py”)
  • LCConfigService.checkOutConfig(“c:/temp”,AdminControl.getCell())
  • LCConfigService.updateConfig(“versionStamp”,””)
  • LCConfigService.checkInConfig()
  • synchAllNodes()

Please restart ALL application JVM’s in order to deploy the changes.

After restart, please enjoy your customizations.

Visits: 547

By angioni

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.