an introduction to the office devpnp community initiative

36
An Introduction to the OfficeDevPnP Community Initiative Nigel Price

Upload: nigel-price

Post on 21-Feb-2017

225 views

Category:

Software


1 download

TRANSCRIPT

Page 1: An introduction to the office devpnp community initiative

An Introduction to the OfficeDevPnP

Community InitiativeNigel Price

Page 2: An introduction to the office devpnp community initiative

Thanks to the Sponsors!

Page 3: An introduction to the office devpnp community initiative

With Thanks, Apologies and Acknowledgements to Vesa

Juvonen, Erwin Van Hunen, Paolo Pialorsi and Bert Jansen

Page 4: An introduction to the office devpnp community initiative

What is Office 365 Developer Patterns and Practices (PnP)• PnP is community driven open source project where Microsoft and

external community members are sharing their learning's around implementation practices for Office 365 and SharePoint on-premises (add-in model). Active development and contributions happen at our GitHub project under Dev branch and each month there is a master merge (monthly release) with more comprehensive testing and communications. Latest activities and future plans are covered in the monthly community calls which are open for anyone from the community. Download invite from http://aka.ms/OfficeDevPnPCall.

Page 5: An introduction to the office devpnp community initiative

Why Do We Need The OfficeDevPnP

Initiative ?

Page 6: An introduction to the office devpnp community initiative

SharePoint evolves…SharePoint 2007

SharePoint 2010 SharePoint

2013

Sandbox

C#

C#C#

Provider Hosted Add-Ins

C#

JSJS

_api

Page 7: An introduction to the office devpnp community initiative

“We’ve heard this story so many times, but want to stay on doing farm solutions at on-premises…”

Absolutely nothing wrong with that. Evaluate your business requirements and chose the right customization model for you.

Page 8: An introduction to the office devpnp community initiative

What does add-ins mean in our terminology

Classic - Full trust solutions• ISV solutions• Platform level customizations to on-premises

• Custom service applications

• Custom WCF services• SharePoint customizations, not customer specific customizations

Client Side Solutions• Server side controls as JavaScript on page layouts and master pages

• Remote provisioning for elements

• Embracing un-ghosted model

• SP add-in dimension with provider hosted apps to provide new capabilities

• Customer specific customizations

Store add-ins• Add-in catalog based solution

• Packaged reusable solutions built for specific functionality

• Not only for market place or store, but also as platform for customer specific customizations

SharePoint Add-Ins means all operations which are executed outside of the server

Page 9: An introduction to the office devpnp community initiative

xml

Content Type B

Manifest xml in the solution package introduces the feature framework elements.

\\15\templates\features\FeatureA

Configuration database

Content database

Content Type A

Content Type C

Feature framework feature with element xml files for content type and site columns.

WSP package1

2

3

Content type and site columns with dependencyNot recommended approach

Provisioned content types And site columns have dependency on element xml files

Same dependency challenge applies for Sandbox solutions…

Page 10: An introduction to the office devpnp community initiative

Modules with Feature Framework These are essentially files

deployed to the site You should follow the same

“remote provisioning pattern” that we outlined for application artifacts such as .webpart files, page layouts and master pages.

Challenge with feature framework based provisioning is that any operation to sandbox or farm solution will impact directly end user sites

Note. This pic is for farm solution based provisioning, but same challenge is with sandbox solutions.

Page 11: An introduction to the office devpnp community initiative

Full trust solution challenges• Full trust solutions with ghosted files– Implications to Disaster Recovery model

• Deployments always cause downtime– Impact on Service Level Agreements as well as availability– Very expensive to maintain enough Infrastructure to reach

“near zero”• Full trust solutions have to be closely analyzed– Do you trust your solution fully?– Complex Application Lifecycle Management processes

• Not available in Office 365 (Multi-Tenant or Dedicated vNext)

Page 12: An introduction to the office devpnp community initiative

What if… We would use

same model for on-premises and

cloud?

Page 13: An introduction to the office devpnp community initiative

Introducing CSOM and The OfficeDevPnP

Initiative

Page 14: An introduction to the office devpnp community initiative

What is CSOM ?• CSOM is short for the Client Side Object Model• It allows another machines to interact with SharePoint servers to

create and operate on Content Types, Site Columns, Lists etc• The other machine can be anything :- Windows, Linux • The code on the other machine can be anything C#, PowerShell, PHP

