Microsoft Windows SharePoint Services includes changes that allow you to bind an event handler to a document library. With this feature, you can use document library events to start other processes, such as workflow processes. You can develop managed code that takes advantage of document library events and create an application based on Windows SharePoint Services to perform whatever actions you need. When you combine document libraries, your own event-handling managed code, and possibly XML forms, you can create complex workflow processes that are easy for users to work with.
For example, in the healthcare industry, when a new patient is admitted to a hospital, there is a lot of paperwork that needs to be generated, and it needs to be done in a specific order. You can write an application that interacts with XML forms in a document library to do such things as:
- Track when a new admissions form is added to the document library.
- Extract the insurance information and forward it to the billing application.
- Notify the staff in the appropriate section of the hospital to pull the patient's chart.
Tracking Events in Document Libraries
The following events can be tracked for document libraries.
||A new document is added to the document library.
||An existing document is edited.
||An existing document is deleted.
||A document is moved or renamed.
||A document or folder is copied.
||A document is checked in.
||A document is checked out.
||Changes made to a checked out document are undone.
For more information about writing managed code to interact with document library events, see the Microsoft Windows SharePoint Services Software Development Kit.
Enabling Document Library Events
If you want to allow developers in your organization to use the document library events to write code, you must enable this feature at the virtual server level.
Enable document library events for a virtual server
- Click Start, point to All Programs, point to Administrative Tools, and then click SharePoint Central Administration.
- Under Virtual Server Configuration, click Configure virtual server settings.
- On the Virtual Server List page, click the name of the virtual server you want to configure.
- On the Virtual Server Settings page, under Virtual Server Management, click Virtual server general settings.
- On the Virtual Server General Settings page, in the Event Handlers section, next to Event handlers are, select On.
- Click OK.
After the feature is enabled, you can write code to handle the events, and then specify the code to use for a particular document library in the document library settings.
Enable document library events for a specific document library
- On the appropriate Web site, navigate to the document library you want to monitor.
- Under Actions, click Modify columns and settings.
- Under General Settings, click Change advanced settings.
- In the Event Handler section, in the Assembly name box, type the strong name of the assembly containing the event handler class.
- In the Class Name box, type the full class name for the event handler.
Note The Class Name value is case sensitive.
- In the Properties box, list any appropriate properties for the event handler.
- Click OK.
Note Be aware that event settings are preserved when a document library is saved as a list template. For more information about templates, see "Working with Templates" in the Windows SharePoint Services Administrator's Guide.