2014 sharepoint saturday melbourne apps or not to apps

62
Gold Sponsors Bronze Sponsors Silver Sponsors SharePoint and Office 365 dev : to apps or not to apps (v3) #SPSMEL

Upload: gilles-pommier

Post on 18-Nov-2014

124 views

Category:

Presentations & Public Speaking


1 download

DESCRIPTION

2014 SharePoint Saturday Melbourne Apps or not to Apps

TRANSCRIPT

Page 1: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Gold Sponsors Bronze SponsorsSilver Sponsors

SharePoint and Office 365 dev : to apps or not to apps (v3)

#SPSMEL

Page 2: 2014 SharePoint Saturday Melbourne Apps or not to Apps

All is Apps, let’s go !!

SharePoint and Office 365 dev : to apps or not to apps : v1

#SPSMEL

Page 3: 2014 SharePoint Saturday Melbourne Apps or not to Apps

… well ! It depends …

SharePoint and Office 365 dev : to apps or not to apps : v2

#SPSMEL

Page 4: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Where are we now ?

SharePoint and Office 365 dev : to apps or not to apps : v3

#SPSMEL

Page 5: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Who am I ?

Gilles PommierOffice 365 MVP, MCT and co-founder of SmartView http://[email protected]

SmartViewAgileSharePoint/Office 365Coaching/Training

Page 6: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Agile + SharePoint

Page 7: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Agenda

Apps model : all you need to knowComparison Apps vs. old WSPNew Wave of SharePoint Dev

Page 8: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Apps model : all you need to know

Page 9: 2014 SharePoint Saturday Melbourne Apps or not to Apps

SharePoint 2013 : everything is an App !

Page 10: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 11: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 12: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 13: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 14: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 15: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 16: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 17: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 18: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 19: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Add an app to your SharePoint Site

Page 20: 2014 SharePoint Saturday Melbourne Apps or not to Apps

App user experiences

Immersive full page app (aka SPA)At least one required in every app—landing page; can still use SharePoint chroming; lives in remote web for a cloud-hosted app

App PartLike a web part; hosted in an IFRAME (can point to content in remote web)

UI custom actions (declarative)

Page 21: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Evolution of SharePoint Development Solutions

2007

SharePoint

IIS

Code runs from GAC on same w3wp.exe as SharePoint web application

2010

SharePoint

IIS Sandbox

Code runs on SPUCWorkerProcess.exe or calls client.svc (CSOM)

-No code solution-

2013

SharePoint

IIS with _api App

Code runs outside of SharePoint but has trust to leverage capabilities exposed in _api

Page 22: 2014 SharePoint Saturday Melbourne Apps or not to Apps

SharePoint2007

SharePoint2010

SharePoint 2013/Office 365

Services (IIS, Apache, Other, …)

Services (Azure, IIS, Apache, Other…)

Services(Azure, IIS, Apache,Other, etc…)

SP2007 SP2010 SP2013

Declar. App & Workflow Events

Custom Code

Custom Code

CSOM

_vti_bin_vti_bin

_api

_api

Evolution of customizations in SharePoint

Page 23: 2014 SharePoint Saturday Melbourne Apps or not to Apps

But what has really changed !!??

Page 24: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Before/After

Page 25: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Developer Site

NapaµOffice 365 Development Tools

SharePoint-hosted App Provider-hosted App

Office 365 Development Environments

Visual StudioOffice Developer Tools

SharePoint Client Components

Page 26: 2014 SharePoint Saturday Melbourne Apps or not to Apps

App isolation: App web vs Host web

Apps live in their own isolated environment called the “app web”.The site in which they function is called the “host web”

http://app-7b0fe2bced5247.apps.contoso.com/555DE569-4083-4397-8714-668B91D9C7A9

APP1UID GUIDAPP1

Page 27: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Get remote events from SharePointUse CSOM/REST + OAuth

Provider-hosted AppBring your own server hosting infrastructureAutohosted AppWindows Azure + SQL Azure provisioned automatically as apps are installed

SharePoint Web

Your Hosted Siteincluding Azure

SharePoint Web

Azure lite

SharePoint-Hosted AppReuse web elements (lists, out-of-box web parts). Client side technologies and declarative workflows. No server-side code.

Hostweb

App Web(from WSP)

Cloud-hosted Apps

SharePoint app hosting

Page 28: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Be careful …

Autohosted Apps Preview program has ended– 05/16/2014

