zevenseas


 

Calling an SSL Web Service from SharePoint 2010 (For example LinkedIn)

I just got to the bottom of what was a pretty painful problem.

We are working on a project that requires integration with LinkedIn, something we were really looking forward to. During our research we found some great code samples out there, so a big thanks at this point to the following people for their community submissions:

http://sp2010linkedin.codeplex.com/ by Stef van Hooijdonk (thanks Stef) http://stefvanhooijdonk.com/2010/03/22/sp2010-and-linkedin-workin-together/ 

and

http://msdn.microsoft.com/en-us/library/ff512786.aspx thanks to Andrew Connell and Matthew McDermott

The problem was, we hit a snag very early on, in fact immediately after the 10 minute job required to set these solutions up. Looking around the net we could see that other people had the same problem, but we couldn’t find anywhere that it’d been solved. 

Problem:


The basic problem was that whenever we tried to “Opt In” to LinkedIn, essentially the bit where you swap over to the LinkedIn site so that you can authenticate and grant access to our SharePoint site, we received the following error:

“The remote certificate is invalid according to the validation procedure.”

In the event viewer we found:

An operation failed because the following certificate has validation errors:\n\nSubject Name: CN=api.linkedin.com, OU=Production Operations Group, O=LinkedIn Corporation, L=Mountain View, S=California, C=US\nIssuer Name: CN=Thawte SGC CA, O=Thawte Consulting (Pty) Ltd., C=ZA\nThumbprint: B78C501CA20EC4AA26FEF60BD2B85E36B8CDDB13\n\nErrors:\n\n The root of the certificate chain is not a trusted root authority..”

Testing:

We did lots of tests, with the first thing being to check the certificates, try from different development boxes and access from a separate client machine. Nothing. I then fired up Fiddler and tried to see if there were any hints floating across the wire. There wasn’t.

We then setup both the projects mentioned above, only to find that both exhibited exactly the same problem. This led us to conclude that the problem was not in the code, but was something to do with the environment.

Going further, we decided to setup the LinkedIn sample from the LinkedIn Developer Toolkit:
http://linkedintoolkit.codeplex.com/

Here we found that everything worked as it should, putting the focus firmly on SharePoint, there was something stopping this code from running correctly within the SharePoint Context.

Solution:

The solution was in the realisation that SharePoint has its own certificate store, one that is separate to that of the operating system. Code called within the context of SharePoint refers only to that store. What I needed to do was identify the Root Certificate of the one used by LinkedIn, and then add it to the SharePoint certificate store.

I got the certificate from here:
https://www.verisign.com/support/roots.html 

Specifically, the “Class 3 Public Primary Certification Authority.cer” found inside this package: https://www.verisign.com/support/roots.zip

I then opened SharePoint Central Administration, and clicked through the following links:
Security –> Manage Trust

I then clicked on the “New” button, completing the form, and uploading the certificate file. Once completed, editing the entry looked like the below:

image

With this step completed, I went back to my LinkedIn sample application, clicked on “Opt-In” button to find that everything started working just as it should.

Summary:

While in this case we were integrating with LinkedIn, my guess is that you are going to need to perform similar configuration steps for any SSL based Web Services you wish to integrate with inside of SharePoint. Hope that helps.

Visiting Australia from Sept 10th–Sept 28th

One of the nice things about being based in India rather than Europe is that it is a lot easier to duck home to Australia every now and then (makes Mum VERY happy, and I know she is reading this). And that is exactly what I will be doing between the 10th and 28th of September.

My plan at this stage is to:

  1. Spend the first week in Adelaide, being from the 10th – 19th of September
  2. Head to Sydney on the 19th of September until the 22nd of September (depending on meetings)
  3. Finally Melbourne from the 22nd of September until returning to Adelaide and India on Friday 24th

If you are in any of these cities, at any of these times and share my interest in SharePoint, Social Computing or the endless possibilities offered by an AppStore for SharePoint, then lets grab a coffee.

I’m available on Skype: danielmcpherson
Email: daniel@zevenseas.com
Twitter: http://twitter.com/danmc

Hope to see you there!

Another Approach to Twitter for Teams

I just had a chat to Chris Pettigrew from ICS Solutions in the UK, part way through the conversation he mentioned that he had remixed our TeamTalk solution. Strangely I hadn’t come across it, but was cool to see someone else pick up the idea and put their own spin on it.

