Office 365 - Attack of the Clones!x

Download Report

Transcript Office 365 - Attack of the Clones!x

Office 365:
Attack of the Clones!
Building reusable site templates with the Office 365
PnP Framework
Agenda
• Introduction
• The case for site templates
• Old way
• New way
• Introducing Office Dev PnP
• Demos
• Getting started - PnP resources
• Questions
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
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 onpremise
• 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
Build a better user
experience
• Unified Experience 
Unified Endpoint
• New APIs for Office
Graph, Delve, etc.
• Consistency across AddIns: Office, SharePoint,
etc.
• 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 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
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 365
BENEFITS
• 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 DEMO
Office Dev PnP guidance and documentation
GitHub
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
PnP Provisioning: Basic Implementation
PnP
Provisioning
Schema
Console app
-ORPowerShell script
C#
>
PnP Core Framework
XML
</>
APPLY
TEMPLATE
EXTRACT
TEMPLATE
SharePoint
C#
>
DEMO
PowerShell: extract & apply template
PnP Provisioning: Advanced Implementation
SOLUTION COMPONENTS
HOST WEB ARTIFACTS
• Provider-hosted SharePoint Add-In
• SharePoint Lists for site requests (on host
web to allow integration with other
applications, e.g. Nintex)
• 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
• 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
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*
DEMO
Provider-hosted provisioning app (UI)
2
ASP.NET MVC ProviderHosted App
PROVIDES APP-ONLY SECURITY
TOKEN TO HOST WEB
C#
Service Bus
3
C#
1
Azure Web Job
(Console App)
C#
INSTALLED ON
Host Web
APPINSTALLING EVENT CREATES
LIST, LIBRARY, CUSTOM ACTIONS
+ UPLOADS ASSETS ON HOST WEB
Library:
Site
Templates
PnP Core Framework
+ Helper Classes
C#
App
7
RETRIEVES USER-MANAGED
TEMPLATE FROM LIBRARY
XML
</>
6
8
RETRIEVES SITE
COLLECTION REQUESTS
FROM LIST
CREATES SITE COLLECTION
+ APPLIES TEMPLATE
+ APPLIES ADD’L CONFIGURATION
List:
Requests
4
UPLOADS
TEMPLATE
5
CREATES
REQUEST
New SharePoint
Site Collection
DEMO
Provider-hosted provisioning app
This is an amazing time to be an
Office 365 developer!
from the Office Dev PnP site
Where to find Office Dev PnP
Office Dev Center
http://dev.office.com/patterns-and-practices
GitHub
https://github.com/OfficeDev/PnP
Twitter
@OfficeDev
@ErwinVanHunen
@VesaJuvonen
@PaoloPia
@cjohnsonO365
Questions?