Creating Custom Actions in SharePoint 2010

8,849 views

Published on

Published in: Technology, Art & Photos
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
8,849
On SlideShare
0
From Embeds
0
Number of Embeds
4,022
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Creating Custom Actions in SharePoint 2010

  1. 1. Thinking SharePoint? Think Jornata.Creating Custom Actions in SharePoint 2010 Geoff VaroskyPrepared for Director, Development & EvangelismPrepared by Jornata Jornata gvarosky@jornata.com 61-63 Chatham Street Fourth Floor Follow me on Twitter @gvaro Boston, MA 02109Submitted on April 25, 2012
  2. 2. About Me• Geoff Varosky – Jornata • Director, Development & Evangelism • BASPUG Co-Founder • SPS Boston Co-Organizer – Blog : www.sharepointyankee.com – Email: gvarosky@jornata.com – Twitter: @gvaro – LinkedIn & Facebook Thinking SharePoint? Think Jornata.
  3. 3. Agenda• What are Custom Actions?• Demonstrations – Using SharePoint Designer – Importing into Visual Studio – Finding Custom Actions – Building & Deployment in Visual Studio• References• Q&A Thinking SharePoint? Think Jornata.
  4. 4. What are Custom Actions?• Bits of XML <CustomAction Id=“MyCustomAction” Location=“Microsoft.SharePoint.SiteSettings … />• Links <CustomAction …> <UrlAction Url=“http://www.foo.com” /> </CustomAction>• JavaScript (optional) <CustomAction …> <UrlAction Url=“javascript:DoSomething();” /> </CustomAction>• Code Behind (optional) <CustomAction … ControlAssembly=“MyCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=63316a326e123aec" ControlClass=“MyCode.Class“ /> Thinking SharePoint? Think Jornata.
  5. 5. What are Custom Actions? • Controls – Button – Menu – Checkbox – Menu Section – Color Picker – MRU Split Button – Combo Box • Most Recently Used – Drop Down – Spinner – Flyout Anchor – Split Button – Insert Table – Text Box – Label – Toggle Button Thinking SharePoint? Think Jornata.
  6. 6. (CustomAction) Anatomy 101 <CustomAction ContentTypeId = "Text" ControlAssembly = "Text" ControlClass = "Text" ControlSrc = "Text" Description = "Text" GroupId = "Text" Id = "Text" ImageUrl = "Text" Location = "Text" RegistrationId = "Text" RegistrationType = "Text" RequireSiteAdministrator = "TRUE" | "FALSE" Rights = "Text" Sequence = "Integer" ShowInLists = "TRUE" | "FALSE" ShowInReadOnlyContentTypes = "TRUE" | "FALSE" ShowInSealedContentTypes = "TRUE" | "FALSE" Title = "Text"> <URLAction URL=“” /> <CommandUI></CommandUI> </CustomAction> Thinking SharePoint? Think Jornata.
  7. 7. (CustomAction) Anatomy 101• Id (optional) – Specifies a unique identifier for custom action – May be a GUID or a unique term – Example: DeleteWeb• GroupID (optional) – Identifies the unique group that this element is contained in – Example: SiteTasks Thinking SharePoint? Think Jornata.
  8. 8. (CustomAction) Anatomy 101• Location (optional) – Specifies the location for this custom action – Example: Microsoft.SharePoint.SiteSettings• RegistrationType (optional) – Specifies the list, item content type, file type, or programmatic identifier that this action is associated with – Example: List Thinking SharePoint? Think Jornata.
  9. 9. (CustomAction) Anatomy 101• RegistrationId (optional) – Specifies the registration attachment for a per- item action – Example (List Identifier – Task List): 107 • {$ListId:Lists/Tasks;} • (http://snipurl.com/ntd5g)• Title (required) – Specifies the name of your action – Example: DeleteWeb Thinking SharePoint? Think Jornata.
  10. 10. (CustomAction) Anatomy 101• Description (optional) – Longer description for action which is shown as a tooltip or sub-description (where applicable) for the action– Sequence (optional) – The order in which your action will appear. – If not specified, displayed in the order it is read by SharePoint by Feature and by order in element listing (XML). Thinking SharePoint? Think Jornata.
  11. 11. (CustomAction) Anatomy 101• UrlAction Tokens – ~site – References the current SPWeb context – ~sitecollection – References the current SPSite context – {ItemId} – GUID of the item action is called from – {ItemUrl} – URL of the item the action is called from Thinking SharePoint? Think Jornata.
  12. 12. (CustomAction) Anatomy 101• UrlAction Tokens – {ListId} • GUID representation of the list – {SiteUrl} • References the URL of the SPWeb context the action is called from – {RecurrenceId} • Unsupported in context menus – http://go.gvaro.net/bHaqaQ Thinking SharePoint? Think Jornata.
  13. 13. What are Custom Actions?• Can be bound to… – Lists • Tasks, Document Libraries, Custom, etc. Thinking SharePoint? Think Jornata.
  14. 14. What are Custom Actions?• Can be bound to… – File Types • By Extension - .docx, .pl, .foo, .bar Thinking SharePoint? Think Jornata.
  15. 15. What are Custom Actions?• Can be bound to… – Content Types • Tasks, Documents, Custom • All (0x) – http://go.gvaro.net/bbYxRy – Programmatic Identifiers • Tasks List (107) • Content Types (0x) Thinking SharePoint? Think Jornata.
  16. 16. Building Custom Actions• SharePoint Designer 2010• Visual Studio 2010• CKS:DEV – Adds Custom Action Item Templates – http://cksdev.codeplex.com• NotePad? Thinking SharePoint? Think Jornata.
  17. 17. Building Custom Actions• SharePoint Designer 2010 – Build Custom Actions • List Item Menu • List View, Edit, Display Forms• Visual Studio 2010 – Import from WSP file – Package – Add Functionality – Deploy Thinking SharePoint? Think Jornata.
  18. 18. DEMOS!Building Custom Actions in SharePoint Designer 2010 Importing Custom Actions into Visual Studio 2010 Listing All Custom Actions Using CKS:DEV Custom Action Groups Hiding Custom Actions Maybe more? Thinking SharePoint? Think Jornata.
  19. 19. Bonus Round!• Referencing JavaScript Files – Jan Tielens on EUSP – http://go.gvaro.net/dvCSS6 – Can Add JavaScript into the HEAD of a page using a Custom Action – Location references “/_layouts/” always Thinking SharePoint? Think Jornata.
  20. 20. References• Eric Kraus – Listing all Custom Actions in the Farm with PowerShell – http://go.gvaro.net/bD7OHm• MSDN – Custom Action Definition Schema • CommandUI Defintions, Extensions, Handlers • CustomAction, CustomActionGroup, HideCustomAction • Default Locations and IDs – http://go.gvaro.net/9q0QV2 Thinking SharePoint? Think Jornata.
  21. 21. References• Wictor Wilén – Creating Custom Ribbon Extensions – Part 1 - http://go.gvaro.net/aFUwBW – Part 2 - http://go.gvaro.net/aGlydC• Using JavaScript + Custom Actions to navigate Document Libraries – http://go.gvaro.net/h2w8mN Thinking SharePoint? Think Jornata.
  22. 22. References• My Blog – www.sharepointyankee.com • Search for “Custom Action” • Creating Custom Actions with SharePoint Designer • Default List Type IDs • Deploying Custom Actions Across All List Types • Custom Actions in SharePoint 2007 • SPBasePermissions Enumeration (Rights) • Creating Custom Actions using SPD • “Delete This Site” • More… Thinking SharePoint? Think Jornata.
  23. 23. • Meets 2nd Wednesday/Month• 6P – 8PM• Microsoft N.E.R.D. Center• http://www.bostonsharepointug.org• Twitter: @BASPUG / #BASPUG Thinking SharePoint? Think Jornata.
  24. 24. • April 28th• Waltham, MA• http://biy.ly/SPSBos• Twitter: @SPSBoston / #SPSBos Thinking SharePoint? Think Jornata.
  25. 25. Q&A
  26. 26. About Me• Geoff Varosky – Jornata • Director, Development & Evangelism • BASPUG Co-Founder • SPS Boston Co-Organizer – Blog : www.sharepointyankee.com – Email: gvarosky@jornata.com – Twitter: @gvaro – LinkedIn & Facebook Thinking SharePoint? Think Jornata.

×