The re-mix was to re-write it as a “Sandboxed” solution (http://www.lifeinsharepoint.co.uk/sptwitter-internal-twitter-application-for-teams/), and he has dropped it up on CodePlex here: http://lifeinsharepoint.codeplex.com/releases/view/47786 

All we need now is for:

  1. Someone to take on the challenge and build out a Silverlight version
  2. Someone else to build out a full desktop client using the managed Client OM.

Then we would be well on our way to demonstrating each of the approaches available to developers when they set out to build a SharePoint Solution. That would be cool.

Thanks for the remix Chris, and next time: daniel@zevenseas.com

Driving User Adoption…Socially | SharePoint and Badges

This post was recently featured on EndUserSharePoint and I’m reposting it here.
http://www.endusersharepoint.com/EUSP2010/2010/07/20/driving-user-adoption%e2%80%a6socially-sharepoint-and-badges/

I recently presented a session titled “How to be more Social” at the SharePoint Australia and New Zealand conferences. The basic premise was to talk about some of the experience I picked up helping large organisations do better Knowledge Management through “Social Computing”. It’s things like http://demo.zevenseas.com.

As the events got closer, I decided I’d include something a little “out there”, something I’ve yet to see an organisation adopt, but which I think could make a difference to user adoption. To my surprise, it was probably the section of my session that got the most traction, and so I wanted to follow it up here.

The Problem

The biggest challenge an organisation faces during the roll out a new solution is not the technology. The technology is always the easy bit. The difficult bit is the difficult bit is the people. There’s just something about us psychologically that means we are resistant to change. I see this in myself, catching moments every now and then where I get annoyed at SP2010 for no reason other than the fact that it has changed, even when, in most cases, its a change for the better.

To put it another way, there is no product feature or technical innovation which will make overcoming our innate psychological predisposition against change easier to overcome. Further, exactly how you should go about overcoming this resistance is all art and no science. User adoption remains one of the biggest challenges we face, just ask Microsoft what percentage of their SharePoint licenses are actually deployed.

Badges

This is why I like the concept of “Badges”, it plays on another innate psychological predisposition, our desire to collect things, and our need to be rewarded. Badges provide a way of rewarding people for using the solutions you build in a constructive and beneficial way, and people are motivated to use your solutions in this way in order to collect all the badges. Its a positive feedback loop, its bringing “game” based elements to your intranet.

Before you write this off, and with it my blog, lets take a look at some examples.

The first example is a geeky one, the Xbox. Today, nearly every Xbox game comes with the concept of “Achievements” built in. Why do we have achievements in games? Because it motivates people to play a game more, and getting more game hours out of a title means more value for the gamer. It is a solution that publishers created in order to overcome a classic “user adoption” problem.

Stepping out of the geek world for a moment. How many people were in the Scouts? If you were, then how many badges did you collect and why did you collect them? Badges in the Scout movement reward people and keep them engaged, there is always a new knot!

What about the military? There are badges all over the place, they convey rank, they convey bravery, they motivate. And when you were at school, your teachers understood how valuable badges could be in promoting good behaviour and completing school work, anyone get a smiley face stamp? You see we have always loved badges, its part of the human condition.

Heading back to the geek world, its now rare that a new mainstream site will launch and become successful without the integration of some sort of “game” based elements. The best recent example of this is Foursquare. The designers of the solution wanted people to check-in their locations on their phones, allowing them to see if friends are nearby, and be offered deals for frequenting nearby vendors. To encourage people to “check-in”, they introduced both the concept of becoming a “Mayor” and lots of badges. The person with the most check-ins at a certain location became the mayor, complete with leaderboard, and by doing different types of check-ins, you collected badges. What happened? People started competing, and the number of check-ins went through the roof. They solved their user adoption problem because people were encouraged and motivated to use the solution in exactly the way it was intended.

To me, all of this says that badges can work for SharePoint too. More specifically, applying the concept of badges to our solutions can give us just one more tool in the kitbag of user adoption techniques and strategies. So I built a proof of concept.

How does it work?

The coolest new Social feature in SharePoint is, without doubt, the Activity Stream. This is basically SharePoint’s version of the Facebook newsfeed, providing you with a list of (nearly) all the interaction a user has with SharePoint. Tag a document, it goes in your activity feed. Update your profile, it goes in your activity feed. Rate a blog post, it goes in your activity feed.

This is exactly the sort of information we need to build a badge system. People updating their profile is a good thing, and they should be rewarded for ensuring that that information is up to date. In this case, rewarding them comes in the form of a “Autobiographer” badge, a gold badge, which is displayed on their “MySite” profile.

The below diagram shows a users “My Site” before they have collected any badges:

image

If we now go and edit the users profile, we should see it added to their Activity Stream on the left, and at the same time, see a new badge appear on the right.

image

In this case its a silver badge, but you can also create Gold and Bronze. Hovering over the badge reveals more information about it.

image

To setup these rules, I created a very basic rules engine. Essentially it just counts the number of times a particular Activity appears in a persons stream, then when you go over that number, you get the badge.

image

We are currently working on a more sophisticated model which provide for more possibilities.

Summary

In summary, I firmly believe that badges have enormous potential. Driving adoption has always been, and continues to remain, the biggest challenge facing those looking to realise maximum business value from their investment in software based solutions. Frankly, we need all the help we can get.

If you are interested in badges, and think it could make a difference to SharePoint in your organisation, drop me an email daniel@zevenseas.com. I love talking about this stuff!

Further Reading:
Check out Badges and Point on http://www.stackoverflow.com
Coding Horror (the developer behind Stack Overflow): http://www.codinghorror.com/blog/2009/03/the-worlds-largest-mmorpg-youre-playing-it-right-now.html

Career : Are you the Best In India? SharePoint Designer, SharePoint Developer and .NET MVC guru

We’re putting together a fantastic team here in Pune, India. I’m really enjoying heading to the office each day knowing that its going to be filled with tough technical challenges, tech talk, and of course, Chai and Pakora. We’ll be making some more announcements about just what I’ve been doing here over the coming weeks, so stay tuned.

With that said, there is always room for one more. Right now we are looking for the best in India at SharePoint Design, SharePoint Development and .NET MVC.

Putting it simply, zevenseas offers an environment where you’ll be challenged everyday, where you have the opportunity to work on cool projects, on the latest technologies, and most importantly, where you will learn and grow with people you enjoy working with. We are all as enthusiastic as you are, and in it for the experience.

 

While enthusiasm is important to us, please only send your resume if:

Developer

  1. You have more than 2 years experience with SharePoint Technologies.
  2. You are a C-Sharper
  3. You are in Information Technology because you love it and can prove it!
  4. You are a great communicator, and a team player.

Designer

  1. You have significant experience applying creative designs to SharePoint Sites
  2. You love the possibilities presented by Javascript
  3. You are a designer because you love it and can prove it!
  4. You are a great communicator, and a team player!

MVC Guru

  1. You have significant experience building solutions according to MVC patterm
  2. You have more than 2 years experience with .NET technology
  3. You are a C-Sharper
  4. You are in Information Technology because you love it and can prove it!
  5. You are a great communicator, and a team player.

If this is you, then please send your resume to daniel@zevenseas.com or skype: danielmcpherson or twitter @danmc we’d be happy to buy you a coffee, a chai or host you at our office where you can meet the team.

SearchCoder updated for SharePOint 2010

I finally got around to publishing an updated version of SearchCoder, one that supports SharePoint 2010.

DOWNLOAD

SearchCoder is a tool we put together to help developers write, test and interrogate the SharePoint Search Engine. It is comprised of two things:

1) A UI that lets you write the SQL Search Queries via a UI

