SharePoint Custom Action Element Definition

Source: Internet
Author: User
Document directory
  • Locations and group IDs
  • Action Rights
SharePoint Custom Action Element Definition

Every time I need this, I have a heck of a time finding it. So I thought I wocould post it here:

The <customaction> element

The<CustomAction>Element is used to create a new custom action in the UI. In the above samples, two custom actions are created:

  • A custom action (namedMy Custom Action) In a Custom Action Group (namedMy Action Group) InSite settingsScreen.
  • A custom action (namedMy new custom action) In an existing Action Group (which isSite actionsMenu ).

The following attributes can be used with this element:

  • Id-(Optional) unique identifier to the custom action. The ID can be guid or unique term, for example,"MyCustomAction".
  • Description-(Optional) description for the custom action. It will be displayed as a tooltip or sub-description for the action, depending on its location.
  • Title-(Required) title for the custom action.
  • GroupId-(Optional) specifies an action group inside which to place the custom action. if this custom action is contained inside a Custom Action Group, the value of this attribute must match the value of the ID attribute of<CustomActionGroup> element.
  • Location-(Required) specifies the location for this custom action. If this custom action is contained inside a Custom Action Group, the value of this attribute must match the value of the location attribute of<CustomActionGroup>Element. Check the possible values below, inLocations and group IDsSection.
  • ImageUrl-(Optional) Address of the image to use as the icon for this custom action. Note that, in certain locations, the custom actions don't have an icon.
  • Rights-(Optional) specifies a set of permissions that the user must have in order for the link to be visible. if omitted, the action always appears. to specify multiple values, separate them using commas (which means the user must have all the permissions specified ). check the possible values below, inAction RightsSection.
  • RequireSiteAdministrator-(Optional)TRUETo specifiy that the user must be a site administrator to see the custom action. The default value isFALSE. This attribute is not supported if the custom action is to be placed in the context menu for a list item.
  • Sequence-(Optional) specifies the order of the custom action inside its action group.
  • ContentTypeId-(Optional) specifies the ID of the content type to associate with the custom action.
  • ShowInReadOnlyContentTypes-(Optional)TRUETo specify that the action shocould only appear in the manage content type screen, for read only content types. The default value isFALSE.
  • ShowInSealedContentTypes-(Optional)TRUETo specify that the action shoshould only appear in the manage content type screen, for sealed content types. The default value isFALSE.
  • ControlAssembly-(Optional) specifies the fully qualified name of the assembly of the control that supports the custom action. This attribute is used in conjunction with the next one.
  • ControlClass-(Optional) specifies the name of the class of the control that supports the custom action. This attribute is used in conjunction with the previous one.
  • ControlSrc-(Optional)
  • RegistrationType-(Optional) used to specify the type of attachment inPer-itemCustom actions. The possible values are:
    • ContentType
    • FileType
    • List
    • ProgId
  • RegistrationId-(Optional) depending onRegistrationTypeValue, this attribute can hold a content type ID, a file type identifier, a list ID or a program identifier.

 

 

The <urlaction> element

The<UrlAction>Element is used inside<CustomAction>Element to specify what happens when the user clicks the Link (or toolbar button, or menu item). It has a single attribute,Url, Which is the address of the page to redirect the user.

In this URL address you can use a few tokens that SharePoint will replace by the correct values when the user clicks it:

  • ~site-Relative address of the current web site.
  • ~sitecollection-Relative address of the root web site of the current site collection.
  • {ItemId}-ID (integer value) of the item being acted upon (if applicable ).
  • {ItemUrl}-URL of the item being acted upon (only works in document libraries ).
  • {ListId}-Guid of the list.
  • {SiteUrl}-Absolute URL of the current web site.
  • {RecurrenceId}-Recurrence index (not supported in the context menu of list items ).
The The <HideCustomAction>Element is used to hide an existing custom action.

The following attributes can be used with this element:

  • Id-(Optional) specifies the ID of this hide Custom Action element.
  • GroupId-(Optional) identifies an action group that contains the action.
  • Location-(Required) specifies the location of the Custom Action to hide. Check the possible values in the table below.
  • HideActionId-(Required) specifies the ID of the action to hide.
Locations and group IDs

The location and group ID values identify a specific place where the custom action must be created (or hidden). See below the possible combinations for both attributes.

