Customizing IBM Connections Profiles – Add custom field to searchResults

Adding a custom field to IBM Connections Profiles is great documented in “SHOW301: Make Your IBM® Connections Deployment Your Own: Customize It!” the Connect 2014 session of Wannes Rams and Klaus Bild. Thanks to them for this great collection of customizing tipps.

In my case the bundle name is “stoeps” and the custom field i want to add is “twitterId”.

lotusconnections-config.xml

<resources>
    <!-- Custom strings for field labels --> 
    <widgetBundle name="local.stoeps.profiles.strings.uiLabels" prefix="stoeps"/>
</resources>

local.stoeps.profiles.strings.uilabels.properties

# extension property field labels
label.stoeps.twitterId=Twitter Id:

profiles-types.xml

<property>
   <!-- Custom field for Twitter ID -->
   <ref>twitterId</ref>
   <updatability>readwrite</updatability>
   <hidden>false</hidden>
</property>  

profiles-config.xml

Checkout profiles-config.xml and change following points:

Uncomment the extensions templateData:

<template name="businessCardInfo">
  <templateDataModel>
        <!--  include if you render workLocation, organization, department information -->
        <templateData>codes</templateData>
        <!--  include if any only if you render profile extension fields in the template -->
        <templateData>extensions</templateData><!-- activated for twitterId in searchResult -->
        <!--  include if you render secretary name or email in the template -->
        <!--   <templateData>secretary</templateData> -->
        <!--  include if you render manager name or email in the template -->
        <!--  <templateData>manager</templateData> -->  
        <!--  include if you render information dependent upon two users being connected -->
        <!--  <templateData>connection</templateData> -->               
  </templateDataModel>
</template>
<template name="searchResults">
  <templateDataModel>
        <!--  include if you render workLocation, organization, department information -->
        <templateData>codes</templateData>
        <!--  include if any only if you render profile extension fields in the template -->
        <templateData>extensions</templateData><!-- activated for twitterId in searchResult -->
        <!--  include if you render secretary name or email in the template -->
        <!--   <templateData>secretary</templateData> -->
        <!--  include if you render manager name or email in the template -->
        <!--  <templateData>manager</templateData> -->                  
  </templateDataModel>            
</template>

Now you must add following line to :

profilesEdit.ftl

I added following line within <@util.renderSection sectionLabel=”contactInformation”>:

<@util.renderFormControl ref="twitterId" singleColumnLayout=false nlsBundle="stoeps" nlsKey="label.stoeps.twitterId"/>

profilesDetails.ftl

<#-- Customize start -->
<#-- Adding a field twitter id -->
<@util.renderProperty ref="twitterId" nlsKey="label.stoeps.twitterId" nlsBundle="stoeps" hideIfEmpty=true ;  ref, dataId, dataKey, nlsKey, nlsBundle>
    <@util.renderValue ref=ref renderAs="twitter" />            
        <br/>
</@util.renderProperty>     

<#– Customize end –>

searchResults.ftl

I added following code above the renderProperty of jobResp:

<@util.renderProperty ref="twitterId" nlsKey="label.stoeps.twitterId" nlsBundle="stoeps" hideIfEmpty=true ;  ref, dataId, dataKey, nlsKey, nlsBundle>        
    <div>
         <@util.renderValue ref=ref renderAs="twitter"/>
    </strong>   
    </div>
</@util.renderProperty> 

renderAs comes from commonUtil.ftl, to format a URL to the Twitter Homepage.

commonUtil.ftl

...
<#elseif renderAs = "email">
    <a href="mailto:${value}">${value}</a>
<#-- customize start -->
<#elseif renderAs = "twitter">
    <#-- special rendering for twitter id -->
    <a href="http://twitter.com/${value}" target="_new">@${value}</a>       
<#-- customize end -->
<#elseif renderAs = "blogUrl">
...

Result:

search result

Selection_20140415_11:28:28_001

Profile

Selection_20140415_11:37:41_001

Log Login Errors of IBM Connections with IBM HTTP Server

You can log login errors within IBM Http Server.

One way would be to get use SetEnvIf, but then you can’t get the querystring of the error page. When you type a wrong password the URL changes from https://connectionshost/application/login/ to https://connectionshost/application/login/?error=true.

