Microsoft Inside Microsoft SharePoint 2010 Ted Pattison Andrew Connell Scot Hillier David Mann
ble of Contents Foreword Acknowledgments Introduction xv xvii xix 1 SharePoint 2010 Developer Roadmap 1 SharePoint Foundation 2 SharePoint Foundation Architecture 3 SharePoint Farms 5 Web Applications 8 Service Applications 10 SharePoint Server 2010 13 Sites 14 Customizing Sites 17 SharePoint Designer 2010 20 Site Customization vs. SharePoint Development 22 Windows PowerShell Boot Camp for SharePoint Professionals 23 Learn Windows PowerShell in 21 Minutes 24 The Windows PowerShell Integrated Scripting Environment (ISE) 28 The SharePoint PowerShell Snap-in 30 Conclusion 33 2 SharePoint Foundation Development 35 The Server-Side Object Model 35 Creating the Hello World Console Application 36 Enabling the SharePoint Developer Dashboard 39 Developing SharePoint Solutions 40 Developing a SharePoint Solution Using a Class Library Project 41 The SharePoint Root Directory 42 Creating a Feature Definition 44 Creating a Solution Package 50 Feature Upgrade Enhancements in SharePoint 2010 61 Conclusion 68 3 SharePoint Developer Tools in Microsoft Visual Studio 2010 69 Life Before SharePoint Developer Tools 69 Getting Started with the SharePoint Developer Tools 71
Using SharePoint Explorer 71 Adding a Feature Receiver 76 Adding a SharePoint Project Item 78 Deployment and Testing 82 Working with Mapped Folders 84 Conclusion 87 4 Sandboxed Solutions 89 Understanding the Sandbox 90 Building a Basic Sandboxed Solution 91 Understanding the Architecture 95 Understanding Solution Restrictions 97 Designing a Sandboxed Solution 100 Understanding Full-Trust Proxies 104 Administrating Sandboxed Solutions 108 Using Central Administration Tools 108 Validating Sandboxed Solutions Ill Using Windows PowerShell for Administration 114 Using Site Collection Tools 115 Conclusion 116 5 Pages and Navigation 117 SharePoint Foundation Integration with ASP.NET 117 ASP.NET Fundamentals 118 SharePoint Web Applications 121 Web Application Configuration Files 123 The Virtual File System of a Site 125 Page Templates and Ghosting 128 Application Pages 130 Master Pages 133 Creating Site Page Templates 138 Creating Pages in Sandboxed Solutions 141 The Module SharePoint Project Item Type 141 TheSandboxedSolutionPages Sample Project 145 Creating Web Part Pages 147 Creating Output References to Integrate Silverlight Applications 149 Creating Pages in Farm Solutions 151 Navigation Support for Application Pages 156 Custom Breadcrumb Navigation Using a Site Map 157 Creating a Reusable Branding Solution 159 Deploying a Custom Master Page 160 Deploying CSS Files and Images to the Style Library 162 Conclusion 166
6 Controls and Web Parts 169 Developing with Controls 169 The WingtipControls Sample Project 170 Safe Mode Processing and Safe Controls 172 Using a Custom Control to Create a Menu 175 User Controls 178 Delegate Controls 182 Developing Web Parts 186 Web Part Fundamentals 187 Web Part Output Rendering 196 Persistent Properties 203 Custom Editor Parts 206 Web Part Verbs 208 Web Parts Connections 211 Asynchronous Processing 216 Conclusion 223 7 Lists and Events 225 Creating Lists 225 Fields and Field Types 229 Views 235 Site Columns 236 Content Types 241 Working with Document Libraries 248 Creating a Document Library 249 Adding a Custom Document Template 250 Creating Document-Based Content Types 252 Programming with Documents 254 Creating Documents with Code 255 Creating and Registering Event Handlers 258 Event Receiver Classes 260 Registering Event Handlers 261 Programming Before Events 268 Programming After Events 273 Conclusion 275 8 Templates and Type Definitions 277 Field Type Definitions 277 Creating Custom Field Types 278 Creating a Custom Field Control 284 List Definitions 292 Creating Site Column Definitions 294 Creating Content Type Definitions 296 Creating List Definitions 298 Feature Activation Dependencies 302
Site Definitions 304 Configurations and Web Templates 305 ONET.XML: The Site Definition Manifest 306 The Global Site Definition 310 Creating and Initializing Sites 312 Creating a Site Provisioning Provider 314 Conclusion 318 9 Accessing Data in Lists 319 Using the Basic List Object Model 319 Querying Lists with CAML 321 Querying Joined Lists 323 Querying Multiple Lists 324 Throttling Queries 327 Introducing LINQ 329 LINQ Overview 330 Understanding LINQ Language Elements 331 Working with LINQ to SharePoint 335 Generating Entities with SPMetal 335 Querying with LINQ to SharePoint 340 Adding, Deleting, and Updating with LINQ to SharePoint 342 Working with Document Libraries 344 Using the Basic Library Object Model 344 Working with Open XML 347 Conclusion 352 10 Client-Side Programming 353 Understanding Client Object Model Fundamentals 353 Understanding Contexts 355 Loading and Executing Operations 356 Working with the Managed Client Object Model 359 Handling Errors 359 Understanding Authentication and Authorization 362 Creating, Updating, and Deleting 364 Working Asynchronously 367 Working with the Silverlight Client Object Model 368 Introducing Silverlight Development 368 Asynchronous Programming with Silverlight 371 Error Handling in Silverlight 374 Passing Parameters to Silverlight 374 Creating a Custom Silverlight Host 376 Working with the JavaScript Client Object Model 378 Setting Up a Basic Page 378 Handling Errors in the JavaScript Client Object Model 380 Running Code on Page Load 382
Working Debugging JavaScript 382 Working with AJAX 382 Using Object-Oriented JavaScript 384 Working with jquery 387 with WCF Data Services 388 Getting Started with WCF Data Services 389 Using WCF Data Services in Visual Studio 390 Conclusion 391 11 Creating and Developing Workflows 393 What Is Workflow? 393 SharePoint Workflow Fundamentals 395 The User Experience in a SharePoint Workflow 397 Creating Custom Workflows 399 SharePoint Designer 2010 399 Getting Started 400 Creating a Workflow with Visio and SharePoint Designer 409 Developing Custom Workflow Components 417 Developing Custom Actions 419 Developing Custom Workflow Templates 426 Conclusion 453 12 SharePoint Security 455 Authentication, Authorization, and Identities 455 User Information List 458 Users and Groups 459 Application Pool Identities 462 SHAREPOINT\SYSTEM Account 462 Delegating User Credentials 466 User Impersonation with the User Token 467 Securing Objects with SharePoint 468 Rights and Permission Levels 469 Handling Authorization Failures with SPUtility 472 Claims-Based Security 473 Claims Architecture 475 User Claims 476 Custom Claims Providers 479 Conclusion 484 13 Business Connectivity Services 485 Introducing Business Connectivity Services 486 Creating Simple BCS Solutions 488 Creating External Content Types 488 Creating External Lists 491 Understanding External List Limitations 493
Understanding BCS Architecture 495 Understanding Connectors 495 Understanding Business Data Connectivity 496 Managing the BDC Service 496 Understanding the BDC Server Runtime 500 Understanding the Client Cache 500 Understanding the BDC Client Runtime 501 Introducing the Secure Store Service 501 Understanding Package Deployment 504 Understanding Authentication Scenarios 504 Configuring Authentication Models 504 Accessing Claims-Based Systems 508 Accessing Token-Based Systems 509 Managing Client Authentication 509 Creating External Content Types 510 Creating Operations 511 Creating Relationships 513 Defining Filters 515 Using ECTs in SharePoint 2010 516 Creating Custom Forms 516 Using External Data Columns 517 External Data Web Parts 518 Creating a Profile Page 519 Searching External Systems 520 Supplementing User Profiles 521 Using ECTs in Office 2010 522 Using the SharePoint Workspace 522 Understanding Outlook Integration 523 Using Word Quick Parts 524 Creating Custom BCS Solutions 525 Using the BDC Runtime Object Models 525 Using the Administration Object Model 528 Creating.NET Assembly Connectors 531 Conclusion 534 14 Enterprise Content Management 535 ECM in SharePoint Server 2010 535 "Featurization" of ECM Capabilities for Wide Use 536 ECM Site Templates 536 Document Management 537 Large Lists 537 Check-in/Checkout 539 Document Sets 540 Document IDs 547
Records Management 550 Declaring Records 550 Content Organizer 551 Web Content Management 552 Page Rendering Process 552 Creating New Page Types 554 Content Aggregation with the Content Query Web Part 557 Managed Metadata 559 Term Sets 560 Enterprise Content Types 567 Conclusion 568 15 SharePoint Search 569 Introducing Search-Based Applications 570 Understanding Search Architecture 571 Understanding the Search Service Application 572 Understanding the Indexing Process 573 Understanding the Query Process 574 Introducing Search Web Parts 574 Introducing the Search Object Models 575 Creating Ranking Models 575 Creating a Custom Ranking Model 577 Using a Custom Ranking Model 580 Customizing Search Centers 581 Adding New Tabs 582 Customizing Search Core Results 583 Working with Keyword Query Syntax 588 Working with SQL Full-Text Search 589 Creating.NET Assembly Connectors for Search 590 Search-Enabling a Model 590 Implementing Security in Search Results 593 Crawling the.net Assembly Connector 596 Conclusion 596 Index 597