image[5]


2) An object model that lets you write the SQL Queries through .NET objects

Both tools are in Beta, and they work pretty well. We know of a couple of bugs in the more complex queries and given some of the work we are doing here, hoping to spend some time squashing them. We recently added support for doing some basic query performance testing, including via the web services. We are also looking at adding support for viewing the Change Log.

Stay tuned.

Actually, there was very little to do, I just had to modify the from statement so that instead of a basic query looking like this:

SELECT Title, Rank, Size, Description, Write, Path
FROM portal..scope()
 
ORDER BY "Rank" DESC

It looked like this:

SELECT Title, Rank, Size, Description, Write, Path
FROM Scope()
 
ORDER BY "Rank" DESC

Note the small change in the “FROM” statement, curious as to what prompted this change, and just how many apps around the world will break because of it!

DOWNLOAD

TunnelPoint and Produshare Web Cast by SharePointDevWiki.com

If you have been waiting for a super easy way to take a look at TunnelPoint and Produshare then you finally have a way to do it! (I cant believe I hadn’t done this before).

Jeremy was kind enough to interview me on his SharePointDevWiki.com WebCast series, so check it out here: http://www.screencast.com/users/jthake/folders/SharePointDevWiki.com%20Webcasts/media/c847d948-d580-49f7-bdad-11a98a18f59f

