SlideShare una empresa de Scribd logo
1 de 16
SHAREPOINT 2010
CLIENT SIDE OBJECT
MODEL
Phil Wicklund
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
About Me?
Training & Certifications:
• MCTIP: SharePoint 2010 Administration
• MCPD: SharePoint 2010 Development
• Microsoft’s SharePoint Masters Training (Redmond, WA)
Other Notable Experience:
• Published Author on SharePoint 2010 (SharePoint 2010 Workflows in
Action)
• National Speaker at SharePoint Conferences (The Experts Conference-LA,
SharePoint Technology Conference-San Fran, TechFuse-MN,
SharePoint Saturdays)
• SharePoint Blog: www.philwicklund.com
About Me: Over 6 years of experience SharePoint Architecture Experience, trained
SharePoint architecture and development classes for nationally renown SharePoint-
focused training organization.
Agenda
 Introduction / Why COM?
 COM Architecture
 Coding Samples
 DEMO
 .NET COM
 Questions
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Intro to the SP 2010 COM
 Not enough web services in SP 2007
 Rather than create more services, COM
provides the complete API
 COM provides a consistent development
experience:
 Windows Applications
 ASP.NET web sites
 Silverlight Applications
 JavaScript, www client side scripting
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
COM Architecture
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Assembly References
 SharePoint, Server Side
 Microsoft.SharePoint (ISAPI)
 .NET clients
 Microsoft.SharePoint.Client (ISAPI)
 Silverlight clients
 Microsoft.SharePoint.Client.Silverlight
(Layouts/clientbin)
 Javascript clients
 SP.js & SP.Core.js (Layouts)SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Comparable Objects
Microsoft.SharePoint Client Object Models
SPContext ClientContext
SPSite Site
SPWeb Web
SPList List
SPListItem ListItem
SPField Field
SPFile File
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Starter Code
Using Microsoft.SharePoint.Client;
...
using (ClientContext context = new
ClientContext("http://intranet"))
{
Web web = context.Web;
context.Load(web);
context.ExecuteQuery();
string title = web.Title;
// ListCollection lists = web.Lists;
}
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Iterating through Lists in a Web
using (ClientContext context = new
ClientContext("http://intranet"))
{
Web web = context.Web;
context.Load(web);
context.Load(web.Lists);
context.ExecuteQuery();
foreach(List list in web.Lists)
{
//do something
}
}
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Efficiencies… Don’t be Lazy!
Web web = context.Web;
context.Load(web, wprop => wprop.Title));
ListCollection lists = web.Lists;
IEnumerable<List> filtered = context.
LoadQuery(lists.Include(l=>l.Title));
context.ExecuteQuery();
foreach(List list in filtered)
{ }
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Working with List Items
Web web = context.Web;
List list = context.Web.Lists.
GetByTitle(“List Title");
CamlQuery query = CamlQuery.CreateAllItemsQuery();
ListItemCollection items = lst.GetItems(query);
context.Load(items);
context.ExecuteQuery();
foreach (ListItem item in items)
{
string title = item["Title"];
}
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Efficencies with List Items
CamlQuery query = new CamlQuery();
query.ViewXml = "<View><Query><Where><Eq>
<FieldRef Name='Title'/><Value
Type='Text'>Phil</Value>
</Eq></Where></Query></View>";
ListItemCollection items = list.GetItems(query);
context.Load(items, x => x.Include(
item => item["ID"],
item => item["Title"],
item => item.DisplayName));
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Adding new List Items
List list = context.Web.Lists.
GetByTitle(“List Title");
context.Load(list);
ListItem newItem = list.AddItem(new
ListItemCreationInformation());
newItem["Title"] = "My new item";
newItem.Update();
context.ExecuteQuery();
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
Silverlight & Asynchronous Calls
private void Button_Click(object sender, RoutedEventArgs e)
{
// Load a bunch of stuff
clientContext.ExecuteQueryAsync(success, failure);
}
private void success(object sender,
ClientRequestSucceededEventArgs args)
{
RunQuery runQuery= Run;
this.Dispatcher.BeginInvoke(runQuery);
}
private delegate void RunQuery();
private void Run() { /* do something */ }
private void failure(object sender,
ClientRequestFailedEventArgs args) { /* do something */ }
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
.NET – COM Demo
 Build a Console (client) Application
 Render all the
List Titles from a remote
SharePoint site.
 Create a new list item
in a remote SharePoint
site.
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAconsulting.com
QUESTIONS & COMMENTS
Phil Wicklund
SharePoint FREEWARE
www.PhilWicklund.com
SharePoint CONSULTING
www.RBAConsulting.com

Más contenido relacionado

La actualidad más candente

Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APISparkhound Inc.
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIChris Beckett
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...SPTechCon
 
Taking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APITaking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APIEric Shupps
 
SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)Kashif Imran
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIsGiuseppe Marchi
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsLiam Cleary [MVP]
 
SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationAdil Ansari
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Kashif Imran
 
SharePoint 2007 Presentation
SharePoint 2007 PresentationSharePoint 2007 Presentation
SharePoint 2007 PresentationAjay Jain
 
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.Eric Shupps
 
Working With Sharepoint 2013 Apps Development
Working With Sharepoint 2013 Apps DevelopmentWorking With Sharepoint 2013 Apps Development
Working With Sharepoint 2013 Apps DevelopmentPankaj Srivastava
 
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonCSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonKunaal Kapoor
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controlsRaed Aldahdooh
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvcGuo Albert
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointRene Modery
 

La actualidad más candente (20)

Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST API
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST API
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
 
Taking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST APITaking Advantage of the SharePoint 2013 REST API
Taking Advantage of the SharePoint 2013 REST API
 
SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)
 
