o365: attack of the clones

25
Office 365: Attack of the Clones! Building Site Templates with the Office 365 PnP Framework

Upload: christopher-johnson

Post on 12-Jan-2017

80 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: O365: Attack of the Clones

Office 365: Attack of the Clones! Building Site Templates with the Office 365 PnP Framework

Page 2: O365: Attack of the Clones

Agenda• Introduction• The case for site templates• Old way• New way• Introducing Office Dev PnP• Demos (3)• Getting started - PnP resources• Questions

Page 3: O365: Attack of the Clones

Chris Johnson@cjohnsonO365• Microsoft MVP – Office Development• Director, PSC Group (Schaumburg, IL)• 7+ years developing for SharePoint• Document Management• Branding• Managed Metadata• Provisioning and Governance• Office 365• Nintex Forms & Workflow

• Current focus: app modernization & cloud readiness

Page 4: O365: Attack of the Clones

1. SharePoint Developer Office 365 Developer

2. This is an amazing time to be an Office 365 developer!

Page 5: O365: Attack of the Clones

Hey, listen!• Some images used on these slides have been borrowed from the

Office Dev PnP site. These– especially the artsy ones– are not my creation!• A lot of the code you see during this presentation was written by me,

but it’s built on frameworks and sample code from the PnP community• I will tweet out links after the presentation so you can:

• Go to the Office Dev PnP site• Connect to the GitHub repo• Download code from demos• View this slide deck, etc.

@cjohnsonO365

Page 6: O365: Attack of the Clones

Raise your hand if:• You’re an end user,

power user or BA• You’re an administrator• You’re a developer /

architect / consultant / etc.• You use SharePoint 2013 on-premise• You use Office 365• You use a hybrid farm

• You’ve ever tried to provision custom sites in SharePoint• You’ve heard of the

OfficeDev Patterns and Practices community• You’ve use a PnP

framework, solution or sample project

Page 7: O365: Attack of the Clones

WARNING:

CODE </>

Page 8: O365: Attack of the Clones

Community: Current SharePoint Initiatives

Application Modernization “Get me to the

cloud!”• Re-write server-side

LOB applications to use “App Model” CSOM

• Decrease dependencies on feature.xml

• Eliminate custom master pages

• Increase OOB feature usage

Take advantage of NEW Office 365

features• Unified Experience

Unified Endpoint• New APIs for Office

Graph, Delve, etc.• Consistency across

Add-Ins: Office, SharePoint, etc.

Build a better user experience

• Modern web applications over “SharePoint-y” UI

• New mobile experiences• Office mobile apps• PowerApps• Next-generation

portals• Lean on provider-

hosted apps

Page 9: O365: Attack of the Clones

The case for site templatesWHY• Easily reproduce common

business customizations• Enforce governance • Provide consistent user

experience

WHAT• Fields• Content types• Lists and libraries• Groups• Permissions• Pages• Web parts• Navigation• Look and feel• Custom actions

Page 10: O365: Attack of the Clones

The old way• Site Settings Save as template

• Sometimes worked• Import to Visual Studio (disaster)

• Site Definitions• onet.xml (kinda hairy)• Publishing? Good luck!

• Custom subclass of SPWebProvisioningProvider• Create site, then apply changes (this is good!)• Requires full-trust code deployed as solution in Central

Administration• Great on-prem solution, but very advanced

Page 11: O365: Attack of the Clones

Limitations in Office 365

• No full-trust code No custom SPWebProvisioningProvider• “Save as template” still unreliable• Use of sandbox solutions and

Feature.xml discouraged

Why are these limitations in place?• Ensure forwards

compatibility• Provide flexibility

for:• Developers• Administrators• Users

Page 12: O365: Attack of the Clones

Client-side development in Office 365BENEFITS• Streamlined deployment• Use the framework of your

choice• Safe

LIMITATIONS• Asynchronous• More complicated

programming• Less documentation• API is less complete

