Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Creating Custom Actionswithin SharePointGeoff Varosky<br />
About Me<br />Geoff Varosky MCP, MCTS<br />Senior Solutions Developer for Grace-Hunt, LLC.<br />Blog: http://www.geoffvaro...
About Grace-Hunt<br />Founded in 2004<br />Based in Hudson, MA<br />Presence in North East, Mid Atlantic, and South East R...
Agenda<br />What are Custom Actions?<br />Demonstrations<br />Creating a Simple Custom Action<br />Anatomy of a Custom Act...
Examples<br />Toolbars<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Compa...
Examples<br />Site Actions Menu<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<b...
Examples<br />Site Settings<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />...
Examples<br />Site Settings (Custom Action Group)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www....
Examples<br />Edit Control Block (ECB)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosk...
Examples<br />Central Administration Pages<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffva...
Just What Are Custom Actions?<br />Per Microsoft –<br />“A custom action represents a link, toolbar button, menu item, or ...
Just What Are Custom Actions?<br />What does that mean?<br />Bits of XML<br />Deployed via Features<br />Create a Link wit...
Just What Are Custom Actions?<br />What does that mean?<br />Custom Actions can be bound to List Types<br />A Custom Actio...
Just What Are Custom Actions?<br />What does that mean?<br />Custom Actions can be bound to File Types<br />Example: ‘Edit...
Just What Are Custom Actions?<br />What does that mean?<br />Custom Actions can be bound to Content Types<br />Example: Fo...
What Can Custom Actions Do?<br />But wait, there’s more!<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blo...
What Can Custom Actions Do?<br />But wait, there’s more!<br />Create links to pages that really should be there…<br />Exam...
What Can Custom Actions Do?<br />…and more<br />Custom Actions can also be hidden<br />Example: You do not want site admin...
What Tools Are Needed?<br />Notepad<br />What do I use?<br />Visual Studio<br />Andrew Connell’s SharePoint Project Utilit...
Demo<br />Creating a Simple <br />Custom Action<br />View Demo: http://www.vimeo.com/9728285<br />Twitter: @gvaro<br />Ema...
Anatomy of a Custom Action<br />Feature Definition (feature.xml)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<...
Anatomy of a Custom Action<br />Scope<br /><ul><li> Web
 A “sub-site”
 Only activates the feature on the specific web
 Site
 Site Collection
 Applies to all webs within the site collection
 Web Application
 Applies to all site collections and webs within a web application
 Farm
 Applies to all web applications, site collections, etc.....</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<...
Anatomy of a Custom Action<br />Element Manifest (manifest.xml)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<b...
Anatomy of a Custom Action<br /><CustomAction<br />ContentTypeId = "Text" <br />ControlAssembly = "Text" <br />ControlClas...
Anatomy of a Custom Action<br />Id (optional)<br /><ul><li>Specifies a unique identifier for custom action
May be a GUID or a unique term
Example:DeleteWeb</li></ul>GroupID(optional)<br /><ul><li>Identifies the unique group that this element is contained in
Example:SiteAdministration</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br...
Anatomy of a Custom Action<br />Location (optional)<br /><ul><li>Specifies the location for this custom action
Example:Microsoft.SharePoint.SiteSettings</li></ul>RegistrationType(optional)<br /><ul><li>Specifies the list, item conten...
Upcoming SlideShare
Loading in …5
×

Creating Custom Actions within SharePoint

2,748 views

Published on

Custom Actions control features in SharePoint such as the Edit Control Block, the Site Actions menu, toolbars, and the links within the Site Settings page. Learn how to leverage Custom Actions to extend the SharePoint User Interface. This session will describe the basics of Custom Actions, a demonstration to build one or more and apply them to a site in SharePoint, as well as provide resources for additional information.

Published in: Technology
  • Be the first to comment

