SharePoint Features - elements, scope and other info
When designing features for SharePoint 2007 you always have to think about the scope where the feature should be executed: Web, Site, WebApplication or Farm. Microsoft has a nice table in its documentation that gives insight in what can be done where. Bram, thanks for pointing this out to me!! For more information on what these features do see this documentation by microsoft. Below I do some hyperlinking/annotation on this information to give you quick(er) access to the wonderful world named features...
The article is not finished yet, I would like to link to interesting blog posts etc, but don't have the time right now. It might be useful as it is right now. If you have other info to link in, let me know (as a comment) and I will update the post.
SCOPE AND ALLOWED FEATURES
Web (Web site)
- Control
- Custom Action
- Custom Action Group
- Hide Custom Action
- List Instance
- List Template
- Module (File Set)
- Receiver
Site (site collection)
- Content Type
- Content Type Binding
- Control
- Custom Action
- Custom Action Group
- Feature/Site Template Association
- Field
- Hide Custom Action
- List Template
- Module (File Set)
- Workflow
WebApplication (Web application)
- Control
- Custom Action
- Custom Action Group
- Document Converter
- Feature/Site Template Association
- Hide Custom Action
Farm (farm)
DETAILED EXPLANATION OF THE FEATURES
Content Type (Site)
Contains a schema definition you can reuse and apply to multiple list definitions.
Links:
Content Type Binding (Site)
Content type binding enables you to provision a content type on a list defined in the onet.xml schema. Lists defined in the onet.xml schema cannot be modified directly.
Links:
Control (Farm, WebApplication, Site, Web)
A delegate control contains a registration for a well-known control installed on a Web page. This lets you replace existing controls, such as the Windows SharePoint Services search control, with another control.
Links:
Custom Action (Farm, WebApplication, Site, Web)
You can define the following kinds of custom actions:
-
Content type links for the content type settings page
-
Drop-down menu actions for the drop-down menu that appears for an item
-
Form toolbar buttons for New, Edit, or Display form toolbars.
-
Site Settings link for the Site Settings page.
In a custom action it is often required to pass context arguments on the URL in the <UrlAction> tag. This in done with URL Tokens.
The following URL tokens are supported:
Windows SharePoint Services supports the following tokens with which to start a relative URL:
In addition, you can use the following tokens within a URL:
- {ItemId} - Integer ID that represents the item within a list.
- {ItemUrl} - URL of the item being acted upon. Only work for documents in libraries. [Not functional in Beta 2]
- {ListId} - GUID that represents the list.
- {SiteUrl} - URL of the Web site (SPWeb).
- {RecurrenceId} - Recurrence index. This token is not supported for use in the context menus of list items.
Procedures
Links:
- Custom Action Definitions (WSS3 SDK documentation on MSDN)
- Custom Action Element (WSS3 SDK documentation on MSDN)
- How to: Add Actions to the User Interface (WSS3 SDK documentation on MSDN)
- Creating a Feature for the Site Actions Menu in Windows SharePoint Services 3.0 (Article on MSDN, by Ted Pattison)
- Reading ListId and ItemId from an Application Page in Windows SharePoint Services 3.0 (Article on MSDN, by Ted Pattison)
- Manage quick menu item using EditControlBlock in WSS 3.0 (Technology tip on MSD2D)
Custom Action Group (Farm, WebApplication, Site, Web)
Defines a group of custom actions.
Links:
Document Converter (WebApplication)
Contains the definition of a document converter. A document converter is a custom executable file that takes a document of one file type, and generates a copy of that file in another file type.
Feature/Site Template Association (Farm, WebApplication, Site)
Binds a feature to a site definition or template so that created sites are provisioned with the feature.
Field (Site)
Contains a field definition that can be reused among multiple lists.
Hide Custom Action (Farm, WebApplication, Site, Web)
Hides a custom action that has been added through another custom action.
Links:
List Instance (Site, Web)
Provisions a SharePoint site with a specific list of data.
List Template (Site, Web)
Contains a list definition or template, which defines a list that can be provisioned in a SharePoint site.
Module (Site, Web)
Contains a set of files with which to provision sites.
Receiver (Web)
Contains an item event receiver registration.
Workflow (Site)
Contains the definition for a workflow in a list.
OTHER INTERESTING INFORMATION
Features and element files
In order to ensure that the feature can be properly upgraded all files belonging to the feature should be included in <ElementFile> tags. If files are not properly defined in <ElementFile> tags they will not always be upgraded when the feature is upgraded. [Source: Jussi Palo]
OTHER LINKS
Activation Dependencies and Scope - How dependency between features is handled in the context of scope