Customizing Display Name IBM Connections 4.x

  • 14 Aug, 2013

One of the most important part of the IBM Connections is the person profile.

The full name of the person, in general, is stored on a corporate LDAP.   Last week i am in charge to populate the profiles database with photos, and a lot of data from LDAP.

The person attributes on the ldap , like SN, CN, Display name was in capital letters like FIRST NAME LAST NAME.  We don´t want this kind of display names,

The solution: Custon function before importing the users.

Copy this function to the file profiles_functions.js

function func_name (fieldname){
  //get attributes
  var nome      work.getAttribute(“givenName”);
  var sobrenome = work.getAttribute(“sn”);
  var fullname  = nome + “ “ + sobrenome;

  return properCase(fullname);

  function properCase(text) {
    var articles = [ ‘e’,‘o’, ‘a’, ‘de’, ‘da’, ‘dos’, ‘das’]

    return map(text.split(/s+/), function(word) {
                                    return isArticle(word)?  word.toLowerCase()
                                    :      /\* otherwise */   capitalise(word) })
           .join(’ ’)

    function map(xs, f) {
      var l = xs.length, r = new Array(xs.length)
      for (var i = 0; i < l; ++i) r[i] = f(xs[i])
      return r }

    function has(xs, x) {
      for (var i = 0; i < xs.length; ++i)
        if (xs[i] === x)  return true
      return false }

    function capitalise(word) {
      return word.slice(0, 1).toUpperCase() + word.slice(1).toLowerCase() }

    function isArticle(word) {
      return has(articles, word.toLowerCase()) }}
}

Change the attribute displayname on the file map_dbrepos_from_source.properties

displayName={func_name}

Run the ./sync_all_dns.sh

Related Posts

Homepage Search: Profiles server fails while creating the initial index

  • 10 Sep, 2013

When trying to create the initial index for Global Search from the Homepage server, the index update fails with an error. To prevent further problems with indexing, perform a search in the Profiles database for any null entries in the table EMPINST.EMPLOYEE. select \ from EMPINST.EMPLOYEE
where EMPINST.EMPLOYEE.PROF\DISPLAY\NAME is null If any entries are returned they must be updated with an entry in the display name column for the Profiles feature to index successfully. To prevent this issue from occurring, change the value of PROF\DISPLAY\NAME=256 in the validate\dbrepos\fields.properties file, to contain the following: PROF\DISPLAY\NAME=(x != null) && (x.length() > 0) && (x.lengt

Homepage Search: Profiles server fails while creating the initial indexRead More

Proud to be an HCL Ambassador 2021

  • 15 Dec, 2020

​If you have a problem, and no-one else can help, and if you can find them, maybe you can ask an HCL Ambassador… !(http://www.mysphere.com.br/wp-content/uploads/2020/12/HCLAmbassaborlight4x.png) See the HCL Ambassadors Class of 2021(https://hcltechsw.com/about/hcl-ambassadors/class-of-2021)

Proud to be an HCL Ambassador 2021Read More

Nominate an IBM Champion

  • 30 Oct, 2019

IBM Champions demonstrate both expertise in and extraordinary support and advocacy for IBM technology, communities, and solutions. I am an IBM Champion since the first class  (2011) an this year i wish to be  an IBM Champion for the year 2020. New Champion Nominations are open now through 22 November 2019. Current IBM Champions may submit a renewal through 9 November 2019. To nominate an IBM Champion use this link(https://developer.ibm.com/champions/)

Nominate an IBM ChampionRead More