Wss3sdk: feature event

Source: Internet
Author: User

Windows SharePoint Services 3.0 provides a class library related to featue events, allowing you to capture and install the corresponding feature on the server farm, add it to a new virtual server, or uninstall it.

Some of the events arePostEvent, that is, triggered only after the action has been submitted or the feature definition has been created in the feature set.

It is impossible to cancel an installation or uninstallation operation through the feature event.

Feature event class
    • Microsoft. Sharepoint. spfeaturereceiverThe basic abstract class can be overwritten to capture the activation, shutdown, installation, or uninstallation operations of feature. Namespace:Microsoft. SharePoint

    • Microsoft. Sharepoint. spfeaturereceiverpropertiesClass provides access to event properties, such as the created feature instance, the definition of feature, or the parent object of feature (for example,Microsoft. Sharepoint. spwebObject ). Namespace:Microsoft. SharePoint

Events provided by feature

Feature provisioning callouts allows you to write specificCodeTo respond to various feature events throughout the lifecycle.SpfeaturereceiverClass provides the following methods to handle events:

    • Featureinstalled

    • Featureuninstalling

    • Featureactivated

    • Featuredeactivating

By creating an inheritedSpfeaturereceiverAnd implement these methods to provide corresponding event processing for feature.

You always pass the pointer to the parent object (such as a parent spweb), so you can customize it as needed.

DLL components that contain feature Receivers must be placed in GAC. In the feature. xml file, you can useReceiverassemblyAndReceiverclassProperty registers the receiver at the top layer of the feature element. For example:

< Feature ID = "5e88ae4e-2ecb-4cc5-b9ec-9019250f5bc8"
Title = "Knowledge base infrastructure"
Scope = "Site"
Receiverassembly = "Ms. samples. Sharepoint. Knowledgebase, version = 1.0.0.0, culture = neutral, publickeytoken = d24e3c1752ded9ed"
Receiverclass = "Ms. samples. Sharepoint. KnowledgeBase. knowledgebaseinstaller"
Xmlns = "Http://schemas.microsoft.com/sharepoint" >

Any exception thrown during the activation process will be transmitted to the user, and the feature will not be marked as activated.

Code is often used to handle situations where a user tries to force an activated feature to be activated. For example, if your feature creates a list during the call, make sure that the activation operation will not go wrong if the list already exists.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.