SetEnvIf Request_URI "/login$" log

This set the environment variable to log, but when you read the Apache documentation you find:

The resource requested on the HTTP request line — generally the portion of the URL following the scheme and host portion without the query string. See the RewriteCond directive of mod_rewrite for extra information on how to match your query string

So we need a way to get ?error=true, with mod_rewrite we can access the query_string:

LoadModule rewrite_module modules/mod_rewrite.so
RewriteCond %{QUERY_STRING} "error=true"
RewriteRule (.*) $1 [E=log:yes] 
CustomLog "D:/IBM/HTTPServer/logs/loginpage.log" combined env=log

Now we can access the login page, type a wrong password and check the log:

192.168.110.190 - - [15/Apr/2014:10:40:15 +0200] "GET /homepage/login/?error=true HTTP/1.1" 200 2763 "https://cnxwin.stoeps.local/homepage/login/?error=true" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0"
192.168.110.190 - - [15/Apr/2014:11:00:49 +0200] "GET /communities/login?error=true HTTP/1.1" 200 2766 "https://cnxwin.stoeps.local/communities/login" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0"
192.168.110.190 - - [15/Apr/2014:11:00:56 +0200] "GET /blogs/login?error=true&lang=en_us HTTP/1.1" 200 2763 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0"

IBM Connections 4.5 CR4 released – new features are available

IBM released CR4 for IBM Connections 4.5 yesterday evening.

You can download CR4, TDISOL and some Cognos Updates at following links:

New Functions

After deploying CR4 you can enable some new features:

Hash tags in status update replies

Add

<properties>
    <genericProperty name="com.ibm.connections.ublog.hashtagCommentEnabled">enabled</genericProperty>
</properties>

to lotusconnections-config.xml

Now you can use hash tags in replies.

Selection_20140401_10:07:57_001

Include file links in status update replies

Activate with:

<properties>
    <genericProperty name="com.ibm.connections.ublog.attachmentCommentEnabled">enabled</genericProperty>
</properties>

Now you get a add file in the reply window and you can attach one file:

Selection_20140401_10:10:27_001

Selection_20140401_10:10:58_001

Expose activity stream search in the user interface and filter by hashtag

Activate with:

<properties>
    <genericProperty name="com.ibm.social.as.hashtagSearchEnabled">true</genericProperty>
</properties>

Search find hashtags in the activity stream now.

Selection_20140401_10:35:20_001

Community Folders

Add following code to files-config.xml:

<folder>
    <community>
        <communityFolder enabled="true"/>
    </community>
</folder>

With this feature you can add folders in the files module of your community or in the community overview.

Selection_20140401_10:30:48_001

Selection_20140401_10:36:50_001

It is possible to share existing folders and create new ones:

Selection_20140401_10:31:31_001

@mentions via the activity stream API

Activated by default, no additional configuration needed! I did not test this feature, but i think it is good.

Properties section of lotusconnections-config.xml after applying CR4

To activate the new features of CR2 (nextGen Theme), CR3 (badging) and CR4 i have following settings in my lotusconnections-config.xml:

<properties>
    <genericProperty name="com.ibm.lconn.core.web.request.HttpRequestFilter.IECompatMode">false</genericProperty>
    <genericProperty name="com.ibm.lconn.core.web.styles.theme.default">gen4</genericProperty>
    <genericProperty name="com.ibm.connections.news.badgingEnabled">enabled</genericProperty>
    <genericProperty name="com.ibm.connections.ublog.hashtagCommentEnabled">enabled</genericProperty>
    <genericProperty name="com.ibm.connections.ublog.attachmentCommentEnabled">enabled</genericProperty>
    <genericProperty name="com.ibm.social.as.hashtagSearchEnabled">true</genericProperty>
</properties>

Update

Luis Benitez mentions some more new features in his last blog post: Introducing File Sync for Mobile and More in IBM Connections 4.5 CR4

Some Words After Engage And Bcconde

This week i attended Engage in Breda. I had a session with famous Sharon Bellamy, we covered an update of our Connect 2014 session about “BP307 – Practical Solutions for Connections Administrators – Tips and Scripts for Your Daily Busines“.

I enjoyed it very much to be with lovely community guys, old and new friends. I want to thank Theo Heselman, he and his crew did and does a really great job to get us all together (350 attendees, 30 IBM Champions, 65 speakers).

