Feature.xml and Elements.xml files that configure a
Feature that contains a list item event receiver.
Feature.xml
<Feature Scope=”Web”
Title=”List Item Event Logger”
Id=”{EF0917F4-5ED8-40b1-9A37-585BCDE9DB63}”
xmlns=”http://schemas.microsoft.com/sharepoint/”>
<ElementManifests>
<ElementManifest Location=”Elements.xml”/>
</ElementManifests>
</Feature>
Elements.xml
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
<Receivers ListTemplateId=”107”>
<Receiver>
<Name>EventLogger</Name>
<Type>ItemAdded</Type>
<SequenceNumber>10000</SequenceNumber>
<Assembly>EventLogger, Version=1.0.0.0, Culture=neutral,
➥PublicKeyToken=5d1d751131e0aacf</Assembly>
<Class>EventLogger.ListEventLogger</Class>
<Data></Data>
<Filter></Filter>
</Receiver>
<Receiver>
<Name>EventLogger</Name>
<Type>ItemUpdated</Type>
<SequenceNumber>10000</SequenceNumber>
<Assembly>EventLogger, Version=1.0.0.0, Culture=neutral,
➥PublicKeyToken=5d1d751131e0aacf</Assembly>
<Class>EventLogger.ListEventLogger</Class>
<Data></Data>
<Filter></Filter>
</Receiver>
<Receiver>
<Name>EventLogger</Name>
<Type>ItemDeleted</Type>
<SequenceNumber>10000</SequenceNumber>
<Assembly>EventLogger, Version=1.0.0.0, Culture=neutral,
➥PublicKeyToken=5d1d751131e0aacf</Assembly>
<Class>EventLogger.ListEventLogger</Class>
<Data></Data>
<Filter></Filter>
</Receiver>
</Receivers>
</Elements>
==============================================
After you have the Feature.xml and Elements.xml files, you can deploy them into your
SharePoint Template\Features directory. After they are in the directory, use the following
stsadm.exe command to install the Feature:
sure you change the relative directory paths and URLs to match your configuration):
After you install and activate the Feature, you must run iisreset for SharePoint to start
making use of the newly registered event receivers.
===================================================
stsadm -o deactivatefeature -filename HelloWorldSequential\feature.xml
stsadm -o uninstallfeature -filename HelloWorldSequential\feature.xml
stsadm -o installfeature -filename HelloWorldSequential\feature.xml -force
stsadm -o activatefeature -filename HelloWorldSequential\feature.xml
Feature that contains a list item event receiver.
Feature.xml
<Feature Scope=”Web”
Title=”List Item Event Logger”
Id=”{EF0917F4-5ED8-40b1-9A37-585BCDE9DB63}”
xmlns=”http://schemas.microsoft.com/sharepoint/”>
<ElementManifests>
<ElementManifest Location=”Elements.xml”/>
</ElementManifests>
</Feature>
Elements.xml
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
<Receivers ListTemplateId=”107”>
<Receiver>
<Name>EventLogger</Name>
<Type>ItemAdded</Type>
<SequenceNumber>10000</SequenceNumber>
<Assembly>EventLogger, Version=1.0.0.0, Culture=neutral,
➥PublicKeyToken=5d1d751131e0aacf</Assembly>
<Class>EventLogger.ListEventLogger</Class>
<Data></Data>
<Filter></Filter>
</Receiver>
<Receiver>
<Name>EventLogger</Name>
<Type>ItemUpdated</Type>
<SequenceNumber>10000</SequenceNumber>
<Assembly>EventLogger, Version=1.0.0.0, Culture=neutral,
➥PublicKeyToken=5d1d751131e0aacf</Assembly>
<Class>EventLogger.ListEventLogger</Class>
<Data></Data>
<Filter></Filter>
</Receiver>
<Receiver>
<Name>EventLogger</Name>
<Type>ItemDeleted</Type>
<SequenceNumber>10000</SequenceNumber>
<Assembly>EventLogger, Version=1.0.0.0, Culture=neutral,
➥PublicKeyToken=5d1d751131e0aacf</Assembly>
<Class>EventLogger.ListEventLogger</Class>
<Data></Data>
<Filter></Filter>
</Receiver>
</Receivers>
</Elements>
==============================================
After you have the Feature.xml and Elements.xml files, you can deploy them into your
SharePoint Template\Features directory. After they are in the directory, use the following
stsadm.exe command to install the Feature:
Stsadm –o installfeature –filename FeatureDirectory\Feature.xml
Use the following stsadm.exe command to activate the Feature on your website (makesure you change the relative directory paths and URLs to match your configuration):
Stsadm –o activatefeature –filename FeatureDirectory\Feature.xml –url
➥“http://server/web site”After you install and activate the Feature, you must run iisreset for SharePoint to start
making use of the newly registered event receivers.
===================================================
stsadm -o deactivatefeature -filename HelloWorldSequential\feature.xml
stsadm -o uninstallfeature -filename HelloWorldSequential\feature.xml
stsadm -o installfeature -filename HelloWorldSequential\feature.xml -force
stsadm -o activatefeature -filename HelloWorldSequential\feature.xml
No comments:
Post a Comment