SlideShare uma empresa Scribd logo
1 de 70
Remixing Confluence with
Speakeasy



Nabeelah Ali
Atlassian

                          2
Show of hands
Written a Confluence plugin?




                              3
Show of hands
Comfortable with Javascript?




                               4
Show of hands
Enjoy memes?




                5
About me
Nabeelah Ali
Confluence developer
 on 4.0 frontend features




                            6
Confluence 4
• new features
• diverse users




                  7
“   Be the change you seek.
                              ”
                     Atlassian value




                                       8
9
In case you were wondering
• ragefaces is really an extension




         BEFORE                      AFTER




                                             10
I can haz plugin?
an atlassian-plugin.xml
<atlassian-plugin name="Ragefaces resource" key="example.plugin.ragefaces" plugins-
version="2">
    <plugin-info>
        <description>A plugin to turn your [/awyeah]s into images</description>
        <vendor name="Meme Corporation" url="http://www.memecorp.us"/>
        <version>1.0</version>
    </plugin-info>

    <web-resource name="Resources" key="resources">
          <resource name="foo.js" type="download" location="resources/foo.js"/>
          <context>atl.general</context>
    </web-resource>

</atlassian-plugin>




                                                                                      11
Creating a Confluence plugin




                              12
Creating a Confluence plugin




                              13
Creating a Confluence plugin



        run -> debug -> run


                              14
Creating a Confluence plugin



        run -> debug -> run


                              15
Creating a Confluence plugin



        run -> debug -> run


                              16
Creating a Confluence plugin



        run -> debug -> run


                              17
What you will hear today
• Speakeasy 101
• Let’s Build an Extension
• Cautionary Advice
• Resources




                             18
Speakeasy
Speakeasy: the what
• cross-product plugin
• run client-side Javascript, CSS & HTML




                                           20
demonstration of Speakeasy for the end user
creating an extension skeleton



                                 22
[demonstration of using the wizard to create an extension]
for plugin developers


                        super fast
                        prototyping




                                      24
for confluence admins



                 try out crazy stuff
                 on production data




                                       25
for confluence admins


                       user-driven
                       development




                                     26
for confluence admins



                  democratise
                  development




                                27
Speakeasy: got Confluence?
Atlassian Plugin SDK
 --atlas-run-standalone --product confluence --version 4.0




                                                             28
demonstration of installing the speakeasy plugin
liking



         30
31
pimping



          32
33
styling



          34
35
Let’s build an extension!
demonstration of plugin to build
Let’s build this thing
1. Include the image
2. Restrict the context
3. Find/replace
4. Twitter request
5. Put it in a dialog



                          38
Include the image
var img =
    require('speakeasy/resources').getImageUrl(module, 'bird.png');




                                                                      39
restrict the context



                       40
Let’s do this all onready