etc• It covers almost all of the functionality that the Server Side Object

Model does (Information Management Policies is an exception)

Page 15: An introduction to the office devpnp community initiative

So What is OfficeDevPnP ?• OfficeDevPnP was started by Vesa Juvonen, Erwin Van Hunen, Paolo Pialorsi

and Bert Jansen (and apologies to anyone I have missed) 12 – 18 months ago• Vesa and Bert work for Microsoft and Erwin and Paolo work for other

companies• OfficeDevPnP is a framework which has been built on top of CSOM to make

it easier for developers and IT Pros to use CSOM• OfficeDevPnP is a community Initiative which anyone can get involved in and

contribute (ie Its OpenSource)• Works with both SharePoint online and SharePoint On Premises

(SP2013,SP2016)

Page 16: An introduction to the office devpnp community initiative

What Does The OfficeDevPnP Consist Of ?• PnP Sites Core Component - GitHub repository • PnP Core Component (JavaScript) - GitHub repository• PnP PowerShell - GitHub repository• PnP Partner Pack - Reusable starter kit for typical enterprise requirements• PnP Guidance - GitHub repository• PnP Office-Addins - GitHub repository• PnP Tools - GitHub repository• PnP Transformation - GitHub repository• PnP Provisioning Schema - GitHub repository

Page 17: An introduction to the office devpnp community initiative

Remote Provisioning Using OfficeDevPnP

Page 18: An introduction to the office devpnp community initiative

M I C R O S O F T C O N F I D E N T I A L – I N T E R N A L O N LY

Site provisioning is the heart and soul for each enterprise deployment…

Page 19: An introduction to the office devpnp community initiative

Evergreen and release cycle – old model

SP2007 SP2010 SP2013 SP2016

Tightly coupledSharePoint customizations

Upgrade Upgrade Upgrade Upgrade

• Specific upgrade project each time new version is introduced• Customizations have to be upgraded to get access on new capabilities in product• Will cause additional costs during each release cycle of customizations• Customization updates cause downtime each time something is changed• Complex ALM processes for ensuring quality of the code

Page 20: An introduction to the office devpnp community initiative

Evergreen and release cycle – new model

SP2013

Loosly coupledSharePoint customizations

SP2016 O17 O18

Development

• You choose when and how applications are updated • Backwards compatibility for API level to move customizations cross versions• Customizations don’t block new capabilities from SharePoint• Customizations extend, not change SharePoint• Customizations can be updated with minimal impact on SharePoint

Customizations will utilize services from SharePoint and other services, but won’t usually change out of the box services.

Page 21: An introduction to the office devpnp community initiative

xml

Content Type B

Assets and configurations either using just code or with for example xml

Content database

Content Type A

Content Type C

PowerShell or code provisioning the assets using remote provisioning pattern directly to content database.

1

Content types do not have any dependency and farm solution can be retracted without any impact to them

2

Content type and site columns with remote provisioningRecommended approach

Page 22: An introduction to the office devpnp community initiative

Comparison of CSOM and OfficeDevPnP – Creating a ListClientContext context = new ClientContext("http://SiteUrl"); // The SharePoint web at the URL.Web web = context.Web; ListCreationInformation creationInfo = new ListCreationInformation();creationInfo.Title = "My List";creationInfo.TemplateType = (int)ListTemplateType.Announcements;List list = web.Lists.Add(creationInfo);list.Description = "New Description"; list.Update();context.ExecuteQuery();

#SPO Sample $cred = Get-Credential -UserName '[email protected]' -Message "Enter SPO credentials"

#Connect to new site and validate Connect-SPOnline -Url 'https://njpenterprises.sharepoint.com/sites/SPS-London-demosite99' -Credentials $cred -ErrorAction Stop #Create list New-SPOList -Title "Demo list" -Template GenericList -Url 'lists/demo'

Page 23: An introduction to the office devpnp community initiative

Create List using OfficeDevPnP

DemoPnP

Page 24: An introduction to the office devpnp community initiative

Creating Different Types of Fields

Add-SPOField -DisplayName "Project End Date" -InternalName "ProjectEndDate" -Id "65E1E394-B354-4C67-B267-57407C416C10" -Type Date -Required -Group "Tender Group"

