SlideShare une entreprise Scribd logo
1  sur  21
SharePoint 2010: Developing with Data Technologies Randy Williams Synergy rwilliams@synergyonline.com
About the Speaker US-West Coast Manager for Synergy Based in San Diego, California Consultant/Trainer/Author SharePoint MVP Specialty in architecting solutions Blog: www.synergyonline.com/randy Twitter: @tweetraw
Session Overview LINQ to SharePoint WCF Data Services (REST) Client Object Model Large List Throttling
Overview of Data Technologies
LINQ to SharePoint SharePoint now includes a LINQ provider Translates LINQ queries to CAML queries All access to data is through strongly typed objects Supports full CRUD operations Use SPMetal to generate proxy classes
Why Use LINQ to SharePoint? SPQuery with CAML SPQuery query = new SPQuery(); query.Query = @" <Where>   <And>     <BeginsWith>       <FieldRef Name="LinkTitle" />       <Value Type="Text">A</Value>     </BeginsWith>     <Eq>       <FieldRef Name="WorkCountry" />       <Value Type="Text">USA</Value>     </Eq>   </And> </Where>";
Why Use LINQ to SharePoint? LINQ Syntax var contacts = from c in ctx.Contacts                where c.LastName.StartsWith ("A") &&  c.CountryRegion == "USA"                select c;
Using SPMetal Command line utility located in 14IN Used to generate proxy class Generates entity classes for a single web Use CKSDev (CodePlex) to integrate with Visual Studio Basic Syntax: SPMetal /web:http://sp2010/teamsite /code:teamsite.cs
Demo LINQ to SharePoint
WCF Data Services (REST) REST: Representational State Transfer List data is made available at http://sp2010/site/_vti_bin/listdata.svc Data access is strongly typed Data access is limited to items in lists Data can be accessed from virtually any client application
REST Examples View available lists http://sp2010/_vti_bin/listdata.svc View data in the Announcements list http://sp2010/_vti_bin/listdata.svc/Announcements View the announcement with ID 1 http://sp2010/_vti_bin/listdata.svc/Announcements(1) View the Announcements items ordered by Modified date http://sp2010/_vti_bin/listdata.svc/Announcements?$orderby=Modified
Query Data Using REST Interface Create a new Service Reference using the appropriate Url to listdata.svc Instantiate a reference to the DataServiceContext object Query items using LINQ or extension method syntax Enumerate the results
Demo WCF Data Services (REST)
Client Object Model Working with SharePoint from client applications ECMAScript (JavaScript) Silverlight .NET Managed Much easier than calling web services Provides a subset of the functionality available in the server object model Designed to work with data within a site collection
Adding Project References ECMAScript (link from code) /_layouts/SP.js Silverlight references Microsoft.SharePoint.Client.Silverlight.dll Microsoft.SharePoint.Client.Silverlight.Runtime.dll .NET Managed references Microsoft.SharePoint.Client.dll Microsoft.SharePoint.Client.Runtime.dll
Sample From .NET Managed Code ClientContext context = new ClientContext("http://sp2010/teamsite"); Web web = context.Web; context.Load(web); context.ExecuteQuery(); MessageBox.Show (web.Title);
Sample From JavaScript varclientContext = new SP.ClientContext.get_current(); this.oWeb = clientContext.get_web(); clientContext.load(this.oWeb); clientContext.executeQueryAsync(Function.createDelegate(this,this.getSuccess), Function.createDelegate(this, this.getError));
Demo Client Object Model
Data Access Summary
Large List Throttling Prevents large queries from running Web Application level setting First threshold is 5,000 items Second threshold is 20,000 and applies if User is an administrator or auditor, and Object model override is enabled, and Code is configured to use override setting
Your Feedback is Important Please fill out a session evaluation form. Thank you!

Contenu connexe

En vedette

SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSPTechCon
 
OSP206 What's New in SharePoint 2013 Search
OSP206 What's New in SharePoint 2013 SearchOSP206 What's New in SharePoint 2013 Search
OSP206 What's New in SharePoint 2013 SearchNick Hadlee
 
