Introduction to Developing Custom Actions within 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 />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 />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 Utili...
Demo<br />Creating a Simple <br />Custom Action<br />View Demo: http://www.screencast.com/t/YjlhZTU0<br />Twitter: @gvaro<...
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 />&lt;CustomAction<br />ContentTypeId = &quot;Text&quot; <br />ControlAssembly = &quot;Text&...
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
Upcoming SlideShare
Loading in …5
×

SharePoint Saturday DC 12/5/09 - Introduction To Developing Custom Actions Within SharePoint

1,290 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, Sports
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,290
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide
  • stsadm -o activatefeature -name SPS.HideCustomAction -url http://spsaturday.litwareinc.com
  • SharePoint Saturday DC 12/5/09 - Introduction To Developing Custom Actions Within SharePoint

    1. 1. Introduction to Developing Custom Actions within 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 />Senior Level Staff<br />Microsoft Gold Partner<br />Specializing in SharePoint and Dynamics (CRM, SL, GP, NAV)<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 />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 />
    13. 13. 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 />
    14. 14. 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 />
    15. 15. 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. (Why? Who knows…) Never fear though – you can add one easily (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 />
    16. 16. 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 />
    17. 17. 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 />
    18. 18. Demo<br />Creating a Simple <br />Custom Action<br />View Demo: http://www.screencast.com/t/YjlhZTU0<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
    19. 19. 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 />
    20. 20. Anatomy of a Custom Action<br />Scope<br /><ul><li> Web
    21. 21. A “sub-site”
    22. 22. Only activates the feature on the specific web
    23. 23. Site
    24. 24. Site Collection
    25. 25. Applies to all webs within the site collection
    26. 26. Web Application
    27. 27. Applies to all site collections and webs within a web application
    28. 28. Farm
    29. 29. 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 />
    30. 30. 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 />
    31. 31. Anatomy of a Custom Action<br />&lt;CustomAction<br />ContentTypeId = &quot;Text&quot; <br />ControlAssembly = &quot;Text&quot; <br />ControlClass = &quot;Text&quot; <br />ControlSrc = &quot;Text&quot; <br />Description = &quot;Text&quot; <br />GroupId = &quot;Text&quot; <br />Id = &quot;Text&quot; <br />ImageUrl = &quot;Text&quot; <br />Location = &quot;Text&quot; <br />RegistrationId = &quot;Text&quot; <br />RegistrationType = &quot;Text&quot; <br />RequireSiteAdministrator = &quot;TRUE&quot; | &quot;FALSE&quot; <br />Rights = &quot;Text&quot; <br />Sequence = &quot;Integer&quot; <br />ShowInLists = &quot;TRUE&quot; | &quot;FALSE&quot; <br />ShowInReadOnlyContentTypes = &quot;TRUE&quot; | &quot;FALSE&quot; <br />ShowInSealedContentTypes = &quot;TRUE&quot; | &quot;FALSE&quot; <br />Title = &quot;Text&quot;&gt; <br />&lt;/CustomAction&gt;<br />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 />Id (optional)<br /><ul><li>Specifies a unique identifier for custom action
    33. 33. May be a GUID or a unique term
    34. 34. Example:DeleteWeb</li></ul>GroupID(optional)<br /><ul><li>Identifies the unique group that this element is contained in
    35. 35. Example:SiteAdministration</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
    36. 36. Anatomy of a Custom Action<br />Location (optional)<br /><ul><li>Specifies the location for this custom action
    37. 37. 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
    38. 38. Example: List</li></ul>Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
    39. 39. Anatomy of a Custom Action<br />RegistrationId(optional)<br /><ul><li>Specifies the registration attachment for a per-item action
    40. 40. Example (List Identifier – Task List): 107 (http://snipurl.com/ntd5g)</li></ul>Title (required)<br /><ul><li>Specifies the name of your action
    41. 41. 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 />
    42. 42. Anatomy of a Custom Action<br />Sequence (optional)<br /><ul><li>The order in which your action will appear.
    43. 43. 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 />
    44. 44. Anatomy of a Custom Action<br />Permissions<br /><ul><li>RequireSiteAdministrator (optional)
    45. 45. Boolean (True or False)
    46. 46. Cannot be used on ECB menu list items
    47. 47. Rights
    48. 48. Specify rights needed for this Custom Action to be visible
    49. 49. Example: “ApproveItems,DeleteListItems”
    50. 50. 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 />
    51. 51. Anatomy of a Custom Action<br />UrlAction Tokens<br /><ul><li>~site
    52. 52. References the current SPWeb context
    53. 53. ~sitecollection
    54. 54. References the current SPSite context
    55. 55. {ItemId}
    56. 56. GUID of the item action is called from
    57. 57. {ItemUrl}
    58. 58. 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 />
    59. 59. Anatomy of a Custom Action<br />UrlAction Tokens<br /><ul><li>{ListId}
    60. 60. GUID representation of the list
    61. 61. {SiteUrl}
    62. 62. References the URL of the SPWeb context the action is called from
    63. 63. {RecurrenceId}
    64. 64. Unsupported in context menus (http://snipurl.com/ntcjc)
    65. 65. Source URL
    66. 66. This token is not available, but there is a way to get it via JavaScript, which we will see in Demo #2
    67. 67. 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 />
    68. 68. Demo<br />Creating a Slightly More Complex Custom Action<br />View Demo: http://www.screencast.com/t/ZDRhOTFkZmIt<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
    69. 69. Demo<br />Hiding Custom Actions<br />View Demo: http://www.screencast.com/t/YmQwNWI1<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
    70. 70. Demo<br />Custom Action Groups<br />View Demo: http://www.screencast.com/t/YjM2YzAzZmI<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
    71. 71. 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 />
    72. 72. 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 />
    73. 73. Q&A<br />Twitter: @gvaro<br />Email: gvarosky@grace-hunt.com<br />Blog: www.geoffvarosky.com<br />Company: www.grace-hunt.com<br />
    74. 74. 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 />

    ×