SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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...
 

Plus 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
 

Plus 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
 

Dernier

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Dernier (20)

WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

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

Notes de l'éditeur

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