SharePoint 2013 REST APIs
SharePoint 2013 REST APIsSharePoint 2013 REST APIs
SharePoint 2013 REST APIs
 
Are you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint AppsAre you getting Sleepy. REST in SharePoint Apps
Are you getting Sleepy. REST in SharePoint Apps
 
SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote Authentication
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
 
SharePoint 2007 Presentation
SharePoint 2007 PresentationSharePoint 2007 Presentation
SharePoint 2007 Presentation
 
Sharepoint Online
Sharepoint OnlineSharepoint Online
Sharepoint Online
 
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
Who Are You and What Do You Want? Working with OAuth in SharePoint 2013.
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Working With Sharepoint 2013 Apps Development
Working With Sharepoint 2013 Apps DevelopmentWorking With Sharepoint 2013 Apps Development
Working With Sharepoint 2013 Apps Development
 
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday HoustonCSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
CSOM (Client Side Object Model). Explained @ SharePoint Saturday Houston
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
 
ASP.NET - Web Programming
ASP.NET - Web ProgrammingASP.NET - Web Programming
ASP.NET - Web Programming
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvc
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
 

Destacado

Protección jurídica del software
Protección jurídica del softwareProtección jurídica del software
Protección jurídica del softwareempresa Industrial
 
Valentine's Day Back to Back
Valentine's Day Back to BackValentine's Day Back to Back
Valentine's Day Back to BackKen Sapp
 
Tilastollisen vaihtelun ilmentäminen
Tilastollisen vaihtelun ilmentäminenTilastollisen vaihtelun ilmentäminen
Tilastollisen vaihtelun ilmentäminenKimmo Vehkalahti
 
Senior Internship Paper
Senior Internship PaperSenior Internship Paper
Senior Internship PaperBrittany Lund
 
Jim Nicholls CV 22 Oct 2015
Jim Nicholls CV 22 Oct 2015Jim Nicholls CV 22 Oct 2015
Jim Nicholls CV 22 Oct 2015Jim Nicholls
 
Deployment no Azure
Deployment no AzureDeployment no Azure
Deployment no AzureRodrigo Kono
 
TVT-strategiat - Vaasan kaupungin sivistystoimi
TVT-strategiat - Vaasan kaupungin sivistystoimiTVT-strategiat - Vaasan kaupungin sivistystoimi
TVT-strategiat - Vaasan kaupungin sivistystoimiSuomen eOppimiskeskus ry
 
