SlideShare une entreprise Scribd logo
1  sur  27
Client side programming with SharePoint 2010 Trung Van PHAM
Client side scenarios Story in SharePoint 2007  SharePoint 2010 Client Object Models Overview of the Client Object Models .NET Client Object Model Silverlight Client Object Model ECMAScript Client Object Model ADO.NET Data Services JQuery, SP WebServices and Silverlight Agenda
Scenarios Web Browsers Microsoft Office Applications Custom Applications Commonly interaction with SharePoint Display SharePoint data Manipulating with SharePoint data Client side scenarios
Story in SharePoint 2007 SharePoint Server Applications Web UIs Web Browsers SharePoint Object Model Web Services, RPC Applications Custom Services SharePoint Content DB
Client Object Model provides complete API instead of more services Provides an abstraction layer to return results as recognizable SharePoint objects Consistent developer experience across platforms (.NET, ECMAScript, Silverlight) Overview of the Client Object Models
SharePoint 2010 Client Object Models SharePoint Server Applications Client.svc Client Apps SharePoint Object Model Client OMs SharePoint Content DB
How does Client OM work? SharePoint Server Client Application Build sequence commands: ,[object Object]
Command 2
Command nExecute Commands Client.svc Execute: ,[object Object]
Command 2
Command nSend result back XML Process result JSON
Site Collections and Sites Lists, List Items, Views, and List Schemas Files and Folders Web, List, and List Item Property Bags Web Parts Security Content Types Site Templates and Site Collection Operations Supported Areas
Consistency
C:rogram Filesommon Filesicrosoft Sharedeb Server Extensions4SAPI Files Microsoft.SharePoint.Client.dll (282KB) Microsoft.SharePoint.Client.Runtime.dll (146 KB) Compare to SharePoint Server OM Microsoft.SharePoint.dll (16.2 MB) .NET Client Object Model
DEMO 1 Getting Started .NET Client Object Model (cont)
Think about efficiency  All the properties are loaded in DEMO1 Specify the properties you need: ctx.Load(web, w=>w.Title); ctx.Load(list,l=>l.Title, l=>l.ItemCoun); ctx.ExecuteQuery(); .NET Client Object Model (cont)
DEMO 2 Specifying properties to load .NET Client Object Model (cont)
Loading List Items  List Items are always loaded using a CAML Query [[Code]] - tbd .NET Client Object Model (cont)
DEMO 3 Loading List Items .NET Client Object Model (cont)
DEMO 4 Creating and Updating List Items .NET Client Object Model (cont)
C:rogram Filesommon Filesicrosoft Sharedeb Server Extensions4EMPLATEAYOUTSlientBin Files: Microsoft.SharePoint.Client.Silverlight.dll (266K) Microsoft.SharePoint.Client.Silverlight.Runtime.dll (142K) Silverlight Client Object Model
[[tbd]] Code Silverlight Client Object Model (cont)
DEMO 5 Creating the Silverlight Web Part Silverlight Client Object Model (cont)
C:rogram Filesommon Filesicrosoft Sharedeb Server Extensions4EMPLATEAYOUTS Files: SP.js (381 KB) Debug version: SP.debug (561 KB) ECMAScript Object Model
[[tbd]] Code ECMAScript Object Model (cont)
DEMO 6 ECMAScript Object Model ECMAScript Object Model (cont)
LINQ to SP not implemented in Silverlight ListData.svc provides RESTful access ADO.NET Data Services ListData.svc Loads ADO.NET Data Services handler assembly

Contenu connexe

Dernier

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 

