Microsoft ® Official Course Client-Side SharePoint Development SharePoint Practice Microsoft SharePoint 2013.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Module 1: Creating Responsive Pages with Ajax Creating Partial-Page Updates by Using AJAX Scripting Actions on the Web Client.
SharePoint 2013 – REST, JSON and SharePoint Designer
OASIS OData Technical Committee. AGENDA Introduction OASIS OData Technical Committee OData Overview Work of the Technical Committee Q&A.
Minneapolis Office Developer Interest Group (MODIG) December 10, 2009 Client Object Model Development Neil Iversen
Introduction To: Client Object Model Development March 20, 2009 SharePoint Saturday Neil Iversen
Microsoft ® Official Course Creating Robust and Efficient Apps for SharePoint Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.
Microsoft SharePoint 2013 SharePoint 2013 as a Developer Platform
Microsoft ® Official Course Working with SharePoint Objects Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Developing Remote-hosted Apps for SharePoint Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Developing Optimized Internet Sites Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Introducing Apps for SharePoint SharePoint Practice Microsoft SharePoint 2013.
Microsoft ® Official Course Managing and Accessing User Profile Data Microsoft SharePoint 2013 SharePoint Practice.
Microsoft ® Official Course Developing Managed Metadata Solutions Microsoft SharePoint 2013 SharePoint Practice.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
©2012 Microsoft Corporation. All rights reserved. Content based on SharePoint 2013 Technical Preview and published July Introducing.
App development in SharePoint 2013 LIVE Introducing Cloud App Model Cloud-hosted Apps Experiences from the Field.
Intelligent Tutoring System Mobile Communication Team Drew Boatwright Nakul Dureja Richard Liou.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Hennie Laubscher K2 Brian Farnhill Independent Consultant.
Agenda What is AJAX? What is jQuery? Demonstration/Tutorial Resources Q&A.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
JavaScript & jQuery the missing manual Chapter 11
Facebook Like Solution in SharePoint Using JavaScript Amie Seisay
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Server-side Scripting Powering the webs favourite services.
Securing Microsoft® Exchange Server 2010
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
06/10/2015AJAX 1. 2 Introduction All material from AJAX – what is it? Traditional web pages and operation Examples of AJAX use Creating.
Module 9 Configuring Messaging Policy and Compliance.
Cross Site Integration “mashups” cross site scripting.
Windows 8 Application Microsoft Word with Apps For Office Internal O365 SharePoint Site Windows Azure Cloud Services Windows Azure Workflow Server.
Chapter 6 Server-side Programming: Java Servlets
Module 10 Administering and Configuring SharePoint Search.
Ventsislav Popov Crossroad Ltd.. 1. What is AJAX?  AJAX Concept  ASP.NET AJAX Framework 2. ASP.NET AJAX Server Controls  ScriptManager, UpdatePanel.
New & Improved Events List Relationships and Joins Large List Support Field & List Item Validation.
Introduction to the SharePoint 2013 REST API. 2 About Me SharePoint Solutions Architect at Sparkhound in Baton Rouge
Database Handling, Sessions, and AJAX. Post Back ASP.NET Functionality The IsPostBack method in ASP.NET is similar to the BlackBerry.refresh method –IsPostBack.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
Online Conference June 17 th and 18 th SharePoint Online Administration with PowerShell.
Asynchronous Javascript And XML AJAX : an introduction UFCEUS-20-2 : Web Programming.
WORKING WITH THE “CALL HTTP WEB SERVICE” WORKFLOW ACTIVITY Derek Nishino Nishino Consulting
Microsoft ® Official Course Developing a Publishing Site for Web Content Microsoft SharePoint 2013 SharePoint Practice.
ICM – API Server & Forms Gary Ratcliffe.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Welcome to the Minnesota SharePoint User Group February 13 th, 2013 SharePoint 2013 – Developers Track - Client Side Rendering.
Microsoft ® Official Course Implementing Enterprise Content Management Microsoft SharePoint 2013 SharePoint Practice.
CHAPTER 8 AJAX & JSON WHAT IS AJAX? Ajax lets you…
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
Microsoft ® Official Course Module 9 Working with Business Connectivity Services.
Course Agenda Deep Dive into the Building Blocks and Services of the SharePoint Platform Module 1: Developing Advanced Workflow Scenarios in Office 365.
A Developer’s Introduction to SharePoint 2013 Apps Ryan McIntyre, MCITP, MCPD National
Powering up your Office 365 cmdlets with CSOM Bjoern H Rapp, Senior Architect Public Cloud, SopraSteria.
CSOM and REST Name Title Company.
Building Dynamic Applications with the SharePoint Client Object Model
SharePoint Architect & Developer
An introduction to REST for SharePoint 2013
CMPE 280 Web UI Design and Development October 24 Class Meeting
SharePoint Online Development Best Practices
02 | Web API Basic Design Jeremy Likness | Principal Architect
03 | Client Side SharePoint Development
Windows Azure Keenan Newton 3-021
Mike Ammerlaan Program Manager Microsoft Corporation
Presentation transcript:

Microsoft ® Official Course Client-Side SharePoint Development SharePoint Practice Microsoft SharePoint 2013

Module Overview Using the Client-Side Object Model for Managed Code Using the Client-Side Object Model for JavaScript Using the REST API with JavaScript

Lesson 1: Using the Client-Side Object Model for Managed Code Overview of the Managed CSOM Using Client Context, Loading Objects, Executing Queries Reading SharePoint Data Changing SharePoint Data Handling Server-Side Errors

Overview of the Managed CSOM When to use the Managed CSOM Components of the Managed CSOM Using the CSOM proxy Application SharePoint Managed CSOM Service Proxy Custom C# Code Client.svc Content DB XML JSON