Koodikerho PEPE Pajapäivä 6.9.2016
Koodikerho PEPE Pajapäivä 6.9.2016Koodikerho PEPE Pajapäivä 6.9.2016
Koodikerho PEPE Pajapäivä 6.9.2016Otto Kekäläinen
 
fazaia inter college lahore 9th class papers examination
fazaia inter college lahore 9th class papers examinationfazaia inter college lahore 9th class papers examination
fazaia inter college lahore 9th class papers examinationAsad Shafat
 
Biogeochemical cycle
Biogeochemical cycleBiogeochemical cycle
Biogeochemical cycleRashmi Yadav
 
Final examination 2011 class vi
Final examination 2011 class viFinal examination 2011 class vi
Final examination 2011 class viAsad Shafat
 
Mid term examination -2011 class vi
Mid term examination -2011 class viMid term examination -2011 class vi
Mid term examination -2011 class viAsad Shafat
 
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)Dimitris Psounis
 
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)Dimitris Psounis
 
Web Design Trends: Ins & Outs
Web Design Trends: Ins & OutsWeb Design Trends: Ins & Outs
Web Design Trends: Ins & OutsDesignMantic
 

Destacado (19)

Protección jurídica del software
Protección jurídica del softwareProtección jurídica del software
Protección jurídica del software
 
Valentine's Day Back to Back
Valentine's Day Back to BackValentine's Day Back to Back
Valentine's Day Back to Back
 
Dokumentacija-Ana
Dokumentacija-AnaDokumentacija-Ana
Dokumentacija-Ana
 
Tilastollisen vaihtelun ilmentäminen
Tilastollisen vaihtelun ilmentäminenTilastollisen vaihtelun ilmentäminen
Tilastollisen vaihtelun ilmentäminen
 
Senior Internship Paper
Senior Internship PaperSenior Internship Paper
Senior Internship Paper
 
Gyostage 15.10.2016
Gyostage 15.10.2016Gyostage 15.10.2016
Gyostage 15.10.2016
 
Jim Nicholls CV 22 Oct 2015
Jim Nicholls CV 22 Oct 2015Jim Nicholls CV 22 Oct 2015
Jim Nicholls CV 22 Oct 2015
 
Deployment no Azure
Deployment no AzureDeployment no Azure
Deployment no Azure
 
TVT-strategiat - Vaasan kaupungin sivistystoimi
TVT-strategiat - Vaasan kaupungin sivistystoimiTVT-strategiat - Vaasan kaupungin sivistystoimi
TVT-strategiat - Vaasan kaupungin sivistystoimi
 
Digiloikasta pedaloikkaan
Digiloikasta pedaloikkaanDigiloikasta pedaloikkaan
Digiloikasta pedaloikkaan
 
Koodikerho PEPE Pajapäivä 6.9.2016
Koodikerho PEPE Pajapäivä 6.9.2016Koodikerho PEPE Pajapäivä 6.9.2016
Koodikerho PEPE Pajapäivä 6.9.2016
 
Treaty of paris
Treaty of parisTreaty of paris
Treaty of paris
 
fazaia inter college lahore 9th class papers examination
fazaia inter college lahore 9th class papers examinationfazaia inter college lahore 9th class papers examination
fazaia inter college lahore 9th class papers examination
 
Biogeochemical cycle
Biogeochemical cycleBiogeochemical cycle
Biogeochemical cycle
 
Final examination 2011 class vi
Final examination 2011 class viFinal examination 2011 class vi
Final examination 2011 class vi
 
Mid term examination -2011 class vi
Mid term examination -2011 class viMid term examination -2011 class vi
Mid term examination -2011 class vi
 
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.5 (ΕΚΤΥΠΩΣΗ)
 
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)
ΠΛΗ31 ΚΑΡΤΕΣ ΜΑΘΗΜΑΤΟΣ 3.4 (ΕΚΤΥΠΩΣΗ)
 
Web Design Trends: Ins & Outs
Web Design Trends: Ins & OutsWeb Design Trends: Ins & Outs
Web Design Trends: Ins & Outs
 