$(document).ready(function() {
  // we’ll put our code here
}




                                 41
Restrict the context
   if (!!AJS.Meta.get("page-id") &&
      !AJS.Meta.get("editor-mode")) {
     // do our stuff
   }




                                        42
grab the content



                   43
atlassian   atlassian




Confluence pages
viewing a page/blog       editing a page/blog                    dashboard
breadcrumbs                breadcrumbs                           breadcrumbs

  title                     title                                Welcome to Confluence    Updates
   content
                            content




                                                                  Spaces




                                                      SAVE
              atlassian                                                           atlassian




                                                                                                    44
Find & replace
  var content = AJS.$("#main-content");

  var twitterfiedContent = content.html().replace(/(^|s)#(w+)/g, "
     $1#<a href="http://search.twitter.com/search?q=%23$2">$2</a>
     <img src='"+ img + "' class='twittericon' hashtag='$2'/>");

  content.html(twitterfiedContent);




                                                                       45
All our hashtags are linked
• Body Level One
• Body Level One
 • Body Level Two
 • Body Level Two

• Body Level One
 • Body Level Two

                              46
Atlassian User Interface (AUI)
• a reusable set of UI components




                                    47
Put it in a dialog
AJS.$(".twittericon").each(function (i) {

  AJS.InlineDialog($(this), 1, function(content, trigger, showPopup)
  {
     // Let’s get some information to put in this inline dialog.
   },  {onHover:true});
}




                                                                       48
Twitter request
      $.getJSON("http://search.twitter.com/search.json?callback=?", {
       q: "#" + $(this).attr('hashtag'),
       rpp: "5",
       lang: "en"
       }, function(data) {
          $.each(data.results, function() {
             // Put each result’s twitter handle, tweet text and user
             //profile photo in nice divs and style.      
           });
       });
   




                                                                        49
Twitter request
      $.getJSON("http://search.twitter.com/search.json?callback=?", {
       q: "#" + $(this).attr('hashtag'),
       rpp: "5",
       lang: "en"
       }, function(data) {
          $.each(data.results, function() {
             // Put each result’s twitter handle, tweet text and user
             //profile photo in nice divs and style.      
           });
       });
   




                                                                        50
So now we have
    AJS.InlineDialog($(this), 1, function(content, trigger, showPopup) {

      var tweets = AJS.$("<div></div>").attr("id", "tweets");
      $.getJSON("http://search.twitter.com/search.json?callback=?", {q: "#" + id, rpp: "5",
lang: "en"}, function(data) {
        $.each(data.results, function() {
          // Assemble results into a tweets div.
        });
       
        $(content).html(tweets);
       showPopup();
       });
    },  {onHover:true});




                                                                                              51
So now we have
var img = require('speakeasy/resources').getImageUrl(module, 'bird.png');

$(document).ready(function () {
    if ( !! AJS.Meta.get("page-id") && !AJS.Meta.get("editor-mode")) {

          var content = AJS.$("#main-content");
          var twitterfiedContent = content.html().replace(/(^|s)#(w+)/g, "$1#
                    <a href="http://search.twitter.com/search?q=%23$2">$2</a><img src='" + img + "' class='twittericon' data-val='$2'/>");
          content.html(twitterfiedContent);

          AJS.$(".twittericon").each(function (i) {

                AJS.InlineDialog($(this), 1, function (content, trigger, showPopup) {

                       var tweets = AJS.$("<div></div>").addClass(“tweets”);
                       AJS.$.getJSON("http://search.twitter.com/search.json?callback=?", {
                           q: "#" + $(this).attr('hashtag'),
                           rpp: "5",
                           lang: "en"
                       }, function (data) {
                           AJS.$.each(data.results, function () {
                               tweets.append(formatTweet(this));
                           });

                             AJS.$(content).html(tweets);
                             showPopup();
                       });

                }, {
                       onHover: true
                });
          });
      }
});




                                                                                                                                               52
THE TWEETINATOR




                  53
Cautionary advice
Breaking things
• Unsubscribe & restore URLs
   yourinstance/plugins/servlet/speakeasy/unsubscribe

   yourinstance/plugins/servlet/speakeasy/restore




                                                        55
Should you use it?
• Do you trust your users?
• Does your instance allow public signup?




                                            56
Speakeasy Settings




                     57
Cross-site scripting
• inserting unescaped HTML into the page
 • from user input
 • from data you fetched




                                           58
XSS Example
var result = "<script>alert();</script>";
var el = document.getElementById('myDiv');
    




                                             59
XSS Example
var result = "<script>alert();</script>";
var el = document.getElementById('myDiv');

el.innerHTML = result;




                                             60
XSS Example
var result = "<script>alert();</script>";
var el = document.getElementById('myDiv');

el.innerHTML = result;                       // BAD - Don’t do this!




                                                                       61
XSS Example
var result = "<script>alert();</script>";
var el = document.getElementById('myDiv');

el.innerHTML = result;                       // BAD - Don’t do this!


el.innerHTML = AJS.escapeHtml(result);       // Do this instead.




                                                                       62
XSS Example
var result = "<script>alert();</script>";
var el = document.getElementById('myDiv');

el.innerHTML = result;                       // BAD - Don’t do this!


el.innerHTML = AJS.escapeHtml(result);       // Do this instead.
AJS.$(el).text(result);                      // Or this.




                                                                       63
Interested in learning more?
Securing your Plugin - Penny Wyatt @ AtlasCamp 2010

               Protip If you weren’t here last year or
               just enjoy nostalgia, check out the
               Atlascamp 2010 website for videos
               of every session.




                                                         64
Where can you go from here?
Moar

• git support
• applinks proxy
• xml/rpc client
• check out the docs!



                        66
Product Compatibility

• Speakeasy documentation
• Extension repository
• Remember: not just Confluence!




                                  67
Resources
Speakeasy Documentation
https://developer.atlassian.com/display/SPEAK/Speakeasy
Speakeasy Source on github
https://github.com/mrdon/speakeasy-plugin
Speakeasy JARs
https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/labs/speakeasy-plugin/




                                                                                                         68
TAKE-AWAYS




“   Got an hour to spare? That’s enough time to

                                                     ”
    prototype a new Confluence feature with Speakeasy.




     #atlascamp


                                                         69
Thank you!

Mais conteúdo relacionado

Mais procurados

E2 appspresso hands on lab
E2 appspresso hands on labE2 appspresso hands on lab
E2 appspresso hands on lab
NAVER D2
 

Mais procurados (20)

OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010OSCON Google App Engine Codelab - July 2010
OSCON Google App Engine Codelab - July 2010
 
E2 appspresso hands on lab
E2 appspresso hands on labE2 appspresso hands on lab
E2 appspresso hands on lab
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfast
 
JavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New WorldJavaScript & HTML5 - Brave New World
JavaScript & HTML5 - Brave New World
 
Implement rich snippets in your webshop
Implement rich snippets in your webshopImplement rich snippets in your webshop
Implement rich snippets in your webshop
 
Cake Php 1.2 (Ocphp)
Cake Php 1.2 (Ocphp)Cake Php 1.2 (Ocphp)
Cake Php 1.2 (Ocphp)
 
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
 
Greach 2019 - Creating Micronaut Configurations
Greach 2019 - Creating Micronaut ConfigurationsGreach 2019 - Creating Micronaut Configurations
Greach 2019 - Creating Micronaut Configurations
 
Progressive What Apps?
Progressive What Apps?Progressive What Apps?
Progressive What Apps?
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
CodeIgniter 3.0
CodeIgniter 3.0CodeIgniter 3.0
CodeIgniter 3.0
 
Power of Simplicity in FW/1
Power of Simplicity in FW/1Power of Simplicity in FW/1
Power of Simplicity in FW/1
 
A Little Backbone For Your App
A Little Backbone For Your AppA Little Backbone For Your App
A Little Backbone For Your App
 
Django
DjangoDjango
Django
 
Moving from Django Apps to Services
Moving from Django Apps to ServicesMoving from Django Apps to Services
Moving from Django Apps to Services
 
Hooks WCSD12
Hooks WCSD12Hooks WCSD12
Hooks WCSD12
 
Java Libraries You Can’t Afford to Miss
Java Libraries You Can’t Afford to Miss Java Libraries You Can’t Afford to Miss
Java Libraries You Can’t Afford to Miss
 
Django for mobile applications
Django for mobile applicationsDjango for mobile applications
Django for mobile applications
 
Lecture: Vaadin Overview
Lecture: Vaadin OverviewLecture: Vaadin Overview
Lecture: Vaadin Overview
 
SEO for Developers
SEO for DevelopersSEO for Developers
SEO for Developers
 

Destaque

Scalability ofjira attelefónicagermany_v1.2_public
Scalability ofjira attelefónicagermany_v1.2_publicScalability ofjira attelefónicagermany_v1.2_public
Scalability ofjira attelefónicagermany_v1.2_public
Atlassian
 
Hodges unite confluence unite presentation
Hodges unite confluence unite presentationHodges unite confluence unite presentation
Hodges unite confluence unite presentation
Atlassian
 
Unite jira presentation 2012 v4 copy
Unite jira presentation 2012 v4 copyUnite jira presentation 2012 v4 copy
Unite jira presentation 2012 v4 copy
Atlassian
 
Equion presentation updated atlassian unite 12 march2012
Equion presentation updated   atlassian unite 12 march2012Equion presentation updated   atlassian unite 12 march2012
Equion presentation updated atlassian unite 12 march2012
Atlassian
 
London unite-zen
London unite-zenLondon unite-zen
London unite-zen
Atlassian
 
20120315 atlassian unite - dvcs
20120315   atlassian unite - dvcs20120315   atlassian unite - dvcs
20120315 atlassian unite - dvcs
Atlassian
 
Alm works atlassian unite london
Alm works   atlassian unite londonAlm works   atlassian unite london
Alm works atlassian unite london
Atlassian
 

Destaque (9)

Scalability ofjira attelefónicagermany_v1.2_public
Scalability ofjira attelefónicagermany_v1.2_publicScalability ofjira attelefónicagermany_v1.2_public
Scalability ofjira attelefónicagermany_v1.2_public
 
Hodges unite confluence unite presentation
Hodges unite confluence unite presentationHodges unite confluence unite presentation
Hodges unite confluence unite presentation
 
Unite jira presentation 2012 v4 copy
Unite jira presentation 2012 v4 copyUnite jira presentation 2012 v4 copy
Unite jira presentation 2012 v4 copy
 
Equion presentation updated atlassian unite 12 march2012
Equion presentation updated   atlassian unite 12 march2012Equion presentation updated   atlassian unite 12 march2012
Equion presentation updated atlassian unite 12 march2012
 
London unite-zen
London unite-zenLondon unite-zen
London unite-zen
 
Juggling Features, Advancement, and Quality As You Grow - Chris Maddern
Juggling Features, Advancement, and Quality As You Grow - Chris MaddernJuggling Features, Advancement, and Quality As You Grow - Chris Maddern
Juggling Features, Advancement, and Quality As You Grow - Chris Maddern
 
Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011Bonfire... How'd You Do That?! - AtlasCamp 2011
Bonfire... How'd You Do That?! - AtlasCamp 2011
 
20120315 atlassian unite - dvcs
20120315   atlassian unite - dvcs20120315   atlassian unite - dvcs
20120315 atlassian unite - dvcs
 
Alm works atlassian unite london
Alm works   atlassian unite londonAlm works   atlassian unite london
Alm works atlassian unite london
 

Semelhante a Remixing Confluence with Speakeasy - AtlasCamp 2011

Ako prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s ElasticsearchAko prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s Elasticsearch
bart-sk
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
Bob Paulin
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
mfrancis
 

Semelhante a Remixing Confluence with Speakeasy - AtlasCamp 2011 (20)

AtlasCamp 2011: Confluence 4 and Beyond
AtlasCamp 2011: Confluence 4 and BeyondAtlasCamp 2011: Confluence 4 and Beyond
AtlasCamp 2011: Confluence 4 and Beyond
 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX Ecosystem
 
Ako prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s ElasticsearchAko prepojiť aplikáciu s Elasticsearch
Ako prepojiť aplikáciu s Elasticsearch
 
Refresh Austin - Intro to Dexy
Refresh Austin - Intro to DexyRefresh Austin - Intro to Dexy
Refresh Austin - Intro to Dexy
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...Learning jQuery made exciting in an interactive session by one of our team me...
Learning jQuery made exciting in an interactive session by one of our team me...
 
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
 
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
Hyperproductive JSF 2.0 @ JavaOne Brazil 2010
 
It's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking ModernizrIt's a Mod World - A Practical Guide to Rocking Modernizr
It's a Mod World - A Practical Guide to Rocking Modernizr
 
Build Your Own CMS with Apache Sling
Build Your Own CMS with Apache SlingBuild Your Own CMS with Apache Sling
Build Your Own CMS with Apache Sling
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
 
Html5 For Jjugccc2009fall
Html5 For Jjugccc2009fallHtml5 For Jjugccc2009fall
Html5 For Jjugccc2009fall
 
Web2.0 with jQuery in English
Web2.0 with jQuery in EnglishWeb2.0 with jQuery in English
Web2.0 with jQuery in English
 
Quick Introduction to Sphinx and Thinking Sphinx
Quick Introduction to Sphinx and Thinking SphinxQuick Introduction to Sphinx and Thinking Sphinx
Quick Introduction to Sphinx and Thinking Sphinx
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 

Mais de Atlassian

Design Your Next App with the Atlassian Vendor Sketch Plugin
Design Your Next App with the Atlassian Vendor Sketch PluginDesign Your Next App with the Atlassian Vendor Sketch Plugin
Design Your Next App with the Atlassian Vendor Sketch Plugin
Atlassian
 

Mais de Atlassian (20)

International Women's Day 2020
International Women's Day 2020International Women's Day 2020
International Women's Day 2020
 
10 emerging trends that will unbreak your workplace in 2020
10 emerging trends that will unbreak your workplace in 202010 emerging trends that will unbreak your workplace in 2020
10 emerging trends that will unbreak your workplace in 2020
 
Forge App Showcase
Forge App ShowcaseForge App Showcase
Forge App Showcase
 
Let's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UILet's Build an Editor Macro with Forge UI
Let's Build an Editor Macro with Forge UI
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge Runtime
 
Forge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User ExperienceForge UI: A New Way to Customize the Atlassian User Experience
Forge UI: A New Way to Customize the Atlassian User Experience
 
Take Action with Forge Triggers
Take Action with Forge TriggersTake Action with Forge Triggers
Take Action with Forge Triggers
 
Observability and Troubleshooting in Forge
Observability and Troubleshooting in ForgeObservability and Troubleshooting in Forge
Observability and Troubleshooting in Forge
 
Trusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy ModelTrusted by Default: The Forge Security & Privacy Model
Trusted by Default: The Forge Security & Privacy Model
 
Designing Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI SystemDesigning Forge UI: A Story of Designing an App UI System
Designing Forge UI: A Story of Designing an App UI System
 
Forge: Under the Hood
Forge: Under the HoodForge: Under the Hood
Forge: Under the Hood
 
Access to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIsAccess to User Activities - Activity Platform APIs
Access to User Activities - Activity Platform APIs
 
Design Your Next App with the Atlassian Vendor Sketch Plugin
Design Your Next App with the Atlassian Vendor Sketch PluginDesign Your Next App with the Atlassian Vendor Sketch Plugin
Design Your Next App with the Atlassian Vendor Sketch Plugin
 
Tear Up Your Roadmap and Get Out of the Building
Tear Up Your Roadmap and Get Out of the BuildingTear Up Your Roadmap and Get Out of the Building
Tear Up Your Roadmap and Get Out of the Building
 
Nailing Measurement: a Framework for Measuring Metrics that Matter
Nailing Measurement: a Framework for Measuring Metrics that MatterNailing Measurement: a Framework for Measuring Metrics that Matter
Nailing Measurement: a Framework for Measuring Metrics that Matter
 
Building Apps With Color Blind Users in Mind
Building Apps With Color Blind Users in MindBuilding Apps With Color Blind Users in Mind
Building Apps With Color Blind Users in Mind
 
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
Creating Inclusive Experiences: Balancing Personality and Accessibility in UX...
 
Beyond Diversity: A Guide to Building Balanced Teams
Beyond Diversity: A Guide to Building Balanced TeamsBeyond Diversity: A Guide to Building Balanced Teams
Beyond Diversity: A Guide to Building Balanced Teams
 
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed TeamThe Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
The Road(map) to Las Vegas - The Story of an Emerging Self-Managed Team
 
Building Apps With Enterprise in Mind
Building Apps With Enterprise in MindBuilding Apps With Enterprise in Mind
Building Apps With Enterprise in Mind
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Remixing Confluence with Speakeasy - AtlasCamp 2011

  • 1.
  • 3. Show of hands Written a Confluence plugin? 3
  • 4. Show of hands Comfortable with Javascript? 4
  • 6. About me Nabeelah Ali Confluence developer on 4.0 frontend features 6
  • 7. Confluence 4 • new features • diverse users 7
  • 8. Be the change you seek. ” Atlassian value 8
  • 9. 9
  • 10. In case you were wondering • ragefaces is really an extension BEFORE AFTER 10
  • 11. I can haz plugin? an atlassian-plugin.xml <atlassian-plugin name="Ragefaces resource" key="example.plugin.ragefaces" plugins- version="2"> <plugin-info> <description>A plugin to turn your [/awyeah]s into images</description> <vendor name="Meme Corporation" url="http://www.memecorp.us"/> <version>1.0</version> </plugin-info> <web-resource name="Resources" key="resources"> <resource name="foo.js" type="download" location="resources/foo.js"/> <context>atl.general</context> </web-resource> </atlassian-plugin> 11
  • 14. Creating a Confluence plugin run -> debug -> run 14
  • 15. Creating a Confluence plugin run -> debug -> run 15
  • 16. Creating a Confluence plugin run -> debug -> run 16
  • 17. Creating a Confluence plugin run -> debug -> run 17
  • 18. What you will hear today • Speakeasy 101 • Let’s Build an Extension • Cautionary Advice • Resources 18
  • 20. Speakeasy: the what • cross-product plugin • run client-side Javascript, CSS & HTML 20
  • 21. demonstration of Speakeasy for the end user
  • 22. creating an extension skeleton 22
  • 23. [demonstration of using the wizard to create an extension]
  • 24. for plugin developers super fast prototyping 24
  • 25. for confluence admins try out crazy stuff on production data 25
  • 26. for confluence admins user-driven development 26
  • 27. for confluence admins democratise development 27
  • 28. Speakeasy: got Confluence? Atlassian Plugin SDK --atlas-run-standalone --product confluence --version 4.0 28
  • 29. demonstration of installing the speakeasy plugin
  • 30. liking 30
  • 31. 31
  • 32. pimping 32
  • 33. 33
  • 34. styling 34
  • 35. 35
  • 36. Let’s build an extension!
  • 38. Let’s build this thing 1. Include the image 2. Restrict the context 3. Find/replace 4. Twitter request 5. Put it in a dialog 38
  • 39. Include the image var img = require('speakeasy/resources').getImageUrl(module, 'bird.png'); 39
  • 41. Let’s do this all onready $(document).ready(function() { // we’ll put our code here } 41
  • 42. Restrict the context if (!!AJS.Meta.get("page-id") && !AJS.Meta.get("editor-mode")) { // do our stuff } 42
  • 44. atlassian atlassian Confluence pages viewing a page/blog editing a page/blog dashboard breadcrumbs breadcrumbs breadcrumbs title title Welcome to Confluence Updates content content Spaces SAVE atlassian atlassian 44
  • 45. Find & replace   var content = AJS.$("#main-content");   var twitterfiedContent = content.html().replace(/(^|s)#(w+)/g, " $1#<a href="http://search.twitter.com/search?q=%23$2">$2</a> <img src='"+ img + "' class='twittericon' hashtag='$2'/>");   content.html(twitterfiedContent); 45
  • 46. All our hashtags are linked • Body Level One • Body Level One • Body Level Two • Body Level Two • Body Level One • Body Level Two 46
  • 47. Atlassian User Interface (AUI) • a reusable set of UI components 47
  • 48. Put it in a dialog AJS.$(".twittericon").each(function (i) { AJS.InlineDialog($(this), 1, function(content, trigger, showPopup) { // Let’s get some information to put in this inline dialog.    },  {onHover:true}); } 48
  • 49. Twitter request       $.getJSON("http://search.twitter.com/search.json?callback=?", { q: "#" + $(this).attr('hashtag'), rpp: "5", lang: "en" }, function(data) {    $.each(data.results, function() {    // Put each result’s twitter handle, tweet text and user //profile photo in nice divs and style.                }); });     49
  • 50. Twitter request       $.getJSON("http://search.twitter.com/search.json?callback=?", { q: "#" + $(this).attr('hashtag'), rpp: "5", lang: "en" }, function(data) {    $.each(data.results, function() {    // Put each result’s twitter handle, tweet text and user //profile photo in nice divs and style.                }); });     50
  • 51. So now we have     AJS.InlineDialog($(this), 1, function(content, trigger, showPopup) {       var tweets = AJS.$("<div></div>").attr("id", "tweets");       $.getJSON("http://search.twitter.com/search.json?callback=?", {q: "#" + id, rpp: "5", lang: "en"}, function(data) {         $.each(data.results, function() { // Assemble results into a tweets div.         });         $(content).html(tweets);        showPopup();        });     },  {onHover:true}); 51
  • 52. So now we have var img = require('speakeasy/resources').getImageUrl(module, 'bird.png'); $(document).ready(function () { if ( !! AJS.Meta.get("page-id") && !AJS.Meta.get("editor-mode")) { var content = AJS.$("#main-content"); var twitterfiedContent = content.html().replace(/(^|s)#(w+)/g, "$1# <a href="http://search.twitter.com/search?q=%23$2">$2</a><img src='" + img + "' class='twittericon' data-val='$2'/>"); content.html(twitterfiedContent); AJS.$(".twittericon").each(function (i) { AJS.InlineDialog($(this), 1, function (content, trigger, showPopup) { var tweets = AJS.$("<div></div>").addClass(“tweets”); AJS.$.getJSON("http://search.twitter.com/search.json?callback=?", { q: "#" + $(this).attr('hashtag'), rpp: "5", lang: "en" }, function (data) { AJS.$.each(data.results, function () { tweets.append(formatTweet(this)); }); AJS.$(content).html(tweets); showPopup(); }); }, { onHover: true }); }); } }); 52
  • 55. Breaking things • Unsubscribe & restore URLs yourinstance/plugins/servlet/speakeasy/unsubscribe yourinstance/plugins/servlet/speakeasy/restore 55
  • 56. Should you use it? • Do you trust your users? • Does your instance allow public signup? 56
  • 58. Cross-site scripting • inserting unescaped HTML into the page • from user input • from data you fetched 58
  • 59. XSS Example var result = "<script>alert();</script>"; var el = document.getElementById('myDiv');      59
  • 60. XSS Example var result = "<script>alert();</script>"; var el = document.getElementById('myDiv'); el.innerHTML = result; 60
  • 61. XSS Example var result = "<script>alert();</script>"; var el = document.getElementById('myDiv'); el.innerHTML = result; // BAD - Don’t do this! 61
  • 62. XSS Example var result = "<script>alert();</script>"; var el = document.getElementById('myDiv'); el.innerHTML = result; // BAD - Don’t do this! el.innerHTML = AJS.escapeHtml(result); // Do this instead. 62
  • 63. XSS Example var result = "<script>alert();</script>"; var el = document.getElementById('myDiv'); el.innerHTML = result; // BAD - Don’t do this! el.innerHTML = AJS.escapeHtml(result); // Do this instead. AJS.$(el).text(result); // Or this. 63
  • 64. Interested in learning more? Securing your Plugin - Penny Wyatt @ AtlasCamp 2010 Protip If you weren’t here last year or just enjoy nostalgia, check out the Atlascamp 2010 website for videos of every session. 64
  • 65. Where can you go from here?
  • 66. Moar • git support • applinks proxy • xml/rpc client • check out the docs! 66
  • 67. Product Compatibility • Speakeasy documentation • Extension repository • Remember: not just Confluence! 67
  • 68. Resources Speakeasy Documentation https://developer.atlassian.com/display/SPEAK/Speakeasy Speakeasy Source on github https://github.com/mrdon/speakeasy-plugin Speakeasy JARs https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/labs/speakeasy-plugin/ 68
  • 69. TAKE-AWAYS “ Got an hour to spare? That’s enough time to ” prototype a new Confluence feature with Speakeasy. #atlascamp 69

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. easy to deploy // fast to deploy // social // per-user\n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n
  48. \n
  49. \n
  50. \n
  51. \n
  52. \n
  53. \n
  54. \n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. \n
  67. \n
  68. \n
  69. \n
  70. \n
  71. \n