Sametime, LDAP e fotos dos usuários

  • 09 Jun, 2009

Um recurso que muitas pessoas estão pedindo, principalmente depois de ver uma apresentação do Sametime, é a capacidade de ver as fotos das pessoas no chat ou em outras partes do produto.
As configurações variam de caso para caso, principalmente com a utilização de LDAP.
Para configurar as fotos e utilizando como diretório LDAP um servidor Domino o TechNote 1244204 resolve o problema. Neste TN tem um passo a passo para inserir a imagem utilizando uma ferramenta do tipo LDAP BROWSER, eu utilizei uma  Open Source muito boa chamada JXPlorer. Para colocar uma foto ou poucas é útil mas para colocar um lote de fotografias fica complicado. Achei o código abaixo que é um agente que coloca imagens no campo jpegPhoto uma a uma. Para fazer a carga de várias fotos o agente tem de ser modificado conforme o caso. O que simplificou meu agente foi a padronização dos arquivos de fotos com menos de 64Kb e os nomes formados pela matrícula + jpg e o shortName dos usuários ser justamente a matrícula.

:

Declare Function NEMGetFile Lib “nnotesws” ( wUnk As Integer, Byval FileName As String, Byval Filter As String, Byval Title As String ) As Integer

Const adTypeBinary = 1

Sub Initialize
                 Dim s As New NotesSession
                 Dim db As NotesDatabase
                 Dim col As NotesDocumentCollection
                 Dim doc As NotesDocument
                 Dim sPath As String
                 Set db = s.CurrentDatabase
                 Set col = db.UnprocessedDocuments
                 Set doc = col.GetFirstDocument
                 sPath = GetFile
                 Call doc.ReplaceItemValueCustomDataBytes(“jpegPhoto”,“jpegPhoto”,ReadByteArray(sPath))
                 Call doc.Save(True, False)
                 Set doc = Nothing
                 Set db = Nothing
                 Set col = Nothing
                 Set s = Nothing

End Sub
Function ReadByteArray(strFileName As String) As Variant
                 Dim bytes As Variant
                 Set bytes = CreateObject(“ADODB.Stream”)
                 bytes.Type = adTypeBinary
                 bytes.Open
                 bytes.LoadFromFile strFileName
                 ReadByteArray = bytes.Read

End Function

Public Function GetFile() As String
                 Dim strFileName As String*256
                 Dim strTitle As String
                 Dim strFilter As String
                 strFileName = “*.jpg”
                 strTitle = “Please select the jpg image to be imported”
                 strFilter = “JPEG Image|*.jpg”
                 Call NEMGetFile( 0, strFileName, strFilter, strTitle)
                 GetFile =  Trim(strFileName)
End Function

Related Posts

Sametime meets Watson

  • 06 Dec, 2016

Bots is a high topic these days and i revisited this kind of application last week. I created a Translation Bot based on this article(http://www.ibm.com/developerworks/lotus/library/ls-STBots1/) from

Sametime meets WatsonRead More

Sametime and IBM Connections integration when you use self certification

  • 20 Oct, 2015

I setup the integration between Sametime Proxy 9.0 and IBM Connections a long time ago. When i access the Connections homepage the sametime widget does not work. After some research i found a solutio

Sametime and IBM Connections integration when you use self certificationRead More

Upgrade the embedded sametime client on Notes 9

  • 24 Sep, 2013

IBM Sametime 9 was launched a few weeks ago.  When i saw this video(http://ibmtvdemo.edgesuite.net/software/lotus/uxid/sametime/ST9wn.mp4) i  do the upgrade of my embedded Sametime client on Notes 9

Upgrade the embedded sametime client on Notes 9Read More