philly code camp oct sharepoint/office 365 developer best practices
TRANSCRIPT
Confidential Jennifer KenderdineProduct Application Lead for SharePoint
OCTOBER 10, 2015
SharePoint / Office 365Developer Best Practices
Featuring a Keynote fromScott GuthrieExecutive Vice PresidentCloud & Enterprise
Microsoft Azure TourTuesday, Oct 13, Philadelphia
A FREE day of Technical Training on October 13 at the Philadelphia Convention Center!Top engineers from Redmond and independent experts from around the world will present: 12 technical sessions across two tracks (IT Experts and
Developers) 6 hands-on labs
Security, Networking, Big Data, Storage, Identity, Web, Mobile, Hybrid, Containers, Devops, Open Source, Management, Internet of Things
Whether you’re new to the cloud or an existing user, you’ll learn something new and walk away ready to apply your discoveries.
Register now! http://MicrosoftAzureTour.com
Confidential ● trellist.com ● 05/03/2023 ● 4
AgendaKnow SharePoint:
• Configure vs. Custom• Terminology• Planning• Pages
Dev Environment & Tools
API’s & Plugins
Branding & Design
Add-Ins & Custom Solutions
Error Logging
Performance
References
Q & A
Confidential ● trellist.com ● 05/03/2023 ● 5
Know SharePoint
Confidential ● trellist.com ● 05/03/2023 ● 6
Configure vs. Custom
Do you know: • Hierarchy• Base Architecture • Difference between File System and Content Database• Business case for creating the customization
Confidential ● trellist.com ● 05/03/2023 ● 7
Configure vs. Custom
Do you know what options you have with “out of the box” configurations?
• Training is key to knowing what you can do before you create that Visual Studio Project
• You need to be more than a .Net DEV - Understanding SharePoint under the covers is Fundamental
• Know the requirements
• Understand Enhanced Workflow model
Confidential ● trellist.com ● 05/03/2023 ● 8
Do you know the terminology?
Client Context
AppWeb
Root Web
HIVEREST
Host Web
Content Database CSOM
Site Collection
Confidential ● trellist.com ● 05/03/2023 ● 9
Configure vs. Custom
• Keep long term maintenance in mind – who takes over when you leave?
• End Users?• Power Users?• Admins?• Other?
Confidential ● trellist.com ● 05/03/2023 ● 10
Key Elements in Planning
• Reusable – “Once and Done”• Testable• Error Handling• Deployable• Maintainable
Confidential ● trellist.com ● 05/03/2023 ● 11
SharePoint Pages
• Know the web parts to use and when• Content Editor
• Reference files vs. “Edit Source”• Script Editor• Content Query• Form Parts• Filters• Content Search
• Maintenance Mode (?contents=1)• Force Edit Mode (?ToolPaneView=2&pagemode=edit)
Confidential ● trellist.com ● 05/03/2023 ● 12
Development Environment
Confidential ● trellist.com ● 05/03/2023 ● 13
DEV Environment Options
• Office 365 Developer Site• Visual Studio• Cloud-based Visual Studio• NAPA (Office 365 Dev)• Guidance from Microsoft
Confidential ● trellist.com ● 05/03/2023 ● 14
DEV Environment Options
• On premise DEV• DEV Environment should mirror
production• Document the install and configuration• Build your own• Visual Studio is installed on the same
computer.
Confidential ● trellist.com ● 05/03/2023 ● 15
Developer Tools
• SharePoint Designer• NAPA (Office 365 Dev)• Visual Studio / Other Code Editors• Git / TFS / other source code management• Debugging tools
• Fiddler• Built in browser debuggers
• Office 365 Developer Patterns & Practices on github
Confidential ● trellist.com ● 05/03/2023 ● 16
API’s and Plugins
Confidential ● trellist.com ● 05/03/2023 ● 17
API’s and Plugins
• Central Library• Scripts (JavaScript, CSS, HTML) • Plugin references (I.e. JQuery)
• Add Content Types (I.e. JavaScript Display Templates)• Use relative paths to reference the required files to use the JavaScript
object model within existing web (/_layouts/15/sp.js)• Client API examples, JavaScript API, .Net API, REST examples
Confidential ● trellist.com ● 05/03/2023 ● 18
Branding and Design
Confidential ● trellist.com ● 05/03/2023 ● 19
Branding and Design
• Use industry best practices and workflow to complete the designs• Plan• Create the assets
• Imagery• CSS Stylesheets• HTML• Scripts
• Build• Test• Package for re-usability
Confidential ● trellist.com ● 05/03/2023 ● 20
Branding and Design
• The Cloud App Model – Remote Provisioning• Code samples for Site Provisioning• Site branding and page customizations• Theming & Alternate CSS• Display Templates
• On Premise – Features in Full trust code
Confidential ● trellist.com ● 05/03/2023 ● 21
Branding and Design
• Master Page Gallery• Always make a copy of the following before you make edits:
• Existing master page• Page layout(s)
• Customizing could cause issues with upgrades• Do you know the difference?
• Ghosted• Unghosted• Customized• Uncustomized
Confidential ● trellist.com ● 05/03/2023 ● 22
Client Side Rendering | JSLink
• JSLink files (JavaScript Display Templates) can be used to quickly and easily change how a list view or a form is rendered
• Master Page Gallery Display Template or Content Type in a library?
Confidential ● trellist.com ● 05/03/2023 ● 23
Add-Ins and Custom Solutions
Confidential ● trellist.com ● 05/03/2023 ● 24
Add-Ins and Custom Solutions
• Moving outside of the Server Side Object Model is more secure and upgradeable
• Full Trust code: if not done well• Impacts performance• Makes upgrades difficult
• Think “Cloud” development (Add-Ins)• Client Side Object Model• REST / OData clients
• Hosting Models and Deployment choices• App Web
Confidential ● trellist.com ● 05/03/2023 ● 25
Add-Ins and Solutions
• Web Parts• Features• Event Receivers• Timer Jobs
Confidential ● trellist.com ● 05/03/2023 ● 26
Error Logging
Confidential ● trellist.com ● 05/03/2023 ● 27
Exceptions in the Code
• Exception Management in SharePoint• Where to log?
• Trace log• ULS Log• SharePoint list• Workflow History List (in SharePoint Workflow)
• Error Messages• Catch the most specific type of exception you can
• Makes the bugs easier to find• If you know the type of error you can customize the Error Messages
users see to make them as user friendly as possible• Avoid empty catch blocks
• Comment the Code
Confidential ● trellist.com ● 05/03/2023 ● 28
Performance
Confidential ● trellist.com ● 05/03/2023 ● 29
Performance Troubleshooting
• Developer Dashboard • On Premise Only
• Stack Tracing • Correlation ID
• Diagnostic Logging• Usage Reporting• SQL Server Performance• Disposal of objects
Confidential ● trellist.com ● 05/03/2023 ● 30
References
Confidential ● trellist.com ● 05/03/2023 ● 31
Links for SharePoint Developers
• Get started creating SharePoint-Hosted Ad-Ins• Dev.Office.com/patterns-and-practices• Dev.Office.com/Getting-started• Dev.Office.com/training• Microsoft Virtual Academy
• Developing Microsoft SharePoint 2013 Core Solutions
• JSLink code samples• Bill Baer blog on creating dev environment• Workflow Fault Handling• Monitoring and Maintaining SharePoint 2013
Confidential ● trellist.com ● 05/03/2023 ● 32
Questions?
Thank You
Trellist Overview
About Trellist
Professional ServicesFirm since 1995
Intelligent SolutionsEmployee Shared
Entrepreneurial Company
Unique CollectiveApproach to Business
Empowering CultureClients as Partners
Immersion and Efficiency
130 Employees across 5 Divisions:
ConsultingBranding + Marketing
DigitalEnterprise Technology
Staffing
About Trellist
About Trellist
Industry LeadingClients
Regional, National and GlobalVaried IndustriesTrusted Partner
Intelligent Solutions that Create Business Value
Broad CapabilitiesDeep Expertise
Stronger Solutions
Dynamic Options in Professional Services
Agency ModelsStaffing ModelsHybrid Models