Page 13: O365: Attack of the Clones

Introducing: Office Dev PnP• More than just a provisioning

framework• Several core frameworks –

Provisioning is just one of them• Also a thriving community• Fills gaps in client-side

development paradigm

• Guidance & best practices for:• Add-ins• Branding• Event receivers• Timer jobs• Workflow• Managed Metadata• Provisioning• More

from the Office Dev PnP site

Page 14: O365: Attack of the Clones

Introducing: Office Dev PnP• Solutions• Samples• Frameworks…that constitute best practices for administration and development on Office 365

...ALL open source in GitHub!…ALL documented!...Frequently updated: monthly releases with open conference call

Page 15: O365: Attack of the Clones

QUICK DEMOOffice Dev PnP guidance and documentationGitHub

Page 16: O365: Attack of the Clones

Wish list: Cloud-ready provisioning solution• Ability to provision:• Look and feel• Fields• Content types• Lists and libraries• Groups• Permissions• Pages• Web parts

• Client-side object model• Scriptable OR deployable

as an app• Declarative OR

compiled/managed code• Documented

Page 17: O365: Attack of the Clones

SharePoint

PnP Provisioning: Basic Implementation

Console app-OR-

PowerShell script

C# > APPLY TEMPLAT

E EXTRACT

TEMPLATE

PnP Provisioning

SchemaXML</>

PnP Core Framework

C# >

Page 18: O365: Attack of the Clones

DEMOPowerShell: extract & apply template

Page 19: O365: Attack of the Clones

PnP Provisioning: Advanced Implementation SOLUTION COMPONENTS• Provider-hosted SharePoint Add-In• ASP.NET MVC web site hosted in

Azure• AppInstalled and AppUninstalled

event receivers (Azure service bus) that create artifacts on host web

• Timer Job (Azure Web Job) w/logging• User-managed custom Site

Templates based on PnP Provisioning Schema

• Common library + PnP extensions

HOST WEB ARTIFACTS• SharePoint Lists for site requests (on host

web to allow integration with other applications, e.g. Nintex)

• SharePoint Library for templates (associate with base template, e.g. Team Site-- allow site requests to choose template)

• Custom ribbon actions to request and cancel provisioning• Ribbon control w/ScriptEnabled methods• JavaScript ScriptLink custom action to

override "New Site" link on provisioned sites

• Branding assets

Page 20: O365: Attack of the Clones

DEMOProvider-hosted provisioning app (UI)

Page 21: O365: Attack of the Clones

New SharePoint Site Collection

ASP.NET MVC Provider-Hosted App

C#

Service BusC#

PnP Core Framework +

Helper Classes C#

Azure Web Job (Console App)

C#

App

Host Web

Library: Site

Templates

List: Request

s

INSTALLED ON1

PROVIDES APP-ONLY SECURITY TOKEN TO HOST

WEB2

APPINSTALLING EVENT CREATES LIST, LIBRARY,

CUSTOM ACTIONS + UPLOADS ASSETS ON HOST

WEB

3

UPLOADS TEMPLAT

E4

CREATES

REQUEST

5RETRIEVES SITE COLLECTION REQUESTS

FROM LIST6RETRIEVES USER-MANAGED TEMPLATE FROM LIBRARY7

CREATES SITE COLLECTION + APPLIES TEMPLATE

+ APPLIES ADD’L CONFIGURATION

8

XML</>

Page 22: O365: Attack of the Clones

DEMOProvider-hosted provisioning app

Page 23: O365: Attack of the Clones

This is an amazing time to be an Office 365 developer!

Page 24: O365: Attack of the Clones

Where to find Office Dev PnPOffice Dev Center http://dev.office.com/patterns-and-practices

GitHub https://github.com/OfficeDev/PnP

Twitter @OfficeDevPnP@ErwinVanHunen@VesaJuvonen@PaoloPia

from the Office Dev PnP site

@cjohnsonO365

Page 25: O365: Attack of the Clones

Questions?