Similar a Access SharePoint Lists and Items Using the Client Object Model

SharePoint Silverlight Sandboxed solutions
SharePoint Silverlight Sandboxed solutionsSharePoint Silverlight Sandboxed solutions
SharePoint Silverlight Sandboxed solutionsPhil Wicklund
 
Custom SharePoint 2010 solutions without server access
Custom SharePoint 2010 solutions without server accessCustom SharePoint 2010 solutions without server access
Custom SharePoint 2010 solutions without server accessPhil Wicklund
 
Session 5-SharePoint with Office-Donovan Follette
Session 5-SharePoint with Office-Donovan FolletteSession 5-SharePoint with Office-Donovan Follette
Session 5-SharePoint with Office-Donovan FolletteMithun T. Dhar
 
SharePoint 2010 Developer 101
SharePoint 2010 Developer 101SharePoint 2010 Developer 101
SharePoint 2010 Developer 101Nick Hadlee
 
SharePoint 2010 Application Development
SharePoint 2010 Application DevelopmentSharePoint 2010 Application Development
SharePoint 2010 Application Developmentmattbremer
 
SharePoint 2010 as a Development Platform, Ayman El-Hattab MVP
SharePoint 2010 as a Development Platform, Ayman El-Hattab MVPSharePoint 2010 as a Development Platform, Ayman El-Hattab MVP
SharePoint 2010 as a Development Platform, Ayman El-Hattab MVPAyman El-Hattab
 
Office 365 development
Office 365 developmentOffice 365 development
Office 365 developmentyounjw
 
Wss Object Model
Wss Object ModelWss Object Model
Wss Object Modelmaddinapudi
 
Chris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
Chris McNulty: ECM/WCM Planning, Implementation and Migration StrategiesChris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
Chris McNulty: ECM/WCM Planning, Implementation and Migration StrategiesSharePoint Saturday NY
 
Solve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesSolve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesCory Peters
 
Intro to SharePoint for Developers
Intro to SharePoint for DevelopersIntro to SharePoint for Developers
Intro to SharePoint for DevelopersRob Wilson
 
SharePoint Developer Education Day Palo Alto
SharePoint  Developer Education Day  Palo  AltoSharePoint  Developer Education Day  Palo  Alto
SharePoint Developer Education Day Palo Altollangit
 
Share Point For Beginners V1
Share Point For Beginners V1Share Point For Beginners V1
Share Point For Beginners V1MJ Ferdous
 
Parallelminds.asp.net web service
Parallelminds.asp.net web serviceParallelminds.asp.net web service
Parallelminds.asp.net web serviceparallelminder
 
The SharePoint & jQuery Guide
The SharePoint & jQuery GuideThe SharePoint & jQuery Guide
The SharePoint & jQuery GuideMark Rackley
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechConThe SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechConSPTechCon
 
SharePoint 2010 and its development tools
SharePoint 2010 and its development toolsSharePoint 2010 and its development tools
SharePoint 2010 and its development toolsShakir Majeed Khan
 
SharePoint Saturday Los Angeles 2011 SharePoint 2010 as The Business Intellig...
SharePoint Saturday Los Angeles 2011 SharePoint 2010 as The Business Intellig...SharePoint Saturday Los Angeles 2011 SharePoint 2010 as The Business Intellig...
SharePoint Saturday Los Angeles 2011 SharePoint 2010 as The Business Intellig...Ivan Sanders
 
SharePoint Branding Guidance @ SharePoint Saturday Redmond
SharePoint Branding Guidance @ SharePoint Saturday RedmondSharePoint Branding Guidance @ SharePoint Saturday Redmond
SharePoint Branding Guidance @ SharePoint Saturday RedmondKanwal Khipple
 

Similar a Access SharePoint Lists and Items Using the Client Object Model (20)

SharePoint Silverlight Sandboxed solutions
SharePoint Silverlight Sandboxed solutionsSharePoint Silverlight Sandboxed solutions
SharePoint Silverlight Sandboxed solutions
 