SharePoint Alerts with WCF and jQuery
SharePoint Alerts with WCF and jQuerySharePoint Alerts with WCF and jQuery
SharePoint Alerts with WCF and jQueryNick Hadlee
 
Best Practices to SharePoint Physical and Information Architecture
Best Practices to SharePoint Physical and Information ArchitectureBest Practices to SharePoint Physical and Information Architecture
Best Practices to SharePoint Physical and Information ArchitectureJoel Oleson
 
Best Practice SharePoint Architecture
Best Practice SharePoint ArchitectureBest Practice SharePoint Architecture
Best Practice SharePoint ArchitectureMichael Noel
 

En vedette (6)

SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
 
OSP206 What's New in SharePoint 2013 Search
OSP206 What's New in SharePoint 2013 SearchOSP206 What's New in SharePoint 2013 Search
OSP206 What's New in SharePoint 2013 Search
 
SharePoint Alerts with WCF and jQuery
SharePoint Alerts with WCF and jQuerySharePoint Alerts with WCF and jQuery
SharePoint Alerts with WCF and jQuery
 
Best Practices to SharePoint Physical and Information Architecture
Best Practices to SharePoint Physical and Information ArchitectureBest Practices to SharePoint Physical and Information Architecture
Best Practices to SharePoint Physical and Information Architecture
 
Best Practice SharePoint Architecture
Best Practice SharePoint ArchitectureBest Practice SharePoint Architecture
Best Practice SharePoint Architecture
 
SharePoint Programming Basic
SharePoint Programming BasicSharePoint Programming Basic
SharePoint Programming Basic
 

Plus de Randy Williams

Architecting Solutions and Systems – Randy’s Secrets to Success
Architecting Solutions and Systems – Randy’s Secrets to SuccessArchitecting Solutions and Systems – Randy’s Secrets to Success
Architecting Solutions and Systems – Randy’s Secrets to SuccessRandy Williams
 
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsAn IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsRandy Williams
 
Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013Randy Williams
 
Governing and managing hybrid SharePoint environments
Governing and managing hybrid SharePoint environmentsGoverning and managing hybrid SharePoint environments
Governing and managing hybrid SharePoint environmentsRandy Williams
 
When governance lacks compliance
When governance lacks complianceWhen governance lacks compliance
When governance lacks complianceRandy Williams
 
The Future of Social Collaboration
The Future of Social CollaborationThe Future of Social Collaboration
The Future of Social CollaborationRandy Williams
 
Getting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 AppsGetting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 AppsRandy Williams
 
Building the next generation of browser apps today
Building the next generation of browser apps todayBuilding the next generation of browser apps today
Building the next generation of browser apps todayRandy Williams
 
SQL Server 2012 and SharePoint 2010: Reporting Nirvana
SQL Server 2012 and SharePoint 2010: Reporting NirvanaSQL Server 2012 and SharePoint 2010: Reporting Nirvana
SQL Server 2012 and SharePoint 2010: Reporting NirvanaRandy Williams
 
How governance drives your information and security architecture
How governance drives your information and security architectureHow governance drives your information and security architecture
How governance drives your information and security architectureRandy Williams
 
Sizing your Content Databases: Understanding the Limits
Sizing your Content Databases: Understanding the LimitsSizing your Content Databases: Understanding the Limits
Sizing your Content Databases: Understanding the LimitsRandy Williams
 
SharePoint Online and the Cloud
SharePoint Online and the CloudSharePoint Online and the Cloud
SharePoint Online and the CloudRandy Williams
 
Enforcing SharePoint Governance
Enforcing SharePoint GovernanceEnforcing SharePoint Governance
Enforcing SharePoint GovernanceRandy Williams
 
Migrating to Office 365
Migrating to Office 365Migrating to Office 365
Migrating to Office 365Randy Williams
 
Governance - how does information & security drive your architecture
Governance - how does information & security drive your architectureGovernance - how does information & security drive your architecture
Governance - how does information & security drive your architectureRandy Williams
 