Dernier (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Client side programming with SharePoint 2010 - SharePoin Saturday Vietnam

  • 1. Client side programming with SharePoint 2010 Trung Van PHAM
  • 2. Client side scenarios Story in SharePoint 2007 SharePoint 2010 Client Object Models Overview of the Client Object Models .NET Client Object Model Silverlight Client Object Model ECMAScript Client Object Model ADO.NET Data Services JQuery, SP WebServices and Silverlight Agenda
  • 3. Scenarios Web Browsers Microsoft Office Applications Custom Applications Commonly interaction with SharePoint Display SharePoint data Manipulating with SharePoint data Client side scenarios
  • 4. Story in SharePoint 2007 SharePoint Server Applications Web UIs Web Browsers SharePoint Object Model Web Services, RPC Applications Custom Services SharePoint Content DB
  • 5. Client Object Model provides complete API instead of more services Provides an abstraction layer to return results as recognizable SharePoint objects Consistent developer experience across platforms (.NET, ECMAScript, Silverlight) Overview of the Client Object Models
  • 6. SharePoint 2010 Client Object Models SharePoint Server Applications Client.svc Client Apps SharePoint Object Model Client OMs SharePoint Content DB
  • 7.
  • 9.
  • 11. Command nSend result back XML Process result JSON
  • 12. Site Collections and Sites Lists, List Items, Views, and List Schemas Files and Folders Web, List, and List Item Property Bags Web Parts Security Content Types Site Templates and Site Collection Operations Supported Areas
  • 14. C:rogram Filesommon Filesicrosoft Sharedeb Server Extensions4SAPI Files Microsoft.SharePoint.Client.dll (282KB) Microsoft.SharePoint.Client.Runtime.dll (146 KB) Compare to SharePoint Server OM Microsoft.SharePoint.dll (16.2 MB) .NET Client Object Model
  • 15. DEMO 1 Getting Started .NET Client Object Model (cont)
  • 16. Think about efficiency All the properties are loaded in DEMO1 Specify the properties you need: ctx.Load(web, w=>w.Title); ctx.Load(list,l=>l.Title, l=>l.ItemCoun); ctx.ExecuteQuery(); .NET Client Object Model (cont)
  • 17. DEMO 2 Specifying properties to load .NET Client Object Model (cont)
  • 18. Loading List Items List Items are always loaded using a CAML Query [[Code]] - tbd .NET Client Object Model (cont)
  • 19. DEMO 3 Loading List Items .NET Client Object Model (cont)
  • 20. DEMO 4 Creating and Updating List Items .NET Client Object Model (cont)
  • 21. C:rogram Filesommon Filesicrosoft Sharedeb Server Extensions4EMPLATEAYOUTSlientBin Files: Microsoft.SharePoint.Client.Silverlight.dll (266K) Microsoft.SharePoint.Client.Silverlight.Runtime.dll (142K) Silverlight Client Object Model
  • 22. [[tbd]] Code Silverlight Client Object Model (cont)
  • 23. DEMO 5 Creating the Silverlight Web Part Silverlight Client Object Model (cont)
  • 24. C:rogram Filesommon Filesicrosoft Sharedeb Server Extensions4EMPLATEAYOUTS Files: SP.js (381 KB) Debug version: SP.debug (561 KB) ECMAScript Object Model
  • 25. [[tbd]] Code ECMAScript Object Model (cont)
  • 26. DEMO 6 ECMAScript Object Model ECMAScript Object Model (cont)
  • 27. LINQ to SP not implemented in Silverlight ListData.svc provides RESTful access ADO.NET Data Services ListData.svc Loads ADO.NET Data Services handler assembly
  • 28. DEMO 7 REST demo ADO.NET Data Services (c0nt)
  • 29. SPServices: JQuery Library for SharePoint Web Services Site Url: http://spservices.codeplex.com/ SPServices
  • 30. DEMO 8 JQuery, SPServices and Silverlight SPServices (cont)
  • 31. Q & A ? THANK YOU! Summary

Notes de l'éditeur

  1. SharePoint Object Model is the main component when working with SharePoint but it’s only available on the SharePoint ServerApplications using it must run on a SharePoint ServerThe Applications can connect directly to SharePoint Content DB, but this case should never happenedThe SharePoint Content DB is very complexThe DB is maintain by MS, and could be updated on the hotfixs…Clients working with SharePointVia Web Browsers with data rendered via Web ControlsVia Web Services (Standard SP Web Services and Custom Web Services)Not providing all the functions of SharePoint Object Model, need to add more functions on Web Services after an update or create custom Web ServicesWeb Services are not easy to useInput parameters and return result use XML documentsXML data needs to parsed manually – not serialize or deserializeNot very intuitiveRPC: Remote Procedure Call Protocol (owssvr.dll)Using by SharePoint DesignerNot provides all the functions on SharePoint Object ModelCustom Services: FTP, WCF…
  2. Throughout each SharePoint release, Microsoft receives more and more requests for new Web ServicesInstead of continuously building new Web services (and replacing existing ASMX services with WCF services), they now provide a client object modelThe client object model provides an abstraction layer so process off the SharePoint server can interact with SharePoint using a consistent API that is very closely matched to the familiar server API
  3. Design GoalsConsistencyEfficiency
  4. The Client Object Model contains a lot of overlap coverage with the full SharePoint API
  5. Similar to programming against server objects in the server context, the new client-side object models use a ClientContext object as the "center of gravity" for all operations. The process of obtaining and working with sites and data begins by retrieving a context object.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
  6. Keep efficiency in mindSpecifying the properties to loadQuickly generate CAML using the CreateAllItemsQuery() method
  7. By default, the managed client object models authenticate users by using their Windows credentials (DefaultCredentials). Optionally, you can change the authentication mode on the ClientContext object and specify using Forms authentication instead. A user must then supply a user name and password through properties on ClientContext. Behind the scenes, Windows SharePoint Services “14” calls the Authentication Web service, obtains the correct cookie, and then makes the necessary object model calls. To run managed client code against a Forms authentication server, you must change to Forms authentication. This requirement does not apply to the JavaScript object model.The managed client object models provide a ClientAuthenticationMode enumeration whose values are Anonymous, Default, andFormsAuthentication. To specify Forms authentication, use code similar to the following:clientContext.AuthenticationMode = ClientAuthenticationMode.FormsAuthentication;In addition to setting the authentication mode, you must specify the user name and password information, such as follows:FormsAuthenticationLoginInfoformsAuthInfo = new FormsAuthenticationLoginInfo("MyUser", "MyPassword");clientContext.FormsAuthenticationLoginInfo = formsAuthInfo; Note: Currently, the account name and password in formsAuthInfo are sent in clear text, so you must use HTTPS protocol instead of HTTP.
  8. • Callback methods are executed on another thread than the UI thread• Use Invokes to alter the UI from the Use Invokes to alter the UI from the background thread!A Web Part can be a host for SilverlightSharePoint ships with Silverlight web partThe web part can contain custom properties that are sent to Silverlight via the InitParameters propertyThe XAP file can be deployed to LAYOUTS and loaded at run timeThe Silverlight application can then make use of the Client OM.For Silverlight client installations, Microsoft SharePoint Foundation deploys Microsoft.SharePoint.Client.Silverlight.dll and Microsoft.SharePoint.Client.Silverlight.Runtime.dll into a special "Scripts only" folder of the /_layouts virtual directory named clientbin. This folder is designed to be a standard place for hosting assemblies that are used in Silverlight.
  9. Compressed and crunched .js files for the ECMAScriptobject model, named SP.js, SP.Core.js, and SP.Runtime.js, are installed in the /_layouts directory. Microsoft SharePoint Foundation also includes uncrunched, debug versions of the .js files named SP.debug.js, SP.Core.debug.js, and SP.Runtime.debug.js. You can toggle which .js file is used in Microsoft SharePoint Foundation by setting ScriptMode="Debug" in web.config. If you add <SharePoint:ScriptLinkrunat=”server” Name=”sp.js” Localizable=”false” LoadAfterUI=”true” /> to the page, the Microsoft.SharePoint.WebControls.ScriptLink server control registers all dependencies.You should be aware of the following important differences between the ECMAScriptand managed client object models.The method signature may be different, as with the ClientContext constructorThe two object models use different data value types. The ECMAScriptobject model does not have equivalents for all the data value types in the .NET Framework managed object model. ECMAScriptregards StringCollection as string[]. On the other hand, ECMAScripthas some values that the .NET Framework does not have, such as NaN, or negative and positive infinity.The ECMAScript object model requires that you include security validation on the page through a FormDigest control; for example, <SharePoint:FormDigest id="MyFormDigest" runat="server"/>.
  10. Client side scenariosStory in SharePoint 2007 SharePoint 2010 Client Object ModelsOverview of the Client Object Models.NET Client Object ModelSilverlight Client Object ModelECMAScript Client Object ModelADO.NET Data ServicesJQuery, SP WebServices and Silverlight