SlideShare a Scribd company logo
Building Dynamic Applications
with the SharePoint Client Object
             Model

           Eric Shupps
      SharePoint Server MVP
About Me

•   SharePoint Server MVP
•   President, BinaryWave
•   Microsoft Patterns & Practices (spg.codeplex.com)
•   CKS:DEV (cksdev.codeplex.com)
•   Web: www.binarywave.com
•   Blog: www.sharepointcowboy.com
•   Twitter: @eshupps
•   Facebook: www.facebook.com/sharepointcowboy
Agenda
•   Introduction to the Client Object Model
•   .NET Client Object Model
•   Silverlight and Client Object Model
•   JavaScript and Client Object Model
• Demos
     •   Building .NET, Silverlight, Javascript and WPF Client Applications
         with SharePoint Data
                   “T h i s s e s s i o n i s a
                    hunk y dor y j ol l y
                    g o o d a w e s o me n e s s
                              t hi ngy ”
                                            - Tobias Zimmergren
Legacy Data Access

        SharePoint Data


                              Server
         SharePoint API
                            Application

   Web Service



       Client Application
Client Object Model




              Client Application

       .Net CLR    Silverlight     JavaScript
Accessing Data with Client OM
Browser


     JavaScript Controls


                                        Server
              JavaScript OM             Object
                                        Model
                   Proxy
                               Client
                              Service

                  Proxy


                Managed OM              Content
                                        Database


         Managed Controls


Client                                        Server
Equivalent Objects

Server         .NET Managed            Silverlight             JavaScript
(Microsoft     (Microsoft.SharePoint   (Microsoft.SharePoint   (SP.js)
.SharePoint)   .Client)                .Client.Silverlight)
SPContext      ClientContext           ClientContext           clientContext
SPSite         Site                    Site                    site

SPWeb          Web                     Web                     web

SPList         List                    List                    list

SPListItem     ListItem                ListItem                listItem

SPField        Field                   Field                   field
Getting Started: 3 things to know

