Accessing SharePoint Online with the SharePoint API is quite easy. You just have to create a SharePoint client context using the SharePoint Client assembly.
Suppose you cannot reference this SharePoint Client assembly. For example if you want to create a CRM Online Plug-In. These plug-ins live in a sandboxed environment where no external assemblies are allowed. How can you access SharePoint Online? There are several blog post about this topic, but the examples didn’t work for me (Luc Stakenborg and Wictor Wilén).
Based on these blog post, my dear colleagues Rene Brauwers and Wesley Bakker and logging in 1000 times at my demo tenant and analyzing the Fiddler logs I came to this solution.
The motion10 SharePoint Twitter Status Notes Control is a study project that extends the default status notes control of SharePoint. The study project tried to proof to send the status text to other social media while the default SharePoint status update functionality stays the same. The study project sends the status message to Twitter, but now it’s easy to create code that sends messages to other social media, like LinkedIn, Yammer or Facebook.
- motion10 SharePoint Twitter Status Notes Control
The project is available at CodePlex. The project contains the following elements:
- Hammock for Rest – for communication and authentication (OAuth) with Twitter.
- Diplo.Twitter – C# Library for easy authentication and sending the status update.
- The Diplo.Twitter C# Library is extended to save and load Twitter Credentials from SharePoint User Profile Service Application.
- A feature that will create two persisted objects > the Twitter Consumer Keys.
- A feature that will register a delegate control.
When the delegate control is loaded, the OnOnit method will check if the Twitter credentials are known in the Secure Store. If not then the connect button is shown. When the user hits te connect button, the user will be redirected to authenticate at Twitter. After that the user is redirected back and the Token and TokenSecret are saved in the Secure Store. After that the user is authenticated to send tweets.
I’am creating a feature that setups the search settings for a project. The feature creates some content sources and scopes. I discoverd that there is no method for adding a rule type ‘Content Source’ on the Scope. The following create rule methods are availble:
I expected a method like ‘CreateContentSourceRule’, like the user interface offers. Using reflector I dissabled the page page and found out that a new Content Source rule is created using the CreatePropertyQueryRule:
scope.Rules.CreatePropertyQueryRule(ScopeRuleFilterBehavior.Invlude, managedProperties.[“ContentSource”], “yourconcentsourcename”);