Compartilhar via


Custom Action Definition Schema

Applies to: SharePoint Foundation 2010

Custom actions are defined in XML documents and deployed as part of a Feature.

XML Schema Definition

An XML document that defines custom actions must validate with the schema defined in the file wss.xsd. This file is located on the following path: %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\XML.

Elements

Elements

  CustomActionGroup

  CustomAction

  HideCustomAction

Remarks

The CustomActionGroup element contains the core definition for a grouping of custom actions.

The UrlAction element must be used to specify the URL for a custom action. If no action is specified (an error condition), the link is displayed but it is not linked to anything.

Use the HideCustomAction element to hide an existing action that is implemented by default within the infrastructure of Microsoft SharePoint Foundation Features, or within another custom action. For a list of the default custom action IDs, see Default Custom Action Locations and IDs.

Example

The following example shows an XML file whose contents replace default actions in a SharePoint Foundation page with new actions. For a programming task that shows the steps for defining and registering custom actions, see How to: Modify the User Interface Using Custom Actions.

<Elements xmlns="https://schemas.microsoft.com/sharepoint/">
   <CustomActionGroup 
      Id="PortalAnalytics"
      Location="Microsoft.SharePoint.Administration.ApplicationManagement"
      Title="Usage Reporting"
      Sequence="50" />
   <CustomAction 
      Id="ManageAnalytics"
      GroupId="PortalAnalytics"
   Location="Microsoft.SharePoint.Administration.ApplicationManagement"
      Sequence="10" 
      Title="Configure usage reporting" >
      <UrlAction Url="_layouts/SpUsageConfig.aspx"/>
   </CustomAction>
   <HideCustomAction
      Id="HideWssSiteCollectionUsage"
      HideActionId="SiteCollectionUsage"
      GroupId="SiteCollectionAdmin"
      Location="Microsoft.SharePoint.SiteSettings" />
   <HideCustomAction
      Id="HideWssWebUsage"
      HideActionId="WebUsage"
      GroupId="SiteAdministration"
      Location="Microsoft.SharePoint.SiteSettings" />
   <CustomAction
      Id="PortalSiteUsage"
      GroupId="SiteCollectionAdmin"
      Location="Microsoft.SharePoint.SiteSettings"
      Rights="ViewUsageData"
      Sequence="30"
      Title="Site usage data">
      <UrlAction Url="_layouts/SpUsageSite.aspx" />
   </CustomAction>
   <CustomAction
      Id="PortalWebUsage"
      GroupId="SiteAdministration"
      Location="Microsoft.SharePoint.SiteSettings"
      Rights="ViewUsageData"
      Sequence="30"
      Title="Web usage data">
      <UrlAction Url="_layouts/SpUsageWeb.aspx" />
   </CustomAction>
</Elements>

See Also

Tasks

Walkthrough: Replacing a Button on the Server Ribbon

Concepts

Custom Action

Declarative Customization of the Server Ribbon

Default Custom Action Locations and IDs

Default Server Ribbon Customization Locations

How to: Modify the User Interface Using Custom Actions