• ClientContext is the central object
   clientContext =
   new ClientContext(“http://mysite”);

• Before you read a property, you have to ask for it
   clientContext.Load(list);


• All requests must be committed in a batch

   clientContext.ExecuteQuery();
High level handling of commands

   Client Application                   Server

       Sequence of                     Client.svc
       commands:
       command 1;
       command 2;                  Execute commands
       command 3;                     in the batch:
                            XML
  context.ExecuteQuery();             command 1;
                                      command 2;
                                      command 3;
                            JSON
     Process results                Send results back
Client Object Model Limitations

• You must handle synch/update semantics in
  code
• No elevation of privilege capabilities
• Requests are throttled
• .net CLR has sync method;
  Silverlight CLR and Jscript are async
• Limited subset of Server OM functionality
• You only get what you ask for – nothing more
  (but sometimes less)
.Net CLR Client OM

• Provides easy access from remote .NET clients
  to manipulate SharePoint data
• Can be utilized from managed code – also from
  office clients etc.
• Assemblies
   ● Microsoft.SharePoint.Client.dll (281kb)
   ● Microsoft.SharePoint.Client.Runtime.dll
     (145kb)
       • To Compare: Microsoft.SharePoint.dll –
         15.3MB
DEMO
Building a .NET Client OM Application
Using SharePoint Data
Silverlight in SharePoint 2010

• Native Silverlight web part allows for compilation
  and deployment of XAP-only solutions
• One-click deployment from Visual Studio 2010
• Web Parts can contain custom properties that
  are sent to Silverlight via the InitParams property
• Abstracted visual design in Expression (make
  the designer do it!)
Silverlight CLR Client OM

• Use the correct references:
  ● C:Program FilesCommon FilesMicrosoft
    SharedWeb Server Extensions
    14TEMPLATELAYOUTSClientBin
        –Microsoft.SharePoint.Client.Silverlight
           »262KB
        –Microsoft.SharePoint.Client.Silverlight.R
         untime
           »138KB
Silverlight Client OM
Building and Deploying Silverlight

• Built in support in Visual Studio 2010
• Redirect assembly output into Module
• F5 deploy and debug experience



                    SharePoint WSP
    Visual Studio
    builds WSP        Module
    package on
    F5                         XAP
DEMO
Building a Silverlight Client OM Application
Using SharePoint Data
JavaScript Client OM

• Provides similar functionality to .NET/Silverlight COM from
  JavaScript/ECMAScript
• Identical structure
   ● Initialize Context -> Specify Items -> Load Objects ->
     Execute Query
• Limited to current site context (no cross-site scripting)
• Asynchronous (like Silverlight)
• Be aware of syntax changes
   ● get_web()
   ● get_lists()
   ● get_item()
DEMO
Building a Javascript Client OM Application
Using SharePoint Data
Your Feedback is Important

      Please fill out a session evaluation form.

                     Thank you!

More Related Content

PPTX
Windows communication foundation (part2) jaliya udagedara
PDF
Progressive Web Apps
PPTX
Client Object Model - SharePoint Extreme 2012
PPTX
Single Page Applications on JavaScript and ASP.NET MVC4
PPTX
Valentine with Angular js - Introduction
PPTX
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
PPTX
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
PPTX
SharePoint 2013 APIs
Windows communication foundation (part2) jaliya udagedara
Progressive Web Apps
Client Object Model - SharePoint Extreme 2012
Single Page Applications on JavaScript and ASP.NET MVC4
Valentine with Angular js - Introduction
Building rich Single Page Applications (SPAs) for desktop, mobile, and tablet...
Building Real Time Applications with ASP.NET SignalR 2.0 by Rachel Appel
SharePoint 2013 APIs

What's hot (20)

PDF
Introduction to asp.net
PPTX
ASP.NET MVC and ajax
PPTX
SharePoint 2013 Javascript Object Model
PDF
Dot net interview questions and asnwers
PPTX
ASP.NET MVC Performance
PPTX
Building Modern Websites with ASP.NET by Rachel Appel
PPTX
PDF
Asp .net web form fundamentals
PPTX
Introduction ASP
PPTX
ASP.NET - Building Web Application..in the right way!
PPTX
ASP.NET MVC 5 - EF 6 - VS2015
PDF
Asp dot net final (2)
PPT
Asp.net.
PPTX
MVC 6 - the new unified Web programming model
PPTX
Introduction to ajax
PPT
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
PPTX
MVC Training Part 1
PPTX
Ch3 server controls
PDF
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
PPTX
Server-side Web development via Ruby on Rails
Introduction to asp.net
ASP.NET MVC and ajax
SharePoint 2013 Javascript Object Model
Dot net interview questions and asnwers
ASP.NET MVC Performance
Building Modern Websites with ASP.NET by Rachel Appel
Asp .net web form fundamentals
Introduction ASP
ASP.NET - Building Web Application..in the right way!
ASP.NET MVC 5 - EF 6 - VS2015
Asp dot net final (2)
Asp.net.
MVC 6 - the new unified Web programming model
Introduction to ajax
.net training | learn .net | Microsoft dot net Course | Microsoft dot net onl...
MVC Training Part 1
Ch3 server controls
JavaCro'15 - Secure Web Services Development - Askar Akhmerov
Server-side Web development via Ruby on Rails
Ad

Similar to Building dynamic applications with the share point client object model (20)

PDF
SharePoint Saturday The Conference DC - How the client object model saved the...
PPT
Introduction to the Client OM in SharePoint 2010
PPTX
Rest API and Client OM for Developer
PPTX
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
PDF
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
PPTX
STUG-Client Object Model SharePoint 2010
KEY
SharePoint 2010 Client Object Model
PPTX
Access SharePoint Remotely
PPTX
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
PPTX
SharePoint 2013 APIs demystified
PPTX
SharePoint Client Object Model (CSOM)
PDF
Introduction to share point 2010 development
PPTX
Programming SharePoint 2010 with Visual Studio 2010
PPTX
Spicing up SharePoint web parts
PDF
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
PDF
WKDNUG SP2010 Development Presentation
PPTX
Introduction to the SharePoint Client Object Model
PPTX
Session 7 - Integrating share point with silverlight firestarter
PPTX
Creating Great Applications in SharePoint 2010 with Silverlight 4
PPTX
SharePoint 2013 - What's New
SharePoint Saturday The Conference DC - How the client object model saved the...
Introduction to the Client OM in SharePoint 2010
Rest API and Client OM for Developer
4 - Silverlight y SharePoint, por Rodrigo Diaz y Mauricio Angulo
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
STUG-Client Object Model SharePoint 2010
SharePoint 2010 Client Object Model
Access SharePoint Remotely
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint 2013 APIs demystified
SharePoint Client Object Model (CSOM)
Introduction to share point 2010 development
Programming SharePoint 2010 with Visual Studio 2010
Spicing up SharePoint web parts
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
WKDNUG SP2010 Development Presentation
Introduction to the SharePoint Client Object Model
Session 7 - Integrating share point with silverlight firestarter
Creating Great Applications in SharePoint 2010 with Silverlight 4
SharePoint 2013 - What's New
Ad

More from Eric Shupps (20)

PPTX
Microsoft Ignite 2022 - Scaling, Securing, Managing, and Publishing Power Pla...
PPTX
Scaling, Securing, Managing, and Publishing Power Platform Custom Connectors....
PDF
A Beginners Guide to Custom Connectors for Power Apps and Power Automate
PDF
App to AppExchange - A Journey from Idea to Market for Salesforce Developers
PPTX
Beginners Guide to Custom Connectors for Power Apps and Power Automate
PPTX
OSW06 - A Real World Guide to Building Highly Available Fault Tolerant ShareP...
PPTX
OSH01 - Developing SharePoint Framework Solutions for the Enterprise
PPTX
Mastering Modern Authentication and Authorization Techniques for SharePoint, ...
PPTX
Developing SharePoint Framework Solutions for the Enterprise (SPC 2019)
PPTX
Developing SharePoint Framework Solutions for the Enterprise - SEF 2019
PPTX
SharePoint and Office 365 Development Workshop
PPTX
ECS 2018: Introduction to Azure Web Applications
POTX
SharePoint 24x7x365 Architecting for High Availability, Fault Tolerance and D...
PPTX
Overcoming Gender Imbalance in the Technical Field
POTX
Mastering Modern Authentication and Authorization for SharePoint and Office A...
PPTX
Enterprise Content Management Solutions in SharePoint and Office 365
PPTX
Introduction to the Office Dev PnP Core Libraries
PPTX
SharePoint and Office Development Workshop
PPTX
From Zero to Hero: A Real World Guide to Building High Availability SharePoin...
PPTX
SharePoint and Office 365 Performance Best Practices
Microsoft Ignite 2022 - Scaling, Securing, Managing, and Publishing Power Pla...
Scaling, Securing, Managing, and Publishing Power Platform Custom Connectors....
A Beginners Guide to Custom Connectors for Power Apps and Power Automate
App to AppExchange - A Journey from Idea to Market for Salesforce Developers
Beginners Guide to Custom Connectors for Power Apps and Power Automate
OSW06 - A Real World Guide to Building Highly Available Fault Tolerant ShareP...
OSH01 - Developing SharePoint Framework Solutions for the Enterprise
Mastering Modern Authentication and Authorization Techniques for SharePoint, ...
Developing SharePoint Framework Solutions for the Enterprise (SPC 2019)
Developing SharePoint Framework Solutions for the Enterprise - SEF 2019
SharePoint and Office 365 Development Workshop
ECS 2018: Introduction to Azure Web Applications
SharePoint 24x7x365 Architecting for High Availability, Fault Tolerance and D...
Overcoming Gender Imbalance in the Technical Field
Mastering Modern Authentication and Authorization for SharePoint and Office A...
Enterprise Content Management Solutions in SharePoint and Office 365
Introduction to the Office Dev PnP Core Libraries
SharePoint and Office Development Workshop
From Zero to Hero: A Real World Guide to Building High Availability SharePoin...
SharePoint and Office 365 Performance Best Practices

Recently uploaded (20)

PPTX
A Presentation on Artificial Intelligence
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Machine Learning_overview_presentation.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Machine learning based COVID-19 study performance prediction
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence
A comparative analysis of optical character recognition models for extracting...
Review of recent advances in non-invasive hemoglobin estimation
Machine Learning_overview_presentation.pptx
Encapsulation theory and applications.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Dropbox Q2 2025 Financial Results & Investor Presentation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Digital-Transformation-Roadmap-for-Companies.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Programs and apps: productivity, graphics, security and other tools
Unlocking AI with Model Context Protocol (MCP)
Machine learning based COVID-19 study performance prediction
Advanced methodologies resolving dimensionality complications for autism neur...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx

Building dynamic applications with the share point client object model

  • 1. Building Dynamic Applications with the SharePoint Client Object Model Eric Shupps SharePoint Server MVP
  • 2. About Me • SharePoint Server MVP • President, BinaryWave • Microsoft Patterns & Practices (spg.codeplex.com) • CKS:DEV (cksdev.codeplex.com) • Web: www.binarywave.com • Blog: www.sharepointcowboy.com • Twitter: @eshupps • Facebook: www.facebook.com/sharepointcowboy
  • 3. Agenda • Introduction to the Client Object Model • .NET Client Object Model • Silverlight and Client Object Model • JavaScript and Client Object Model • Demos • Building .NET, Silverlight, Javascript and WPF Client Applications with SharePoint Data “T h i s s e s s i o n i s a hunk y dor y j ol l y g o o d a w e s o me n e s s t hi ngy ” - Tobias Zimmergren
  • 4. Legacy Data Access SharePoint Data Server SharePoint API Application Web Service Client Application
  • 5. Client Object Model Client Application .Net CLR Silverlight JavaScript
  • 6. Accessing Data with Client OM Browser JavaScript Controls Server JavaScript OM Object Model Proxy Client Service Proxy Managed OM Content Database Managed Controls Client Server
  • 7. Equivalent Objects Server .NET Managed Silverlight JavaScript (Microsoft (Microsoft.SharePoint (Microsoft.SharePoint (SP.js) .SharePoint) .Client) .Client.Silverlight) SPContext ClientContext ClientContext clientContext SPSite Site Site site SPWeb Web Web web SPList List List list SPListItem ListItem ListItem listItem SPField Field Field field
  • 8. Getting Started: 3 things to know • ClientContext is the central object clientContext = new ClientContext(“http://mysite”); • Before you read a property, you have to ask for it clientContext.Load(list); • All requests must be committed in a batch clientContext.ExecuteQuery();
  • 9. High level handling of commands Client Application Server Sequence of Client.svc commands: command 1; command 2; Execute commands command 3; in the batch: XML context.ExecuteQuery(); command 1; command 2; command 3; JSON Process results Send results back
  • 10. Client Object Model Limitations • You must handle synch/update semantics in code • No elevation of privilege capabilities • Requests are throttled • .net CLR has sync method; Silverlight CLR and Jscript are async • Limited subset of Server OM functionality • You only get what you ask for – nothing more (but sometimes less)
  • 11. .Net CLR Client OM • Provides easy access from remote .NET clients to manipulate SharePoint data • Can be utilized from managed code – also from office clients etc. • Assemblies ● Microsoft.SharePoint.Client.dll (281kb) ● Microsoft.SharePoint.Client.Runtime.dll (145kb) • To Compare: Microsoft.SharePoint.dll – 15.3MB
  • 12. DEMO Building a .NET Client OM Application Using SharePoint Data
  • 13. Silverlight in SharePoint 2010 • Native Silverlight web part allows for compilation and deployment of XAP-only solutions • One-click deployment from Visual Studio 2010 • Web Parts can contain custom properties that are sent to Silverlight via the InitParams property • Abstracted visual design in Expression (make the designer do it!)
  • 14. Silverlight CLR Client OM • Use the correct references: ● C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions 14TEMPLATELAYOUTSClientBin –Microsoft.SharePoint.Client.Silverlight »262KB –Microsoft.SharePoint.Client.Silverlight.R untime »138KB
  • 16. Building and Deploying Silverlight • Built in support in Visual Studio 2010 • Redirect assembly output into Module • F5 deploy and debug experience SharePoint WSP Visual Studio builds WSP Module package on F5 XAP
  • 17. DEMO Building a Silverlight Client OM Application Using SharePoint Data
  • 18. JavaScript Client OM • Provides similar functionality to .NET/Silverlight COM from JavaScript/ECMAScript • Identical structure ● Initialize Context -> Specify Items -> Load Objects -> Execute Query • Limited to current site context (no cross-site scripting) • Asynchronous (like Silverlight) • Be aware of syntax changes ● get_web() ● get_lists() ● get_item()
  • 19. DEMO Building a Javascript Client OM Application Using SharePoint Data
  • 20. Your Feedback is Important Please fill out a session evaluation form. Thank you!

Editor's Notes

  • #7: Show the various resources and their locationsServer – Microsoft.SharePoint – [..]\\14\\ISAPI .NET – Microsoft.SharePoint.Client – [..]\\14\\ISAPISilverlight – Microsoft.SharePoint.Client.Silverlight – [..]\\14\\LAYOUTS\\ClientBinECMAScript– SP.js - [..]\\LAYOUTS