Поделиться через


Server and Site Architecture Overview

Microsoft® Windows® SharePoint™ Services offers a highly structured server-side object model that makes it easy to access objects representing the various aspects of a SharePoint site. From higher level objects, you can drill down through the object hierarchy to obtain the object that contains the members you need to use in your code.

Depending on which part of a Windows SharePoint Services deployment that you need to customize, and the type of custom application you are creating, you can use different means of entry into the object model to obtain the appropriate higher-level object from which to start. The SPGlobalAdmin class provides access to the highest levels in the hierarchy, which are related to administrative operations, and you can also use this class to reach the lower objects in the hierarchy. Use the constructor of this class to attain an SPGlobalAdmin object to customize global administrative settings in the deployment.

If you are creating a Web Part, Web service, or Web application to work with site collections, individual sites, or lists, use the GetContextSite or GetContextWeb method of the SPControl class to attain the current site collection or site. When you create a Web application in the _layouts directory, its functionality becomes available to all sites on the Web server. Outside an HTTP context, such as in a console application, use the constructor of the SPSite class to attain a specified site collection.

The following diagram shows the Windows SharePoint Services site architecture in relation to the collections and objects of the Microsoft.SharePoint and Microsoft.SharePoint.Administration namespaces.

1  The ContentDatabases property of the SPVirtualServer class returns an SPContentDatabaseCollection object that represents the collection of content databases used for a virtual server. Each SPContentDatabase object provides access to properties of the content database.

2  The WebServers property of the SPGlobalConfig class returns an SPWebServerCollection object representing the collection of front-end Web servers in the Windows SharePoint Services deployment. Each SPWebServer object provides access to properties of the Web server.

3  The VirtualServers property of the SPGlobalAdmin class provides access to an SPVirtualServerCollection object representing all of the virtual servers in the Windows SharePoint Services deployment. The OpenVirtualServer method of the SPGlobalAdmin class returns a specific virtual server. Each SPVirtualServer object has members that can be used to manage the virtual server. The Sites property provides access to the SPSiteCollection object representing the collection of all site collections on the virtual server, and the Add method is used to create top-level site collections.

4  Each SPSite object represents a site collection and has members that can be used to manage the site collection. The AllWebs property provides access to the SPWebCollection object that represents the collection of all sites within the site collection, including the top-level site. The OpenWeb method of the SPSite class returns a specified site.

5  Each site collection includes any number of SPWeb objects, and each object has members that can be used to manage a site, including its template and theme, but also to access files and folders on the site. The Webs property returns an SPWebCollection object representing all the subsites of a specified site, and the Lists property returns an SPListCollection object representing all the lists in the site.

6  Each SPList object has members for managing the list or for accessing items in the list. The GetItems method can be used to perform queries that return specific items. The Fields property returns an SPFieldCollection object representing all the fields, or columns, in the list, and the Items property returns an SPListItemCollection object representing all the items, or rows, in the list.

7  Each SPField object has members that contain settings for the field.

8  Each SPListItem object represents a single row in the list.