SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Dernier (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

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