ASP.NET Web 应用程序中的存在控制

发布于 2024-10-17 23:28:30 字数 358 浏览 7 评论 0原文

我已经成功地在我自己的自定义构建的应用程序中实现了 Sharepoint 中使用的 Name.NameCtrl.1 active x 以实现存在。一切正常,我正在根据 Office Communications Server 上的用户状态正确更新状态。但是,我没有像在 SharePoint 中那样获得在状态控件中提出的有关用户的任何其他详细信息。我得到的只是电子邮件字段中的 sip 地址(而不是 AD 中真正的默认电子邮件地址)和安排会议的链接。

谁能告诉我如何让控件填充 AD 的详细信息(部门、电子邮件、电话等),就像在 sharepoint 中那样?另外,我在控件中没有像共享点那样获得组织选项卡。

有什么想法吗?

谢谢,

基尼

I've managed to implement the Name.NameCtrl.1 active x used in sharepoint in my own custom built apps for presence. All is working fine and I'm updating presence status correctly based on a users status on Office Comunication Server. However I'm not getting any other details on the user propulated in the presence control like it does in SharePoint. All I get is the sip address in the email field (rather than the real default email address in AD) and a link to schedule a meeting.

Can anyone tell me how to get the control to populate with details from AD (dept, email, phone etc) like it does in sharepoint?? Also I don't get an organization tab in the control like sharepoint.

Any ideas?

Thanks,

Keeney

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

葬﹪忆之殇 2024-10-24 23:28:30

NameCtrl 从客户端计算机上正在运行的 Communicator(或 Lync,如果您使用的话)实例获取大部分数据。不会直接从 SharePoint 中提取任何数据。要让 NameCtrl 在您的网页上正常工作,您需要确保:

  • Communicator(或 Lync)正在客户端上运行,并且已登录
  • 您调用 NameCtrl 的网页位于浏览器的 Intranet 或受信任的站点区域中

建议的模式是在调用任何其他方法之前对 NameCtrl 对象调用 PresenceEnabled - 如果返回 false,则上述先决条件之一(或两者)为 false。下面的代码通常对我有用

<script>

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>

<span onmouseover="ShowOOUI()" onmouseout="HideOOUI()" style="border-style:solid">Your Contact</span>

如果您还没有看到它,有一个很好的NameCtrl参考此处

NameCtrl gets the majority of its data from the running instance of Communicator (or Lync, if you're using that) on the client machine. No data is directly pulled back from SharePoint. To have NameCtrl work properly on your web pages, you need to make sure that:

  • Communicator (or Lync) is running on the client, and signed in
  • The web page you are calling NameCtrl from is in the Intranet or Trusted Sites zone in your browser

The recommended pattern is to call PresenceEnabled on the NameCtrl object before calling any other methods - if this returns false, then one (or both) of the above prereqs is false. The code below generally works for me

<script>

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>

<span onmouseover="ShowOOUI()" onmouseout="HideOOUI()" style="border-style:solid">Your Contact</span>

In case you haven't already seen it, there is a good(ish) NameCtrl reference here

懒猫 2024-10-24 23:28:30

我认为在 SharePoint 中,控件填充了用户配置文件服务中存在的数据。如果您希望在非共享点 ASP.NET Web 应用程序中使用此功能,那么您必须从 AD 构建用户配置文件详细信息的存储库(并缓存它!),您的控件将通过该存储库来显示该信息。

I think in SharePoint, the control is populated with data that exists in the user profile service. If you want this in a non-sharepoint ASP.NET web app, then you'd have to build a repository of user profile details from AD (and cache it!) which your control will look to to display that information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文