sharepoint server 2013: to app or not to app?

33
SharePoint 2013: To App or not to App? joris poelmans 04.09.2012

Upload: microsoft-developer-network-msdn-belgium-and-luxembourg

Post on 11-May-2015

3.441 views

Category:

Technology


1 download

DESCRIPTION

Presentation by Joris Poelmans http://twitter.com/jopxtwits. More developer events in Belgium: http://msdn-events.be.

TRANSCRIPT

Page 1: SharePoint Server 2013: to app or not to app?

SharePoint 2013: To App or not to App?

joris poelmans04.09.2012

Page 2: SharePoint Server 2013: to app or not to app?

About me

Joris Poelmans

@jopxtwitsjopx.blogspot.comlinkedin.com/in/jorispoelmans

unit managerarchitectdeveloper

SharePoint

Windows 8 & Phone

Page 3: SharePoint Server 2013: to app or not to app?

Agenda• Introduction to SharePoint 2013 apps• Deployment options and design patterns• Technologies used in app development• Building a SharePoint-hosted app

Page 4: SharePoint Server 2013: to app or not to app?

setting the sceneIntroducing the new SharePoint app framework

Page 5: SharePoint Server 2013: to app or not to app?

Introducing appsIn SharePoint 2013 everything is an app …

In strict sense: “Apps are self-contained pieces of functionality that extend the capabilities of a SharePoint site.”

new deployment method

low server footprint

cloud driven

using app catalog

Page 6: SharePoint Server 2013: to app or not to app?

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 7: SharePoint Server 2013: to app or not to app?

Packaging and deployment optionsFarm

• Full access API• Server side

code• Server file level

access required• Classic model

from 2007• On-premise only

Sandbox Apps

• Partially trusted code service with limited server side code

• No file level access required

• Resource monitored

• Introduced with 2010

• Online deployment possible

• New model• Deploy from

corporate catalog or marketplace

• Limited server footprint

• Relies heavily on client-side technologies

• Online deployment possible

Page 8: SharePoint Server 2013: to app or not to app?

SharePoint 2013 app development scenariosDeployment options

On-premise install

Development options Development tools

Hosted install

Office 365

Farm solution

Sandbox solution

SharePoint-Hosted appsDeveloper-Hosted apps

Azure-Hosted apps

Browser

SharePoint Designer

Visual Studio

Eclipse, PHP, etc....

Page 9: SharePoint Server 2013: to app or not to app?

DemoApps from end user perspective

Page 10: SharePoint Server 2013: to app or not to app?

Getting started with development• Local development• Has to be on Windows Server 2008 R2 (or later)• Memory reqs have gone up – 12 GB RAM seems

workable ... But TechNet recommends 24 GB• Extra configuration needed for app development• Visual Studio 2012

• Remote development• Sign up for Office 365 Developer Site• Possible to use NAPA – app for building apps

Page 11: SharePoint Server 2013: to app or not to app?

SharePoint App UX• Immersive App - app is shown full screen

with in a separate page • Part - App is shown as a part on the

SharePoint page – similar experience to web part

• UI Custom Actions – possible to make the App available through ribbon or menu actions for documents and items

See Apps for SharePoint UX design guidelines

Page 12: SharePoint Server 2013: to app or not to app?

DemoHello world SharePoint app

Page 13: SharePoint Server 2013: to app or not to app?

the bigger picturedeployment options, app identity and design patterns

Page 14: SharePoint Server 2013: to app or not to app?

Basic SharePoint App architecture• Code runs “Off SharePoint

Box”• Declarative Hooks into

SharePoint• AppWeb Host in SharePoint

Page 15: SharePoint Server 2013: to app or not to app?

Apps – three possible approaches

App Web

Parent Web

SharePoint-hosted AppProvision 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

Azure Auto-Provisioned AppWindows Azure + SQL Azure provisioned invisibly as apps are installed

Azure SharePoint Web

Get remote events from SharePoint Use CSOM/REST + OAuth to work with SPS

Cloud-based Apps

Developer-Hosted App“Bring your own server hosting infrastructure”Developers will need to isolate tenants

SharePoint

Web

Your Hosted

Site

Page 16: SharePoint Server 2013: to app or not to app?

Hosting: cloud vs SharePointCloud Hosted Apps SharePoint Hosted Apps

Possible hosting model for almost all types of apps

Good for smaller apps

Choose your own infrastructure & technology

SharePoint based; no server-side code

May require your own hosting Automatically hosted in SharePoint

May require your own handling of multitenancy & permission management

Inherent multitenancy & isolation

