20
OFF002 - Come riprogettare le attuali Farm Solution di SharePoint con il nuovo modello di App Fabio Franzini – SharePoint MVP

Come riprogettare le attuali farm solution di share point con il nuovo modello di app

Embed Size (px)

DESCRIPTION

How to convert WSP Solution to the new SharePoint App Model

Citation preview

OFF002 - Come riprogettare le attuali Farm Solution di SharePoint con il nuovo modello

di App

Fabio Franzini – SharePoint MVP

• SharePoint MVP

• Senior Consultant and Software Engineer

• MCT Trainer

• MCPD Web Applications, MCTS SharePoint 2010/2007

• Official Ignite Trainer for SharePoint 2013 & 2010 in Italy

• Over 10 years experience in IT as a software engineer

• Twitter: @franzinifabio

• Email: [email protected]

• Web: www.fabiofranzini.com

About Me

“SharePoint 2013 App Model Succinctly”SharePoint 2013 App Model Succinctly is a hands-on approach to

learning how to develop SharePoint apps.

Author Fabio Franzini introduces readers to the concepts that make

SharePoint 2013 simpler and easier to use than previous development

models.

You’ll learn to develop both on-premises and cloud applications in

Visual Studio 2013, then enable your apps to communicate with

SharePoint using the client-side object model (CSOM) or the

representational state transfer (REST) API

http://bit.ly/1ytzthl

Agenda

• Evolution in SharePoint Development

• SharePoint Remote API Intro

• CSOM / REST

• Convert WSP to APP

SP2007

WSP

SP2010

WSP

SP2013

App

Declar. App &

Workflow

Events

CSOM

_api

_api

Evolution in SharePoint Development

CSOM

New App Model

• Apps no longer live in SharePoint• Reduces the ramp-up time for those building apps (Don’t need to know/be as familiar with SharePoint “-isms”)

• Custom code executes in the client, cloud or on-premise• Easier to upgrade to future versions of SharePoint

• Works in hosted environments w/o limitations

• Apps communicate with SharePoint via REST / CSOM

• Apps are granted permissions to SharePoint via OAuth

• Acquire apps via centralized Marketplace

• Some Examples http://code.msdn.microsoft.com/officeapps

Kinds of Apps

Provision an Isolated sub web

on a parent web

Reuse web elements

(lists, files, out-of-box web

parts)

No server code allowed; use

client JavaScript for logic, UX

Server side code allowed

Any web stack allowed

Windows Azure + SQL Azure

provisioned invisibly as apps are

installed

JavaScript

Library

Silverlight

Library

.Net CLR

Library

Custom Client Code

Client

Server

_api is new alias for _vti_bin/client.svc

SharePoint 2013 Remote API

OData

Execute

Query

Programming using CSOM

Client.svc

Server OM

Content

database

JavaScript OM

Proxy

Managed OM

Proxy

Your C# and VB.NET Code

Your JavaScript Code

XML Request

XML Request

JSON Response

JSON Response

Browser

Managed Client

SharePoint Web Server

CSOM using Managed Code

CSOM using JavaScript

REST URLs in SharePoint 2013

• CSOM URLS can go through _api folder

• Simplifies URLs that need to be built

• Removes client.svc file name from URL

• You can replace this URLhttp://contososerver/_vti_bin/client.svc/web

• With this URLhttp://contososerver/_api/web

Mapping Objects to Resources

• Example REST URLs targeting SharePoint sites

• _api/web/lists

• _api/web/lists/getByTitle('Announcements')

• _api/web/getAvailableWebTemplates(lcid=1033)

REST Query from Managed Code

• Use the HttpWebRequest and HttpWebResponse objects

• Query XML using XDocument.Descendants

REST Query Using JavaScript & jQuery

Office 365 «LIMITATIONS»

• FARM SOLUTIONS: NO!• No server-side object model• No feature receivers• No timer jobs• No event receivers• No custom fields• No site definitions• No custom web parts

• SANDBOX SOLUTIONS: YES, partially …• We cannot use code in Sandbox solutions

• APPS: YES!• This is the suggested model

Convert WSP to APPFarm solution artifacts App model/remote code artifacts

Web parts App parts

Event receivers Remote event receivers

Application pages Pages in Provider-Hosted Apps

Site definitions Web templates in Sandbox Solutions

Custom fields Client Side Rendering templates

Custom user controls App parts, Javascript in page

Custom ribbon controls/custom actions The same, but with Apps pages/Javascript scripts

Timer jobs Scheduled processes in Azure

Branding solutions The same, but without server-side code

Feature receivers App Events

Workflows Declarative workflows in Apps

Custom authentication NOTHING

Run with elevated privileges App-only authentication

Powershell scripts Powershell scripts with CSOM

Demo

Q & A

Contatti OverNet Education

OverNet Education

[email protected]

www.overneteducation.it

Tel. 02 365738

@overnete

www.facebook.com/OverNetEducation

www.linkedin.com/company/overnet-solutions