http://blogs.office.com/2014/05/16/update-on-autohosted-apps-preview-program/

Page 29: 2014 SharePoint Saturday Melbourne Apps or not to Apps

How apps run

SP Farm Other Platform

CSOM/OData

OAuth

Page 30: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Demo : Provider Hosted apps

Project structureMVC SharePoint TemplateAzure deployment

Page 31: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Accessing SharePoint data remotely

.NET Managed client object model (CSOM) JavaScript client object model (JSOM) REST endpoints with OData

Page 32: 2014 SharePoint Saturday Melbourne Apps or not to Apps

.NET Managed client object model (CSOM) example

Page 33: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Differences between C# and JavaScript

C# JavaScript

using Microsoft.SharePoint.Client; ExecuteOrDelayUntilScriptLoaded(initFunc, “sp.js”); …or…$(document).ready(initFunc);

using (ClientContext context = new ClientContext(absoluteUrl))using (ClientContext context = TokenHelper…( ))

var context = SP.ClientContext.get_current();var context = new SP.ClientContext(relativeUrl);

string title = web.Title; var title = web.get_title();

context.Load(oList, list=>list.Title, list=>list.Created);

context.load(oList, ‘Title’, ‘Id’);context.load(oListColl, ‘Include(Title, Id)’);

context.ExecuteQuery();context.ExecuteQueryAsync();

context.executeQueryAsync(onSuccess, onError);

Value types: StringCollection Value types: string[], NaN

Automatic FormDigest handling Manual FormDigest handling

Issues creating RoleDefinitionBindingCollection’s

Page 34: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Comparison Apps vs. old WSP

Page 35: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Apps (.App) vs solution packages (WSP)

Apps Sandboxed WSP No Code (*)

Full trust WSP(on prem only)

Where does server-side code run? Anywhere but farm

Farm (User Code Service) Farm (w3wp.exe)

Scalable Highly Limited Based on farm

Who installs and removes Users Site collection admin Farm admin

Supported in SP2013 Yes Yes Yes

SharePoint Online compatible Yes Yes No

Azure-hosting compatible Yes No No

Requires local farm for developers No Yes Yes

Remote deployment and debugging from Visual Studio Yes No No

*SandBox Solution with code is deprecated in SP 2013 & O365

Page 36: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Why Apps?

Page 37: 2014 SharePoint Saturday Melbourne Apps or not to Apps

When to use the new SP2013 App Model?When your SharePoint customizations use: Full screen interfaces (SPA) App Parts Workflows and Remote Event Receivers Data from other systems Custom Ribbon/Menu Actions Custom Lists/Fields/Views/etc Capabilities offered by your host of choice

Page 38: 2014 SharePoint Saturday Melbourne Apps or not to Apps

When NOT to Use the New SP2013 App ModelJust some examples:

Web templates

Deploying assets to /_vti_bin or /_layouts

Connectable App Parts

Reusable workflow actions for farm

Reusable custom Web Services

Page 39: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Gray Areas

= Things that you can do in an app for SharePoint, but perhaps there are:

limitations or alternative ways to do it

Page 40: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Branding

Design ManagerFarm Solution

Sandboxed Solution

app for SharePoint

Recommendedto evaluate this!

All three of these are still traditional ways to change look and feel of SharePoint

SharePoint Designer

Maybe… through event receivers, PowerShell, and more

wsp

Page 41: 2014 SharePoint Saturday Melbourne Apps or not to Apps

MSDN : how to deploy a custom theme, apps ?

Page 42: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Demo : Branding with Apps

• Branding with apps is possible (http://www.youtube.com/watch?v=wtQKjsjs55I)

• Need “full control” for the site collection (cannot be deployed on Office Store)

• Provisioning pages, layout, etc to site collection galery … must be done by CSOM

Page 43: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Timer Jobs

Not directly supported in an app for SharePoint

Alternatives: 1) New Windows Azure WebJob feature2) Console App3) Farm Solution (on premises only)

Page 44: 2014 SharePoint Saturday Melbourne Apps or not to Apps

External data

BCS supports only OData connections in the App Model

Alternatives: 1) Create your own OData wrapper

outside of the app for SharePoint

2) Write code instead of using BCS

Page 45: 2014 SharePoint Saturday Melbourne Apps or not to Apps

“To App or Not To App” ?

SharePoint 2013 (on prem) DOES support:

