Showing posts with label Jellybean. Show all posts
Showing posts with label Jellybean. Show all posts

Saturday 30 September 2017

Integrating Skype into a SPA in SharePoint

SPA are pretty common and recently on a project I had a request to show contacts with a SPA hosted on SharePoint.  Here is code that shall show Skype presence to the user.

Note: Works on IE, requires the user to be logged into Skype and have the Skype client.

<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=10" />
    <title> Presence with Skype </title>
    <link rel="stylesheet" type="text/css" href="/_layouts/15/1033/styles/Themable/corev15.css" />
    <script type="text/javascript" src="/_layouts/15/init.js"></script>
    <script type="text/javascript" src="/_layouts/15/1033/strings.js"></script>
    <script type="text/javascript" src="/_layouts/15/core.js"></script>
</head>
<body>
    <script type="text/javascript">
        var g_presenceEnabled = true;
    </script>
    <div>
        ​ <span class="ms-verticalAlignTop ms-noWrap ms-displayInlineBlock">
            <span class="ms-imnSpan">
                <a class="ms-imnlink ms-spimn-presenceLink" aria-hidden="true" onclick="IMNImageOnClick(event);return false;" href="#">
                    <span class="ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10">
                        <img name="imnmark" class="ms-spimn-img ms-spimn-presence-online-10x10x32" id="imn_1,type=smtp" alt="Offline" src="/_layouts/15/images/spimn.png" sip="pb@radimaging.co.uk" showofflinepawn="1" />
                    </span>
                </a>
            </span>
            <span class="ms-noWrap ms-imnSpan">
                Paul beck
            </span>
        </span>
    </div>
</body>

</html>

Saturday 4 February 2012

Presence Indicator not working

Problem: Presence indicator is not working in SP2010.

Initial Hypothesis: We have Office Communication 2007 installed.  I believe the presence indicator will also work if you are running Windows messanger on each client machine but our issue affected all our users in our test environment.

Resolution: A colleague, Greg Williams figured out how to fix the issue and I have posted it here to help others.  Neither the email address or the SIP are populated in the 'User Information' page (User Information List).
Here is the PS that fixed our issue, Brian Cartmel provided the PS:
$web = Get-SPWeb http://demo.dev
## get the user information list
$list = $web.Lists | where { $_.Title -eq "User Information List" }
## get the system account item
$item = $list.Items | where { $_["Account"] -eq "i:0e.t|ADFS20|paul.beck@demo.dev" }
$item["Title"] = "Paul Beck"
$item["SIP Address"] = paul.beck@demo.dev
$item.Update()



Explaination: "If the user does have a profile then the hyperlink will redirect to the user's main profile page under My Site. If the user does not have a profile, the hyperlink will redirect to the SharePoint Foundation 'User Information' page. All users in a site have a 'User Information' page, if they also have a User Profile the settings from the profile are synchronised down to the User Information page on a scheduled basis (by a timer job).
The key piece of information to make the presence work is the user's SIP Address which is basically their IM address (This is not always the same as email address). When a users is either added to a site in SharePoint or has their profile imported, the SIP Address will be drawn from Active Directory which is where OCS stores it and placed into the SIP address field in either the user's profile which will in turn synchronise down to the site's local 'User Information' page."  Martin Kearn

Tip: So as long as email or sip is populate with the email, the status indicator works.

More Info:
http://sharepoint.stackexchange.com/questions/15446/presence-indicators-without-lync
http://erikswenson.blogspot.com/2009/12/sharepoint-presence-not-showing.html
http://kbalertz.com/2448575/SharePoint-presence-information-appear-correctly-People-search-results-intermittently.aspx
http://blogs.msdn.com/b/uksharepoint/archive/2010/05/07/office-communicator-integration-presence-in-a-custom-webpart-for-sharepoint-2010.aspx (Read this)
http://blog.falchionconsulting.com/index.php/2011/12/updating-sharepoint-2010-user-information/
http://sharepintblog.com/2011/06/17/update-system-account-user-information-on-a-local-sharepoint-install/  Great blog and source of the Poweshell.