Robert Brown2
Thanks Ishai,
I managed to find a tool that alows you to add event handlers to just about anything in sharepoint here is the link http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx ID=1547.
However this tool does not create a feature for your event handlers so you cannot activate and deactivate them unless you remove them with the tool again (not the optimal solution).
I also found a way to install my event handlers as features on predefined content types (using the XML files) but it doesnt seem to be firing the event when i do it either way (If i use the tool or i do it this way).
I created a document library specificaly for this content type, and the idea is when ever this content type is uploaded the event is fired and the data in the file is then processed.
here is how i did the install.
Feature.xml
<Feature
Scope="Site"
Title="Simple Event Handler"
Id="dbb8da7a-6964-4487-91c9-4e29fcf64542"
xmlns="http://schemas.microsoft.com/sharepoint/"
Description="This is to test the useage of event handlers">
<ElementManifests>
<ElementManifest Location="Elements.xml"/>
</ElementManifests>
</Feature>
Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentType ID="0x01010075F2AFC3AB2A444EB3B2608A4F61E96F" Name="Content Type 1" Group="Custom Content Types" Description="This is to test the event management system" Version="0">
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
<spe:Receivers xmlns:spe="http://schemas.microsoft.com/sharepoint/events">
<Receiver>
<Name>ItemAdding</Name>
<Type>ItemAdding</Type>
<SequenceNumber>1</SequenceNumber>
<Assembly>SimpleEventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0e25abe2b7d6001b</Assembly>
<Class>SimpleEventHandler.SimpleEventHandler</Class>
<Data>
</Data>
<Filter>
</Filter>
</Receiver>
<Receiver>
<Name>ItemUpdating</Name>
<Type>ItemUpdating</Type>
<SequenceNumber>2</SequenceNumber>
<Assembly>SimpleEventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0e25abe2b7d6001b</Assembly>
<Class>SimpleEventHandler.SimpleEventHandler</Class>
<Data>
</Data>
<Filter>
</Filter>
</Receiver>
</spe:Receivers>
</XmlDocument>
</XmlDocuments>
</ContentType>
</Elements>
The hilighted section was important, the Content type id can be found when you are in sharepoint and are viewing the content type, look in the address bar for this. Any variations in this will create a new Content Type.
Do you know any way that i can test to see why the event does not fire when it on a content type
Rob