Using Client Context, Loading Objects, Executing Queries public string getSiteCollectionUrl () { string appWebUrl = Page.Request["SPAppWebUrl"]; using (ClientContext context = new ClientContext(appWebUrl)); { Site siteCollection = context.Site; context.Load(siteCollection, s=>s.Title, s=>s.ServerRelativeUrl); context.ExecuteQuery(); return siteCollection.Url; }

Reading SharePoint Data Obtain a collection of lists in a site: Obtain a list by its title: Obtain items in a list by using a CAML query: ListCollection allLists = currentWeb.Lists; List suggestionsList = allLists.GetByTitle("Suggestions");

Changing SharePoint Data Creating lists: Create a ListCreationInformation object Pass the object to Web.Lists.Add() Creating items: Create a ListItemCreationInformation object Pass the object to List.AddItem() Updating items: Set fields on an item Call Item.Update() Deleting items: Call Item.DeleteObject()

Handling Server-Side Errors Use an exception handling scope for server-side errors as in the JavaScript CSOM Use using() { } code blocks to ensure correct disposal of objects Make sure there is only one call to ExecuteQuery() after the exception handling scope is disposed of

Lab A: Using the Client-Side Object Model for Managed Code Exercise 1: Create the Mileage Claim List Exercise 2: Add Mileage Claim Creation Code Exercise 3: Display Mileage Claims on the App Start Page

Lab Scenario The field sales team at Contoso regularly submits expense claims for mileage. Because of the fluctuating price of fuel, variable tax rates, and other factors, some salespeople find it difficult to calculate their expense claims accurately. To help the sales team, you will implement an app that calculates mileage expenses. To ensure that the app always uses the latest formula and to remove the processing burden from client browsers, you decide to create an autohosted app. The app will prompt users for the required information, calculate the claimable expenses, and then submit the claim on behalf of the salesperson.

Lab Review In Exercise 2, how did you ensure that all pages in the remote web could locate the app web in SharePoint to read or write data?

Lesson 2: Using the Client-Side Object Model for JavaScript Overview of the CSOM for JavaScript Using the Client Context Object Loading Objects and Running Queries Demonstration: How to Use load and loadQuery Reading SharePoint Data Changing SharePoint Data Handling Server-Side Errors

Overview of the CSOM for JavaScript Components of the CSOM Linking to script libraries Using the CSOM proxy App SharePoint JavaScript CSOM Service proxy Custom JavaScript Client.svc Content database XML JSON

Using the Client Context Object getSiteCollection = function () { context = new SP.ClientContext.get_current(); siteCollection = context.get_site(); context.load(siteCollection); context.executeQueryAsync(onSuccess, onFailure); }, onSuccess = function () { alert("URL: " + siteCollection.get_url()); }, onFailure = function(sender, args) { alert("Could not obtain the site collection URL"); }

Loading Objects and Running Queries Loading objects The context.load() method The context.loadQuery() method Executing operations Asynchronous Synchronous

Demonstration: How to Use load and loadQuery In this demonstration, you will see how to: Use the load method from the JavaScript CSOM to load items Loop through results by using an enumerator Use the loadQuery method from the JavaScript CSOM to load items Loop through results by using the forEach method

Demonstration: How to Use load and loadQuery

Reading SharePoint Data Reading all the lists in a site Getting a list by title Getting items in a list by using a CAML query Getting an item by ID

Changing SharePoint Data Creating a new list in a site Creating a new item in a list Using SP.ListItemCreationInformation Updating an existing item in a list Deleting an item from a list

Handling Server-Side Errors By default, a server-side error causes the whole batch of operations to fail. To avoid this, you can use an exception handling scope to define server-side try/catch/finally blocks var e = new SP.ExceptionHandlingScope(context); var s = e.startScope(); var t = e.startTry(); // This is the try block. t.dispose(); var c = e.startCatch(); // This is the catch block. c.dispose();

Lesson 3: Using the REST API with JavaScript Overview of the REST API SharePoint REST API URLs Reading Data Creating and Updating Data

Overview of the REST API RESTful services: Use logical URLs to specify objects Use HTTP verbs to specify operations Use OData to exchange data The SharePoint Client.svc service is a REST API $.getJSON( " function (data) { alert('The SharePoint site is called: ' + data.d.Title); } )

SharePoint REST API URLs Address of the REST API URLs for common SharePoint objects Using OData operators /_api/web/lists/getbytitle("MyList")/items ?$select=ID,Title &$order=Title &$filter=startswith(Title,”A”)

Reading Data Using the _spPageContextInfo.webServerRelativeUrl property The jQuery getJSON() function The jQuery ajax() function

Creating and Updating Data Creating new items Formulate a URL to the parent list in the REST API Use the POST verb Updating existing items Formulate a URL to the item itself Use the PATCH, MERGE, or PUT verbs Deleting items Formulate a URL to the item itself Use the DELETE verb Always pass a form digest

Lab B: Using the REST API with JavaScript Exercise 1: Creating List Relationships Exercise 2: Add Vote Recording Exercise 3: Display Votes for Each Suggestion

Lab Scenario The management team at Contoso has asked that you extend the Site Suggestions app to include more sophisticated functionality. In particular, they want users to be able to vote on suggestions made by others. Votes can be positive or negative, and the net votes should be displayed with each item.

Lab Review In the code that retrieves and displays votes, how did you ensure only votes for the current suggestion are retrieved from SharePoint? In Exercise 2, you passed a form digest with REST request. Why was this form digest unnecessary in the REST request you formulated in Exercise 3?

Module Review and Takeaways Review Question(s) Common Issues and Troubleshooting Tips