Object Model Enhancements

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Windows SharePoint Services 3.0 has greatly extended or modified the object model of existing Windows SharePoint Services 2.0 namespaces, and added entirely new namespaces for new features. All object model changes in Windows SharePoint Services 3.0 have been made with an emphasis on high backward-compatibility with Windows SharePoint Services 2.0, so even though an area of the object model may have been completely refactored, such as for administration, code based on Windows SharePoint Services 2.0 should still function. However, be aware that old code, although functional, may not do what you expect with respect to the new object model hierarchy.

Administration

The object model of the Microsoft.SharePoint.Administration namespace has been completely refactored to allow for greater extensibility. The new hierarchical object store provides a common framework for third-party applications to manipulate and store administrative data. Both the administrative Web site and command line operations are extensible. The new Microsoft.SharePoint.Administration.Backup namespace provides members for backup and restore operations.

Work Items and Timer

The Job Service in Windows SharePoint Services 3.0 provides facilities for setting up a timed job that executes at the following times:

  • At a definable interval (every n minutes).

  • During a certain time period in the hour, day, week, month, or year.

The Job Service also provides a facility for distributing work among servers in a farm. For example, based on a request to create a site, which originates on a front-end Web server, a one-time job can soon run on an indexing server.The main objects for the Job service are Microsoft.SharePoint.Administration.SPJobDefinition and Microsoft.SharePoint.SPWorkItem:

  • SPJobDefinition - An administrative timer that can implement one-time or simple recurring schedules. You set a schedule, and then you implement the Execute method.

  • SPWorkItem - A content-related job that involves one-time execution. You processs batches through the administrative timer job.

Events

Events are key to Windows SharePoint Services 3.0 as a developer platform. The greatly expanded events infrastructure enables third-party applications to implement or override default Windows SharePoint Services behaviors.

Events fall into two major categories:

  • List events   This category includes core events—such as changes, additions, and removals of not only list items, but also of list columns (for example, schema changes).

  • Simple site events   This category includes deletion of sites and site collections.

Events are either synchronous Before events, denoted by the "XYZing" name format, or asynchronous After events, denoted by the "ABCed" name format.

You can register event receivers through Features defined for list items, lists, Web sites, or content types. For example, you can associate an event receiver that ensures a document always has a copyright in the footer with a central content type, and push it down to all document libraries associated with that type.

Just as in Windows SharePoint Services 2.0, you can override and extend event handler methods. A new sequence number parameter allows for finer control of the firing order of multiple events.

For more information about events, see Event Fundamentals.

Web Services

Windows SharePoint Services 3.0 expands several existing Web services, increasing the number of methods provided through Lists, Site Data, Users and Groups, Web Part Pages, and Webs Web services. Both Lists and Webs, for example, now include new methods for content type integration, and the Lists Web service provides new methods for working with files in document libraries, In addition, Windows SharePoint Services 3.0 introduces several new Web services, including services for authentication, copying files, managing security principals, portal search, and directory management for messaging application synchronization.

For more information about Windows SharePoint Services Web services, see Windows SharePoint Services Web Services.

Recycle Bin

Recycle Bins, or undelete functionality, is another important new Feature in Windows SharePoint Services 3.0. This functionality is available in both lists and document libraries and can be accessed through new types in the Microsoft.SharePoint namespace.

Deleting an item from a list triggers a multilevel series of events. First, the item is sent to a Web-level Recycling Bin. From there, the item can be undeleted by any individual who has been given appropriate rights. When the item is deleted from this bin, the item is sent to a second Recycling Bin, controlled by the site administrator. Among the design features of this bin are timers that allow you to automate the removal of old documents. For example, an administrator might decide that the vast majority of requests for item restorations must happen within the first 90 days. In this scenario, the administrator might set the timer such that items older than 90 days are permanently deleted.

Property Bags

Property bags are now exposed on several major objects in the Microsoft.SharePoint namespace, including the SPWeb, SPFile, SPFolder, and SPListItem classes. These and other classes provide a Properties property that returns a property bag for the specified object, which consists of a hash table in which values are stored. A call to the Update method on the object persists the values set in the property bag. All values can be stored and retrieved by using Web service methods.

See Also

Other Resources

Event Fundamentals

Windows SharePoint Services Web Services