Page 17: SharePoint Server 2013: to app or not to app?

App identity• Challenge with SPS2010• Farm solutions – too much privileges - risk of

RunWithElevatedPrivileges• Sandbox solutions – no RunWithElevatedPrivileges –

always under user context• In SharePoint 2013 apps have their own identity

and specific permissions• Installing user either grants or denies permissions to host

web• Permission is explicitly given for a specific scope• App identity is passed around using oAuth tokens

Page 18: SharePoint Server 2013: to app or not to app?

App scopes• SPSite – site collection• SPWeb – site• SPList • Tenancy• Other scopes (and rights) for performing search

queries, accessing taxonomy data, user profiles, etc...

Page 19: SharePoint Server 2013: to app or not to app?

App rights• Default rights : Read, Write, Manage and Full Control• Not possible to customize• Apps are granted permissions to a scope and all

children of the scope• Defined in declarative XML

Page 20: SharePoint Server 2013: to app or not to app?

Azure Access Control Service (ACS)• ACS required with oAuth implementation in

SharePoint 2013• How is the ACS server configured as the

authentication server?• Automatically done for sites in Office 365 Preview• On-premise farms, a trust to ACS must be configured.

Possible to avoid when using Server-to-server (S2S) trust

Page 21: SharePoint Server 2013: to app or not to app?

DemoUsing App permissions

Page 22: SharePoint Server 2013: to app or not to app?

base technologiesSharePoint 2013 REST/CSOM API

Page 23: SharePoint Server 2013: to app or not to app?

SharePoint 2013 CSOM and REST API• Apps connect to SharePoint using

• SharePoint 2013 Client Side Object Model (CSOM)• SharePoint 2013 REST API• Javascript cross-domain library (SP.RequestExecutor.js)

• Main investments in 2013• Client.svc is extended with REST capabilities

• Easier for javascript and non .NET code• Implemented in accordance with oData protocol• Programming style is largely unchanged

• New APIs for SharePoint Server functionality• User Profiles, Search, Taxonomy, Feeds, ....

Page 24: SharePoint Server 2013: to app or not to app?

REST URLs in SharePoint 2013• CSOM URLs can go through _api folder• Replace

http://sharepoint/_vti_bin/client.svc/web• With

http://sharepoint/_api/web

• Example REST URLs targeting SharePoint sites• _api/web/lists• _api/web/lists/List1• _api/web/?$select=title,id• /_api/web/lists/getByTitle('Consultants')/Items• ....

Page 25: SharePoint Server 2013: to app or not to app?

ATOM XML vs JSON• Response data format selected with ACCEPT header• XML can be easier to deal with from managed code• JSON easier to deal with using Javascript• To get JSON response use “application/json”http://sharepoint/_vti_bin/client.svc/web

Page 26: SharePoint Server 2013: to app or not to app?

DemoExploring SPS 2013 REST API

Page 27: SharePoint Server 2013: to app or not to app?

building a SharePoint hosted appUsing Office 365 Developer site

Page 28: SharePoint Server 2013: to app or not to app?

SharePoint Hosted App• App components are SharePoint components• SharePoint list, site columns, content types• CSOM and REST API• Client web part

• Key Developer skills• HTML5, CSS, Javascript• Jquery, ASP.NET AJAX• CSOM and REST API• Silverlight

Page 29: SharePoint Server 2013: to app or not to app?

SharePoint Hosted App• Installation of App creates child site in target

site• App can add declarative items to App Web• App Web <-> Host Web communication:

CSOM/REST or Javascript cross-domain library • Full client-side extension – no server-side code

Host Web

App Web

• Custom Actions• Client-side web parts

• Lists• Site Pages• CSS files• Javascript files

Page 30: SharePoint Server 2013: to app or not to app?

DemoBuilding a SharePoint Hosted App with Office 365

Page 31: SharePoint Server 2013: to app or not to app?

summary

Call to Action

Page 32: SharePoint Server 2013: to app or not to app?

SummaryCall to action:• Sign up for Office 365 Developer Preview• Watch developer videos around building Shar

ePoint 2013 apps

• Register on www.biwug.be as a member to stay up to date for local SharePoint 2013 sessions

• For more information or questions• SharePoint 2013 Preview start page• SharePoint 2013 Preview Developer documentation• Developing Apps for SharePoint 2013 MSDN forum• SharePoint 2013 Delicious links• Yammer – https://www.yammer.com/spyam

Page 33: SharePoint Server 2013: to app or not to app?

questionsthank you for your attendance

@jopxtwits