37

Spca2014 chris o brien modern share-point development - techniques for off-box co

  • Upload
    nccomms

  • View
    166

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 2: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Modern SharePoint Development -techniques for moving code off SharePoint servers

Chris O’Brien - MVP

Page 3: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Blog: www.sharepointnutsandbolts.com

Twitter: @ChrisO_Brien

LinkedIn: http://uk.linkedin.com/in/chrisobrienmvp

Page 4: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 5: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 6: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 7: Spca2014 chris o brien   modern share-point development - techniques for off-box co

No - farm solutions/files deployed to _LAYOUTS

• No feature receivers

• No timer jobs

• No event receivers

Yes/maybe - sandbox solutions, but no code in sandbox solutions

Yes - apps (aka remote code)

* Deployable in Office 365 *

• No custom field controls

• No site definitions

• No custom web parts (due to use of code)

Page 8: Spca2014 chris o brien   modern share-point development - techniques for off-box co

• One app can no longer bring SharePoint down

Better isolation

• Fewer SharePoint artifacts to audit/upgrade

Simpler upgrade (e.g. to “SharePoint 2015”)

• Less rework to transition

Keeps door open to Office 365

Page 9: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Farm solution Remote code/apps

Timer job Scheduled process in Azure (CSOM to

read/write to SP)

Event receiver Remote event receiver

Custom field control JSLink

Site definition WebTemplate in NCSS *

Run With Elevated Privileges App-only authentication

Custom web parts/user control App part, or JavaScript + DOM

Feature receiver, DelegateControl,

application page

None – but other approaches possible

* NCSS = no-code

sandbox solution

Page 10: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 11: Spca2014 chris o brien   modern share-point development - techniques for off-box co

| | | | etc.

Page 12: Spca2014 chris o brien   modern share-point development - techniques for off-box co

JavaScript-based approaches can be interesting!

http://cob-sp.com/JSOMProvisioning

Page 13: Spca2014 chris o brien   modern share-point development - techniques for off-box co

External

not

(and more to come!)

Page 14: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Pros – Azure Websites Cons - Azure Websites

+ Easy. Even a dev can do it! - Typically need to implement authentication

(since accessible on internet)

+ Microsoft take care of SSL,

external access, load-balancing,

high availability etc.

- Need to implement Azure if not done

already (e.g. who pays the bill?)

Page 15: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 16: Spca2014 chris o brien   modern share-point development - techniques for off-box co

(Remote Event Receivers)

Page 17: Spca2014 chris o brien   modern share-point development - techniques for off-box co

1. Create provider-hosted app (and add RER code)

2. Create Azure Website (if doesn’t exist)

3. Publish remote code to Azure

4. Register app with AppRegNew.aspx (or Seller Dashboard)

5. Publish app package, put in app catalog

6. Add to site

7. Associate RERs with lists (e.g. with PowerShell/CSOM)

8. Test!

Page 18: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 19: Spca2014 chris o brien   modern share-point development - techniques for off-box co

0

100

200

300

400

500

600

700

800

900

Poweshell cmdlets

PS cmdlets

On-premises SharePoint Online

On-premises SharePoint Online

774 30

Page 20: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Instead, use STANDARD PowerShell

command prompt for PS + CSOM

Page 21: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 22: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 23: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 24: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Importing/exporting taxonomy terms

Importing/exporting search schema

Recreating site collections

Sandbox solution deployment – no API for this!

Activating web templates

Create publishing pages

Uploading files

Page 25: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 26: Spca2014 chris o brien   modern share-point development - techniques for off-box co

https://github.com/OfficeDev/

Because it’s AWESOME – it’s the “helper library” you

dreamed about, plus samples you’d use!

Page 27: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Branding

• DeployThemeToWeb

• SetThemeToWeb

• SetSiteLogo

Features

• ActivateFeature

• DeactivateFeature

Fields and content types

• AddContentTypeToList

• AddFieldToContentType

• CreateContentType

• CreateField

• CreateTaxonomyField

(including wire-up)

Files and folders

• UploadDocumentToLibrary

• UploadDocumentToFolder

• CreateFolder

Pages

• AddWebPartToWebPartPage

• AddWebPartToWikiPage

• DeleteWebPart

• AddHtmlToWikiPage

Sites

• AddSite

• AddSiteCollectionTenant

• MySiteSearch (CSOM search)

• ProcessQuery (CSOM search)

• SetPropertyBagValue

Security

• AddAdministrators

• GetAdministrators

• GetSharingCapabilitiesTenant

Navigation

• AddCustomAction

• AddNavigationNode

• DeleteAllQuickLaunchNodes

List

• AddList

• AddDocumentLibrary

• GetList

• UpdateListVersioning

See – I *told* you it was AWESOME!

Page 28: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Branding

Create fields

and content

types

Create

lists/libraries

Create

sites/site

collections

Upload filesConfigure

navigation

App code (CSOM) to support lots of

“collab” scenarios:

Page 29: Spca2014 chris o brien   modern share-point development - techniques for off-box co

1.

2.

3.

4.

5.

6.

Page 30: Spca2014 chris o brien   modern share-point development - techniques for off-box co

1.

2.

3.

4.

5.

Page 31: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 32: Spca2014 chris o brien   modern share-point development - techniques for off-box co
Page 33: Spca2014 chris o brien   modern share-point development - techniques for off-box co

MSFT optimum Reason But consider!

NO custom master

page

MSFT want to push updates

to master pages

Your customisations could

break (e.g. DOM change)

NO XML for

provisioning, remote

code used instead

Fields/ctypes in XML causes

them upgrade problems

Unclear if any benefit to

implementor

Page 34: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Apps

No-Code

Sandbox

Solutions

PS/CSOM

scripts

Remote Event

Receivers Azure

OfficeDev

samples

Page 35: Spca2014 chris o brien   modern share-point development - techniques for off-box co

www.sharepointnutsandbolts.com

@ChrisO_Brien

Page 36: Spca2014 chris o brien   modern share-point development - techniques for off-box co

Videos:http://cob-sp.com/RER_Config_Video

http://cob-sp.com/PS_CSOM

http://cob-sp.com/OfficeDevPnPVideo

http://cob-sp.com/JSOMProvisioning

http://cob-sp.com/1d2wnD8

Page 37: Spca2014 chris o brien   modern share-point development - techniques for off-box co