Upload
nccomms
View
166
Download
3
Embed Size (px)
Citation preview
Modern SharePoint Development -techniques for moving code off SharePoint servers
Chris O’Brien - MVP
Blog: www.sharepointnutsandbolts.com
Twitter: @ChrisO_Brien
LinkedIn: http://uk.linkedin.com/in/chrisobrienmvp
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)
• 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
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
| | | | etc.
JavaScript-based approaches can be interesting!
http://cob-sp.com/JSOMProvisioning
External
not
(and more to come!)
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?)
(Remote Event Receivers)
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!
0
100
200
300
400
500
600
700
800
900
Poweshell cmdlets
PS cmdlets
On-premises SharePoint Online
On-premises SharePoint Online
774 30
Instead, use STANDARD PowerShell
command prompt for PS + CSOM
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
https://github.com/OfficeDev/
Because it’s AWESOME – it’s the “helper library” you
dreamed about, plus samples you’d use!
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!
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:
1.
2.
3.
4.
5.
6.
1.
2.
3.
4.
5.
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
Apps
No-Code
Sandbox
Solutions
PS/CSOM
scripts
Remote Event
Receivers Azure
OfficeDev
samples
www.sharepointnutsandbolts.com
@ChrisO_Brien
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