+

Search Tips   |   Advanced Search

Configure the Profiles server to support feeds

Configure the Connections Profiles server to support dynamic feeds in Microsoft Outlook Social Connector.

To configure support for dynamic feeds for an IBM Connections 4 server, edit properties in the profiles-types.xml, and profiles-config.xml files.

  1. Navigate to the configuration files in...

      WebSphere/AppServer/profiles/<AppSrv>/config/cells/<serverNodeCell>/LotusConnections-config

  2. Edit profiles-types.xml, and add a <property> for the attribute hashEmail:
    <property>
      <ref>hashEmail</ref>
      <updatability>readwrite</updatability>
      <hidden>false</hidden>
      <fullTextIndexed>true</fullTextIndexed>
     </property>

  3. Edit the file profiles-config.xml file in a text editor and Add a <simpleAttribute> to the <profileExtensionAttributes> element.

      <simpleAttribute extensionId="hashEmail" length="40"/>

  4. Save the changes and close the configuration files.

  5. Restart the connections server so the changes take effect.

  6. Populate the new attribute. This code sample demonstrates how to produce the hash with a simple Java method:
    String hash = hashString(email,"MD5");  // SHA-1 
    
       public static String hashString(String text, String alg) 
    throws NoSuchAlgorithmException, UnsupportedEncodingException
       {
          MessageDigest md = MessageDigest.getInstance(alg);
          md.update(text.getBytes("iso-8859-1"), 0, text.length());
          // convert the byte-array into a hex-string
          byte[] hash = md.digest();
          StringBuffer buf = new StringBuffer();
          for( int i=0; i < hash.length; i++ )
          {
             int b = hash[i];
             if( b < 0 )
                b = 256 + b;
             if( b < 16 )
                buf.append("0");
             buf.append(Integer.toHexString(b));
          }
          return buf.toString();
       }

    The result is a web page with only the hashed email returned.

To configure support for dynamic feeds for a Connection 3.x server.

  1. Check out the Profiles configuration files:

    ./wsadmin.sh -jython
    execfile("profilesAdmin.py")
    ProfilesConfigService.checkOutConfig("/tmp", "cell_name")

  2. Edit profiles-config.xml and add a simpleAttribute to the profileExtensionAttributes element. To do so, search for
    <profileDataModels>  
     <profileExtensionAttributes>
    and add:

      <simpleAttribute extensionId="hashEmail" length="40"/>

  3. Indicate the extension is editable by extending the apiModel element. To do so, search for
    <apiConfiguration> 
     <apiModel profileType="default">
    and add:

      <editableApiExtensionAttribute extensionIdRef="hashEmail"/>

  4. After editing the files, check the configuration files back in, and we must do so during the same wsadmin session in which you checked them out for the changes to take effect. See Applying property changes in Profiles for information about how to save and apply the changes.

  5. To populate the new attribute, perform an HTTP PUT to the profileExtension.do URL for each user. To verify the attribute is correctly populated, we can test each entry using the following URL pattern:

      https://<servername>/profiles/atom/profileExtension.do?extensionId=hashEmail&email=<email address>

    The result is a web page with only the hashed email returned.

    The following code sample shows how to create the attribute value using MD5 hashing.

    MD5 Hashing Sample 
    // (C) Copyright IBM Corp. 2010 - All Rights Reserved.
    //
    // DISCLAIMER:
    // The following source code is sample code created by IBM Corporation.
    // This sample code is provided to you solely for the purpose of assisting you // in the use of Lotus Connections. The code is provided 'AS IS', without warranty or // condition of any kind. IBM shall not be liable for any damages arising out of your // use of the sample code, even if IBM has been advised of the possibility of // such damages.
    // 
    // Return a MD5 hash of the first argument 
    package com.ibm.sample;
    import java.io.UnsupportedEncodingException;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    
    public class Hash {
      public static String hashString(String paramString1, String paramString2)
     throws NoSuchAlgorithmException, UnsupportedEncodingException
      {
        MessageDigest localMessageDigest = MessageDigest.getInstance(paramString2);
        localMessageDigest.update(paramString1.getBytes("iso-8859-1"), 0, paramString1.length());
        byte[] arrayOfByte = localMessageDigest.digest();
    
        StringBuffer localStringBuffer = new StringBuffer();
        for (int i = 0; i < arrayOfByte.length; i++) 
        {
          int j = arrayOfByte[i];
          if (j < 0)
            j = 256 + j;
          if (j < 16)
            localStringBuffer.append("0");
          localStringBuffer.append(Integer.toHexString(j));
        }
        return localStringBuffer.toString();
      }
    }


Parent topic:
Configure dynamic feeds for the Outlook Social Connector