SlideShare uma empresa Scribd logo
1 de 42
Leveraging the Ribbon API and Dialog Framework Cory Peters Chief SharePoint Architect Eastridge Technology, Inc.
About Me Chief SharePoint Architect at Eastridge Technology, Inc. Microsoft Gold Partner focused on the south east and based out of North Carolina Working with SharePoint since Portal Server 2003 Worked with all aspects of SharePoint including Branding Development Administration Implementation Architecture
Leveraging the dialog framework Creating, deploying and interacting with dialogs
Dialog goals Understand how dialogs work How to create a dialog How to pass data to/from a dialog What’s involved in deploying a custom dialog
how it works Use returnVal for further processing or display result Perform any OM or Client OM functionality Page / Web Part Dialog showModalDialog url, callback callbackFunction dialogResult, returnVal OK Cancel dialogResult (int)  ,[object Object]
0 = CancelreturnVal (string) Application Page
SP.UI.ModalDialog SP.UI.ModalDialog.showModalDialog(options) Options parameter url title allowMaximize showClose width height dialogReturnValueCallback
creating a dialog varoptions = SP.UI.$create_DialogOptions(); options.url = "/_layouts/Ex/CustomPage.aspx"; options.width= 400; options.height= 400; options.dialogReturnValueCallback= Function.createDelegate(null, customCallback); SP.UI.ModalDialog.showModalDialog(options);
Getting data into a dialog Creating the Dialog varoptions = SP.UI.$create_DialogOptions(); options.url = "/_layouts/Ex/CustomPage.aspx?p1=value&p2=v1;v2;v3"; … Within the ApplicationPage string param1 = Request.QueryString[“p1”]; string[] param2 = Request.QueryString[“p2”].Split(‘;’);
Getting data from a dialog var form = document.forms.<%SPHttpUtility.NoEncode(Form.ClientID,Response.Output);%>; varitemTitle = 	form.<%SPHttpUtility.NoEncode(itemTitleTextbox	.ClientID,Response.Output);%>.value;
closing a dialog OK Button Clicked SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, ‘Return Data’); Cancel Button Clicked SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Canceled');
Processing the result Callback receives two parameters: dialogResult and dialogData if (dialogResult === SP.UI.DialogResult.OK) { 	// use client OM for further processing } if (dialogResult=== SP.UI.DialogResult.cancel) { SP.UI.Notify.addNotification(“Dialog was 	canceled. ", false); }
dialog demo
Customizing the ribbon XML, XML and some JavaScript!
Ribbon goals Learn common terminology Have a better understanding of the Ribbon XML Know what’s involved in a ribbon customization See how all the pieces play together
RIBBON OVERVIEW Defined via XML within <CustomAction> and feature deployed Tabs can be visible/hidden Controls can be enabled/disabled * No custom controls (.ascx) Heavy JavaScript required / Client OM Complex, nested, relational XML
RIBBON XML TERMINOLOGY Ribbon Tab Contextual Tab Group Section Row Control
Targeting ribbons CustomAction Location
AVAILABLE CONTROLS CONTAINERS Tab Group CONTROLS Button CheckBox Color Picker Combo Box Drop Down Flyout Anchor Insert Table Label Menu Menu Section MRU Split Menu Spinner Split Button Textbox Toggle Button
control displays DisplayMode Display modes listed are not available for all controls.
What makes up a ribbon? Ribbon XML Defines the tabs, groups, controls, rendering templates JavaScript CommandUIHandler or a custom Page Component Handles populating Dropdowns, on click events, etc Delegate Control One approach to getting your custom JavaScript loaded into the page Note: Any method of getting your JavaScript into the page is fine
RIBBON XML CommandUIExtension CommandUIDefinition CommandUIHandlers
RIBBON XML CommandUIExtension CommandUIDefinition
RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate Tab
RIBBON XML CommandUIExtension CommandUIDefinition Tab
RIBBON XML CommandUIExtension GroupId CommandUIDefinition Tab Scaling Groups MaxSize Group Controls Scale Etc Button DropDown MaxSize Scale Group Controls Etc Button DropDown GroupId
RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate Tab
RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate
RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate Layout Section Row ControlRef ControlRef Row ControlRef ControlRef Section
RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate Tab
RIBBON XML CommandUIExtension Template Id CommandUIDefinition GroupTemplate Tab Layout Groups Section Group Row Controls ControlRef ControlRef Button DropDown TemplateAlias Scaling MaxSize Scale Size
RIBBON XML CommandUIExtension CommandUIDefinition CommandUIHandlers
RIBBON XML CommandUIExtension CommandUIHandlers
RIBBON XML CommandUIExtension CommandUIHandlers Two attributes: Command, CommandAction Command is a unique identifier CommandAction is JavaScript, URL or anything that was previously used in an UrlAction CommandUIHandler CommandUIHandler CommandUIHandler CommandUIHandler CommandUIHandler
RIBBON XML CommandUIExtension CommandUIHandlers CommandUIDefinition
RIBBON XML CommandUIExtension CommandUIHandlers CommandUIDefinition CommandUIHandler Tab Groups CommandUIHandler Group CommandUIHandler Controls Button DropDown Group Command Id Controls Button DropDown
Command UI Handler Maps a control to set of JavaScript Very powerful when coupled with the Client OM Example <Button  Id=“ButtonId" Command=“ButtonCommand“ … /> <CommandUIHandler Command=“ButtonCommand“ CommandAction="javascript: SP.UI.Notify.addNotification(‘Button was clicked');"/>
Page Component JavaScript class that serves as the middle man between the Ribbon and your customization Uses a structured contract that the Ribbon understands
Page Component (cont) Create your custom page component class Register your namespace Register your class to inherit from CUI.Page.PageComponent Initialize the page component CP.SharePoint.RibbonExample.PageComponent.initializePageComponent = function () { varribbonPageManager= 				  SP.Ribbon.PageManager.get_instance(); if (null !== ribbonPageManager) { ribbonPageManager.addPageComponent(CP.SharePoint.RibbonExample.PageComponent.instance);     } }
Delegate Control Load SharePoint Prerequisites <SharePoint:ScriptLinkName="SP.js" runat="server" LoadAfterUI="true” … /> <SharePoint:ScriptLink Name="CUI.js" runat="server" LoadAfterUI="true" … /> Load Custom JavaScript <SharePoint:ScriptLink Name="/_layouts/RibbonExample/sp.ui.RibbonExample.js" runat="server" LoadAfterUI="true“ … /> Initialize  Our Page Component <script type="text/javascript"> //<![CDATA[     function initializeRibbonExample() { CP.SharePoint.RibbonExample.PageComponent.initialize();     } ExecuteOrDelayUntilScriptLoaded(initializeRibbonExample, 'sp.ui.RibbonExample.js');    //]]> </script>
Getting current Context Get List of Selected Items // Returns a collection of item ids varctx = SP.ClientContext.get_current(); varitems = SP.ListOperation.Selection.getSelectedItems(ctx); Get Selected List // Returns a guid SP.ListOperation.Selection.getSelectedList()
ribbon demos

Mais conteúdo relacionado

Mais procurados

Zoho Creator Presentation
Zoho Creator PresentationZoho Creator Presentation
Zoho Creator PresentationSuzie Vesper
 
Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPFDoncho Minkov
 
Pub101 slideshare oct2010
Pub101 slideshare oct2010Pub101 slideshare oct2010
Pub101 slideshare oct2010Tanya Troska
 
Windows presentation foundation
Windows presentation foundationWindows presentation foundation
Windows presentation foundationNaga Harish M
 
[Workshop] Single Sourcing with the Technical Communication Suite: Using Fram...
[Workshop] Single Sourcing with the Technical Communication Suite: Using Fram...[Workshop] Single Sourcing with the Technical Communication Suite: Using Fram...
[Workshop] Single Sourcing with the Technical Communication Suite: Using Fram...Scott Abel
 
Creating Acessible floating labels
Creating Acessible floating labelsCreating Acessible floating labels
Creating Acessible floating labelsRuss Weakley
 
Creating a quiz using visual basic 6
Creating a quiz using visual basic 6Creating a quiz using visual basic 6
Creating a quiz using visual basic 6Ella Marie Wico
 
Building Data Centric Apps in WPF
Building Data Centric Apps in WPFBuilding Data Centric Apps in WPF
Building Data Centric Apps in WPFFrank La Vigne
 
Gl13 m5-c2-presentation
Gl13 m5-c2-presentationGl13 m5-c2-presentation
Gl13 m5-c2-presentationTracie King
 
Power Point 2010
Power Point 2010 Power Point 2010
Power Point 2010 Vasu Jain
 
User guide
User guideUser guide
User guidenhockiki
 
FlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
FlexNet Delivery and FlexNet Operations On-Demand Tips & TricksFlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
FlexNet Delivery and FlexNet Operations On-Demand Tips & TricksFlexera
 

Mais procurados (19)

Zoho Creator Presentation
Zoho Creator PresentationZoho Creator Presentation
Zoho Creator Presentation
 
Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPF
 
Pub101 slideshare oct2010
Pub101 slideshare oct2010Pub101 slideshare oct2010
Pub101 slideshare oct2010
 
WPF
WPFWPF
WPF
 
Windows presentation foundation
Windows presentation foundationWindows presentation foundation
Windows presentation foundation
 
[Workshop] Single Sourcing with the Technical Communication Suite: Using Fram...
[Workshop] Single Sourcing with the Technical Communication Suite: Using Fram...[Workshop] Single Sourcing with the Technical Communication Suite: Using Fram...
[Workshop] Single Sourcing with the Technical Communication Suite: Using Fram...
 
An Overview Of Wpf
An Overview Of WpfAn Overview Of Wpf
An Overview Of Wpf
 
Creating Acessible floating labels
Creating Acessible floating labelsCreating Acessible floating labels
Creating Acessible floating labels
 
Creating a quiz using visual basic 6
Creating a quiz using visual basic 6Creating a quiz using visual basic 6
Creating a quiz using visual basic 6
 
Power Point Unit B
Power Point Unit BPower Point Unit B
Power Point Unit B
 
Building Data Centric Apps in WPF
Building Data Centric Apps in WPFBuilding Data Centric Apps in WPF
Building Data Centric Apps in WPF
 
Power point unit a
Power point unit aPower point unit a
Power point unit a
 
Html tag ref
Html tag refHtml tag ref
Html tag ref
 
Gl13 m5-c2-presentation
Gl13 m5-c2-presentationGl13 m5-c2-presentation
Gl13 m5-c2-presentation
 
Fewd week7 slides
Fewd week7 slidesFewd week7 slides
Fewd week7 slides
 
Power Point 2010
Power Point 2010 Power Point 2010
Power Point 2010
 
User guide
User guideUser guide
User guide
 
Salesforce Winter Release
Salesforce Winter ReleaseSalesforce Winter Release
Salesforce Winter Release
 
FlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
FlexNet Delivery and FlexNet Operations On-Demand Tips & TricksFlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
FlexNet Delivery and FlexNet Operations On-Demand Tips & Tricks
 

Semelhante a Leveraging the Ribbon API and Dialog Framework

Share point 2010-uiimprovements
Share point 2010-uiimprovementsShare point 2010-uiimprovements
Share point 2010-uiimprovementsLiquidHub
 
Grasping The LightSwitch Paradigm
Grasping The LightSwitch ParadigmGrasping The LightSwitch Paradigm
Grasping The LightSwitch ParadigmAndrew Brust
 
JavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern ImplementationJavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern Implementationdavejohnson
 
IBM Rational HATS Customized Amazing Features by Royal Cyber
IBM Rational HATS Customized Amazing Features by Royal CyberIBM Rational HATS Customized Amazing Features by Royal Cyber
IBM Rational HATS Customized Amazing Features by Royal CyberRoyal Cyber Inc.
 
IBM Lotus iNotes 8.5 Customization
IBM Lotus iNotes 8.5 CustomizationIBM Lotus iNotes 8.5 Customization
IBM Lotus iNotes 8.5 Customizationrledwich
 
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And DxlBp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxldominion
 
A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010Abram John Limpin
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NETPeter Gfader
 
Windows Forms 2.0 Enhancements
Windows Forms 2.0 EnhancementsWindows Forms 2.0 Enhancements
Windows Forms 2.0 Enhancementsguestd115f
 
User guide
User guideUser guide
User guidefoxyhat
 
What is WebElement in Selenium | Web Elements & Element Locators | Edureka
What is WebElement in Selenium | Web Elements & Element Locators | EdurekaWhat is WebElement in Selenium | Web Elements & Element Locators | Edureka
What is WebElement in Selenium | Web Elements & Element Locators | EdurekaEdureka!
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...Joel Oleson
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBADCPS
 
Getting the Most out of Data Page and Rich Data Definition in Portlet Factory
Getting the Most out of Data Page and Rich Data Definition in Portlet FactoryGetting the Most out of Data Page and Rich Data Definition in Portlet Factory
Getting the Most out of Data Page and Rich Data Definition in Portlet FactoryDavalen LLC
 
Branding share point 2013
Branding share point 2013Branding share point 2013
Branding share point 2013Khoa Quach
 
Griffon In Front Grails In Back
Griffon In Front Grails In BackGriffon In Front Grails In Back
Griffon In Front Grails In BackJim Shingler
 
Hnd201 Building Ibm Lotus Domino Applications With Ajax Plugins
Hnd201 Building Ibm Lotus Domino Applications With Ajax PluginsHnd201 Building Ibm Lotus Domino Applications With Ajax Plugins
Hnd201 Building Ibm Lotus Domino Applications With Ajax Pluginsdominion
 
Software Architecture New Features of Visual Studio 2010 / .Net 4.0 - Part 1...
Software Architecture New Features of Visual Studio 2010 / .Net 4.0  - Part 1...Software Architecture New Features of Visual Studio 2010 / .Net 4.0  - Part 1...
Software Architecture New Features of Visual Studio 2010 / .Net 4.0 - Part 1...Shahzad
 
"Developing with the New User Interface Features in Microsoft SharePoint Serv...
"Developing with the New User Interface Features in Microsoft SharePoint Serv..."Developing with the New User Interface Features in Microsoft SharePoint Serv...
"Developing with the New User Interface Features in Microsoft SharePoint Serv...Tihomir Ignatov
 

Semelhante a Leveraging the Ribbon API and Dialog Framework (20)

Share point 2010-uiimprovements
Share point 2010-uiimprovementsShare point 2010-uiimprovements
Share point 2010-uiimprovements
 
Grasping The LightSwitch Paradigm
Grasping The LightSwitch ParadigmGrasping The LightSwitch Paradigm
Grasping The LightSwitch Paradigm
 
JavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern ImplementationJavaScript and DOM Pattern Implementation
JavaScript and DOM Pattern Implementation
 
IBM Rational HATS Customized Amazing Features by Royal Cyber
IBM Rational HATS Customized Amazing Features by Royal CyberIBM Rational HATS Customized Amazing Features by Royal Cyber
IBM Rational HATS Customized Amazing Features by Royal Cyber
 
IBM Lotus iNotes 8.5 Customization
IBM Lotus iNotes 8.5 CustomizationIBM Lotus iNotes 8.5 Customization
IBM Lotus iNotes 8.5 Customization
 
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And DxlBp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
Bp308 Ibm Lotus Domino Web Facelift Using Ajax And Dxl
 
A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010
 
Better User Experience with .NET
Better User Experience with .NETBetter User Experience with .NET
Better User Experience with .NET
 
Windows Forms 2.0 Enhancements
Windows Forms 2.0 EnhancementsWindows Forms 2.0 Enhancements
Windows Forms 2.0 Enhancements
 
User guide
User guideUser guide
User guide
 
What is WebElement in Selenium | Web Elements & Element Locators | Edureka
What is WebElement in Selenium | Web Elements & Element Locators | EdurekaWhat is WebElement in Selenium | Web Elements & Element Locators | Edureka
What is WebElement in Selenium | Web Elements & Element Locators | Edureka
 
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
STSADM Automating SharePoint Administration - Tech Ed South East Asia 2008 wi...
 
Transforming Power Point Show with VBA
Transforming Power Point Show with VBATransforming Power Point Show with VBA
Transforming Power Point Show with VBA
 
Getting the Most out of Data Page and Rich Data Definition in Portlet Factory
Getting the Most out of Data Page and Rich Data Definition in Portlet FactoryGetting the Most out of Data Page and Rich Data Definition in Portlet Factory
Getting the Most out of Data Page and Rich Data Definition in Portlet Factory
 
Branding share point 2013
Branding share point 2013Branding share point 2013
Branding share point 2013
 
Griffon In Front Grails In Back
Griffon In Front Grails In BackGriffon In Front Grails In Back
Griffon In Front Grails In Back
 
Real Estate in Hyderabad
Real Estate in HyderabadReal Estate in Hyderabad
Real Estate in Hyderabad
 
Hnd201 Building Ibm Lotus Domino Applications With Ajax Plugins
Hnd201 Building Ibm Lotus Domino Applications With Ajax PluginsHnd201 Building Ibm Lotus Domino Applications With Ajax Plugins
Hnd201 Building Ibm Lotus Domino Applications With Ajax Plugins
 
Software Architecture New Features of Visual Studio 2010 / .Net 4.0 - Part 1...
Software Architecture New Features of Visual Studio 2010 / .Net 4.0  - Part 1...Software Architecture New Features of Visual Studio 2010 / .Net 4.0  - Part 1...
Software Architecture New Features of Visual Studio 2010 / .Net 4.0 - Part 1...
 
"Developing with the New User Interface Features in Microsoft SharePoint Serv...
"Developing with the New User Interface Features in Microsoft SharePoint Serv..."Developing with the New User Interface Features in Microsoft SharePoint Serv...
"Developing with the New User Interface Features in Microsoft SharePoint Serv...
 

Mais de Cory Peters

Top 10 in SharePoint 2013
Top 10 in SharePoint 2013Top 10 in SharePoint 2013
Top 10 in SharePoint 2013Cory Peters
 
Ready, Set, Upgrade!
Ready, Set, Upgrade!Ready, Set, Upgrade!
Ready, Set, Upgrade!Cory Peters
 
Solve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesSolve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesCory Peters
 
SharePoint 2010 - What's New?
SharePoint 2010 - What's New?SharePoint 2010 - What's New?
SharePoint 2010 - What's New?Cory Peters
 
SharePoint Search Results Branding
SharePoint Search Results BrandingSharePoint Search Results Branding
SharePoint Search Results BrandingCory Peters
 
SharePoint 2010 - Records Management
SharePoint 2010 - Records ManagementSharePoint 2010 - Records Management
SharePoint 2010 - Records ManagementCory Peters
 

Mais de Cory Peters (6)

Top 10 in SharePoint 2013
Top 10 in SharePoint 2013Top 10 in SharePoint 2013
Top 10 in SharePoint 2013
 
Ready, Set, Upgrade!
Ready, Set, Upgrade!Ready, Set, Upgrade!
Ready, Set, Upgrade!
 
Solve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 FeaturesSolve Todays Problems with 10 New SharePoint 2010 Features
Solve Todays Problems with 10 New SharePoint 2010 Features
 
SharePoint 2010 - What's New?
SharePoint 2010 - What's New?SharePoint 2010 - What's New?
SharePoint 2010 - What's New?
 
SharePoint Search Results Branding
SharePoint Search Results BrandingSharePoint Search Results Branding
SharePoint Search Results Branding
 
SharePoint 2010 - Records Management
SharePoint 2010 - Records ManagementSharePoint 2010 - Records Management
SharePoint 2010 - Records Management
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 

Último (20)

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 

Leveraging the Ribbon API and Dialog Framework

  • 1. Leveraging the Ribbon API and Dialog Framework Cory Peters Chief SharePoint Architect Eastridge Technology, Inc.
  • 2. About Me Chief SharePoint Architect at Eastridge Technology, Inc. Microsoft Gold Partner focused on the south east and based out of North Carolina Working with SharePoint since Portal Server 2003 Worked with all aspects of SharePoint including Branding Development Administration Implementation Architecture
  • 3. Leveraging the dialog framework Creating, deploying and interacting with dialogs
  • 4. Dialog goals Understand how dialogs work How to create a dialog How to pass data to/from a dialog What’s involved in deploying a custom dialog
  • 5.
  • 6. 0 = CancelreturnVal (string) Application Page
  • 7. SP.UI.ModalDialog SP.UI.ModalDialog.showModalDialog(options) Options parameter url title allowMaximize showClose width height dialogReturnValueCallback
  • 8. creating a dialog varoptions = SP.UI.$create_DialogOptions(); options.url = "/_layouts/Ex/CustomPage.aspx"; options.width= 400; options.height= 400; options.dialogReturnValueCallback= Function.createDelegate(null, customCallback); SP.UI.ModalDialog.showModalDialog(options);
  • 9. Getting data into a dialog Creating the Dialog varoptions = SP.UI.$create_DialogOptions(); options.url = "/_layouts/Ex/CustomPage.aspx?p1=value&p2=v1;v2;v3"; … Within the ApplicationPage string param1 = Request.QueryString[“p1”]; string[] param2 = Request.QueryString[“p2”].Split(‘;’);
  • 10. Getting data from a dialog var form = document.forms.<%SPHttpUtility.NoEncode(Form.ClientID,Response.Output);%>; varitemTitle = form.<%SPHttpUtility.NoEncode(itemTitleTextbox .ClientID,Response.Output);%>.value;
  • 11. closing a dialog OK Button Clicked SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, ‘Return Data’); Cancel Button Clicked SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, 'Canceled');
  • 12. Processing the result Callback receives two parameters: dialogResult and dialogData if (dialogResult === SP.UI.DialogResult.OK) { // use client OM for further processing } if (dialogResult=== SP.UI.DialogResult.cancel) { SP.UI.Notify.addNotification(“Dialog was canceled. ", false); }
  • 14. Customizing the ribbon XML, XML and some JavaScript!
  • 15. Ribbon goals Learn common terminology Have a better understanding of the Ribbon XML Know what’s involved in a ribbon customization See how all the pieces play together
  • 16. RIBBON OVERVIEW Defined via XML within <CustomAction> and feature deployed Tabs can be visible/hidden Controls can be enabled/disabled * No custom controls (.ascx) Heavy JavaScript required / Client OM Complex, nested, relational XML
  • 17. RIBBON XML TERMINOLOGY Ribbon Tab Contextual Tab Group Section Row Control
  • 19. AVAILABLE CONTROLS CONTAINERS Tab Group CONTROLS Button CheckBox Color Picker Combo Box Drop Down Flyout Anchor Insert Table Label Menu Menu Section MRU Split Menu Spinner Split Button Textbox Toggle Button
  • 20. control displays DisplayMode Display modes listed are not available for all controls.
  • 21. What makes up a ribbon? Ribbon XML Defines the tabs, groups, controls, rendering templates JavaScript CommandUIHandler or a custom Page Component Handles populating Dropdowns, on click events, etc Delegate Control One approach to getting your custom JavaScript loaded into the page Note: Any method of getting your JavaScript into the page is fine
  • 22. RIBBON XML CommandUIExtension CommandUIDefinition CommandUIHandlers
  • 23. RIBBON XML CommandUIExtension CommandUIDefinition
  • 24. RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate Tab
  • 25. RIBBON XML CommandUIExtension CommandUIDefinition Tab
  • 26. RIBBON XML CommandUIExtension GroupId CommandUIDefinition Tab Scaling Groups MaxSize Group Controls Scale Etc Button DropDown MaxSize Scale Group Controls Etc Button DropDown GroupId
  • 27. RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate Tab
  • 28. RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate
  • 29. RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate Layout Section Row ControlRef ControlRef Row ControlRef ControlRef Section
  • 30. RIBBON XML CommandUIExtension CommandUIDefinition GroupTemplate Tab
  • 31. RIBBON XML CommandUIExtension Template Id CommandUIDefinition GroupTemplate Tab Layout Groups Section Group Row Controls ControlRef ControlRef Button DropDown TemplateAlias Scaling MaxSize Scale Size
  • 32. RIBBON XML CommandUIExtension CommandUIDefinition CommandUIHandlers
  • 33. RIBBON XML CommandUIExtension CommandUIHandlers
  • 34. RIBBON XML CommandUIExtension CommandUIHandlers Two attributes: Command, CommandAction Command is a unique identifier CommandAction is JavaScript, URL or anything that was previously used in an UrlAction CommandUIHandler CommandUIHandler CommandUIHandler CommandUIHandler CommandUIHandler
  • 35. RIBBON XML CommandUIExtension CommandUIHandlers CommandUIDefinition
  • 36. RIBBON XML CommandUIExtension CommandUIHandlers CommandUIDefinition CommandUIHandler Tab Groups CommandUIHandler Group CommandUIHandler Controls Button DropDown Group Command Id Controls Button DropDown
  • 37. Command UI Handler Maps a control to set of JavaScript Very powerful when coupled with the Client OM Example <Button Id=“ButtonId" Command=“ButtonCommand“ … /> <CommandUIHandler Command=“ButtonCommand“ CommandAction="javascript: SP.UI.Notify.addNotification(‘Button was clicked');"/>
  • 38. Page Component JavaScript class that serves as the middle man between the Ribbon and your customization Uses a structured contract that the Ribbon understands
  • 39. Page Component (cont) Create your custom page component class Register your namespace Register your class to inherit from CUI.Page.PageComponent Initialize the page component CP.SharePoint.RibbonExample.PageComponent.initializePageComponent = function () { varribbonPageManager= SP.Ribbon.PageManager.get_instance(); if (null !== ribbonPageManager) { ribbonPageManager.addPageComponent(CP.SharePoint.RibbonExample.PageComponent.instance); } }
  • 40. Delegate Control Load SharePoint Prerequisites <SharePoint:ScriptLinkName="SP.js" runat="server" LoadAfterUI="true” … /> <SharePoint:ScriptLink Name="CUI.js" runat="server" LoadAfterUI="true" … /> Load Custom JavaScript <SharePoint:ScriptLink Name="/_layouts/RibbonExample/sp.ui.RibbonExample.js" runat="server" LoadAfterUI="true“ … /> Initialize Our Page Component <script type="text/javascript"> //<![CDATA[ function initializeRibbonExample() { CP.SharePoint.RibbonExample.PageComponent.initialize(); } ExecuteOrDelayUntilScriptLoaded(initializeRibbonExample, 'sp.ui.RibbonExample.js'); //]]> </script>
  • 41. Getting current Context Get List of Selected Items // Returns a collection of item ids varctx = SP.ClientContext.get_current(); varitems = SP.ListOperation.Selection.getSelectedItems(ctx); Get Selected List // Returns a guid SP.ListOperation.Selection.getSelectedList()
  • 43. resources XML file defining all OOTB Ribbons C:rogram filesommon filesicrosoft Sharedeb Server Extensions4EMPLATELOBALMLMDUI.xml MSDN Resources http://msdn.microsoft.com/en-us/library/ee540027.aspx http://msdn.microsoft.com/en-us/library/ee539395.aspx http://msdn.microsoft.com/en-us/library/ff407303.aspx Community Resources http://www.sharepointnutsandbolts.com/2010/01/customizing-ribbon-part-1-creating-tabs.html http://blogs.msdn.com/b/jfrost/archive/2009/11/08/how-to-display-a-sharepoint-dialog-from-ribbon-button-and-get-selected-item-context.aspx http://blogs.msdn.com/b/vesku/archive/2010/02/25/how-to-sharepoint-2010-js-client-object-model-and-ui-advancements.aspx

Notas do Editor

  1. * Important aspect of the ribbon. Controls should never move or be hidden.