
Reading in chapter 9 of the Sametime Administration PDF I learned of the UserInfoServlet configured through the UserInfoConfig.xml document in the Domino directory (in the filesystem mind you) on the Sametime 7.5 server. In this post I will not go into the different configuration files but simply describe how the UserInfoServlet works, which parameters it takes and what it returns. You can use this, as I did, for troubleshooting.
Please note: All the information in this post was reverse engineered so use it and treat it accordingly.
Just to get it out of the way. The reason why my initial configuration didn’t work was that the Sametime client contacted a hostname that wasn’t configured in the Internet Sites view in the Domino Directory (I guess it resolved the ip address or hostname wrongly in some way). Anyways – the way to configure the phote part of the business card is perfectly descriped on Grant Binghams blog and in the Sametime 7.5 Administration PDF.
The UserInfoServlet
It appears that the servlet takes 4 arguments:
- operation (valid values are: 1, 2, 3)
- userid (the username of the user as listed in the ($Users) view)
- setid (valid values are the configured blackbox sets; usually 0 and 1)
- field?? (with ?? being a an incremental number starting a 1)
The operation parameter is the main parameter that controls what the servlet tries to do and what other parameters are required. See below for a description of each operation.
operation=1
This operation is used to get value for specific fields based on the name of the field the Sametime client uses. You can request information from more than one field at a time. The valid names of the fields are the ones from UserInfoConfig.xml and hence the field names shown when you use the operation=2 parameter.
URL syntax: http://hostname/servlet/UserInfoServlet?operation=1&field1=<field name>&userid=<username>
Example URL: http://hostname/servlet/UserInfoServlet?operation=1&field1=Name&field2=Title&userid=jdoe
<?xml version="1.0" encoding="UTF-8"?>
<userinfo>
<user id ="lekkim">
<field name="Name" type="text/plain">John Doe</field>
<field name="Title" type="text/plain">Marketing Manager</field>
</user>
</userinfo>
operation=2
This operation gives you a list of the fields configured for the required field set. If you leave out the optional setid-parameter a value of 0 will be implied.
URL syntax: http://hostname/servlet/UserInfoServlet?operation=2&setid=<set id>
Example URL: http://hostname/servlet/UserInfoServlet?operation=2&setid=0
<?xml version="1.0" encoding="UTF-8"?>
<userinfo>
<field name="MailAddress" type="text/plain" />
<field name="Telephone" type="text/plain" />
<field name="Company" type="text/plain" />
<field name="Title" type="text/plain" />
<field name="Name" type="text/plain" />
<field name="Photo" type="image/jpeg" />
<field name="Location" type="text/plain" />
</userinfo>
Example URL: http://hostname/servlet/UserInfoServlet?operation=2&setid=1
<?xml version="1.0" encoding="UTF-8"?>
<userinfo>
<field name="Photo" type="image/jpeg" />
<field name="Name" type="text/plain" />
<field name="Title" type="text/plain" />
<field name="MailAddress" type="text/plain" />
<field name="Telephone" type="text/plain" />
</userinfo>
operation=3
This operation is the workhorse of the servlet and the one that the Sametime client calls. This operation returns, as the others do, a XML document containing the business card of the requested user. The photo data is base64 encoded and the type attribute indicates whether it is a jpeg or a gif image.
URL syntax: http://hostname/servlet/UserInfoServlet?operation=3&userid=<username>
Example URL: http://hostname/servlet/UserInfoServlet?operation=3&userid=jdoe
<?xml version="1.0" encoding="UTF-8"?>
<userinfo>
<user id="John Doe/Acme">
<field name="MailAddress" type="text/plain">jdoe@example.com</field>
<field name="Telephone" type="text/plain">555-9921</field>
<field name="Company" type="text/plain">Acme Corp.</field>
<field name="Title" type="" error="UNAVAILABLE"/>
<field name="Name" type="text/plain">John Doe</field>
<field name="Photo" type="image/gif">R0lGODlhoQCjAOf==</field>
<field name="Location" type="" error="UNAVAILABLE"/>
</user>
</userinfo>