Add-SPOTaxonomyField -DisplayName "Record Type" -InternalName "RecordType" -Id "{53FF9B38-32F2-47A0-A094-D3692CB52352}" -Group "Tender Group" -TermSetPath "InnovateUK|Tenders|Record Type“

Add-SPOField -DisplayName "Project Phase" -InternalName "ProjectPhase" -Id "{53FF9B38-32F2-47A0-A094-D3692CB52354}" -Type Choice -Group "Tender Group" -AddToDefaultView -Choices "Initiation","Definition","Development","Delivery","Evaluation"

Add-SPOField -DisplayName "Supplier Name" -InternalName "SupplierName" -Id "65E1E394-B354-4C67-B267-57407C416C15" -Type Text -Required -Group "Tender Group"

Add-SPOField -DisplayName "Project Name" -InternalName "ProjectName" -Id "65E1E394-B354-4C67-B267-57407C416C16" -Type Text -Required -Group "Tender Group"

Page 25: An introduction to the office devpnp community initiative

Create Fields and Content Types using OfficeDevPnP

DemoPnP

Page 26: An introduction to the office devpnp community initiative

OfficeDevPnP Site Provisioning Framework

Page 27: An introduction to the office devpnp community initiative

Business user driven templates

Provisioning engine

Provider Hosted App / PowerShell

SharePoint Service

https://contoso.sharepoint.com/sites/site

1 2

54

3

Extract template

Modify with browser

Template details are being extracted from actual template sites during provisioning.Templates can be modified and created using browser UI and all changes are reflected to the newly created and potentially modified sites.

Template sites

Page 28: An introduction to the office devpnp community initiative

PnP Site Provisioning FrameworkC#

// Get template from existing sitetemplate = ctx.Web.GetProvisioningTemplate();

XMLFileSystemTemplateProvider

XMLAzureStorageTemplateProvider

XMLSharePointTemplateProvider

1

2

4

Site A

Site B

Connectors

3

// Save template using XML providerXMLFileSystemTemplateProvider provider = new XMLFileSystemTemplateProvider(@"c:\temp\", "");string templateName = "template.xml";provider.SaveAs(template, templateName);

// Load the saved model againProvisioningTemplate p2 = provider.GetTemplate(templateName);

// Apply template to existing sitectxTarget.Web.ApplyProvisioningTemplate(template);

Page 29: An introduction to the office devpnp community initiative

PnP Site Provisioning Framework

Demohttps://github.com/OfficeDev/PnP/tree/master/Samples/Provisioning.Framework.Console

PnP

Page 30: An introduction to the office devpnp community initiative

What is the challenge with custom master page?

Time

Oob Master

Custom Master<< Copy >>

Service updates for introducing new version of the out of the box master page with some new capabilities or bug fixes.

Significant differences on the outcome unless custom master page been updated during the releases.

New custom master page is created by copying oob master or starting from scratch using oob master as the reference

master

Seattle.masterVersion 1.0 master

Seattle.masterVersion 2.0 master

Seattle.masterVersion 3.0

master

contoso.masterVersion 1.0 master

contoso.masterVersion 1.0 master

contoso.masterVersion 1.0

Page 31: An introduction to the office devpnp community initiative

Example: Custom master page and case of an evolving suite bar…

Page 32: An introduction to the office devpnp community initiative

PnP Site Provisioning Framework

Demohttps://github.com/OfficeDev/PnP/tree/master/Samples/Provisioning.Framework.Console

PnP

Page 33: An introduction to the office devpnp community initiative

“Why are you using CSOM/REST for provisioning operations and not feature framework?”

When you provision your changes on top of oob templates using remote APIs, you get always all of the latest capabilities from the services or product.

Page 34: An introduction to the office devpnp community initiative

Summary• What is Office 365 Developer Patterns and Practices (PnP)• Why Do We Need The OfficeDevPnP Initiative ?• Introducing CSOM and The OfficeDevPnP Initiative• What is CSOM ?• What is OfficeDevPnP ?• What Does The OfficeDevPnP Consist Of ?• Remote Provisioning Using OfficeDevPnP• OfficeDevPnP Site Provisioning Framework

Page 35: An introduction to the office devpnp community initiative

It is a community project!Feel free to contribute with Issues,Pull Requests and Yammer threads

Page 36: An introduction to the office devpnp community initiative

“Sharing is caring”

Any Questions ?