Mike Ammerlaan Program Manager Microsoft Corporation

Slides:



Advertisements
Similar presentations
What is all about and how does it work? Client Application.
Advertisements

© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Interactivity Navigating a data model Working with large quantities of data Entry Editing and adding data User feedback and validation Presentation.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”
demo while !EmptyList Execute(next WorkItem) while !EmptyList Execute(next WorkItem) Work items are executed one at a time within a single.

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

demo User Signs Up Temporary Account is Created with Verification Link Sent User Clicks Link Account is Activated Login.Register(userName,
Virtual techdays INDIA │ august 2010 Silverlight And SharePoint Saranya Sriram │ Developer Evangelist, Microsoft.
Overview Silverlight Client Object Model JavaScript Client Object Model Calling SharePoint Web Services Summary.
DataModel VisualizationExternal Assets Workbook Excel Services API BrowserRich Apps EWA JSOMBrowser REST BrowserRich Apps.
Course Agenda Deep Dive into the Building Blocks and Services of the SharePoint Platform Module 1: Developing Advanced Workflow Scenarios in Office 365.
O SharePoint 2013 Remote Event Receivers Speaker.
MIX 09 4/17/2018 4:41 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
DoRon Motter Development Lead Microsoft Corporation
Building Dynamic Applications with the SharePoint Client Object Model
Jim Nakashima Program Manager – Cloud Tools Microsoft Corporation
SPC Developer 6/25/2018 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Accessing and Surfacing LOB Data in SharePoint 2010
Customize Office 365 Search and create result sources
Excel Services Deployment and Administration
Возможности Excel 2010, о которых следует знать
Office 365 Development.
Enterprise Metadata in SharePoint 2013
Title of Presentation 11/22/2018 3:34 PM
Developer Patterns to Integrate Silverlight 4.0 with SharePoint 2010
Deep dive on app data roaming
SharePoint & jQuery: Better Together
SharePoint data access and LINQ to SharePoint
Title of Presentation 12/2/2018 3:48 PM
Windows Azure Keenan Newton 3-021
Agenda OAuth Concepts Programming OAuth.
SPC Developer 1/1/2019 Deep Dive on the Capabilities of SharePoint Online's New Public Website Josh Stickler Program Manager WCM Kevin Gjerstad Principal.
OPEN DATA FOR THE OPEN WEB
Hooking into Apps for SharePoint
Tailor your SharePoint 2013 social layer according to your needs
Pablo Castro Software Architect Microsoft Corporation
Maxim Lukiyanov Program Manager Microsoft Corporation
Silverlight Debugging
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
SharePoint 2013 Authentication with Azure – Part 1
Windows 8 Security Internals
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
The complete developer's guide to the SkyDrive API
Title of Presentation 5/24/2019 1:26 PM
Title of Presentation 7/24/2019 8:53 PM
Office 365 Development.
Building Data-Driven Applications Using "Quadrant" and "M"
WCL425 App Compat for Nerds Chris Jackson.
Presentation transcript:

Mike Ammerlaan Program Manager Microsoft Corporation 2/18/2019 2:29 PM PR07 Developing Solutions for Microsoft SharePoint Server 2010 Using the Client Object Model Mike Ammerlaan Program Manager Microsoft Corporation © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Overview of Data Technologies 2/18/2019 2:29 PM Overview of Data Technologies Methods, MOSS Weakly-typed lists Strongly-typed lists Web Services Client OM REST APIs Client-side Data Platform Farm Site List Data External Lists Server OM Server-side Weakly-typed lists LINQ Strongly-typed lists New in 2010 Improved © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Client Object Model Agenda The Basics Queries Exception Scopes Conditional Load Silverlight Cross-site Data Access

Client Object Model: The Basics Client-side library for remotely calling SharePoint Mirrors (a subset) of objects on the server Usable in JavaScript, .net CLR, Silverlight CLR Requests are batched for over-the-wire performance Used by SharePoint UI for operations like batch deletion

Starting with the client OM .NET CLR: 14\ISAPI Silverlight: 14\TEMPLATE\LAYOUTS\ClientBin Packaged .XAP coming post-beta JavaScript: Use <ScriptLink>/SP.SOD.execute to add JS files Microsoft.SharePoint.Client 281kb Microsoft.SharePoint.Client.Runtime 145kb SP.js 380kb SP.Core.js 13kb SP.Runtime.js 68kb

Getting Started: 3 things to know 1. ClientContext is the central object 2. Before you read a property, you have to ask for it 3. All requests must be committed in a batch clientContext = new ClientContext(“http://mysite”); clientContext.Load(list); clientContext.ExecuteQuery();

Hello World, Client Object Model

C# private ClientContext context; private Web web; private void TestButton_Click(object sender, RoutedEventArgs e) { context = ClientContext.Current; web = context.Web; context.Load(web); context.ExecuteQueryAsync(TitleRetrievedContinue, null); } private void TitleRetrievedContinue(object sender, ClientRequestSucceededEventArgs args) web.Title = web.Title + " + Silverlight"; web.Update(); context.ExecuteQueryAsync(SayDone, null);

JavaScript var context; var web; function testButtonClick() { context = new SP.ClientContext(); web = context.get_web(); context.load(web) context.executeQueryAsync(titleRetrievedContinue); } function titleRetrievedContinue() web.set_title(web.get_title() + " + JavaScript"); web.update(); context.executeQueryAsync(sayDone);

Accessing Data with Client OM Client Application Client Application WPF/WinForm/Office Silverlight JavaScript Client OM client ExecuteQuery() XML server JSON Web Service Client.svc Server Application SharePoint API SharePoint Data

Major Objects in Client Object Model Microsoft SharePoint Conference 2009 2/18/2019 Major Objects in Client Object Model Site Web ContentType Change List Navigation Form NavigationNode View UserCustomAction Field RoleDefinition ListItem RoleAssignment Folder WorkflowAssociation User Interface Data and Schema File WorkflowTemplate Logic WebPart Security © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Items not covered by CSOM User Profiles Excel REST web services People Publishing Search Administration Enterprise Metadata

Client Object Model Limitations Client object model cannot be used on server to talk to same-server You still need to handle synch/update semantics (change log could help) No elevation of privilege capabilities Requests are throttled .net CLR has sync method; Silverlight CLR and Jscript are async

Retrieval Queries By default, .Load will fetch most* simple properties of an object Explicitly need to retrieve client objects or child collections You can use Linq to further define the shape of your queries What properties to include What sub-objects to retrieve (List items still need to use CAML queries)

Web Properties: Default Operations bool AllowRssFeeds bool AllowRssFeeds bool AllowRssFeeds Group AssociatedMemberGroup ContentTypeCollection ContentTypes DateTime Created DateTime Created DateTime Created User CurrentUser String Description String Description String Description FieldCollection Fields Guid Id Guid Id Guid Id List Lists List Lists bool RecycleBinEnabled bool RecycleBinEnabled bool RecycleBinEnabled Folder RootFolder Folder RootFolder String Title String Title String Title clientContext.Load(web); clientContext.Load(web.RootFolder); clientContext.Load(web.Lists);

Advanced queries using Linq

Query Syntax var query = from list in clientContext.Web.Lists          where list.Title != null          select list;   var result = clientContext.LoadQuery(query); clientContext.ExecuteQuery();

Method Syntax clientContext.Load(oList,list => list.Fields .Where(field => field.Hidden == false && field.Filterable == true)); clientContext.ExecuteQuery();

Query Modes: Fill vs. Query “Fill”: context.Load(object, params LinqExpression) Fills out the objects in the context: in-place ‘method syntax’ linq “Query”: context.LoadQuery(IQueryable) Use linq query to return custom objects Not filled into the context ‘query syntax’ and ‘method syntax’ linq

Method Query Syntax Basics Use .Where method to: Filter down items retrieved in a collection Use .Include method to: Explicitly select properties or child objects to retrieve You own specifying what you want! (use .IncludeWithDefaultProperties for default + custom properties) Use .Take method to: Restrict overall number of items retrieved

Queries and Filtering

Client Object Model Advanced Topics Exception Handling Use to react to exceptions within a batch Conditional Scope + Retrieves Use to check conditions before doing loads, on the server within a batch Uses scopes and using statements (IDisposable) to signify how methods are filtered

Exception Handling & Conditional Load

Silverlight Cross-Site Data Access using the Client Object Model The Problem: You want to host powerful apps on SharePoint that use data on another server You want to minimize impact to SharePoint deployments Silverlight is (generally) limited to calls on one domain One solution: host XAP on external server & delegate user token

Browser Page (http://sharepoint/page.aspx) 2. Page is instantiated with special token Silverlight XAP (http://scrum/myscrum.xap) 3. XAP calls back to custom web service on host server, with token client server http://sharepoint http://scrum 1. Web Part is added to page with application markup that indicates host server is http://scrum 4. App server can forwards client OM request on behalf of user

Cross-site data access: core concepts Application Principal SPUser that represents the incoming request account Effective permissions of Silverlight w/ client OM = Permissions of App Principal & Initiating User Application XML Contains hosting server information External Application Provider Can be deployed to host server to provide customized application-add experience Request Forwarder Code deployed to remote server to forward requests

Cross-Site Data Access

Getting Started: 3 things to know 1. ClientContext is the central object 2. Before you read a property, you have to ask for it 3. All requests must be committed in a batch clientContext = new ClientContext(“http://mysite”); clientContext.Load(list); clientContext.ExecuteQuery();

Overview of Data Technologies 2/18/2019 2:29 PM Overview of Data Technologies Methods, MOSS Weakly-typed lists Strongly-typed lists Web Services Client OM REST APIs Client-side Data Platform Farm Site List Data External Lists Server OM Server-side Weakly-typed lists LINQ Strongly-typed lists New in 2010 Improved © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

YOUR FEEDBACK IS IMPORTANT TO US! Please fill out session evaluation forms online at MicrosoftPDC.com

channel9.msdn.com/learn 2/18/2019 2:29 PM Learn More On Channel 9 Expand your PDC experience through Channel 9 Explore videos, hands-on labs, sample code and demos through the new Channel 9 training courses channel9.msdn.com/learn Built by Developers for Developers…. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/18/2019 2:29 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/18/2019 2:29 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.