Custom Action (Customization Policy)
Specifies an item that is added to a menu or toolbar through a Feature.
Real World Example
A portal customer wants a set of new items to appear in the shortcut (context) menu of a document in a document library. Her developer creates a Feature that adds a custom action that calls a control to add the new items to the document shortcut menu when called.
The following example, from the Applications.xml file of the AdminLinks feature, shows a custom action group and a custom action Feature that uses a static URL.
<CustomActionGroup Id="WebApplicationConfiguration" Location="Microsoft.SharePoint.Administration.ApplicationManagement" Title="$Resources:ApplicationManagement_WebApplicationConfiguration_Title;" Sequence="10" /> <CustomAction Id="Extend" GroupId="WebApplicationConfiguration" Location="Microsoft.SharePoint.Administration.ApplicationManagement" Sequence="10" Title="$Resources:ApplicationManagement_Extend_Title;"> <UrlAction Url="/_admin/extendvsoption.aspx" /> </CustomAction>
The following example, from the SiteActionsMenuCustomization.xml file of the AddDashboard feature, is an example of a custom action Feature that uses a control class to determine the links.
<CustomAction Id="ReportListActionsMenuCustomizer" Location="Microsoft.SharePoint.StandardMenu" GroupId="SiteActions" Title="Report List Site Actions Menu Customization" ControlAssembly="Microsoft.SharePoint.Portal, Version=220.127.116.11, Culture=neutral, PublicKeyToken=71e9bce111e9429c" ControlClass="Microsoft.SharePoint.Portal.WebControls.ReportLibrarySiteActionsMenuCustomizer"> </CustomAction>
The following example, from the Links.xml file of the Hold feature, shows that the URLAction element can reference some built-in variables to make the URL less static.
Custom actions have the standard support burden of Features, but rarely cause performance burden on code because of the lightweight nature of activities that are normally involved in generating items for a toolbar or menu. If a custom action uses a control class, the assembly must be installed in the global assembly cache.