I am facing a serious problem. I want to display all users and their status in a HTML Table .Is it possible to do using javascript ?
I have gone through the below link where it is showing only one user and it's status and user mail id is hard coded.
Integrate Microsoft Office Communicator 2007 in ASP.NET Page
Javascript
<script type="Javascript">
var sipUri = "[email protected]";
var nameCtrl = new ActiveXObject('Name.NameCtrl.1');
if (nameCtrl.PresenceEnabled)
{
nameCtrl.OnStatusChange = onStatusChange;
nameCtrl.GetStatus(sipUri, "1");
}
function onStatusChange(name, status, id)
{
// This function is fired when the contacts presence status changes.
// In a real world solution, you would want to update an image to reflect the users presence
alert(name + ", " + status + ", " + id);
}
function ShowOOUI()
{
nameCtrl.ShowOOUI(sipUri, 0, 15, 15);
}
function HideOOUI()
{
nameCtrl.HideOOUI();
}
</script>
HTML
<span onmouseover="ShowOOUI()" onmouseout="HideOOUI()" style="border-style:solid">Your Contact</span>
<table id="tblContacts" runat="server">
<tr>
<td> email id </td>
<td> status </td>
</tr>
<tr>
<td> --- </td>
<td> --- </td>
</tr>
<tr>
<td> --- </td>
<td> --- </td>
</tr>
<tr>
<td> --- </td>
<td> --- </td>
</tr>
</table>
Here in this example it is showing for a single user and user mail id is defined as a string(hard coded). i want to show all users. Is it possible through javascript ?
Any solution/Demo will be very much helpful for me.
Thanks.
After a long try I am able to achieve the functionality according to my need. Here I am explaining the steps to be followed.
I used "Communicator API " with "NameCtrl" to achieve that
1) Refer this link http://msdn.microsoft.com/en-us/library/bb787231%28v=office.12%29.aspx
why I am telling to refer this, because To develop applications using the Microsoft Office Communicator Automation API, the following requirements must be met:
2) Install Lync2010 on the server and login to that.
3) add reference to CommunicatorAPI.dll and CommunicatorPrivate.dll from your Web application
I am using communicator images here which I have downloaded from "http://www.microsoft.com/en-us/download/details.aspx?id=10503" . it's a msi file . download it and execute. in the demo, you can copy these images and add to your application
Here is the complete solution.
HTML
Codebehind