28
SharePoint 2013 – Fun with SharePoint Social, CSOM and Windows 8 Joris Poelmans SharePoint Architect RealDolmen

Fun with Social, Windows 8 and Javascript

Embed Size (px)

Citation preview

Page 1: Fun with Social, Windows 8 and Javascript

SharePoint 2013 – Fun with SharePoint Social, CSOM and Windows 8Joris PoelmansSharePoint ArchitectRealDolmen

Page 2: Fun with Social, Windows 8 and Javascript

About meWork at RealDolmen

Technical lead and product manager

SharePoint Server MVP since 2005

Active in Belux Information Worker User Group –

www.biwug.be

Blog: http://jopx.blogspot.com

Twitter: @jopxtwits

Page 3: Fun with Social, Windows 8 and Javascript

3

Session Objectives• View what’s new with Social in SharePoint 2013

• Show how to develop a social app ...

• ... But mainly have some fun with Javascript, CSOM and the SharePoint 2013 social API

Session Objectives and Takeaways

Page 5: Fun with Social, Windows 8 and Javascript

5

• What are we going to build?

• What is Social?

• Client Side Object Model (CSOM) Overview

• Win RT Overview

• Roadblocks and common mistakes

Agenda

Page 6: Fun with Social, Windows 8 and Javascript

DemoWhat are we going to build?

Page 7: Fun with Social, Windows 8 and Javascript

What is Social in 2013?… it’s not about wasting company time

Page 8: Fun with Social, Windows 8 and Javascript

It’s all about socialShare

MicrofeedsLikesRatingsFeedsReputationMentions

Page 9: Fun with Social, Windows 8 and Javascript

9

• Microfeed is open in nature – but possible to restrict view in community sites

• @Mentions is powered by users in profile database

• My Site should be present

I share therefore I am

Page 10: Fun with Social, Windows 8 and Javascript

It’s all about socialShare

LikesRatingsFeedsReputationMentions

Stay up to date

FollowsSitesUsersDocumentsRecommendsCommunity site

Page 11: Fun with Social, Windows 8 and Javascript

11

• Newsfeed shows you updates on social activities for items and people you are following

• People posts, profile changes, changes on followed documents, items tagged with followed tags, mentions, likes, company feed

• Recommended Content web part driven by Search Analytics provides follow suggestions

• Community site• Discussion boards gain functionality with

reputation settings, best answer roll-up, report abuse, etc …

Stay up to date

Page 12: Fun with Social, Windows 8 and Javascript

It’s all about socialShare

LikesRatingsFeedsReputationMentions

How it works

MicrofeedAppfabricUser Profiles

Stay up to date

FollowsSitesUsersDocumentsRecommendsCommunity site

Page 13: Fun with Social, Windows 8 and Javascript

13

• Microfeed list• It’s about the GUIDs• Consolidated View web part reads from AppFabric Cache

• AppFabric• Used by Distributed Cache service (Velocity)• Drives social and token caching• Fast State memory – not everything is persisted (e.g.

document activities)

How it all works

Page 14: Fun with Social, Windows 8 and Javascript

CSOM … or the long version – the Client Side Object Model

Page 15: Fun with Social, Windows 8 and Javascript

15

Allows development that runs outside of the SharePoint Server

First introduced in SharePoint 2010

Main investments in 20131. Client.svc is extended with REST capabilities and

implemented in accordance with oData protocol2. New APIs for SharePoint Server functionality – User

Profiles,Search, Taxonomy, Feeds, …

CSOM

Page 16: Fun with Social, Windows 8 and Javascript

16

CSOM in SharePoint 2010

Page 17: Fun with Social, Windows 8 and Javascript

17

CSOM in SharePoint 2013

Page 18: Fun with Social, Windows 8 and Javascript

18

We still have our old friends• Microsoft.SharePoint.Client

• Microsoft.SharePoint.ClientRuntime

… but with some new buddies• Microsoft.SharePoint.Client.DocumentManagement

• Microsoft.SharePoint.Client.UserProfiles

• Microsoft.SharePoint.Client.Publishing

• Microsoft.SharePoint.Client.Search

• Microsft.SharePoint.Client.Taxonomy

CSOM in SharePoint 2013

Page 19: Fun with Social, Windows 8 and Javascript

19

Still works the same way• Create Context

• Build Request

• Execute Query

… but with extra classes• SocialFeedManager – Get Feeds

• SocialFollowingManager – Get Followed Content

• SocialActor – User,site,document or tag

• SocialPost – Text, attachment, likerInfo

CSOM in SharePoint 2013

Page 20: Fun with Social, Windows 8 and Javascript

20

CSOM in SP2013 – code sample//create the client contextClientContext cc = new ClientContext("http://portal.contoso.com");cc.Credentials = CredentialCache.DefaultCredentials;

//prepare your querySocialFeedManager sfm = new SocialFeedManager(cc);SocialFeedOptions feedOptions;feedOptions = new SocialFeedOptions();ClientResult<SocialFeed> feed = sfm.GetFeed(SocialFeedType.News, feedOptions);

//execute querysfm.Context.ExecuteQuery();

Page 21: Fun with Social, Windows 8 and Javascript

Something about Win RT

Page 22: Fun with Social, Windows 8 and Javascript

22

New application architecture for Windows 8 OS

Native support for x86 and ARM architectures

C#; VB.NET and Javascript (also C++/CX)

New app model with focus on security and stability

Win RT Overview

Page 23: Fun with Social, Windows 8 and Javascript

23

Learn Javascript & JQuery

HTML5/CSS3 supported

New controls in WinJS - http://msdn.microsoft.com/en-us/library/windows/apps/hh465453.aspx

Able to reference Windows Runtime Component libraries (C#,VB, or C++)

Some things work differently – no alert, prompt, moveBy, moveTo, Resize, …

Win RT & Javascript

Page 24: Fun with Social, Windows 8 and Javascript

24

Script “injection” is not allowed“toStaticHTML” filters HTML injected into the pageAffects the following properties and methods

createContextualFragmentinnerHTML and outerHTMLinsertAdjacentHTMLpasteHTMLdocument.write and document.writelnDOMParser.parseFromString

Also affects some Elements, Attributes, and CSS properties

Making HTML safer: details for toStaticHTML (Windows Store apps using JavaScript and HTML) (Windows) - http://msdn.microsoft.com/en-us/library/windows/apps/hh465388.aspx

Win RT & Javascript

Page 25: Fun with Social, Windows 8 and Javascript

DemoLet’s build it from scratch ... (but not completely off course )

Page 26: Fun with Social, Windows 8 and Javascript

26

ReferencesCode samples and walkthrough will be posted on http://jopx.blogspot.com

How to: Read and write to the social feed using the .NET client object model in SharePoint 2013http://msdn.microsoft.com/en-us/library/jj163977(v=office.15).aspx

Creating Windows Runtime Components in C# and VBhttp://msdn.microsoft.com/en-us/library/windows/apps/br230301.aspx

Walkthrough: Creating a simple component in C# or VB and calling it from JavaScripthttp://msdn.microsoft.com/en-us/library/windows/apps/hh779077.aspx

Page 27: Fun with Social, Windows 8 and Javascript

Thank You

Page 28: Fun with Social, Windows 8 and Javascript

Q & A