Thanks Jeremy:
zevenseas answer to the SharePoint App Store - webcast

And if you are a developer with a solution, drop me an email: daniel@zevenseas.com

Work in progress, but we are running #SharePoint2010

Just wanted to let you know that we went live with SharePoint 2010 on our www.zevenseas.com site a couple of weeks ago. We are strong believers in “Eating our own dogfood”, if you say you are a SharePoint’er, then I think you need to practice it too.

We also moved to a cleaner, crisper brand, with a new logo that looks like this:

image

Let us know what you think!

We will be migrating across our blogs, though that is going to take a little time, as we need to preserve that Google Juice and the URL’s are CKS:EBE enhanced. Will need to work on a migration strategy. At that point, we will also implement our soon to be release Blog Extensions for SharePoint 2010, stay tuned and let me know at daniel@zevenseas.com if you want to beta test.

Thanks all for reading, going to be a great 2010!

How to bootstrap JQuery on every SharePoint page, even in the Sandbox

I’ve been doing a lot of work in the sandbox over the last few days, not all of it stress-free, but that is for another post. Something I wanted to be able to do was bootstrap a javascript library, for example JQuery, onto every page in the site. Outside the sandbox of course, there are a few ways to do this, however inside it your options are limited.

After much research, help from Wouter van Vugt (and SharePoint Overflow) I have the solution and now, the blog post too.

Solution

