Download presentation
Presentation is loading. Please wait.
Published byPoppy Rogers Modified over 8 years ago
1
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016
2
Thank you Sponsors! Use #SPSOmaha in your tweets to thank them!
3
About Me… Former Trainer / Consultant with SharePoint Working with SharePoint since SharePoint 2007 Working for Boys Town as SharePoint Developer / Architect ◦http://www.Boystown.orghttp://www.Boystown.org ◦http://www.boystownhospital.orghttp://www.boystownhospital.org ◦http://www.boystownpediatrics.orghttp://www.boystownpediatrics.org ◦http://www.yourlifeyourvoice.orghttp://www.yourlifeyourvoice.org
4
Outline Background of a SharePoint.NET Developer What Happened in Development? SharePoint Development vs. The App Model vs. Modern Development Quick Intro to Knockout ◦What is Knockout? ◦Defining Your Data ◦Defining Your Template ◦Bringing it Together Quick Intro to Web API for Integration ◦What is Web API? ◦Creating a Web API Controller ◦Deploying Your Web API Service ◦Calling a Web API Method ◦Building in Reverse (IOC and TDD) ◦as time permits only, big topic, but important ◦Limitations of Web API
5
Background of a SharePoint Developer Starts with good ASP.NET 2.0? 3.5? Web Forms Development – ASP:Controls Custom Workflows? XML Parsing for Elements and CAML SharePoint Object Model SharePoint as a Storage Layer / Integration Point While we were doing that… some stuff changed in the rest of the world…
6
What Happened in Development? MVC Web API Methods vs WCF Responsive Design / HTML5 / Attractive Layouts Client Side Development with JavaScript Single Page Application (SPA)
7
SharePoint Development vs. the App Model vs. Modern Development SharePoint Development: ◦Extend What SharePoint Already Does ◦Make it “easier” for users to interact with their data in SharePoint ◦Integrate other systems using SharePoint Technologies or Code ◦Building Bricks App Model: ◦Host Web vs. App Web ◦Trust and Security ◦Cloud Ready ◦Multi-Authenticated Users and Apps ◦Building Houses Modern Development: ◦Using More of the Modern Development Techniques in SharePoint ◦Back to “Extending SharePoint”, Building Bricks ◦Integrating External Systems into SharePoint using SharePoint Technologies or Code ◦Make SharePoint Easier to Interact with (RWD) ◦Make SharePoint “Prettier” ◦Works in Many, but not all of SharePoint Development Scenarios
8
What is KnockoutJS? JavaScript MVVM Development Pattern - http://knockoutjs.com/http://knockoutjs.com/ What does that mean? ◦Similar to MVC ◦Model-View-View Model ◦Model – Your Data ◦View – How it Looks ◦View Model – Your data and other stuff it needs to work No, really, what does that mean? ◦Write Objects ◦Write Event Handlers ◦Create HTML5 ready template ◦Let Knockout Bind it up
9
Knockout: Define Your Data JavaScript Object for your Model JavaScript Based Loader to Get the Data to Your Model ◦List View Web Part ◦Content Search Web Part ◦SharePoint Web API (uses current user’s security) Load “Assistance” Data for the View Model
10
Knockout: Define Your Template Get template from a designer Start with pure HTML and CSS Make Responsive or Good Designs ◦Don’t do JavaScript events or transitions yet! Add in the User Controls (Buttons, Drop Downs, etc.) Convert HTML Document into Knockout Bindings
11
Knockout: Bring It Together Create a JavaScript Object as Your View Model On Page Load (document.ready), call your Loader method and pass an instance of your view model to ko.applyBindings(…);
12
What is Web API? ASP.NET MVC – Resource by Route ◦Pattern Defined to Determine Code to Invoke ◦Code Determined View to Return ◦Highly Dependent on HTTP Verbs (GET, POST, PUT, etc.) ◦http(s)://url/ / / Web API – As Opposed to returning HTML, Return Data SharePoint Exposes a lot of Functionality via Web API Methods You can create your own to integrate with other systems
13
Web API: Create a Service Create an ASP.NET MVC Project Select Empty (or Web API) Define a Model – Communication Medium from Client to Service Create a Web API Controller – Use VS Templates Write Service Code for Each Method You’ll Support
14
Web API: Deployment Options First of all, use Web Deploy Deploy to a Virtual Directory Under the SharePoint Web Application ◦Benefits: ◦Can use Server Side SharePoint Object Model ◦Uses the same user security as the user that is logged in to access resources ◦Deploys to the Virtual Directory do not Recycle the Web Application ◦Drawbacks: ◦Your code runs on the same server as SharePoint ◦Not “cloud-ready” Deploy to a Separate Web Host ◦Benefits: ◦Can use SharePoint Client Side Object Model ◦Deploys do not Recycle SharePoint ◦Can be invoked by O365 (if URL is Internet Accessible) ◦Can have different security mechanism than SharePoint Site ◦Drawbacks: ◦Have to handle CORS issues (IIS Configuration or MVC NuGet) ◦Additional Infrastructure
15
Web API: Calling a Method from SharePoint Call from JavaScript on a SharePoint Page Create JS Object that will map to Model Get HTML Control Values Call the using Ajax Methods Call from SPD 2013 Workflow Using the Call HTTP Service Task Requires Azure Workflow Services Installed Substitutes for Event Receivers
16
Web API: Surrounding Technologies Building in Reverse – Single Responsibility Pattern, Dependency Injection and Inversion of Control, Mocking Objects, and Test Driven Development Controller Actions are great at handling requests and returning values to caller – Extract code to separate objects (Single Responsibility) Wouldn’t it be nice to test sections in isolation? Inject Simple Objects into the Controller, SimpleInjector (NuGet) Simple Object Creators – MOQ (NuGet) Test Driven Development – Make sure the controller works, make sure logic is extracted, make sure service objects work, separate repositories DEMO if time permits
17
Web API: Managing Limitations Security ◦JS calls to SharePoint Web API uses the current user’s permissions and does not work anonymously ◦JS calls to custom Web API requires additional configuration to use any other credentials than the Application Pool ◦Make sure to be prepared for CORS if hosted remote ◦You can protect your services with the [Authorize] Attribute Not a full replacement for all SharePoint Development Techniques ◦Custom Ribbon controls ◦Event Receivers (Use Workflow) ◦Timer Jobs (Use Externally Scheduled Console Applications or PowerShell)
18
Questions? THANK YOU FOR ATTENDING! IF TIME PERMITS, WE CAN TALK MORE ABOUT HOW TO REPLACE OTHER SHAREPOINT DEVELOPMENT OPTIONS WITH MORE “FUTURE READY” DEVELOPMENT.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.