From Solutions to Apps - Moving to SP2013

Post on 23-Jan-2015

667 views 1 download

description

SharePoint Saturday NH talk on moving from SharePoint 2010 solutions to SharePoint 2013 apps - by @Bob1German and @SPDCP

transcript

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

From Solutions to Apps

Bob GermanDerek Cash-PetersonBlueMetal Architects

Moving to SharePoint 2013

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Agenda

• Apps Model Overview• App Access to SharePoint– RESTful Access– Client Side Object Model (CSOM)– Cross-domain Access– OAuth Access

• Other Topics

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Apps 101

HostWeb

AppLink orIFrame

REST orClient OM

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

App Hosting Options

HostWeb

App Web

SharePointHosted App

Provider or Auto-Hosted App

AppAzure

or other provider

HostWeb

App Web(optional)

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

App

HostWeb

AppWeb

• Auto-hosted apps are provisioned by Office 365 on app installation

• Pretty muchanything goes

• Access hostweb via Oauth

App Hosting Options

App Web• Provisioned by SharePoint on

app installation• No Server Code – period

(though you can leverage installed ASP.NET controls)

• May contain declarative, web-scoped features (lists, site pages, client script, images, css)

• Access host web via cross-domain library

Provider or Azure

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

App Isolation

AppAzure

or other provider

HostWeb

App Web(optional)

http://myserver/sites/myweb/

http://app12345/sites/myweb/

http://whatevs.com/somepath/

Different domain names leverage browsers’ same-origin policy

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

DEMONSTRATION

Isolated Application shows: - Client Side Object Model - Declarative features in App Site - Simple Client Web Part (“App Part”)

Chord Calculator

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

App Access to SharePoint

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Choosing an App Model

2010 Model• Reuse and backward

compatibility with existing solutions

• Full access to server OM– Nearly complete access to

everything in SharePoint– Well documented – MSDN,

many books, blogs, etc.

• Leverages SharePoint development skills

2013 Apps• App code is reusable in

SharePoint and Office• Better isolation – no more

leftover web parts and lists• App-level AuthN from Azure

or other provider• No dependency on User

Code Service• Leverages general web

development skills

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Choosing an Access Method

REST• Synchronous or

asynchronous in Javascript• Returns entities (e.g.

Contact, Task)• Easier access from jQuery–

no dependency on SP.JS

CSOM• Asynchronous only in

Javascript• Returns SharePoint objects

(e.g. List, ListItem)• Easier access from .NET

server side• Batched requests

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Choosing a Hosting Model

SharePoint Hosted• No server side code, period• Access to OOB SharePoint

web controls on the page• Able to store content on

customer’s SP infrastructure

Provider / Azure Hosted• Server-side code• Server is not subject to

cross-domain policy• More flexible data storage

(SQL Azure, etc.)

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Accessing Data with Client OMSharePoint Data

SharePoint API

Client.svc

Client Application

Client OM Proxies• .NET CLR• Silverlight• Javascript

OData(REST)

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

What’s New in CSOM

• User Profiles• Search• Taxonomy• Feeds• Publishing• Business Connectivity

Services

• Sharing• Workflow• E-Discovery• IRM• Analytics

So much more than simple site and list access!

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

DEMONSTRATION

Silverlight App w/Cross-Domain Policy• CSOM Cross-domain Access• CSOM File UploadWebcam Demo

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Representational State Transfer (REST)SharePoint Data

SharePoint API

Client Application

ServerApplication

Client Application

ADO.NET Data Svcs Client

JSON ATOM

WPF/WinForm/OfficeSilverlightJavaScript

JSON ATOM

/_api/

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Representational State Transfer (REST)

• Operations map to HTTP verbs– Retrieve items/lists GET– Create new item POST– Update an item PUT or MERGE– Delete an item DELETE– These apply to links (lookups) as well

• SharePoint rules apply during updates– Validation, access control, etc.

Derek
Need to add in extensions to REST.

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

URL Conventions• Addressing lists and items

List of lists /_api/web/lists

List /_api/web/lists(‘guid’)

List /_api/web/lists/getbytitle(‘Title’)

Items /_api/web/lists/getbytitle('listname')/items

Item /_api/web/lists/getbytitle('listname')/items(1)

Single column /_api/web/lists/getbytitle('listname')/items(1)/fields/getByTitle('Description')

Sorting ?$orderby=Fullname

Filtering $filter=JobTitle eq 'SDE'

Projection ?$select=Fullname,JobTitle

Paging ?$top=10&$skip=30

Inline expansion ?$expand=Project

− Presentation options

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

DEMONSTRATION

jQuery App with Cross-Domain LibraryImage Rotator

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Open Authentication

• Standard in use by dozens of public sites

• Similar to a valet key– App gives to a partly

trusted 3rd party– Grants limited access

• SharePoint grants theapp access on theuser’s behalf– No need to pass the

user’s credentials– SharePoint can limit the

scope of access

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

DEMONSTRATION

Azure-Hosted App with OAuthContacts Map

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Remote Event Receivers• Require a provider or Azure-hosted app• Uses Access Control Services (ACS) token

– Passed from SharePoint to remote web service– Web service can request a token to send back to SharePoint

• SharePoint calls a web service with the following methods:– ProcessEvent() – Synchronous– ProcessOneWayEvent() – Asynchronous

• List, ListItem, Web, and App level scopes• App Events – call AppEventReceiver.svc

– App Installed– App Uninstalling– App Upgraded

• Caveats:– No guaranteed delivery– Watch latency and performance on synchronous events

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

Workflow

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

ResourcesSharePoint 2013 Development• Host webs, Web apps, and SharePoint Components: http://bit.ly/R3tUiO• Data Access Options for Apps in SharePoint 2013:http://bit.ly/Peeof9 • OAuth and SharePoint 2013: http://bit.ly/Ny1jNd • SharePoint 2013 Workflows: http://bit.ly/PEJCze • Programming using the SharePoint 2013 REST service: http://bit.ly/LR66Ju• Programming using the SP 2013 CSOM (JavaScript): http://bit.ly/OJUARG Contact Us• Bob German - @Bob1German

http://msdn.microsoft.com/BobGermanBobg@bluemetal.com

• Derek Cash Peterson - @SPDCPhttp://spdcp.com Derekcp@bluemetal.com

@Bob1German • bobg@bluemetal.com@SPDCP • derekcp@bluemetal.com

was made possible by the generous support of the following sponsors…

And by your participation… Thank you!