Upload
christopher-johnson
View
81
Download
1
Embed Size (px)
Citation preview
Office 365: Attack of the Clones! Building Site Templates with the Office 365 PnP Framework
Agenda• Introduction• The case for site templates• Old way• New way• Introducing Office Dev PnP• Demos (3)• Getting started - PnP resources• Questions
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
1. SharePoint Developer Office 365 Developer
2. This is an amazing time to be an Office 365 developer!
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
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
WARNING:
CODE </>
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
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
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
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
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
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
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
QUICK DEMOOffice Dev PnP guidance and documentationGitHub
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
SharePoint
PnP Provisioning: Basic Implementation
Console app-OR-
PowerShell script
C# > APPLY TEMPLAT
E EXTRACT
TEMPLATE
PnP Provisioning
SchemaXML</>
PnP Core Framework
C# >
DEMOPowerShell: extract & apply template
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
DEMOProvider-hosted provisioning app (UI)
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</>
DEMOProvider-hosted provisioning app
This is an amazing time to be an Office 365 developer!
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
Questions?