Engage 2014-8003

Kitty and Warren Elsmore were with us again and made lovely copies of ourself in lego. Thanks to you too.

After closing session We4It has organized a shuttle to Hamburg. The travel was really good organized and we enjoyed soft drinks, beer and even a great meal at a rainy stop in the middle of the way.

Oli Heinz made great pictures at Engage and Bccon. He also saves this unforgetable experience:

enter image description here

Well prepared we arrived in Hamburg to be at the bcconde a new usergroup event in Germany. About 100 people were there, to see sessions, talk with speakers and sponsors. 7 of 30 IBM Champions which where in Breda made it to come to Hamburg and 6 of us had a short night there.

Session with Klaus Bild was the first time presentating the Connect slides in german and doing a session with Klaus. I see forward to make some new sessions with him.

On thursday i made a review of a IBM Connections environment in Hamburg. Nothing special, but some interesting effects. Main problem in my eyes is the internet proxy used here.

Flight back wasn’t special, but again i had to wait half an hour for suitcase at the airport. Finally i arrived at home at March 21st, 00:30.

There is only one word to describe this week:

AWESOME!

Last weeks, new scripts and next weeks

It was little bit quiet here after Connect 2014. I had lots of projects and no time to add new scripts or even do bug fixing.

I promised at Connect, that i will fix the JDBC drivers, that they will load on Windows too. See cnxMemberCheckExIDByEmail.py as an example.

Loading JDBC Drivers within jython scripts

Jan Riedel sent me a solution for SLES and i tested his proposal today within Windows. He points me in the right direction, i mustn’t load the path or jar within the script, it is better to load on starting wsadmin. You have to add the JDBC Driver path to WAS_EXT_DIRS.

I see two ways here:

Change setupCmdLine.sh|bat (Update)

I don’t like to change setupCmdLine directly, because i don’t want to load the driver everytime i start wsadmin or WebSphere, but you can add your JDBC path to the line

set WAS_EXT_DIRS=….;c:\ibm\jdbc (Windows)
export WAS_EXT_DIRS=….:/opt/IBM/JDBC (Linux)

Please do not change your setupCmdLine in this way. I had errors on using Connections updateInstaller, when i use it! Use WAS_USER_SCRIPT!

Add a WAS_USER_SCRIPT

I create a batch|shell script with following content.

wasuserscript.sh

Create the script in $WAS_HOME/profiles/Dmgr01/bin and make it executable.

export WAS_EXT_DIRS=$WAS_EXT_DIRS:/opt/IBM/JDBC

wasuserscript.bat

Create batch in %WAS_HOME%\profiles\Dmgr01\bin

set WAS_EXT_DIRS=%WAS_EXT_DIRS;c:\IBM\JDBC

Now it is enough to set the environment variable WAS_USER_SCRIPT, then the jdbc driver will be loaded on wsadmin start. So when you want to load cnxmenu.py or one of the scripts using JDBC ( cnxMemberCheckExIDByEmail.py, cnxMemberDeactAndActByEmail.py) simply set the WAS_USER_SCRIPT variable in your operating system, terminal or console.

export WAS_USER_SCRIPT=/opt/IBM/.../wasuserscript.sh

or

set WAS_USER_SCRIPT=C:\....\wasuserscript.bat

Thanks to Victor Toal for your script testing and bug reporting!

New scripts

I added some scripts for special j2ee roles to the github repository:

  • cfgJ2EERoleGlobalModerator.py
  • cfgJ2EERoleMetricsReader.py
  • cfgJ2EERoleMetricsReportRun.py
  • cfgJ2EERoleSocialMail.py

These scripts set consistent the roles mentioned in the file name. So you can enable or disable Socialmail integration, Metrics or Moderation.

Next weeks, next events

Next events i will attend are: Engage in Breda, BCCON in Hamburg and Social Connections VI in Prag.

At Engage i will speak with my friend Sharon Bellamy about Scripting.

At BCCON i will be with my swiss friend and scripting colleague Klaus Bild, we will do the Script show in german.

I plan a session for SocCon VI too, hope i will get a slot there.

Christoph Stoettner – Scripting, IBM Connections, Linux and so on