Download presentation
Presentation is loading. Please wait.
Published byGriffin Walton Modified over 8 years ago
1
Office 365: Attack of the Clones! Building reusable site templates with the Office 365 PnP Framework
2
Agenda Introduction The case for site templates Old way New way Introducing Office Dev PnP Demos Getting started - PnP resources Questions
3
Chris Johnson @cjohnsonO365 Solutions Architect, 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
4
1.SharePoint Developer Office 365 Developer 2. This is an AMAZING time to be an Office 365 developer!
5
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
6
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
7
WARNIN G: CODE
8
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
9
The case for site templates WHY 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
10
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
11
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
12
Client-side development in Office 365 BENEFITS Streamlined deployment Use the framework of your choice Safe LIMITATIONS Asynchronous More complicated programming Less documentation API is less complete
13
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
14
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
15
QUICK DEMO Office Dev PnP guidance and documentation GitHub
16
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
17
SharePoint PnP Provisioning: Basic Implementation Console app -OR- PowerShell script C#> APPLY TEMPLAT E EXTRAC T TEMPLA TE PnP Provisioning Schema XML PnP Core Framework C#>
18
DEMO PowerShell: extract & apply template
19
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
20
Template Limitations SUPPORTS Security Pages Web Parts Page Layouts Branding Files Custom Actions Lists & Libraries Fields & Content Types Taxonomy DOESN’T SUPPORT Quick Launch Navigation Home Page Configuration (coming soon) Publishing Pages (coming soon) Content*
21
DEMO Provider-hosted provisioning app (UI)
22
New SharePoint Site Collection ASP.NET MVC Provider- Hosted App C# Service Bus C# PnP Core Framework + Helper Classes C# Azure Web Job (Console App) C# AppHost Web Library: Site Template s List: Requests INSTALLED ON 1 PROVIDES APP-ONLY SECURITY TOKEN TO HOST WEB 2 APPINSTALLING EVENT CREATES LIST, LIBRARY, CUSTOM ACTIONS + UPLOADS ASSETS ON HOST WEB 3 UPLOADS TEMPLAT E 4 CREATE S REQUE ST 5 RETRIEVES SITE COLLECTION REQUESTS FROM LIST 6 RETRIEVES USER-MANAGED TEMPLATE FROM LIBRARY 7 CREATES SITE COLLECTION + APPLIES TEMPLATE + APPLIES ADD’L CONFIGURATION 8 XML
23
DEMO Provider-hosted provisioning app
24
This is an amazing time to be an Office 365 developer!
25
Where to find Office Dev PnP Office Dev Center http://dev.office.com/patterns-and- practiceshttp://dev.office.com/patterns-and- practices GitHub https://github.com/OfficeDev/PnPhttps://github.com/OfficeDev/PnP Twitter @OfficeDev @ErwinVanHunen @VesaJuvonen @PaoloPia from the Office Dev PnP site @cjohnsonO365
26
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.