Event Handlers - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Event Handlers

Description:

One per library. Synchronous vs Asynchronous. Synchronous ... Checkin/Checkout/Uncheckout ... New List 'FieldAdded' Admin kit 'Bulk site collection move' ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 17
Provided by: johnm454
Category:

less

Transcript and Presenter's Notes

Title: Event Handlers


1
Event Handlers
  • John Miller

2
What is an Event Handler
  • This is an assembly that fires on a Sharepoint
    event that allows you to extend your Sharepoint
    application with custom business logic.

3
Agenda
  • Background information
  • What events are available?
  • How do I deploy?
  • What else do I need to know?

4
History
  • Event handlers were available in SPS 2003
  • On document and form libraries
  • Asynchronous after event
  • One per library

5
Synchronous vs Asynchronous
  • Synchronous
  • Event happens before action is committed, you can
    still cancel the event
  • Provides a chance for the UI
  • Is a blocking call
  • Asynchronous
  • Event happens after action is committed
  • Runs in a separate worker thread

6
What objects use event handlers
  • Site Level
  • List Level
  • List Item Level
  • Email Listener Level
  • Content Type Level
  • Feature Level
  • File Level (backwards compatability)

7
What site events can I attach
  • Web Moving
  • Web Moved
  • Web Deleting
  • Web Deleted
  • Site Deleting
  • Site Deleted

8
What list events can I attach
  • Field Adding
  • Field Added
  • Field Updating
  • Field Updated
  • Field Deleting
  • Field Deleted

9
What List Item events can I attach
  • Item Add
  • Item Delete
  • Item Updated
  • Item Attachment Add
  • Item Attachment Delete
  • Item Checkin/Checkout/Uncheckout
  • ItemFile Move
  • ItemFileConverted

10
What feature events can I attach
  • FeatureInstalled
  • FeatureActivated
  • FeatureDeactivating
  • FeatureUninstalling

11
Demo 1
12
Code Deployment
  • Event handlers need to be installed to the GAC

13
Deployment Information
  • Event Type
  • Assembly
  • Class
  • Sequence Number

14
Deploying event receivers
  • Feature
  • Deploy to a ListType
  • Deploy to a ContentType
  • Programatically
  • Custom Site Settings application
  • Command-line
  • Hybrid

15
Configuration Validation Info
  • Properties Receiver data (properties.ReceiverData)
  • Set when the event is registered
  • String data or path to an xml file
  • Event Receivers have access to the web.config

16
Limitations
  • Events do not fire on bulk operations
  • New List FieldAdded
  • Admin kit Bulk site collection move
  • Lists are still second class citizens
  • Performance
  • Sync vs Async vs Timer Job
Write a Comment
User Comments (0)
About PowerShow.com