First, as described by Jan Tielens over here, outside the sandbox there are a number of ways of achieving this, specifically:

  • Adding a Script reference to the Master Page

    Not a solution for me because I didn’t want to overwrite the MasterPage as part of my feature activation.

  • Use a Delegate Control (e.g. the AdditionalPageHead)

    Not a solution for me because Delegate Controls are not permitted in the Sandbox.

  • Dynamically through code, e.g. in a Web Part

    Not a solution for me because I wanted the script library available on ALL pages.

    With SharePoint 2010 there one more technique at your disposal, thanks Wouter for pointing it out to me. This hint then led me to Jan’s post. Its a new type of “CustomAction” that can be included inside a feature along with a “ScriptSrc” attribute which can point to a Javascript library. Eureka! I yelled, and then fell back to earth when I discovered that it pre-appends the SharePoint Hive path to all locations you configure, making it no use to me inside the Sandbox.

    Reading Wouters comment more carefully on SharePoint Overflow, I noted that he actually suggested a variation of this custom action, one that allows you to insert a script block instead. I shouted Eureka! again.

    Not content with just being able to add my own snippet of Javascript this way, I was sure there would be a way to adapt this to dynamically adding a reference to JQuery. There was, and here it goes:

    1. First, create your new SharePoint project, and set it to deploy to the Sandbox.

    image

    2. Add a new module to the project, this is where your CustomAction will be created. If you want to deploy your own JS library you can replace the Sample.Txt file with your *.JS and deploy it to the site. Otherwise you can delete it and reference any other JS Library.

    image

    3. Now we need to insert the ScriptBlock which is where all the magic happens. I have added comments to describe what happens. This script should be inserted immediately below the:

     

    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">

     

    <CustomAction
        Location="ScriptLink"
        ScriptBlock="
            //Function that Dynamically Loads the Javascript
            function loadScript(scriptSrc, callbackFunction) {
              //Gets a reference to the Head section, where the Script tage will be inserted
              var headSection = document.getElementsByTagName('head')[0];
     
              //Creates a new Script tag
              var script = document.createElement('script');
              script.type = 'text/javascript';
     
              //Sets the source for the script tag to our external library
              script.src = scriptSrc;
     
              // most browsers
              script.onload = callbackFunction;
     
              // Fix to ensure support for IE 6-7
              script.onreadystatechange = function() {
                  if (this.readyState == 'complete') {
                    callbackFunction();
                  }
              }
     
              //Adds the section to the header
              headSection.appendChild(script);
            }
     
            //Function to test that JQuery has loaded successfully
            //This should be replaced with your own function calls
            function runScript() {
                $(document).ready(function() {  
                alert('jQuery is loaded!!'); });
            }
     
            //Important, this ensure the scripts execute after SharePoint has done everything it needs to. 
            _spBodyOnLoadFunctionNames.push('loadScript(\'http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js\', runScript)'); 
        " Sequence="101">
    </CustomAction>


    In this example we are inserting JQuery from http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js

    3) After completing the above step, you are ready to go. You now simply need to deploy your solution, and then refresh your home page. If everything worked correctly you should get something like the below.

    image

    I have packaged up my complete solution, and its available for you to download, grab it from here:
    http://www.zevenseas.com/go.aspx?ScriptInTheSandbox=Download

     

  • Introducing Link Conductor for the SharePoint 2010 Sandbox

    I’ve just completed our first true “Sandboxed” solution for SharePoint 2010**, its an updated, and improved version of the Link Conductor.

    What does it do? Well, in a nutshell, it provides you with a simple way to create a permanent URL which can then redirect to anywhere you like. It’s a little bit like a URL shortening service. We use it across our blogs, so that when we include a link to a product, or information page, we can ensure it always points to the latest information, without the need to go back and update all those references.

    The Microsoft web site has a similar service, you might have noticed them linking to various pages using a URL that looks something like this:
    http://go.microsoft.com/fwlink/?LinkId=XXXXXX

    ** While we previously released “TeamTalk”, that only used the Javascript Object Model.

    How do I get it and how does it work?

    Both excellent questions. You get it by downloading it from here (via our excellent Link Conductor Tool):
    http://www.zevenseas.com/go.aspx?LinkConductor2010=Download

    For more information about Link Conductor you can visit:
    http://www.zevenseas.com/go.aspx?LinkConductor2010=Information

    Note: The community version supports a maximum of 15 redirect pathways.

    Installation

    Once you have downloaded it, you install it like any other Sandboxed solution.

    1. Go to “Site Settings” in the root web of your Site Collection, and select “Solutions”.

    image

    2. Under the “Library” tab in the Ribbon, select “Upload Solution”.

    image

    3. Select the WSP from your filesystem, and upload it.

    image

    4. Once uploaded, you need to “Activate” it.

    image

    5. The final step is to then Activate the “Link Conductor” feature in the Site where you would like to host the solution. This is a “Web” scoped feature, so it can be done in the Root web, or any sub web. When inside the host, click on Site Settings –> Manage site Features.

    image

    6. Activate the “Link Conductor” feature.

    image

    7. You are now finished, to confirm it has Activated correctly, return to “Site Settings” and look for the following administration links:
    image 

    Usage

    There are two lists associated with the “Link Conductor” solution. One is responsible for defining the “Pathways”, that is the URL redirects and their destination. The other is responsible for storing any statistic gathered during the redirection process.

    Defining a new pathway

    To define a new pathway, follow the below steps:

    1. Under “Site Settings” click on the “Link Conductor Pathways” link, this will take you to the list where the pathways can be defined. Click on the “Add new item” link.

    image

    2. Complete the fields as required, for example, the below picture illustrates a pathway which would redirect people to the SharePoint homepage.

    image

    3. Save the pathway, and you are now done. There is a “Test” link which you can click on to test your pathway, and it also provides you an easy place to copy the link from. Clicking on the link should take you to the Microsoft SharePoint homepage, after a brief pause on a “Redirect” page.

    Reviewing the statistics

    Whenever a redirect occurs, a statistic is written away to the “Link Conductor Statistics” list. You can review this by doing the following:

    1. Under “Site Settings” click on the “Link Conductor Statistics” link. This will take you to a list that displays all of the redirects that have taken place, and any errors. You can create views to filter and sort based on your requirements. In the below screenshot, you can see the redirect we just performed.

    image

    2. Viewing the item also reveals the “Referrer”. Useful for providing specific URLs during specific campaigns.

    image

    Anonymous Configuration

    The solution has been designed to work with “Anonymous” authentication, however to get the statistics working correctly, you will need to make a small adjustment to the Statistics list permissions. Follow the below instructions:

    1. Open the “Link Conductor Statistics” list, and then under the “List” tab in the ribbon, select “Settings” and then “List Permissions”.

    image

    2. Click on “Stop Inheriting Permissions”

    image

    3. Click on “Anonymous Access”

    image

    4. Check the “Add Items” option:

    image

    You will now be able to track statistic for redirect requests occurring anonymously.

    So, take a look, and let us know what you think about it, as always, I’m at daniel@zevenseas.com

     Next >>

     
     
     

    © 2009 Community Kit For SharePoint