Custom SharePoint 2010 solutions without server access
Custom SharePoint 2010 solutions without server accessCustom SharePoint 2010 solutions without server access
Custom SharePoint 2010 solutions without server access
 
Session 5-SharePoint with Office-Donovan Follette
Session 5-SharePoint with Office-Donovan FolletteSession 5-SharePoint with Office-Donovan Follette
Session 5-SharePoint with Office-Donovan Follette
 
SharePoint 2010 Developer 101
SharePoint 2010 Developer 101SharePoint 2010 Developer 101
SharePoint 2010 Developer 101
 
SharePoint 2010 Application Development
SharePoint 2010 Application DevelopmentSharePoint 2010 Application Development
SharePoint 2010 Application Development
 
SharePoint 2010 as a Development Platform, Ayman El-Hattab MVP
SharePoint 2010 as a Development Platform, Ayman El-Hattab MVPSharePoint 2010 as a Development Platform, Ayman El-Hattab MVP
SharePoint 2010 as a Development Platform, Ayman El-Hattab MVP
 
Office 365 development
Office 365 developmentOffice 365 development
Office 365 development
 
Wss Object Model
Wss Object ModelWss Object Model
Wss Object Model
 
Chris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
Chris McNulty: ECM/WCM Planning, Implementation and Migration StrategiesChris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
Chris McNulty: ECM/WCM Planning, Implementation and Migration Strategies
 
Solve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesSolve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 Features
 
Intro to SharePoint for Developers
Intro to SharePoint for DevelopersIntro to SharePoint for Developers
Intro to SharePoint for Developers
 
SharePoint Developer Education Day Palo Alto
SharePoint  Developer Education Day  Palo  AltoSharePoint  Developer Education Day  Palo  Alto
SharePoint Developer Education Day Palo Alto
 
Share Point For Beginners V1
Share Point For Beginners V1Share Point For Beginners V1
Share Point For Beginners V1
 
Parallelminds.asp.net web service
Parallelminds.asp.net web serviceParallelminds.asp.net web service
Parallelminds.asp.net web service
 
The SharePoint & jQuery Guide
The SharePoint & jQuery GuideThe SharePoint & jQuery Guide
The SharePoint & jQuery Guide
 
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechConThe SharePoint and jQuery Guide by Mark Rackley - SPTechCon
The SharePoint and jQuery Guide by Mark Rackley - SPTechCon
 
SharePoint 2010 and its development tools
SharePoint 2010 and its development toolsSharePoint 2010 and its development tools
SharePoint 2010 and its development tools
 
SharePoint Saturday Los Angeles 2011 SharePoint 2010 as The Business Intellig...
SharePoint Saturday Los Angeles 2011 SharePoint 2010 as The Business Intellig...SharePoint Saturday Los Angeles 2011 SharePoint 2010 as The Business Intellig...
SharePoint Saturday Los Angeles 2011 SharePoint 2010 as The Business Intellig...
 
SharePoint Branding Guidance @ SharePoint Saturday Redmond
SharePoint Branding Guidance @ SharePoint Saturday RedmondSharePoint Branding Guidance @ SharePoint Saturday Redmond
SharePoint Branding Guidance @ SharePoint Saturday Redmond
 
KMA Deck -C. McNulty discusses ecm wcm-upgrades2010 - nyc
KMA Deck -C. McNulty discusses ecm wcm-upgrades2010 - nycKMA Deck -C. McNulty discusses ecm wcm-upgrades2010 - nyc
KMA Deck -C. McNulty discusses ecm wcm-upgrades2010 - nyc
 

Último

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
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
 
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
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
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
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
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
 

Último (20)

Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
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
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
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
 
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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
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
 
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
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
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
 
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
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
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
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
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
 