Description Location Group ID
Display form Toolbar Displayformtoolbar N/
Edit form Toolbar Editformtoolbar N/
New Form Toolbar Newformtoolbar N/
List View Toolbar Viewtoolbar N/
List item context menu Editcontrolblock N/
New menu for list and document library view toolbars Microsoft. Sharepoint. standardmenu Newmenu
Actions menu for list and document library view toolbars Microsoft. Sharepoint. standardmenu Actionsmenu
Settings menu for list and document library view toolbars Microsoft. Sharepoint. standardmenu Settingsmenu
Upload Documents menu for document libraries Microsoft. Sharepoint. standardmenu Uploadmenu
Site actions menu Microsoft. Sharepoint. standardmenu Siteactions
Site settings site collection administration links Microsoft. Sharepoint. sitesettings Sitecollectionadmin
Site settings site administration links Microsoft. Sharepoint. sitesettings Siteadministration
Site settings galleries links Microsoft. Sharepoint. sitesettings Galleries
Site settings look and feel links Microsoft. Sharepoint. sitesettings Customization
Site settings users and permissions links Microsoft. Sharepoint. sitesettings Usersandpermissions
Site actions menu for surveys Microsoft. Sharepoint. standardmenu Actionsmenuforsurvey
Site settings links for surveys Microsoft. Sharepoint. sitesettings Settingsmenuforsurvey
Content type settings links Microsoft. Sharepoint. contenttypesettings N/
Central Administration Operations page Microsoft. Sharepoint. Administration. Operations N/
Central Administration Application Management page Microsoft. Sharepoint. Administration. applicationmanagement N/
Action Rights

Each custom action has its own set of permission requirements which are defined usingRightsAttribute of<CustomAction>Element. The list below summarizes the possible values for this attribute.

  • Addandcustomizepages-Add, change, or delete HTML pages or Web Part pages, and edit the web site using a Windows SharePoint Services-compatible editor.
  • Adddelprivatewebparts-Add or remove personal Web parts on a Web Part Page.
  • Addlistitems-Add items to lists, add documents to document libraries, and add Web Discussion comments.
  • Applystylesheets-Apply a style sheet (.css file) to the web site.
  • Applythemeandborder-Apply a theme or borders to the entire web site.
  • Approveitems-Approve a minor version of a list item or document.
  • Browsedirectories-Enumerate files and folders in a web site using Microsoft Office Sharepoint designer 2007 and WebDAV interfaces.
  • Browseuserinfo-View information about users of the web site.
  • Cancelcheckout-Discard or check in a document which is checked out to another user.
  • Createalerts-Create E-Mail Alerts.
  • Creategroups-Create a group of users that can be used anywhere within the site collection.
  • Createsscsite-Create a web site using self-service site creation.
  • Deletelistitems-Delete items from a list, documents from a document library, and Web Discussion comments in documents.
  • Deleteversions-Delete past versions of a list item or document.
  • Editlistitems-Edit items in lists, edit documents in document libraries, edit web discussion comments in documents, and customize Web Part pages in document libraries.
  • Editmyuserinfo-Allows a user to change his or her user information, such as adding a picture.
  • Emptymask-Has No permissions on the web site. Not available through the user interface.
  • Enumeratepermissions-Enumerate permissions on the web site, list, folder, document, or list item.
  • Fullmask-Has all permissions on the web site. Not available through the user interface.
  • Managealerts-Manage alerts for all users of the web site.
  • Managelists-Create and delete lists, add or remove columns in a list, and add or remove public views of a list.
  • Managepermissions-Create and change permission levels on the web site and assign permissions to users and groups.
  • Managepersonalviews-Create, change, and delete personal views of lists.
  • Managesubwebs-Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.
  • Manageweb-Grant the ability to perform all administration tasks for the web site as well as manage content. activate, deactivate, or edit properties of web site scoped features through the object model or through the user interface (UI ). when granted on the Root web site of a site collection, activate, deactivate, or edit properties of site collection scoped features through the object model. to browse toSite Collection featuresPage and activate or deactivate site collection scoped features through the UI, you must be a site collection administrator.
  • Open-Allow users to open a Web site, list, or folder to access items inside that container.
  • Openitems-View the source of documents with server-side file handlers.
  • Updatepersonalwebparts-Update Web parts to display personalized information.
  • Useclientintegration-Use features that launch client applications; otherwise, users must work on specified ents locally and upload changes.
  • Useremoteapis-Use soap, WebDAV, or Microsoft Office Sharepoint designer 2007 interfaces to access the web site.
  • Viewformpages-View forms, views, and application pages, and enumerate lists.
  • Viewlistitems-View items in lists, documents in document libraries, and view web discussion comments.
  • Viewpages-View pages in a web site.
  • Viewusagedata-View reports on web site usage.
  • Viewversions-View past versions of a list item or document.

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.