Understanding SharePoint Governance
Understanding SharePoint GovernanceUnderstanding SharePoint Governance
Understanding SharePoint GovernanceRandy Williams
 
Guiding a Successful SharePoint Implementation
Guiding a Successful SharePoint ImplementationGuiding a Successful SharePoint Implementation
Guiding a Successful SharePoint ImplementationRandy Williams
 
Plugging holes in your SharePoint 2010 disaster recovery strategy
Plugging holes in your SharePoint 2010 disaster recovery strategyPlugging holes in your SharePoint 2010 disaster recovery strategy
Plugging holes in your SharePoint 2010 disaster recovery strategyRandy Williams
 
Spicing up SharePoint web parts
Spicing up SharePoint web partsSpicing up SharePoint web parts
Spicing up SharePoint web partsRandy Williams
 

Plus de Randy Williams (20)

Architecting Solutions and Systems – Randy’s Secrets to Success
Architecting Solutions and Systems – Randy’s Secrets to SuccessArchitecting Solutions and Systems – Randy’s Secrets to Success
Architecting Solutions and Systems – Randy’s Secrets to Success
 
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsAn IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
 
Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013Integrating SharePoint with Exchange-2013
Integrating SharePoint with Exchange-2013
 
Governing and managing hybrid SharePoint environments
Governing and managing hybrid SharePoint environmentsGoverning and managing hybrid SharePoint environments
Governing and managing hybrid SharePoint environments
 
When governance lacks compliance
When governance lacks complianceWhen governance lacks compliance
When governance lacks compliance
 
The Future of Social Collaboration
The Future of Social CollaborationThe Future of Social Collaboration
The Future of Social Collaboration
 
Getting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 AppsGetting Started with SharePoint 2013 Apps
Getting Started with SharePoint 2013 Apps
 
Building the next generation of browser apps today
Building the next generation of browser apps todayBuilding the next generation of browser apps today
Building the next generation of browser apps today
 
SQL Server 2012 and SharePoint 2010: Reporting Nirvana
SQL Server 2012 and SharePoint 2010: Reporting NirvanaSQL Server 2012 and SharePoint 2010: Reporting Nirvana
SQL Server 2012 and SharePoint 2010: Reporting Nirvana
 
How governance drives your information and security architecture
How governance drives your information and security architectureHow governance drives your information and security architecture
How governance drives your information and security architecture
 
Sizing your Content Databases: Understanding the Limits
Sizing your Content Databases: Understanding the LimitsSizing your Content Databases: Understanding the Limits
Sizing your Content Databases: Understanding the Limits
 
SharePoint Online and the Cloud
SharePoint Online and the CloudSharePoint Online and the Cloud
SharePoint Online and the Cloud
 
Enforcing SharePoint Governance
Enforcing SharePoint GovernanceEnforcing SharePoint Governance
Enforcing SharePoint Governance
 
Migrating to Office 365
Migrating to Office 365Migrating to Office 365
Migrating to Office 365
 
Governance - how does information & security drive your architecture
Governance - how does information & security drive your architectureGovernance - how does information & security drive your architecture
Governance - how does information & security drive your architecture
 
Understanding SharePoint Governance
Understanding SharePoint GovernanceUnderstanding SharePoint Governance
Understanding SharePoint Governance
 
Why I Use SharePoint
Why I Use SharePointWhy I Use SharePoint
Why I Use SharePoint
 
Guiding a Successful SharePoint Implementation
Guiding a Successful SharePoint ImplementationGuiding a Successful SharePoint Implementation
Guiding a Successful SharePoint Implementation
 
Plugging holes in your SharePoint 2010 disaster recovery strategy
Plugging holes in your SharePoint 2010 disaster recovery strategyPlugging holes in your SharePoint 2010 disaster recovery strategy
Plugging holes in your SharePoint 2010 disaster recovery strategy
 
Spicing up SharePoint web parts
Spicing up SharePoint web partsSpicing up SharePoint web parts
Spicing up SharePoint web parts
 