So why use the App Model?It is the recommended approach for development for SP2013 and beyond!

Farm Solutions compiled for SharePoint 2013

Sandbox Solutions compiled for SharePoint 2013

Farm Solutions compiled for SharePoint 2010

Sandbox Solutions compiled for SharePoint 2010

Page 46: 2014 SharePoint Saturday Melbourne Apps or not to Apps

“To App or Not To App” (Decision Matrix)

1) Out of box SP capabilities?

2) App already exists?

3) Lite customization tools?

4) App Model? (with Azure,…)

5) Only as a last resort – farm/sandbox solution?

Page 47: 2014 SharePoint Saturday Melbourne Apps or not to Apps

New Wave of SharePoint Dev

Page 48: 2014 SharePoint Saturday Melbourne Apps or not to Apps

SharePoint 2013 / O365 developer = Web Developer

Page 49: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Before : Is there any SharePoint Developer available ?

Page 50: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Old WSP talksDid you check your code with

SPDisposeCheck Tool ??

Page 51: 2014 SharePoint Saturday Melbourne Apps or not to Apps

SP 2013 dev talks now are more …

Angular JS ?Knockout JS ?

Breeze ?TypeScript ?

Page 52: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Demo :javascript – angular js – Office 365 API …

http://dev.office.com & http://officeams.codeplex.com

Page 54: 2014 SharePoint Saturday Melbourne Apps or not to Apps

New SharePoint client components redistsUpdated client components for SharePoint server 2013 SP1New client components for SharePoint onlineBoth include portable libraries for use in Windows Store apps

New APIs available in Office 365 and on-premisesSite collection managementSpecify content type IDsAlternateCssUrlSiteLogoUrland More

Site provisioning and branding solution pack

New SharePoint remote APIs

Page 55: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Sample Site Collection management (RunWithElevatedPrivileges is back ? )

Page 56: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Further reading

Andrew Connell : My thoughts on the SharePoint App Model, Office 365, SharePoint Store and the Business of SharePoint Apps TodayDoug Ware : The SharePoint 2013 App Model is better than FarmBjørn Furuknap : SharePoint 2013 App Model – The Jury is BackJeremy Thake : Migrating Solution Packages to SharePoint 2013 Apps…really?Chris O'Brien : SP2013 host web apps: provisioning files (e.g. master pages) to the host web

Page 57: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Takeaway

Futur of development model for SharePoint and O365 is Apps

SharePoint developer is changing to become Web Developer (javascript/jquery/html)

Use apps whenever it’s possibleSome developement cannot be done with apps, but there are alternative solutions

YES, you can do AngularJS with SP Farm WebPartFarms & SandBox solutions are still used … for now

Page 58: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Gold Sponsors Bronze SponsorsSilver Sponsors

Thanks

Page 59: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Gold Sponsors Bronze SponsorsSilver Sponsors

Page 60: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Deployment

Model Office 365 Permissions On-Prem Permissions

SharePoint

Sandbox YES YES

Full Trust NO YES

SharePoint Hosted

YES OAuth via ACS YES High-Trust (S2S)

Remote

Provider Hosted• Developer

hosts app• Could be in

Azure

YES OAuth via ACS YES High-Trust (S2S)

Auto-Hosted• App can deploy

website and SQL Azure db

• Hosted in Office 365 Azure Cloud

YES OAuth via ACS NO

Page 61: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Compare customization models

Full trust WSP Sandboxed WSP Apps

Where does server-side code run? Farm (w3wp.exe) Farm (User Code

Service) Anywhere but farm

Scalable Based on farm Limited Highly

Who installs and removes Farm admin Site collection admin Users

Supported in SP2013 Yes Yes Yes

SharePoint Online compatible No Yes Yes

Auto-hosting compatible No No Yes

Requires local farm for developers Yes Yes No

Remote deployment and debugging from Visual Studio No No Yes

Page 62: 2014 SharePoint Saturday Melbourne Apps or not to Apps

Hosting ComparisonSharePoint Hosted Cloud Hosted

App Scope SharePoint Site Site or Tenancy

Architecture Web Site Can be Multi-Tenant App

Developer Skillset SharePoint + HTML/JS

Full Stack

UI Technologies SharePoint + HTML/JS

Any Web Stack

Server Code None Any

Storage Lists and Libraries Any

Key Limitations No Server Code Hosting Expertise Required

Good for… Smaller apps & resource storage

Any type of Application