9 Convergence Instant Messaging Customization Examples

This chapter provides several examples for customizing the instant messaging service in Oracle Communications Convergence.

Customization Requirements

To perform any Convergence customization, you should have expert knowledge in dojo and knowledge of UI customization. For more information on general Convergence customization, see "Technical Overview".

Nearly all customization examples require the same setup and preparation.

  • You start by verifying that the c11n_Home directory exists. If it does not exist, create it.

    See "Customization Directory Structure" for more information.

  • Next, you verify that customization is enabled in Convergence. If customization is disabled, enable it.

    See "Enabling Customization in the Convergence Server" for more information.

  • When you have completed your customization, you must restart the GlassFish server for Convergence.

    See Convergence System Administrator’s Guide for more information.

Displaying Multi-Network Icons in Federated Instant Messaging

If you have integrated Convergence with Oracle Communications Instant Messaging Server federation, this customization example explains how to get the icons in the Instant Messaging window to display properly.

  1. Verify that the c11n_Home directory exists. If c11n_Home does not exist, create it.

  2. Verify that customization is enabled in Convergence. If customization is disabled, enable it.

  3. In c11n_Home, verify that the following directories exist. If they do not exist, create them:

    /c11n_Home/allDomain/layout/css/
    
  4. In c11n_Home, verify that config.js exists. If it does not exist, create it.

  5. Modify config.js so that it enables JavaScript customization (jsEnabled: true) across all domains (module: "allDomain").

    dojo.provide("c11n.config");
    c11n.config = {
          
            // allDomain configuration
            allDomain: {
                   module: "allDomain", // module name
                   themeEnabled: false, // true if theme is customized
                   i18nEnabled: false, // true if i18n is customized
                   jsEnabled: true // true if js is customized
          
                   // the last entry must not end with comma
          
            }
    }
    
  6. In /opt/sun/comms/iwc/config, configure imgateways.json to enable multi-network federated instant messaging deployments where myfedserver is the federated IM server being added to the Convergence UI.

    {
             enabled: true,
             gateways: [
                  {
                            type: "myfedserver",
                            category: 'federated',
                            name: "MyFedServer",
                            domain: "myfedserver.example.com",
                            serverurl: "talk.myfedserver.example.com:5222",
                            enabled: true
                  }
             ]
    }
    
  7. In c11n_Home/allDomain/layout/css, create a new CSS file (clln_icons.css) to include the Instant Messaging icons from other networks. In this example, the background-image points to the new images.

    .ManageAccounts .GatewayIcon.gateway_type {
    background: url("image_location") no-repeat center center;
    }
    

    where gateway_type is value of "type" in required gateway service. Convert the first character of "type" to an upper-case character so it matches the values in imgateways.json. For example:

    .ManageAccounts .GatewayIcon.Myfedserver {
    background: url("../images/myfedserver.png") no-repeat center center;
    }
    
  8. In c11n_Home/allDomain/js, create or modify customize.js (the domain specific customization) to include the following code:

    dojo.provide("c11n.allDomain.js.customize");
    
    // Load Customized CSS File Helper
    var loadCustomizedCssFile = function(url, id) {
            if (!id){
                    id = url.replace(/\.\./gm, "").replace(/\//gm, "_").replace(/\./gm, "_");
            }
            var link = window.document.getElementById(id);
            if (! link) {
                    link = window.document.createElement("link");
                    link.setAttribute("id", id);
                    link.setAttribute("type", "text/css");
                    link.setAttribute("rel", "stylesheet");
                    var head = window.document.getElementsByTagName("head")[0];
                    head.appendChild(link);
            }
    
            link.setAttribute("href", url + "?" + djConfig.cacheBust);
    }
    
    // load the calendar.css after the loadCustomizedCssFile function
    loadCustomizedCssFile("../c11n/allDomain/layout/css/c11n_icons.css");
    
  9. Place icon in the c11n_Home/allDomain/layout/images directory.

  10. Restart the GlassFish server and clear the browser cache.