Tag Archives: Customizing

Announcement plugin for IBM Connections

Last week i searched a way to send all Connections users an information on important updates, which should be configurable and uses cookies to hide it for a specific time.

First i had a look at the Greenhouse Announcement Widget which is used within Greenhouse.

2014-12-19_16-46-41

Quite nice, but i had problems with IE 9 users and the popup appears on each page you open within Connections. So i tried something other.

After some searching i found a script of Ollie Phillips which is originally used to inform users about Cookie usage on the site. Ollie published the cookiesDirective.js under the MIT License. When you find the announcement slider useful, please buy him a beer.

I took the script and put it to a osgi bundle and added some configuration parameters.

Selection_20141219_16:43:43_001

If you want to test it, announcement-osgi, please use the updated archive! Download link see last point in this post!

Installation

Unarchive the package and copy de.stoeps.announcement_1.0.0.jar to your Connections customization folder/provision/webresources and the folder de (and all content below) to customization/javascript.

The text which is shown within the slider can be edited within customization/javascript/de/stoeps/announcement/popup.txt. You can use html code and links within this text file. So you can add links to additional informations.

Background color backgroundColor: '#CACACA', button text (buttonTextPre & buttonTextPost) and opacity (set backgroundOpacity: '99' to show a solid color) is configured in customization/javascript/de/stoeps/announcement/initialize.js

The announcement can be disabled with announcementEnabled: 'false'.

cookieLiveTime: 2 set the cookie to 2 days, so your users get the announcement again after 2 days and must confirm with the button.

After installation and after changes in initialize.js you must restart Common Application.

Update

Klaus and Rainer mentioned problems with german language within the browsers. So i renamed the plugin from de.stoeps to org.scripting101.

Please use the following archive to install the announcement osgi plugin!

announcement-osgi-1.0.1

Installation and customization is nearly the same, only the path within customization/javascript changes from de/stoeps to org/scripting101!

Thanks for testing guys.

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:

<profileDataModels>
    <profileExtensionAttributes>
    ...
        <simpleAttribute extensionId="twitterId" length="180 />
    </profileExtensionAttributes>
</profileDataModels>

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>
...
<searchLayout>
...     
<!-- custom field in searchResult -->
<extensionAttribute showLabel="false" labelKey="label.stoeps.twitterId" bundleIdRef="stoeps" extensionIdRef="twitterId"/>
</searchLayout>

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

Activate and customize “Table of contents” macro in IBM Connections Wiki

I read of a new function in IBM Connections Wiki i missed the last time on twitter today. A new macro to create a table of contents within a wiki page.

The activation of this macro is documented here: Wikis configuration properties

wikimacros.enabled

Specifies whether macros are enabled in Wikis. You can use macros to automate common tasks, such as generating a table of contents in a wiki page. The default value of this parameter is false. To enable macros, set the value to true. When enabled, macros are available from the Macros menu in the editor toolbar.

I’m a little bit confused, because i have to change the wording in wikis-config.xml:

 <editor>
      <wikitexttab enabled="true" />
      <wikimacros enabled="true" /> <!-- add this line --> 
 </editor>

After checking in the configuration file and restart connections i got a new button in my wikis editor:

Macro for Table of Contents

Quite cool, but the macro only generates headings with format h2, h3 and h4 to the TOC. The richtext editor provides headings h1-h4. I want to change this behavior, that h1 will be added to TOC too.

I found a great article on adding templates to ckeditor from Rob Novak, there he describes how you can customize the ckeditor of wikis. I used the paths mentioned in this article to customize the toc behavior.

Extract toc.js

You can find the needed file com.ibm.lconn.wikis.web.resources_3.5.0.20130627-1601.jar in folder /opt/IBM/Connections/data/shared/provision/webresources. I extracted it to /tmp:

unzip -d /tmp/ckeditor /opt/IBM/Connections/data/shared/provision/webresources/com.ibm.lconn.wikis.web.resources_3.5.0.20130627-1601.jar

Create customization path and copy toc.js

mkdir -p /opt/IBM/Connections/data/shared/customization/javascript/lconn/wikis/macros
cp /tmp/ckeditor/resources/macros/toc.js /opt/IBM/Connections/data/shared/customization/javascript/lconn/wikis/macros

Change toc.js

vim /opt/IBM/Connections/data/shared/customization/javascript/lconn/wikis/macros/toc.js

You find the following part:

lconn.wikis.macros.toc = {
//node id sequence for TOC link.
    fragmentSeqn: 1,
    topLevel: 2,
    bottomLevel: 4,
    template: 'Table of Contents:<INSERT-BODY>',

You have to change topLevel and bottomLevel to following:

lconn.wikis.macros.toc = {
//node id sequence for TOC link.
    fragmentSeqn: 1,
    topLevel: 1,
    bottomLevel: 5,
    template: 'Table of Contents:<INSERT-BODY>',

After a new Connections restart my toc got updated with h1 – h5.

Update

Change Styles

If you want to change the default style of your tocs, you can do this in the toc.js file too! I prefer my TOC on the right screen side and with a light grey not yellow background.

I changed:

 style: 'border-radius: 6px; margin: 8px; padding: 4px; display: block; width: 50%;background-color: #ffc;',

To:

 style: 'border-radius: 6px; margin: 8px; padding: 4px; display: block; width: 30%;background-color: #E0E0E0;float:right;padding:10px;margin-left:20px;margin-bottom:20px;',

Now i have a little bit smaller toc with additional space to the content:

Changing the style of your toc

It would be better to define the styles through a CSS file in customization folder, but i only want to test it. When you want to change through css file, then you should remove most of the styles from style:.

Connections 3 Customizing – custom.css is not enough

I had a problem last week with some customizations via custom.css in IBM Connections 3.0.1.1 CR3. Communities still use the default Layout and colors.

I found that defaultTheme.css rewrites some of my custom.css statements. I had to add the content of custom.css to the end of the xxxTheme.css (lazy but it works), that i have a consistent color and layout change. Tests with @import are not working, because @import must be the first statement of a css file and i need to add the custom.css to the end of the xxxTheme.css.

Customizing Connections 4 Wikis Default (Welcome) Page

The Default Page of Wikis shows some content for our users to offer them better work experience, but in some companies it would be good to change this text or use only one language. Content of this welcome page is set in the default language of the user who creates the wiki.

I found the properties File for this text area in {WAS_Root}/profiles/AppSrv01/installedApps/{cellname}/Wikis.ear When you unzip the file share.services.jar, you get the path com/ibm/lconn/share/services/handlers/wiki/nls/ and there the properties-files for wikis (WikiWelcomePageMessages.properties).

To change the values for english, you create a file named com.ibm.lconn.share.services.handlers.wiki.nls.WikiWelcomePageMessages.properties in {Connections Shared Directory}/customization/strings/

Here you define:

WELCOME_MESSAGE_HTML=Your Default Wiki Welcome Text
WELCOME_MESSAGE_COMMUNITY_HTML=Your Default Community Wiki Welcome Text

The string can contain html markup.

If you want to change this in additional languages, you have to prepare files with following name: com.ibm.lconn.share.services.handlers.wiki.nls.WikiWelcomePageMessages_{LanguageCode}.properties