This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
adding custom actions to menus of the SharePoint UI, 604
adding menu items as custom actions to elements.xml, code listing, 616
adding nested menus, 613 assembling web controls for hierarchical
menu structures, procedure for, 613 ControlAssembly property, 613, 615 ControlClass property, 613, 615 CreateChildControls method, 614 creating custom web controls, 614 custom web control implementation for
nested menus, code listing, 614 CustomAction element, 607, 615 CustomActionContainer class, 611 displaying all custom actions, 609 elements.xml with a custom action
definition, code listing, 607 examples of custom actions, 609 extending the site settings page, 612 FeatureLinkSection control, 605
FeatureMenuTemplate control, 605–606, 614
GetCustomMenuItemActions method, 606 GroupId property, 609 Location and GroupID properties for
StandardMenu, table of, 608 Location property, 609 OnPreRender method, 614 Page_Load method, 611 PersonalActions menu, 607 registering a web control as safe, 615 specifying custom actions for menu
DynamicMasterPageFile property, 435 Inherits attribute, 433–434 internal layout pages, 432 LayoutsPageBase class, 432–434 linking to an application page, 435 main placeholder sections included in the
APIs for lists and libraries, 72 BaseFieldControl class, 78 basic scalar types, table of, 77
classes related to the SPContentType base class, 80
classes related to the SPField base class, 78 classes related to the SPFile base class, 76 classes related to the SPList base class, 75 classes related to the SPQuery and SPView
base classes, 84 configuring columns and field types, 79 content types, 80 DataContext class, 83 document libraries, 72 field controls, 78 <FieldRef> element, 81 fields, 77 LINQ to SharePoint, 82 list template types, table of, 72 lists, 72 <Module> element, 76 queries, 82 query schema, 84 reading and writing files with Stream
building blocks, deployment-related element files, 85 feature.xml, 85, 87 features, 85 full trust solutions, 88 sandboxed solutions, 88 site collections, 90 using a validator to check the validity of a
package, 88 web sites, 90
building blocks, UI creation application pages, 93–94 classes related to the SPEventReceiverBase
business collaboration applications, xxvi Business Connectivity Services (BCS)
accessing external data through the client object model, 279–280
adding an external list using the UI, 278 architecture of, 270 Business Data Catalog (BDC), 270 Business Data Connectivity Service link, 276 connecting LOB systems into a SharePoint
portal, 270
console application that retrieves data using a CAML query, code listing, 279
core components, list of, 271 creating an external content type using
SharePoint Designer, procedure for, 272–276
displaying external data, 277 external content types (ECT), 271 integration with Microsoft Office, 270 Northwind database, retrieving data from,
272 setting a user and assigning permissions,
276 SPList class, 279
business logic layer, xxii
■ C C#, compiling using the 2.0 compiler, 12 Cache object, 478 CanCreateItems method, 474 CanDeleteItems method, 474 canHandleCommand method, 679 Catalog mode, 318 CatalogZone, 323 Central Administration, xxiv, 11, 63, 1058 ChangeConflict property, 247 ChangeConflictException, 247 CheckedOutBy field, 1076 CheckPermissions method, 148 CheckRights method, 433 child sites, xxi chrome, rendering a Web Part in, 300 claims-based identity, 136 Click event, 364 client object model
accessing a property that has not been loaded, 739
AuthenticationMode property, 718 clarifying the difference between value
objects and client objects, 743 client objects, 718, 743 ClientContext class, 717 client-side data retrieval, 719 CollectionNotInitialized exception, 721 comparison of SharePoint main objects and
of, 715 SP namespace, 715 SP.ClientObject, 718 SP.ClientValueObject, 718 using client objects across methods, code
listing, 743 value objects, 743 XML request for all properties of a web
object, code listing, 741 See also administrative object model
ClientContext class, 717 constructors in the three client object
models, 723 ClientScript object, 367 cmdlets
Add-PsSnapin, 503 Add-SPSolution, 504
■ INDEX
1091
Add-SPUserSolution, 505 combining, 500 compiling a list of all installed cmdlets, 503 creating and sharing, 500 definition of, 500 deploying solution packages using cmdlets,
499 Get-Help command, 504 Install-SPUserSolution, 505 naming convention for commands, 503 obtaining more information about a cmdlet,
504 Remove-SPUserSolution, 505 Uninstall-SPUserSolution, 505 See also PowerShell
(CAML) adding fields from another list, 220 building custom queries, 216 combining several joins together, 221 comparing to LINQ, 214 console application that joins two lists, code
editing, 93 <SafeControls> section, 94 unghosted or uncustomized, 93 using custom code in, 94
content placeholders, 563 Content Query Web Part (CQWP), 1072–1073 <content> tag, 557 content types, xxii, 53, 80
base types for lists and libraries, 186 configuring, 81 ContentTypes collection, 188 custom content type, 189 definition of, 166 elements of, 167, 186 FieldLinks collection, 188 Fields collection, 186 global fields, 186 handling loosely structured data, 166 predefined site columns, 187 SPContentType object, 186 SPField object, 186 SPFieldLink object, 186 treating as a form of polymorphism, 186 when to use content types
activating using code, 22 activating using stsadm.exe, 20 activating via PowerShell, 21 trace information screen, 22 working with, 22
developer toolbox, xxiv development environment
Active Directory, 9 adding diagnostic output to your code, 23 Central Administration, 11 Complete installation, 9 config.xml, 6 configuring the necessary Windows features
for installing SharePoint, 7 Developer Dashboard, activating with code,
22 Developer Dashboard, activating with
stsadm.exe, 20 Developer Dashboard, activating with
PowerShell, 21 developing a plan for troubleshooting, 18 examining the event log, 19 examining the SharePoint and IIS logs, 19 extending the settings in the web.config file,
13 FilterPack, installing, 9 Hyper-V, 5 installation scenarios, 5 installing and configuring SharePoint using
setup.exe, 9 installing SharePoint on Windows Server
2008, procedure for, 5
installing SharePoint on Windows Vista or Windows 7, procedure for, 6
installing SharePoint on Windows Vista SP1 only, procedure for, 7
installing Visual Studio 2010, 11 learning the Microsoft internals of
SharePoint, 16 LINQ to SharePoint, 13 Microsoft.IdentityModel assembly, 9 programming against SharePoint’s internal
configuration or content databases, 15 prohibiting SharePoint installations on
Windows Vista or Windows 7 machines, 6
Reflector, 16 Roeder, Lutz, 16 running the SharePoint Products and
Technologies Configuration wizard, 10 services not normally required on a
development machine, 12 setting up, 4 setting up a Team Foundation Server, 11 setting up a virtual server on a physical
adding a folder programmatically, 199 definition of, 197 deleting a file, 200 deleting a file from a subfolder, 201 OpenBinary method, 198 OpenBinaryStream method, 198 recycling a file into the Recycle Bin folder,
functions of, 25 Internet Explorer Developer Toolbar,
functions of, 27 proxy settings for receiving incoming and
outgoing traffic, 26 starting, 26 support for breakpoints, 27 using your machine name as the hostname,
27 field controls
<asp:Button>, 629 BaseFieldControl class, 625 ControlMode property, 628 CreateChildControls method, 635, 643 creating a custom field type for lists, 630 creating a new list item, 626 custom field implementation, requirements
listing, 637 default field types for list items, 624 DefaultTemplateName method, 635 displaying or editing list items, 624 DisplayListItem.aspx.cs, code listing, 626 field editor user control, implementing,
enabling in custom application pages, 736 executeQueryAsync method, 737 failedCallback parameter, 737 succeededCallback parameter, 737 using within JS files, 738 Visual Studio’s lack of support for, 735
internal links, 580 Internet Explorer, Developer Toolbar functions,
27 Internet Information Services (IIS), 53–54 Internet Services API (ISAPI)
asynchronous data retrieval, 720 building dialog pages, 729 client object model, 711 Dialog framework, 724 dialogResult parameter, 728 displaying an external web page as a pop-up
dialog, 725 dlgframe.css, 732 enabling JavaScript IntelliSense in custom
a web object, code listing, 741 lack of support for JavaScript IntelliSense
within Visual Studio, 735 load function, 740 MicrosoftAjax.js, 736 onFailedCallback function, 740 onSucceededCallback function, 740 opening a page directly or within a pop-up
Access Services grid, 702 asynchronous validation, 703 converting DataTable data into grid
columns and fields, code listing, 708 converting results of a LINQ query to a
DataTable, code listing, 707 data validation using a widget framework,
704 DataType property, 709 default copy and paste operations, 703 displaying a JS Grid control in an
application page, code listing, 705 displaying read-only data from a data table,
705 editing and rendering tabular data, 702 EditMode enumeration, list of values, 704 embedding, 705 exporting data to Excel, 703 features of, 703 Gantt chart data view, 702 GetDataTable method, 707 GetGridColumns method, 709 GetGridFields method, 709
grid pane, 703 GridSerializer, table of properties, 706 highlighting of errors, 703 Linq2DataTable method, code listing, 707 precedence of edit mode, 704 <SharePoint:JSGrid> tag, 705 using the JS Grid control in custom pages or
SharePoint lists, 284 dynamically generated XML mapping, code
listing, 290 GetXmlMapping method, 291
■ INDEX
1105
IsAllowedField method, 287 LeadAuthorsDbItem class, 288 limitations of accessing the content
database directly, 291 managing fast queries over large SharePoint
lists, 280 method for dynamic generation of mapping
XML, 290 model classes for the two SQL views to use
with LINQ, 288 querying the number of books per lead
author, code listing, 289 querying with, 288 SPField class, 284 SQL CREATE VIEW script for the SharePoint
list Books, 285 SQL function script for converting UTC time
to local time, 284 SQL SELECT query that returns all books,
283 SQL view creation script for the SharePoint
list LeadAuthors, 285 storing datetime database values in
Universal Time Coordinated (UTC), 284
System.Linq namespace, 289 understanding the SharePoint content
database, 280 UserData built-in view, 283 using direct SQL access for best
performance, 292 See also Collaborative Application Markup
Language (CAML); Language Integrated Query (LINQ); LINQ to SharePoint
Linq2DataTable method, code listing, 707 list definition template, 34 List Definition Visual Studio 2010 project
template, 392 list definitions, 392 <List> element, 235 list permissions, 137 list templates
AllItems.aspx, 394, 402
basic list-definition structure in schema.xml, 396
building a chain of joins, 402 changing list rendering in SharePoint
Designer, procedure for, 402 ContentType, 397, 400 ContentTypes element in schema.xml, 397 creating a custom list definition, 392 creating a new list using the SharePoint API,
procedure for, 408 creating custom forms, 405 creating list templates in the SharePoint UI,
392 defining a lookup field, 399 Elements.xml for list definition deployment,
code listing, 395 FeatureActivated event, 394 FeatureDeactivated event, 394 FeatureReceiver class, code listing, 394 Field specification in schema.xml, code
listing, 398 FieldRef element, 403 Fields element in fldtypes.xml, 398 foreign list, 402 hidden attribute, 396 inner joins, 402 left joins, 402 List Definition Visual Studio 2010 project
template, 392 list definitions, 392 List element in schema.xml, 396 ListAlias attribute, 403 lookup field specification in schema.xml,
399 main.xsl, 402 MaxQueryLookupFields property, 404 onet.xml, 397, 407 primary list, 402 ProjectedFields element, 404 query specification in a view, 405 schema.xml, 393 SecurityBits attribute, 407 setting a type attribute, 396
■ INDEX
1106
Solution Explorer, 392 specification of joins defined in
schema.xml, code listing, 403 specification of the Forms element in
schema.xml, 405 specifying a BaseType ID, 397 specifying the four required list forms inside
the list definition file, 394 types of, 392 Url property, 397 using a custom site definition, procedure
for, 407 using CAML-based joins and projections to
build views, 402 using custom list templates, 406 using SharePoint Designer to create a new
list from an installed list template, 408 using the SharePoint UI, procedure for, 406 ViewFields element in schema.xml, 404 viewpage.aspx page, 394 Views element in schema.xml, 400 ViewStyle element, 402 when to use, 391 XSL-based view rendering, 401 XSLT List View Web Part, 402 See also column templates; site templates;
accessing large lists, 780 accessing list items, 755 Add method, 169, 171 AddFieldAsXml method, 752 adding a lookup, 171 adding an attachment to a list item, 176 adding fields to a list, 171
adding items to a list, 173 AddLookup, 171 ArgumentException, 174 asynchronous list-level events, table of, 191 calling DeleteObject, 754 changing field properties programmatically,
172 checking whether a list already exists, 170 classes related to the SPList base class, 75 content types, 166 copying an attachment, 179 creating a new list (C#), code listing, 752 creating a new list (JavaScript), code listing,
752 creating a new list item (C#), code listing,
758 creating a new list item (JavaScript), code
listing, 758 creating programmatically, 169 defining and using views, 180 defining custom field types, 171 deleting a list (C#), code listing, 754 deleting a list (JavaScript), code listing, 754 deleting a list item (C#), code listing, 760 deleting a list item (JavaScript), code listing,
760 deleting an existing attachment, 177 downloading a file, 178 downloading an attachment, 177 DropDownList control, 181 elements of, 165 enumerating a fields collection, 173 handling huge lists, 179 List<T> element, 170 List.Fields property, 751 ListCreationInformation class, 752 ListItemCollectionPosition property, 780 ListItemCreationInformation class, 758 metadata, 166 modifying a property of an existing
SharePoint list (C#), code listing, 753
■ INDEX
1107
modifying a property of an existing SharePoint list (JavaScript), code listing, 754
OfType operator, 170, 173 OnQuickLaunch property, 170 Package object, 176 paging a large list (C#), code listing, 780 reading an attachment for a specific list
item, 175 reading an attachment via the folder
hierarchy, 176 retrieving all the items in a list (C#), code
listing, 755 retrieving all the items in a list (JavaScript),
code listing, 756 retrieving all the SharePoint lists for a web
site (C#), code listing, 750 retrieving all the SharePoint lists for a web
site (JavaScript), code listing, 750 retrieving list items using CAML (C#), code
listing, 756 retrieving list items using CAML
(JavaScript), code listing, 757 retrieving list schema information (C#),
code listing, 751 retrieving list schema information
sharing the same master page, 563 application.master, 560, 563 applicationv4.master, 563 applying recursively to all child sites, 575 autorepairing master pages that contain
566 example of, 556 falling back to a ghosted version of the
default master page, 565 GetMappedPage method, 567 handling in custom galleries, 95 improvements to, in SharePoint 2010, 562 layout of the placeholders within a master
Open Packaging Convention (OPC), 201 OpenBinaryStream method, 204 Package object, 204 SPDocumentLibrary object, 204 System.IO.Packaging namespace, 204 using LINQ to XML, 204 XML data files and zipped packages, 201 XML Paper Specification (XPS), 204
713 .NET Framework, xviii, 4 referencing the client object model DLLs in
a Windows application, 713
See also ASP.NET New Project dialog, 430 Northwind database, retrieving data from, 272 notification API, table of functions, 734 notification area, 734 NT Lan Manager (NTLM), 57
■ O object model (SharePoint)
advantages of using, 16 architectural components of, 51 extending the platform to add more
adding a bug-tracking list to the list section, 423
adding a discussion board to the list section, 424
basic structure of, 417 folder location of, 417 Image Web Part specification in, 421 list view Web Part specification in, 422 ListTemplates declaration in, 419 production configuration, code listing, 422 types of components defined in, 422
command-line scripts, 494 obtaining more information about a cmdlet,
504 Remove-SPUserSolution cmdlet, 505 scripts, 500 SharePoint.ps1 script, 502 Uninstall-SPUserSolution cmdlet, 505 using .NET objects as input and output, 499 See also cmdlets
Accept request header, 260 accessing a SharePoint list as a feed, 259 advantages of, 256 architectural constraints, 258 Atom Publishing Protocol (AtomPub), code
listing, 258 comparing to SOAP, 257 description of, 257 endpoint, definition of, 258 mapping operations to HTTP verbs, 258 online introductions to, 257 resource, definition of, 258 RESTful systems, 257 routing data independently in a layered
system, 258 Uniform Resource Identifiers (URIs), 258 using to address web services, 258
adding a button 59, 619 advantages of toolbars over ribbons, 672 available ribbon controls, table of, 680 canHandleCommand method, 679 classes related to the SPRibbon base class,
96 CMDUI.XML, 617 ComboBox control, 682 CommandDispatcher object, 675–676 CommandUIVisible property, 688 configuring, 96 Controls element, 674 creating a feature with a ribbon definition,
686 creating an application page and displaying
the ribbon bar, 687 CUI.Page.CommandDispatcher class, 95,
679 CUI.Page.PageCommand class, 95 custom PageComponent implementation in
SP.UI.MyCustomRibbon.debug.js, code listing, 691
customizing, 618, 686 defining in XML, 674 enabling custom commands on the ribbon,
code listing, 688 extended OnPreRender method for using a
custom PageComponent, code listing, 693
extending the ribbon to add functionality, 674
extracting from UsageRibbonPageComponent in SP.Ribbon.js, 690
FlyoutAnchor control, 682 GetFontFamilyMenuXml function, 683 groups and controls, 674 Groups element, 674 handleCommand method, 679 HideCustomAction element, 620 ICommandHandler pseudointerface, 677 implementing a JavaScript command
handler in custom actions, 618 implementing server-side event handlers,
basic list-definition structure in, 396 ContentType specification in, 400 ContentTypes element in, 397 Field specification, code listing, 398 Forms element in, 405 List element in, 396 lookup field specification in, 399
specification of defined joins, code listing, 403
ViewFields element in, 404 Views element in, 400
Scope attribute, 389, 686 search
accessing the index from code to retrieve the search results, 1059
Central Administration, 1058 choosing between two object models, 1059 configuring the index and query services,
1058 custom search with the query object model,
code listing, 1060 Fast Query Language (FQL), 1060 FAST Search Server 2010 for SharePoint,
namespace, 1060–1061 query object model, 1060 required DLLs for, 1060 search capabilities for different SharePoint
products, table of, 1062 Search Server 2010, 1058 Search Server 2010 Express, 1058 SharePoint Foundation 2010, 1058 SharePoint Server 2010, 1058 tools to implement enterprise search in
access control lists, 138 anonymous access, 135 ASP.NET Forms Authentication, 136 audiences, 138 authentication, 133
■ INDEX
1119
authority, 136 authorization failures, 151 CheckPermissions method, 148 claim, defintion of, 136 claims-based identity, 136 configuring a combination of
authentication methods, 137 creating a 401 (Access Denied) HTTP
message, 152 defining group permissions, 141 DoesUserHavePermissions method, 148 EnsureUser method, 141 getting a particular user of type SPUser, 141 getting and setting the application pool
133 users, groups, and roles, 138 using elevated-privilege code, best
practices, 146 validating a user’s identity via IIS, 133 Web Single Sign-On authentication, 136 Windows Authentication, 134 Windows Identity Foundation (WIF), 136
Active Directory, 9 Ajax, 25 application page that uses the notification
API, code listing, 734 application page that uses the status API,
code listing, 733 application platform, definition of, 3 ASP.NET, xviii authentication, xxiii authorization, xxiii <authorization> tag, 47 browser support, 25 business collaboration applications, xxvi Business Connectivity Services (BCS), xxii business logic layer, xxii categories of SharePoint Web Parts, 299 Central Administration, xxiv, 11 child sites, xxi client object model, 711 Collaborative Application Markup
Language (CAML), xxii command-line tools supporting
administration and automation tasks, 42
Common Language Runtime (CLR), xxi, 4 comparing SharePoint Designer to Visual
Studio, 35 Complete installation, 9 config.xml, 6
configuring ASP.NET applications to run 64-bit code, procedure for, 45
configuring the necessary Windows features for installing SharePoint, 7
content types, xxii customizing as a development platform and
framework, xvi data layer, xxi defining user, administrator, and developer
roles, xx developer toolbox, xxiv enable32BitAppOnWin64 property, 45 evolution of client access to SharePoint
data, 712 examples of deprecated types and methods,
table of, 551 execution environment, xxi extending the settings in the web.config file,
13 FAST Search Server 2010 for SharePoint,
1058 features supported, xx Fiddler, using, 25 FilterPack, installing, 9 forcing authentication for an ASP.NET
application, procedure for, 47 forcing the application pool to use the
SharePoint administrator account, procedure for, 46
GUIDs, 1039 handling 64-bit quirks, 43 installation scenarios, 5 installing and configuring SharePoint using
setup.exe, 9 installing on Windows Server 2008,
procedure for, 5 installing on Windows Vista or Windows 7,
procedure for, 6 installing Visual Studio 2010, 11 learning the Microsoft internals, 16 libraries, xxi line-of-business (LOB) applications, xvi,
xxv–xxvi LINQ to SharePoint, 43
■ INDEX
1121
lists, xxi making a console application 64-bit ready,
procedure for, 43 manually upgrading custom solutions,
procedure for, 550 master pages, xxiii Microsoft Management Console (MMC), 4 Microsoft.IdentityModel assembly, 9 Microsoft’s SharePoint 2010 web site, xviii migrating existing solutions to Visual Studio
2010 and SharePoint 2010, 544 .NET Framework, xviii, 4 notification API, table of functions, 734 notification area, 734 overview of SharePoint and its related
technologies, xix platform requirements, xvii postbacks, 26 PowerShell cmdlets, 42 prohibiting installations on Windows Vista
or Windows 7 machines, 6 psconfig.exe, 42 psconfigui.exe, 43 root site, xxi running the Products Configuration Wizard,
261 running the SharePoint Products and
Technologies Configuration wizard, 10 Search Server 2010, 1058 Search Server 2010 Express, 1058 security layer, xxiii service-oriented architecture (SOA), 4 setting authentication for an ASP.NET
application, procedure for, 48 setting up a Team Foundation Server, 11 SharePoint client object namespaces, table
of, 715 SharePoint communities, xxi SharePoint Products and Technologies
Configuration Wizard, 42 SharePoint.exe, 6 Silverlight, xxiii site collection, definition of, xxi
six layers of, xxi SPMetal.exe, 43 SQL Server, 4 SQL Server 2008 Express, 11 Standalone installation, 9 status API, table of functions, 732 status bar, 732 stsadm.exe, xxiv, 42 UI layer, xxii using as an application platform, xviii using existing SharePoint 2007 code, 550 Visual Studio 2010, xx Web Analytics, 1072 web application architecture, illustration of,
14 Web Parts, xxiii, xxvi web.config, 47–48 What’s Popular Web Part, 1072 Windows Communication Foundation
(WCF), xix Windows Features dialog settings, 8 Windows Identity Foundation (WIF), xix, 9 Windows Presentation Foundation (WPF),
xix, xxiii Windows Server 2008, 4 Windows Workflow Foundation (WF), 4 working with users, groups, and roles, 760 XAML, xxiii XML, 4 See also SharePoint API; SharePoint
Designer; SharePoint Server 2010 SharePoint API
AddItemToList method, 126 creating a new list, procedure for, 408 creating an absolute URL, 122 DateOptions class, 125 DateTime class, 125 determining if a memory leak is due to
incorrectly disposed of objects, 133 disposing of objects and collections, 129 DoNotEncodeUrl, 122
■ INDEX
1122
establishing the site context or site collection context, 118
FormatDate method, 119 formatting a date, 119 formatting scalar data, table of examples,
124 GetContextSite method, 118 GetContextWeb method, 118 GetFullUrl method, 120 GetList method, 126 getting the full (absolute) URL, 120 handling the source URL with the
Business Data Connectivity data sources, 41 changing list rendering, procedure for, 402 changing the required permissions for, 37 comparing to Visual Studio, 35 creating a new list from an installed list
template, 408 creating an external content type,
procedure for, 272–276 creating new content types, 39 creating new lists, libraries, and workflows,
39 Data Sources option, 41
■ INDEX
1123
editing a list view to reveal the underlying XSLT, 41
External Content Types option, 41 features of, 36 installing the 32-bit or 64-bit version, 37 Permission Tools tab, 37 Site Actions menu, 37 storing and deploying resources, 40
SharePoint Foundation, xix, 52 SharePoint SDK, 3 SharePoint Server 2010
capabilities of, xxiv content publishing, xxv creating a repository to retain business
ime.dll, 714 referencing the client object model DLLs in
a Silverlight application, 714 Simple Object Access Protocol (SOAP),
comparing to REST, 256
simple.master, 571 simplev4.master, 563, 571 site (custom) master page, 558 Site Actions menu, 37, 435 site collections, 90
classes related to the SPWeb and SPSite base classes, 92
common LCID values, table of, 92 configuring, 92 creating programmatically, 1039 definition of, xxi Dispose method, 91 exporting and storing site templates as
site columns, 77, 187 site permissions, 137 Site property, 432–433 site templates
adding a bug-tracking list to the list section of onet.xml, 423
adding a discussion board to the list section of onet.xml, 424
basic structure of the onet.xml, code listing, 417
Configuration element in webTempProject.xml, 414
Content control, 416 Content Editor Web Part specification in a
module, code listing, 420 creating a minimal site definition using
Visual Studio 2010, procedure for, 410 creating a new site using Central
Administration, procedure for, 426 creating a new site using the SharePoint
Create pages, procedure for, 426 creating a new site with stsadm.exe, 425 creating a new subsite, code listing, 427
■ INDEX
1124
creating a site template, procedure for, 410 creating the development-environment
configuration, 423 default.aspx, 411, 420, 422 defining one or more configurations for a
site definition, 422 distinguishing between a site template and
a site definition, 410 DocumentTemplates element, 420 extended default.aspx page, code listing,
416 extending webTempProject.xml, code
listing, 424 Image Web Part specification in onet.xml,
421 implementing a custom FeatureActivated
event handler, 427 list view Web Part specification in onet.xml,
422 ListTemplates declaration in onet.xml, 419 Modules section, 420 NavBarHome attribute, 420, 422 NavBarLink element, 418 NavBars element, 418 onet.xml, 411 options for creating a new site from a site
definition, 425 production configuration in onet.xml, code
listing, 422 ProvisioningProvider, 414 quick launch bar, code listing, 418 site definition, basic structure, 411 skeleton default.aspx page, code listing, 415 specifying a declaration of the template as
an XML file, 412 specifying site-scoped and web-scoped
features, 423 types of components defined in onet.xml,
422 uses for, 408 using the site definition project template in
namespace, 673 NavigateUrl property, 673 Page.LoadControl method, 673 ToolBar.ascx, 672 ToolBarButton.ascx, 672 See also ribbon control
ToolboxItemAttribute, 329 ToolTipCustomProperty property, 634 top link bar navigation, 579 tracing, turning on and off, 20 TransferToErrorPage method, 123 Transmission Control Protocol (TCP), 56 tree view navigation, 584 TreeView element, 590 troubleshooting
adding diagnostic output to your code, 23 Developer Dashboard, activating using
code, 22 Developer Dashboard, activating using
stsadm.exe, 20 Developer Dashboard, activating via
PowerShell, 21 developing a plan for, 18 examining the event log, 19 examining the SharePoint and IIS logs, 19 Fiddler, using, 25
■ INDEX
1130
Internet Explorer Developer Toolbar, functions of, 27
SPMonitoredScope class, code listing, 23 turning on developer-friendly error
messages in web.config, 18 turning tracing on and off, 20 using advanced .NET debugging methods,
20 Type attribute, 222, 396 TypeName attribute, 69
■ U UI layer, xxii unified request-processing pipeline, 55 Uniform Resource Identifiers (URIs), 258 Uninstall-SPUserSolution cmdlet, 505 Unit type, 337 Universal Time Coordinated (UTC), 284 UnsecuredLayoutsPageBase class, 91, 118, 432–
Views element, list of properties, 401 ViewStyle element, 402 virtual directories, definition of, 57 Virtual Path Provider, 57, 63, 67, 94 Visible property, 669 Visual Studio 2010
adding SharePoint items and features to a project, 514
building a package, procedure for, 35 checking the settings for a new project, 31 comparing SharePoint Designer to Visual
Studio, 35 configuring the security level for a solution,
514 creating a full-trust proxy for a sandboxed
solution, 528 creating a sandboxed solution, 525 creating a solution package, 512 creating a solution validator, procedure for,
536 creating an error page for the solution
validator, 540 debugging the solution, 523 debugging using SPUCWorkerProcess.exe,
527 Default configuration, 522 deploying a package, procedure for, 35 deploying and registering the solution
validator, 542 deploying the full-trust proxy DLL to the
GAC, 532 deployment and retraction steps for
deployment configuration, table of, 522
editing a solution in the Packaging Explorer, 519
editing the manifest in an XML editor, procedure for, 517
Empty SharePoint Project template, 513, 525
F5 deployment feature, 5 Feature Designer, 33 feature event receiver, code listing, 533, 542 feature properties, table of, 518 Features folder, 33 FullTrustProxyArgs.cs, code listing, 530 FullTrustProxyOps.cs, code listing, 531 Global Assembly Cache (GAC), 31 importing a package, 34 importing a VSeWSS project, procedure for,
546 importing a WSP file, procedure for, 548 installing, 11 installing the Import VSeWSS Project Visual
Studio template, procedure for, 545 investigating a package, 33 lack of support for JavaScript IntelliSense
within Visual Studio, 735 list definition template, 34 manually upgrading custom solutions,
procedure for, 550 No Activation deployment configuration,
522 package properties, table of, 520 packaging the solution, 524 registering the full-trust proxy using a
feature receiver, 533 setting the project properties, 521 SharePoint development templates for C#
developers, table of, 29 SharePoint item templates for C#
developers, table of, 32 signing the DLL for GAC deployment, 529 SolutionValidationErrorPage.aspx, code
listing, 541 SolutionValidator class, code listing, 536 SPFullTrustProxyLog.txt, 536 testing whether a full-trust proxy is
registered in SharePoint, 536 upgrading a VSeWSS solution, 545 upgrading a WSP-packaged solution, 548
■ INDEX
1132
using a full-trust proxy to extend a sandboxed solution, 534
using IIS instead of the internal web server for debugging, 29
using the Feature Designer to edit project features, 516
using the project templates for SharePoint solutions, 513
Web Part, code listing, 526, 535 See also Ajax; JavaScript
Visual Web Part template, code listing, 307 VisualWebPart1UserControl.ascx, 309 VMware, 5 VSeWSS, 545
■ W WCF Data Services
Accept HTTP header, 267 accessing a data source using
nonproprietary standards, 257 accessing SharePoint lists for client
applications, 260 adding $metadata to the URL, 263 ADO.NET Data Services, 256, 261 Bad Request error (HTTP code 400), 267 basic format of the URI, 264 concat function, 268 creating an object-relational mapping to the
list, 268 Data Services Update for .NET 3.5 SP1,
downloading, 261 DataServiceContext class, 268 DataServiceQuery<T> property, 268 EntitySet property, 264 eq operator, 268 exchanging entities in JSON and Atom
formats, 267 filter expressions and operators, table of,
265 functions used in expressions, table of, 265 HomeDataContext, 269 HTTP, 257 installing, 261
investigating the source and retrieving data, code listing, 262
JavaScript Object Notation (JSON), 257 Key property, 264 object-relational mapping, 260 options to manipulate the response, table
of, 264 Plain Old XML (POX), 257 Property parameter, 264 querying data using, 256 reference.cs, 268 replacing SharePoint web services with, 257 Representational State Transfer (REST), 257 request and response MIME types, table of,
267 Resource Description Framework (RDF),
257 restricting a result set, 265 sample response in JSON format, code
listing, 260 setting the Content-Type HTTP header, 267 standards utilized, 257 syntax for retrieving data, examples of, 267 System.Net namespace, 269 typical response to a request, illustration of,
261 URI format, 261
Web Analytics, 1072 web applications
building a new web application, procedure for, 1037
console to create a new SharePoint web, code listing, 1037
ation namespace, 1068 PageFieldValue token, 1072 PageQueryString token, 1072 slots, definition of, 1072 user interface improvements in SharePoint
2010, 1070 using the PublishingWeb class, code listing,
1067 Web Content Accessibility Guidelines
(WCAG) 2.0, 1071 web controls
categories of, 623 data controls, 694 field controls, 624 input form controls, 643 Microsoft.SharePoint.WebControls
namespace, 623 overview of, 623 pickers and selector controls, 651 System.Web.UI.Control, 623 toolbar and ribbon controls, 672
<Web> element, 235 Web Part Page Services Component (WPSC),
366 Web Parts, xxiii, xxvi
Action class, 375 adding a security permission attribute to
code, 304
adding a trusted Web Part to an installation, 301
adding a Web Part to a page (C#), code listing, 772
adding a Web Part to a page (JavaScript), code listing, 772
adding controls to a custom editor pane, 330
adding the CAS policy to the current project’s package, 306
AddOnPreRenderCompleteAsync method, 370
Advanced category, 380 AllowAnonymousAccess property, 384 AllowCustomization property, 382 AllowPersonalization property, 382 ApplyChanges method, 329, 332, 342 ASCX file of a basic Web Part, code listing,
298 AssemblyInfo.cs, 306 asynchronous data fetching, 378 asynchronous data source, code listing, 373 asynchronous Web Part, code listing, 370 attributes to control the property pane,
table of, 380 BeginGetResponse, 373 benefits of, 295 best development practices, 375 Bing client library, 334 BingWebPart.cs, 334 BingWebPartUserControl.cs, 334 categories of SharePoint Web Parts, 299 checking permissions before rendering, 376 Click event, 364 ClientScript object, 367 Code Access Security (CAS), 98, 301 code-behind class of the custom editor,
code listing, 340 code-behind for the user control, code
listing, 310 coding a connected web part, 350 complete sender control, code listing, 351 connection interfaces, 347
331–332, 337, 342, 355, 362, 367 CreateEditorParts method, 330 creating a basic Web Part, procedure for,
298 creating a custom editor part, 333 creating connectable Web Parts using a data
connection, 347 creating private actions using verbs, 366 creating Visual Web Parts, 312 custom code access policy, 305 customizing the appearance of properties in
the tool pane, 381 CustomPropertyToolPart class, 381 <data> element, 311 default mapping between types and
controls, table of, 328 definition file for connected Web Parts,
code listing, 348 definition for a custom
<CodeAccessSecurity> section, code listing, 306
definition of, 296 deleting a Web Part from a page (C#), code
listing, 774 deleting a Web Part from a page
(JavaScript), code listing, 774 developing connected Web Parts, 348 DialogFeatures parameter, 344 DialogMaster class, 346 editing complex properties using a pop-up,
343 editing complex properties with editor
parts, 329 editing the AssemblyInfo.cs file, 311
editing the safe control entries using the Properties Editor, 301
editor part referencing custom controls, code listing, 341
EditorPart class, 330 EditorPartCollection, 330 <EditZone> control, 328 Elements.xml, 311, 348 encoding all user input rendered to the
client, 381 enhancing Web Parts using Ajax, 361 EnsureChildControls method, 332 ExecuteRegisteredAsyncTasks method, 370 ExportControlledProperties property, 379 Feature.xml, 348 FieldCallback, 357 fieldData parameter, 360 GetExtension method, 354 GetFieldInterface method, 359 GetFieldValue method, 359 GetFileByServerRelativeUrl method, 769 GetToolParts method, 381 Google Maps, 334 GroupedDropDownList control, 353 handling all exceptions to prevent web part
page failures, 375 handling validation errors, 332 helper class that supports private types,
code listing, 337 Hide method, 381 how to display a Web Part preview, 383 HtmlDesignerAttribute, 328, 343 HTMLEncode method, 381 HtmlGenericControl class, 353 IDesignTimeHtmlProvider interface, 380 IImageSelectorProvider interface, 353 Image element, 366 ImageSelectorProvider.cs, 348 <importErrorMessage> element, 98, 311 interfaces supporting generic connections,
356 IsClientScriptBlockRegistered method, 367
■ INDEX
1135
IWebPartField interface, 356 IWebPartRow interface, 356 IWebPartTable interface, 356 key.snk, 312 LimitedWebPartManager class, 769 List Web Part, 347 LoadControl method, 308 localizing custom properties, 384 LockLayout property, 382 making a property personalizable, 326 making a Web Part asynchronous, 369 making a Web Part safe by default, 70 making web parts easily searchable, 383 manifest file for the source, code listing, 350 manifest file for the target Web Part, code
listing, 350 markup of the custom editor, code listing,
340 master-detail pattern connection scenario,
356 meta information needed for each property,
326 Microsoft.SharePoint.WebPartPages
namespace, 299, 343 Microsoft.Web.CommandUI assembly, 310 modifying the design-time behavior of a
Web Part, 300 namespace and property definition in the
project item file for the Bing map Web Part, code listing, 343
properties, contents of, 327 <property> element, 314 property pane, 326 RadioButtonList, 331 ReadOnlyAttribute, 328 RegisterCustomerProvider method, 366 registering a client-side script via a web
reference, procedure for, 377 registering a Web Part as a safe control, 301 registering in web.config, 98 Render method, 331 RenderContents method, 297 rendering inside a chrome, 300 RenderWebPart method, 383 restrictions concerning specific trust levels,
table of, 302 retrieving embedded resource names using
the Immediate window, 384 Rich Text Editor, 300 RowCallBack, 357 running Visual Web Parts in a sandbox, 312 <SafeControl> element, 98 sample XML file, code listing, 97 SaveWebPartChanges method, 770 saving changes to a Web Part without the
correct permissions, 382 Schema property, 359 securing, 301 security and, 98 security exception after using a disallowed
permission, 303 sending and receiving components, 347 SetFieldInterface method, 360 SetLabel method, 360 setting medium trust as the default trust
level, 305 setting the Assembly Deployment property,
305 SharePoint support for ASP.NET Web Parts,
296 showModalDialog function, 346
■ INDEX
1136
Silverlight controls, 308 skeleton of an EditorPart control, code
listing, 330 Source Editor, 300 source Web Part definition, code listing, 349 SourceWebPart.cs, 348 specifying custom error messages, 376 specifying Web Part property values, 382 specifying whether Web Part properties can
class, 296 TableCallback, 357 target Web Part, complete code listing, 354 TargetWebPart.cs, 348 throwing a WebPartPageUserException, 332 ToolboxItemAttribute, 329 understanding data connections, 347 Unit type, 337 UpdatePanel, 362, 366 updating a Web Part title (C#), code listing,
770 updating a Web Part title (JavaScript), code
listing, 771 user control’s code-behind, code listing, 337 user controls markup part, code listing, 336 using a Web Part cache to store property
values, 378 using an interface to transfer a data
structure, 347 using attributes on properties to add meta
information, 326 using the default.master page, 299
validating properties before saving database changes, 376
viewing all the named parameters at once in Visual Studio, 307
Visual Web Part class that loads a user control, 313
Visual Web Part template, code listing, 307 Visual Web Parts and the Sandboxed
Solution property, 309 VisualWebPart1UserControl.ascx, 309 Web Part definition file with basic
properties, code listing, 310 Web Part implementing IWebPartField,
code listing, 357 Web Part Page Services Component
(WPSC), 366 Web Part Property Definition, code listing,
349 Web Part that exposes data via Ajax, code
listing, 362 Web Part that receives an object of type
IWebPartField, code listing, 359 Web Part that receives data via Ajax, code
Configuration element in, 414 elements and attributes, list of, 412
What’s Popular Web Part, 1072 window.frameElement property, table of
functions for finishing dialogs, 728 window.onload event, 345 window.onunload event, 345 Windows 7 Ultimate, xvii Windows Authentication, 134 Windows Communication Foundation (WCF),
xix, xxii, 56, 271 Windows Features dialog, settings for
SharePoint installation, 8 Windows Identity Foundation (WIF), xix, 9, 136
■ INDEX
1138
Windows Presentation Foundation (WPF), xix, xxiii
Windows Process Activation Service (WAS), 56 Windows Server 2008, xvii Windows Workflow Foundation (WF), 4 worker process, 59 workflows
classes related to the SPWorkflow base classes, 102
configuring, 102 namespaces used, 101 shapes, 101 Windows Workflow Foundation (WF)