Access SharePoint Lists and Items Using the Client Object Model

  • 1. SHAREPOINT 2010 CLIENT SIDE OBJECT MODEL Phil Wicklund SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 2. About Me? Training & Certifications: • MCTIP: SharePoint 2010 Administration • MCPD: SharePoint 2010 Development • Microsoft’s SharePoint Masters Training (Redmond, WA) Other Notable Experience: • Published Author on SharePoint 2010 (SharePoint 2010 Workflows in Action) • National Speaker at SharePoint Conferences (The Experts Conference-LA, SharePoint Technology Conference-San Fran, TechFuse-MN, SharePoint Saturdays) • SharePoint Blog: www.philwicklund.com About Me: Over 6 years of experience SharePoint Architecture Experience, trained SharePoint architecture and development classes for nationally renown SharePoint- focused training organization.
  • 3. Agenda  Introduction / Why COM?  COM Architecture  Coding Samples  DEMO  .NET COM  Questions SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 4. Intro to the SP 2010 COM  Not enough web services in SP 2007  Rather than create more services, COM provides the complete API  COM provides a consistent development experience:  Windows Applications  ASP.NET web sites  Silverlight Applications  JavaScript, www client side scripting SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 6. Assembly References  SharePoint, Server Side  Microsoft.SharePoint (ISAPI)  .NET clients  Microsoft.SharePoint.Client (ISAPI)  Silverlight clients  Microsoft.SharePoint.Client.Silverlight (Layouts/clientbin)  Javascript clients  SP.js & SP.Core.js (Layouts)SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 7. Comparable Objects Microsoft.SharePoint Client Object Models SPContext ClientContext SPSite Site SPWeb Web SPList List SPListItem ListItem SPField Field SPFile File SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 8. Starter Code Using Microsoft.SharePoint.Client; ... using (ClientContext context = new ClientContext("http://intranet")) { Web web = context.Web; context.Load(web); context.ExecuteQuery(); string title = web.Title; // ListCollection lists = web.Lists; } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 9. Iterating through Lists in a Web using (ClientContext context = new ClientContext("http://intranet")) { Web web = context.Web; context.Load(web); context.Load(web.Lists); context.ExecuteQuery(); foreach(List list in web.Lists) { //do something } } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 10. Efficiencies… Don’t be Lazy! Web web = context.Web; context.Load(web, wprop => wprop.Title)); ListCollection lists = web.Lists; IEnumerable<List> filtered = context. LoadQuery(lists.Include(l=>l.Title)); context.ExecuteQuery(); foreach(List list in filtered) { } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 11. Working with List Items Web web = context.Web; List list = context.Web.Lists. GetByTitle(“List Title"); CamlQuery query = CamlQuery.CreateAllItemsQuery(); ListItemCollection items = lst.GetItems(query); context.Load(items); context.ExecuteQuery(); foreach (ListItem item in items) { string title = item["Title"]; } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 12. Efficencies with List Items CamlQuery query = new CamlQuery(); query.ViewXml = "<View><Query><Where><Eq> <FieldRef Name='Title'/><Value Type='Text'>Phil</Value> </Eq></Where></Query></View>"; ListItemCollection items = list.GetItems(query); context.Load(items, x => x.Include( item => item["ID"], item => item["Title"], item => item.DisplayName)); SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 13. Adding new List Items List list = context.Web.Lists. GetByTitle(“List Title"); context.Load(list); ListItem newItem = list.AddItem(new ListItemCreationInformation()); newItem["Title"] = "My new item"; newItem.Update(); context.ExecuteQuery(); SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 14. Silverlight & Asynchronous Calls private void Button_Click(object sender, RoutedEventArgs e) { // Load a bunch of stuff clientContext.ExecuteQueryAsync(success, failure); } private void success(object sender, ClientRequestSucceededEventArgs args) { RunQuery runQuery= Run; this.Dispatcher.BeginInvoke(runQuery); } private delegate void RunQuery(); private void Run() { /* do something */ } private void failure(object sender, ClientRequestFailedEventArgs args) { /* do something */ } SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 15. .NET – COM Demo  Build a Console (client) Application  Render all the List Titles from a remote SharePoint site.  Create a new list item in a remote SharePoint site. SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAconsulting.com
  • 16. QUESTIONS & COMMENTS Phil Wicklund SharePoint FREEWARE www.PhilWicklund.com SharePoint CONSULTING www.RBAConsulting.com