Dernier

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
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
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Dernier (20)

Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.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
 
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
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
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
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

SharePoint 2010: Developing with Data Technologies

  • 1. SharePoint 2010: Developing with Data Technologies Randy Williams Synergy rwilliams@synergyonline.com
  • 2. About the Speaker US-West Coast Manager for Synergy Based in San Diego, California Consultant/Trainer/Author SharePoint MVP Specialty in architecting solutions Blog: www.synergyonline.com/randy Twitter: @tweetraw
  • 3. Session Overview LINQ to SharePoint WCF Data Services (REST) Client Object Model Large List Throttling
  • 4. Overview of Data Technologies
  • 5. LINQ to SharePoint SharePoint now includes a LINQ provider Translates LINQ queries to CAML queries All access to data is through strongly typed objects Supports full CRUD operations Use SPMetal to generate proxy classes
  • 6. Why Use LINQ to SharePoint? SPQuery with CAML SPQuery query = new SPQuery(); query.Query = @" <Where> <And> <BeginsWith> <FieldRef Name="LinkTitle" /> <Value Type="Text">A</Value> </BeginsWith> <Eq> <FieldRef Name="WorkCountry" /> <Value Type="Text">USA</Value> </Eq> </And> </Where>";
  • 7. Why Use LINQ to SharePoint? LINQ Syntax var contacts = from c in ctx.Contacts where c.LastName.StartsWith ("A") && c.CountryRegion == "USA" select c;
  • 8. Using SPMetal Command line utility located in 14IN Used to generate proxy class Generates entity classes for a single web Use CKSDev (CodePlex) to integrate with Visual Studio Basic Syntax: SPMetal /web:http://sp2010/teamsite /code:teamsite.cs
  • 9. Demo LINQ to SharePoint
  • 10. WCF Data Services (REST) REST: Representational State Transfer List data is made available at http://sp2010/site/_vti_bin/listdata.svc Data access is strongly typed Data access is limited to items in lists Data can be accessed from virtually any client application
  • 11. REST Examples View available lists http://sp2010/_vti_bin/listdata.svc View data in the Announcements list http://sp2010/_vti_bin/listdata.svc/Announcements View the announcement with ID 1 http://sp2010/_vti_bin/listdata.svc/Announcements(1) View the Announcements items ordered by Modified date http://sp2010/_vti_bin/listdata.svc/Announcements?$orderby=Modified
  • 12. Query Data Using REST Interface Create a new Service Reference using the appropriate Url to listdata.svc Instantiate a reference to the DataServiceContext object Query items using LINQ or extension method syntax Enumerate the results
  • 13. Demo WCF Data Services (REST)
  • 14. Client Object Model Working with SharePoint from client applications ECMAScript (JavaScript) Silverlight .NET Managed Much easier than calling web services Provides a subset of the functionality available in the server object model Designed to work with data within a site collection
  • 15. Adding Project References ECMAScript (link from code) /_layouts/SP.js Silverlight references Microsoft.SharePoint.Client.Silverlight.dll Microsoft.SharePoint.Client.Silverlight.Runtime.dll .NET Managed references Microsoft.SharePoint.Client.dll Microsoft.SharePoint.Client.Runtime.dll
  • 16. Sample From .NET Managed Code ClientContext context = new ClientContext("http://sp2010/teamsite"); Web web = context.Web; context.Load(web); context.ExecuteQuery(); MessageBox.Show (web.Title);
  • 17. Sample From JavaScript varclientContext = new SP.ClientContext.get_current(); this.oWeb = clientContext.get_web(); clientContext.load(this.oWeb); clientContext.executeQueryAsync(Function.createDelegate(this,this.getSuccess), Function.createDelegate(this, this.getError));
  • 20. Large List Throttling Prevents large queries from running Web Application level setting First threshold is 5,000 items Second threshold is 20,000 and applies if User is an administrator or auditor, and Object model override is enabled, and Code is configured to use override setting
  • 21. Your Feedback is Important Please fill out a session evaluation form. Thank you!