Creating Custom Actions within SharePoint

  1. 1. Creating Custom Actionswithin SharePointGeoff Varosky<br />
  2. 2. About Me<br />Geoff Varosky MCP, MCTS<br />Senior Solutions Developer for Grace-Hunt, LLC.<br />Blog: http://www.geoffvarosky.com<br />Email: gvarosky@grace-hunt.com<br />Twitter: @gvaro<br />
  3. 3. About Grace-Hunt<br />Founded in 2004<br />Based in Hudson, MA<br />Presence in North East, Mid Atlantic, and South East Regions<br />Microsoft Gold Partner<br />Specializing in SharePoint and Dynamics (CRM, SL, GP, NAV) Consulting, Implementation, and Integration<br />Web: http://www.grace-hunt.com<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  4. 4. Agenda<br />What are Custom Actions?<br />Demonstrations<br />Creating a Simple Custom Action<br />Anatomy of a Custom Action<br />Creating a Slightly More Complex Custom Action<br />Hiding Custom Actions<br />Custom Action Groups<br />References<br />Q&A<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  5. 5. Examples<br />Toolbars<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  6. 6. Examples<br />Site Actions Menu<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  7. 7. Examples<br />Site Settings<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  8. 8. Examples<br />Site Settings (Custom Action Group)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  9. 9. Examples<br />Edit Control Block (ECB)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  10. 10. Examples<br />Central Administration Pages<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  11. 11. Just What Are Custom Actions?<br />Per Microsoft –<br />“A custom action represents a link, toolbar button, menu item, or any control that can be added to a toolbar or menu that a user sees. Custom actions can be bound to list type, content type, file type, or programmatic identifier (ProgID).”<br />Source: http://snipurl.com/d8y70<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  12. 12. Just What Are Custom Actions?<br />What does that mean?<br />Bits of XML<br />Deployed via Features<br />Create a Link within SharePoint<br />Specific Location<br />JavaScript, AJAX, URLs, etc.<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  13. 13. Just What Are Custom Actions?<br />What does that mean?<br />Custom Actions can be bound to List Types<br />A Custom Action can be bound to a Document Library, but, may not be bound to a Task List<br />Example: Check In/Check Out<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  14. 14. Just What Are Custom Actions?<br />What does that mean?<br />Custom Actions can be bound to File Types<br />Example: ‘Edit in Microsoft Word’ bound to Word (.doc, .docx) document types<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  15. 15. Just What Are Custom Actions?<br />What does that mean?<br />Custom Actions can be bound to Content Types<br />Example: Folders, Document Content Types, List Content Types, etc.<br />Programmatic Identifiers<br />Example: Task List Identifier (107)<br />http://snipurl.com/ntd5g<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  16. 16. What Can Custom Actions Do?<br />But wait, there’s more!<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  17. 17. What Can Custom Actions Do?<br />But wait, there’s more!<br />Create links to pages that really should be there…<br />Example: There is a link to the Site Collection Recycle Bin on the Site Settings page, however, there is no link to the current site Recycle Bin. (Demo #1)<br />Custom Actions can pass along information to act upon<br />Example: Add a “Complete Task” action to an Edit Control Block, which calls an ASPX page, taking the parameters of the List ID and Item ID, and updating the task item within a list. (Demo #2)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  18. 18. What Can Custom Actions Do?<br />…and more<br />Custom Actions can also be hidden<br />Example: You do not want site administrators to be able to delete their sites by using the Delete This Site link on the Site Settings page so, we can remove it by using HideCustomAction (Demo #3)<br />Create Groupings of Custom Actions by using CustomActionGroup<br />Example: Create a grouping of your Custom Actions on the Site Settings page for all of your Custom Actions… (Demo #4)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  19. 19. What Tools Are Needed?<br />Notepad<br />What do I use?<br />Visual Studio<br />Andrew Connell’s SharePoint Project Utility for Visual Studio<br />http://snipurl.com/d8yv9<br />Requires DevExpress DX Core to be installed (free)<br />WSPBuilder (CodePlex)<br />http://snipurl.com/d8yxv<br />SharePoint Solution Installer (CodePlex)<br />http://snipurl.com/nt6ux<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  20. 20. Demo<br />Creating a Simple <br />Custom Action<br />View Demo: http://www.vimeo.com/9728285<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  21. 21. Anatomy of a Custom Action<br />Feature Definition (feature.xml)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  22. 22. Anatomy of a Custom Action<br />Scope<br /><ul><li> Web
  23. 23. A “sub-site”
  24. 24. Only activates the feature on the specific web
  25. 25. Site
  26. 26. Site Collection
  27. 27. Applies to all webs within the site collection
  28. 28. Web Application
  29. 29. Applies to all site collections and webs within a web application
  30. 30. Farm
  31. 31. Applies to all web applications, site collections, etc.....</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  32. 32. Anatomy of a Custom Action<br />Element Manifest (manifest.xml)<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  33. 33. Anatomy of a Custom Action<br /><CustomAction<br />ContentTypeId = "Text" <br />ControlAssembly = "Text" <br />ControlClass = "Text" <br />ControlSrc = "Text" <br />Description = "Text" <br />GroupId = "Text" <br />Id = "Text" <br />ImageUrl = "Text" <br />Location = "Text" <br />RegistrationId = "Text" <br />RegistrationType = "Text" <br />RequireSiteAdministrator = "TRUE" | "FALSE" <br />Rights = "Text" <br />Sequence = "Integer" <br />ShowInLists = "TRUE" | "FALSE" <br />ShowInReadOnlyContentTypes = "TRUE" | "FALSE" <br />ShowInSealedContentTypes = "TRUE" | "FALSE" <br />Title = "Text"> <br /></CustomAction><br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  34. 34. Anatomy of a Custom Action<br />Id (optional)<br /><ul><li>Specifies a unique identifier for custom action
  35. 35. May be a GUID or a unique term
  36. 36. Example:DeleteWeb</li></ul>GroupID(optional)<br /><ul><li>Identifies the unique group that this element is contained in
  37. 37. Example:SiteAdministration</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  38. 38. Anatomy of a Custom Action<br />Location (optional)<br /><ul><li>Specifies the location for this custom action
  39. 39. Example:Microsoft.SharePoint.SiteSettings</li></ul>RegistrationType(optional)<br /><ul><li>Specifies the list, item content type, file type, or programmatic identifier that this action is associated with
  40. 40. Example: List</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  41. 41. Anatomy of a Custom Action<br />RegistrationId(optional)<br /><ul><li>Specifies the registration attachment for a per-item action
  42. 42. Example (List Identifier – Task List): 107 (http://snipurl.com/ntd5g)</li></ul>Title (required)<br /><ul><li>Specifies the name of your action
  43. 43. Example: DeleteWeb</li></ul>Description (optional)<br /><ul><li>Longer description for action which is shown as a tooltip or sub-description (where applicable) for the action</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  44. 44. Anatomy of a Custom Action<br />Sequence (optional)<br /><ul><li>The order in which your action will appear.
  45. 45. If not specified, displayed in the order it is read by SharePoint by Feature and by order in element listing (XML).</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  46. 46. Anatomy of a Custom Action<br />Permissions<br /><ul><li>RequireSiteAdministrator (optional)
  47. 47. Boolean (True or False)
  48. 48. Cannot be used on ECB menu list items
  49. 49. Rights
  50. 50. Specify rights needed for this Custom Action to be visible
  51. 51. Example: “ApproveItems,DeleteListItems”
  52. 52. Possible Values http://snipurl.com/ntcz5</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  53. 53. Anatomy of a Custom Action<br />UrlAction Tokens<br /><ul><li>~site
  54. 54. References the current SPWeb context
  55. 55. ~sitecollection
  56. 56. References the current SPSite context
  57. 57. {ItemId}
  58. 58. GUID of the item action is called from
  59. 59. {ItemUrl}
  60. 60. URL of the item the action is called from</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  61. 61. Anatomy of a Custom Action<br />UrlAction Tokens<br /><ul><li>{ListId}
  62. 62. GUID representation of the list
  63. 63. {SiteUrl}
  64. 64. References the URL of the SPWeb context the action is called from
  65. 65. {RecurrenceId}
  66. 66. Unsupported in context menus (http://snipurl.com/ntcjc)
  67. 67. Source URL
  68. 68. This token is not available, but there is a way to get it via JavaScript, which we will see in Demo #2
  69. 69. http://snipurl.com/d8zb6</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  70. 70. Demo<br />Creating a Slightly More Complex Custom Action<br />View Demo: http://www.vimeo.com/9728320<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  71. 71. Demo<br />Hiding Custom Actions<br />View Demo: http://www.vimeo.com/9728353<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  72. 72. Demo<br />Custom Action Groups<br />View Demo: http://www.vimeo.com/9759410<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  73. 73. Resources<br />My Blog<br />http://www.geoffvarosky.com<br />Click on SharePoint Saturday category on left side of page<br />GraceHunt.SharePointCodePlex Projects<br />http://codeplex.com/GraceHunt<br />John Holliday’s Custom Action Resources<br />Hiding Custom Actions, and a Utility to get all custom action identifiers http://snipurl.com/d8zea<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  74. 74. Resources<br />MSDN<br />Custom Action Definitions <br />http://snipurl.com/d8zi7<br />Default Custom Action Locations and IDs <br />http://snipurl.com/d8zka<br />How to: Add Custom Actions to the User Interface<br />http://snipurl.com/d8zq2<br />CustomAction Element <br />http://snipurl.com/d9jd4<br />CustomActionGroup Element <br />http://snipurl.com/d9jfx<br />HideCustomAction Element<br />http://snipurl.com/d9jhs<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  75. 75. Resources<br />Custom Actions in SharePoint 2010<br />Adding Custom Button to the SharePoint 2010 Ribbon<br />http://snipurl.com/tz3vq by Jonathon Frost @ MSDN<br />Adding Custom Actions to the List Item Menu in SharePoint 2010 Using SharePoint Designer 2010 http://snipurl.com/tr0t3 by Geoff Varosky<br />How to Add a Tab to the Ribbon in SharePoint Foundation http://snipurl.com/tz3wi by Andrew May @ SP Dev Doc Team<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  76. 76. Q&A<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
  77. 77. About Me<br />Geoff Varosky MCP, MCTS<br />Senior Solutions Developer for Grace-Hunt, LLC.<br />Company: http://www.grace-hunt.com<br />Blog: http://www.geoffvarosky.com<br />Email: gvarosky@grace-hunt.com<br />Twitter: @gvaro<br />

×