SlideShare a Scribd company logo
Pimp My Confluence Plugin - AtlasCamp 2011
Confluence 4.0
Integrating your plugin as a first class citizen



Ryan Thomas
Developer, Atlassian
http://atlss.in/confluence4
#atlascamp                                        2
About Me




           3
About Me
• Confluence Developer




                        3
About Me
• Confluence Developer
• Worked on 4.0 since January
  2010




                                3
About Me
• Confluence Developer
• Worked on 4.0 since January
  2010
• Managed a lot of the ecosystem
  integration



                                   3
About Me
• Confluence Developer
• Worked on 4.0 since January
  2010
• Managed a lot of the ecosystem
  integration
• Deployed 4.0 to the Atlassian
  internal instances
                                   3
Agenda




         4
Agenda




         4
Agenda

• Editor Plugin Points




                         4
Agenda

• Editor Plugin Points
• Transformer Pipeline




                         4
Agenda

• Editor Plugin Points
• Transformer Pipeline
• XHTML in Macros




                         4
Agenda

• Editor Plugin Points
• Transformer Pipeline
• XHTML in Macros
• Demonstration




                         4
Editor Terminology




                     5
Editor Terminology




            Rich Text Editor
                               5
Editor Terminology




              Toolbar
                        5
Editor Terminology




             Insert Menu
                           5
Editor Terminology




           Formatting Menu
                             5
Editor Terminology




                     5
Editor Terminology




           Macro Placeholder
                               5
Editor Terminology




         Macro Property Panel
                                5
Formatting Menu




                  6
Formatting Menu




                  6
Formatting Menu
• Plug into the Formatting menu
  in the Toolbar




                                  6
Formatting Menu
• Plug into the Formatting menu
  in the Toolbar
• Allows you to interact with the
  TinyMCE formatting styles




                                    6
Formatting Menu
• Plug into the Formatting menu
  in the Toolbar
• Allows you to interact with the
  TinyMCE formatting styles
• Done as a web-item



                                    6
Formatting Menu




                  7
Formatting Menu
   <web-item key="editor-awesome-format" name="Awesome Format"
        section="system.editor.more.formats" weight="10">
     <label key="my.plugin.awesome.format"/>
     <link linkId="my-awesome-format"/>
   </web-item>




                                                                 7
Formatting Menu
   <web-item key="editor-awesome-format" name="Awesome Format"
        section="system.editor.more.formats" weight="10">
     <label key="my.plugin.awesome.format"/>
     <link linkId="my-awesome-format"/>
   </web-item>



   $("#my-awesome-button").click(function(){
     tinymce.activeEditor.execCommand("FormatBlock",
          false, "samp");
   });




                                                                 7
Formatting Menu
   <web-item key="editor-awesome-format" name="Awesome Format"
        section="system.editor.more.formats" weight="10">
     <label key="my.plugin.awesome.format"/>
     <link linkId="my-awesome-format"/>
   </web-item>

                   system.editor.more.formats

   $("#my-awesome-button").click(function(){
     tinymce.activeEditor.execCommand("FormatBlock",
          false, "samp");
   });




                                                                 7
Insert Menu




              8
Insert Menu




              8
Insert Menu
• Add your macro to the Insert menu in
  the Toolbar




                                         8
Insert Menu
• Add your macro to the Insert menu in
  the Toolbar
• Default behaviour opens Macro
  Browser




                                         8
Insert Menu
• Add your macro to the Insert menu in
  the Toolbar
• Default behaviour opens Macro
  Browser
• Done as a web-item



                                         8
Insert Menu




              9
Insert Menu
   <web-item key="editor-my-macro"
        name="Insert Menu Link - My Macro"
        section="system.editor.featured.macros.default"
        weight="100">
     <label key="my.plugin.macro"/>
     <link linkId="mymacro"/>
   </web-item>




                                                          9
Insert Menu
   <web-item key="editor-my-macro"
        name="Insert Menu Link - My Macro"
        section="system.editor.featured.macros.default"
        weight="100">
     <label key="my.plugin.macro"/>
     <link linkId="mymacro"/>
   </web-item>

              system.editor.featured.macros.default




                                                          9
Overriding The Macro Browser




                               10
Overriding The Macro Browser
• Want to use a custom dialog?




                                 10
Overriding The Macro Browser
• Want to use a custom dialog?
• Want to perform some action before opening the Macro
  Browser?




                                                         10
Overriding The Macro Browser
• Want to use a custom dialog?
• Want to perform some action before opening the Macro
  Browser?
• Want your macro to appear as a native Confluence
  component?



                                                         10
Overriding The Macro Browser




                               11
Overriding The Macro Browser
   AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
       function(macro) {
          // Custom logic goes here
       }
   });




                                                              11
Overriding The Macro Browser
     AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
         function(macro) {
            // Custom logic goes here
         }
     });

 • This will affect all the following areas:




                                                                11
Overriding The Macro Browser
     AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
         function(macro) {
            // Custom logic goes here
         }
     });

 • This will affect all the following areas:
  • Insert Menu




                                                                11
Overriding The Macro Browser
     AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
         function(macro) {
            // Custom logic goes here
         }
     });

 • This will affect all the following areas:
  • Insert Menu
  • Autocomplete



                                                                11
Overriding The Macro Browser
     AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
         function(macro) {
            // Custom logic goes here
         }
     });

 • This will affect all the following areas:
  • Insert Menu
  • Autocomplete
  • Property panel Edit button

                                                                11
Overriding The Macro Browser
     AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
         function(macro) {
            // Custom logic goes here
         }
     });

 • This will affect all the following areas:
  • Insert Menu
  • Autocomplete
  • Property panel Edit button
  • Manually selecting inside the macro browser
                                                                11
Image Macro Placeholders




                           12
Image Macro Placeholders




                           12
Image Macro Placeholders
• Replaces the Macro Placeholder




                                   12
Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
  image, or reference static images




                                      12
Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
  image, or reference static images
• Only applicable to Bodiless Macros




                                       12
Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
  image, or reference static images
• Only applicable to Bodiless Macros
• Macro Placeholder chrome can be
  applied optionally

                                       12
Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
  image, or reference static images
• Only applicable to Bodiless Macros
• Macro Placeholder chrome can be
  applied optionally

                                       12
Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
  image, or reference static images
• Only applicable to Bodiless Macros
• Macro Placeholder chrome can be
  applied optionally

                                       12
Image Macro Placeholders




                           13
Image Macro Placeholders
   public interface EditorImagePlaceholder
   {
       ImagePlaceholder getImagePlaceholder(
           Map<String, String> parameters,
           ConversionContext   context);
   }




                                               13
Image Macro Placeholders
   public interface EditorImagePlaceholder
   {
       ImagePlaceholder getImagePlaceholder(
           Map<String, String> parameters,
           ConversionContext   context);
   }

   public interface ImagePlaceholder
   {
       String     getUrl();
       Dimensions getDimensions();
       boolean    applyPlaceholderChrome();
   }


                                               13
Macro Property Panel




                       14
Macro Property Panel




                       14
Macro Property Panel




                       14
Macro Property Panel
• Provides contextual actions for
  the macro




                                    14
Macro Property Panel
• Provides contextual actions for
  the macro
• Provides Edit and Remove
  buttons




                                    14
Macro Property Panel
• Provides contextual actions for
  the macro
• Provides Edit and Remove
  buttons
• Custom buttons for your macros



                                    14
Macro Property Panel
• Provides contextual actions for
  the macro
• Provides Edit and Remove
  buttons
• Custom buttons for your macros



                                    14
Macro Property Panel




                       15
Macro Property Panel
                      atlassian-plugin.xml

   <xhtml-macro key="status" name="status" ...>
       <!-- SNIP -->
       <property-panel>
           <spacer/>
           <button id="Grey" label=""/>
           <button id="Red" label=""/>
           <button id="Yellow" label=""/>
           <button id="Green" label=""/>
           <spacer/>
       </property-panel>
   </xhtml-macro>


                                                  15
Macro Property Panel




                       16
Macro Property Panel
  AJS.Confluence.PropertyPanel.Macro.registerButtonHandler("Grey",
      function(e, macroNode) {
          // Custom button logic goes here
          updateMacro(macroNode, "Grey"); // Plugin function
      });


  See complete example here:

  https://bitbucket.org/rthomas/confluence-status-macro/




                                                                     16
Parameter Placeholder




                        17
Parameter Placeholder




                        17
Parameter Placeholder




                        17
Parameter Placeholder




                        17
Parameter Placeholder




                        17
Parameter Placeholder




                        17
Parameter Placeholder




                        17
Parameter Placeholder




                        18
Parameter Placeholder
<parameters>
    <default>
        <option key="showValueInPlaceholder" value="true" />
    </default>
    <parameter name="key" type="string">
        <option key="showKeyInPlaceholder" value="false" />
        <option key="showValueInPlaceholder" value="true" />
    </parameter>
    <parameter name="server" type="string">
        <option key="showKeyInPlaceholder" value="false" />
        <option key="showValueInPlaceholder" value="false" />
    </parameter>
</parameters>


                                                                18
Editor Plugin Points




                       19
Editor Plugin Points




                       19
Editor Plugin Points

 • Formatting Menu




                       19
Editor Plugin Points

 • Formatting Menu
 • Insert Menu & Overrides




                             19
Editor Plugin Points

 • Formatting Menu
 • Insert Menu & Overrides
 • Image Placeholders




                             19
Editor Plugin Points

 • Formatting Menu
 • Insert Menu & Overrides
 • Image Placeholders
 • Macro Property Panel




                             19
Editor Plugin Points

 • Formatting Menu
 • Insert Menu & Overrides
 • Image Placeholders
 • Macro Property Panel
 • Parameter Placeholder


                             19
Transformer Pipeline




                       20
Transformer Pipeline




                       20
Transformer Pipeline
• Confluence 4.0 contains a
  completely new rendering engine




                                    20
Transformer Pipeline
• Confluence 4.0 contains a
  completely new rendering engine
• Part of this engine is the
  Transformer Pipeline




                                    20
Transformer Pipeline
• Confluence 4.0 contains a
  completely new rendering engine
• Part of this engine is the
  Transformer Pipeline
• This is available to all plugins



                                     20
Transformer Pipeline




                       21
Transformer Pipeline
• Confluence 4.0 stores its data in XHTML, this is known
  as Storage Format - (No more wiki-markup! )




                                                          21
Transformer Pipeline
• Confluence 4.0 stores its data in XHTML, this is known
  as Storage Format - (No more wiki-markup! )
• We have three formats, however only the Storage
  Format is persisted




                                                          21
Transformer Pipeline
• Confluence 4.0 stores its data in XHTML, this is known
  as Storage Format - (No more wiki-markup! )
• We have three formats, however only the Storage
  Format is persisted
 • View Format: HTML



                                                          21
Transformer Pipeline
• Confluence 4.0 stores its data in XHTML, this is known
  as Storage Format - (No more wiki-markup! )
• We have three formats, however only the Storage
  Format is persisted
 • View Format: HTML
 • Editor Format: HTML with data attributes

                                                          21
Transformer Pipeline




                       22
Transformer Pipeline
• The pipeline controls the rendering of Confluence
  content from one format to another




                                                     22
Transformer Pipeline
• The pipeline controls the rendering of Confluence
  content from one format to another
• There are three pipelines inside of the rendering
  engine:




                                                      22
Transformer Pipeline
• The pipeline controls the rendering of Confluence
  content from one format to another
• There are three pipelines inside of the rendering
  engine:
 • Storage to View (viewing a page)



                                                      22
Transformer Pipeline
• The pipeline controls the rendering of Confluence
  content from one format to another
• There are three pipelines inside of the rendering
  engine:
 • Storage to View (viewing a page)
 • Storage to Edit (editing a page)

                                                      22
Transformer Pipeline
• The pipeline controls the rendering of Confluence
  content from one format to another
• There are three pipelines inside of the rendering
  engine:
 • Storage to View (viewing a page)
 • Storage to Edit (editing a page)
 • Edit to Storage (saving a page)
                                                      22
Transformer Pipeline
Transformer Pipeline
               Storage
               Format




       View               Edit
      Format             Format

                                  23
Transformer Pipeline




                       24
Transformer Pipeline
• Why?




                       24
Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
  content before or after Confluence operates on it




                                                          24
Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
  content before or after Confluence operates on it
 • Inject content




                                                          24
Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
  content before or after Confluence operates on it
 • Inject content
 • Modify content



                                                          24
Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
  content before or after Confluence operates on it
 • Inject content
 • Modify content
 • Remove content

                                                          24
Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
  content before or after Confluence operates on it
 • Inject content
 • Modify content
 • Remove content

                                                          24
Transformer Pipeline
                    With great power
• Why?
• Allows a plugin developers to intercept the Confluence
  content before or after Confluence operates on it
 • Inject content
 • Modify content
                   comes
 • Remove content
            great responsibility
                                                          24
The New Macro Interface




                          25
The New Macro Interface
• Confluence 4.0 introduces a new Macro
  interface




                                         25
The New Macro Interface
• Confluence 4.0 introduces a new Macro
  interface
• Required for 4.0 integration




                                         25
The New Macro Interface
• Confluence 4.0 introduces a new Macro
  interface
• Required for 4.0 integration
• Default Macro body is rendered! (i.e. View
  Format - HTML)



                                               25
The New Macro Interface
• Confluence 4.0 introduces a new Macro
  interface
• Required for 4.0 integration
• Default Macro body is rendered! (i.e. View
  Format - HTML)
• How do you avoid this?

                                               25
The New Macro Interface




                          26
The New Macro Interface
@Override
public String execute(
    Map<String, String> parameters, String body, ConversionContext context)
    throws MacroExecutionException {




                                                                              26
The New Macro Interface
@Override
public String execute(
    Map<String, String> parameters, String body, ConversionContext context)
    throws MacroExecutionException {


@Override
@RequiresFormat(Format.Storage)
public String execute(
    Map<String, String> parameters, String body, ConversionContext context)
    throws MacroExecutionException {




                                                                              26
The New Macro Interface




                          27
The New Macro Interface
• If you intend to output the body - You need to
  render it!




                                                   27
The New Macro Interface
• If you intend to output the body - You need to
  render it!
• Confluence provides an easy mechanism to do
  this




                                                   27
The New Macro Interface
• If you intend to output the body - You need to
  render it!
• Confluence provides an easy mechanism to do
  this
• The XhtmlContent spring bean




                                                   27
The New Macro Interface
• If you intend to output the body - You need to
  render it!
• Confluence provides an easy mechanism to do
  this
• The XhtmlContent spring bean
 • Storage Format to View


                                                   27
The New Macro Interface
• If you intend to output the body - You need to
  render it!
• Confluence provides an easy mechanism to do
  this
• The XhtmlContent spring bean
 • Storage Format to View
 • Wiki Markup to Storage Format
                                                   27
The New Macro Interface




                          28
The New Macro Interface
 private final XhtmlContent xhtmlContent;

 public MyAwesomeMacro(XhtmlContent xhtmlContent) {
     this.xhtmlContent = xhtmlContent;
 }




                                                      28
The New Macro Interface
    private final XhtmlContent xhtmlContent;

    public MyAwesomeMacro(XhtmlContent xhtmlContent) {
        this.xhtmlContent = xhtmlContent;
    }


@Override
@RequiresFormat(Format.Storage)
public String execute(Map<String, String> parameters, String body,
                ConversionContext context) throws MacroExecutionException {
    try {
        return xhtmlContent.convertStorageToView(body, context);
    }
    ...
                                                                              28
Demo




       29
Demo


   Eric Chiang




                 29
Gliffy Confluence Plugin




            Confluence 3.5




                             30
Gliffy Confluence Plugin




    Confluence 3.5        Confluence 4.0


                                           31
Macro Override
    • <web-resource>
       • editor scope
• Overrides default macro with our own function (insert menu and autocomplete)


• function gliffyCreateEdit()
  • Constructs an AUI Dialog
  • Ajax calls (getting templates, recent diagrams)

  • Launches the Gliffy editor
                                                                                 32
Macro Image Placeholder
• Shows an attachment as an image
  or renders it thru a pipeline




                                    33
Property Panel
• Edit button (macro override)
• Image resize buttons
• Border button
• More button
   AUI Dialog




                                 34
Property Panel - Image Resize



• Simple macro re-render




                                 35
Insert Menu
• web-item




              36
Thanks Eric




              37
Thanks Eric
• Insert Menu Web Item




                         37
Thanks Eric
• Insert Menu Web Item
• Macro Override




                         37
Thanks Eric
• Insert Menu Web Item
• Macro Override
• Property Panel




                         37
Thanks Eric
• Insert Menu Web Item
• Macro Override
• Property Panel
• Image Macro Placeholder




                            37
Passing The Torch




                    38
Passing The Torch




                    38
Passing The Torch
• Confluence Ecosystem
  Integration




                        38
Passing The Torch
• Confluence Ecosystem
  Integration
• Technical Point of Contact
  inside Confluence




                               38
Passing The Torch
• Confluence Ecosystem
  Integration
• Technical Point of Contact
  inside Confluence
• Introducing......



                               38
Joseph Clark




               38
Joseph Clark
• Confluence Team Lead




                        38
Joseph Clark
• Confluence Team Lead
• 2 Years on the Team




                        38
Joseph Clark
• Confluence Team Lead
• 2 Years on the Team
• .NET Background




                        38
Joseph Clark
• Confluence Team Lead
• 2 Years on the Team
• .NET Background
• All-round awesome fellow!




                              38
Joseph Clark
• Confluence Team Lead
• 2 Years on the Team
• .NET Background
• All-round awesome fellow!
• jclark@atlassian.com


                              38
Get Started Today




                    39
Get Started Today




                    39
Get Started Today
• Try out your plugin in
  Confluence 4.0




                           39
Get Started Today
• Try out your plugin in
  Confluence 4.0
• Play with the new plugin
  points




                             39
Get Started Today
• Try out your plugin in
  Confluence 4.0
• Play with the new plugin
  points
• Check out the documentation
  http://atlss.in/confluence4


                                39
Questions



     ?
            Joseph Clark
            jclark@atlassian.com

            Ryan Thomas
            rthomas@atlassian.com

            http://atlss.in/confluence4

            #atlascamp


                                          40
Thank you!

More Related Content

PDF
Đề tài: Thuật toán khai phá dữ liệu trong quản lý địa chỉ Internet
PDF
Giải pháp phòng ngừa rủi ro tín dụng tại ngân hàng thương mại cổ phần á châu ...
 
DOC
Chuong 1
PDF
Luận án: Nâng cao năng lực quản trị rủi ro tín dụng tại Ngân hàng thương mại ...
PDF
Phân tích thực trạng hoạt động cho vay tiêu dùng tại ngân hàng tmcp việt nam ...
DOC
Nâng cao chất lượng cho vay ngắn hạn của Ngân hàng SeABank, 9đ
DOC
Tiểu luận Xử lý sai phạm về thu chi tài chính trong nhà trường.doc
DOCX
Bài tiểu luận hệ thống lái trợ lực thủy lực
Đề tài: Thuật toán khai phá dữ liệu trong quản lý địa chỉ Internet
Giải pháp phòng ngừa rủi ro tín dụng tại ngân hàng thương mại cổ phần á châu ...
 
Chuong 1
Luận án: Nâng cao năng lực quản trị rủi ro tín dụng tại Ngân hàng thương mại ...
Phân tích thực trạng hoạt động cho vay tiêu dùng tại ngân hàng tmcp việt nam ...
Nâng cao chất lượng cho vay ngắn hạn của Ngân hàng SeABank, 9đ
Tiểu luận Xử lý sai phạm về thu chi tài chính trong nhà trường.doc
Bài tiểu luận hệ thống lái trợ lực thủy lực

What's hot (14)

PDF
Đề tài đảm bảo tín dụng tại ngân hàng, RẤT HAY, ĐIỂM CAO
PPT
Học thuyết hình thái kinh tế xã hội dành cho Học viên Cao Học không chuyên ng...
DOCX
Tiểu-luận-Triết-học.docx
PDF
Pháp luật điều chỉnh hoạt động cấp tín dụng tại Sacombank, HOT
DOC
nâng cáo chất lượng thẩm định tín dụng đối với doanh nghiệp vừa và nhỏ tại ng...
PPT
Stress&Coping
DOC
LV: Hoạt động cho vay tiêu dùng cá nhân tại ngân hàng nông nghiệp, HAY!
DOC
Đề tài: Phần mềm quản lý học sinh cấp 3, HAY
DOCX
Đề tài: Giải pháp nâng cao hoạt động cho vay tiêu dùng tại AGRIBANK
PDF
Đề tài cho vay ngắn hạn tại ngân hàng thương mại, RẤT HAY, ĐIỂM 8
PPTX
ABRAHAM HAROLD MASLOW &lt;1908>
PDF
Zbgthamdinhtindung
PDF
Khóa Luận Tốt Nghiệp - Bản Chính Thức - Phân Tích Rủi Ro Tín Dụng Tại Ngân Hà...
DOC
HOÀN THIỆN CÔNG TÁC QUẢN TRỊ RỦI RO TÍN DỤNG TIÊU DÙNG ĐỐI VỚI KHÁCH HÀNG CÁ ...
Đề tài đảm bảo tín dụng tại ngân hàng, RẤT HAY, ĐIỂM CAO
Học thuyết hình thái kinh tế xã hội dành cho Học viên Cao Học không chuyên ng...
Tiểu-luận-Triết-học.docx
Pháp luật điều chỉnh hoạt động cấp tín dụng tại Sacombank, HOT
nâng cáo chất lượng thẩm định tín dụng đối với doanh nghiệp vừa và nhỏ tại ng...
Stress&Coping
LV: Hoạt động cho vay tiêu dùng cá nhân tại ngân hàng nông nghiệp, HAY!
Đề tài: Phần mềm quản lý học sinh cấp 3, HAY
Đề tài: Giải pháp nâng cao hoạt động cho vay tiêu dùng tại AGRIBANK
Đề tài cho vay ngắn hạn tại ngân hàng thương mại, RẤT HAY, ĐIỂM 8
ABRAHAM HAROLD MASLOW &lt;1908>
Zbgthamdinhtindung
Khóa Luận Tốt Nghiệp - Bản Chính Thức - Phân Tích Rủi Ro Tín Dụng Tại Ngân Hà...
HOÀN THIỆN CÔNG TÁC QUẢN TRỊ RỦI RO TÍN DỤNG TIÊU DÙNG ĐỐI VỚI KHÁCH HÀNG CÁ ...
Ad

Similar to Pimp My Confluence Plugin - AtlasCamp 2011 (20)

PDF
AtlasCamp 2013: Confluence patterns
PDF
Indexed primefaces users_guide_3_5
PDF
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
PDF
WebObjects Developer Tools
PDF
Connect 2014 JMP101: Java for XPages Development
PDF
Primefaces mobile users_guide_0_9
PPTX
JavaScript for ASP.NET programmers (webcast) upload
PDF
Exploring Maven SVN GIT
PDF
Instant download Developing Backbone js Applications Addy Osmani pdf all chapter
PDF
Developing Backbone js Applications Addy Osmani
PDF
Primefaces users guide_3_3
PDF
Developing Backbonejs Applications Early Release Addy Osmani
KEY
Beginning jQuery Mobile
PPTX
What's New in MongoDB 2.6
PDF
Building Isomorphic Apps (JSConf.Asia 2014)
PDF
Developing Backbone js Applications Addy Osmani
PDF
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
KEY
Preparing for Confluence 4.1
PDF
Ember vs Backbone
PDF
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
AtlasCamp 2013: Confluence patterns
Indexed primefaces users_guide_3_5
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
WebObjects Developer Tools
Connect 2014 JMP101: Java for XPages Development
Primefaces mobile users_guide_0_9
JavaScript for ASP.NET programmers (webcast) upload
Exploring Maven SVN GIT
Instant download Developing Backbone js Applications Addy Osmani pdf all chapter
Developing Backbone js Applications Addy Osmani
Primefaces users guide_3_3
Developing Backbonejs Applications Early Release Addy Osmani
Beginning jQuery Mobile
What's New in MongoDB 2.6
Building Isomorphic Apps (JSConf.Asia 2014)
Developing Backbone js Applications Addy Osmani
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Preparing for Confluence 4.1
Ember vs Backbone
MVP Community Camp 2014 - How to use enhanced features of Windows 8.1 Store ...
Ad

More from Atlassian (20)

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

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Mushroom cultivation and it's methods.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Getting Started with Data Integration: FME Form 101
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Machine learning based COVID-19 study performance prediction
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Tartificialntelligence_presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
MIND Revenue Release Quarter 2 2025 Press Release
Mushroom cultivation and it's methods.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
A comparative study of natural language inference in Swahili using monolingua...
OMC Textile Division Presentation 2021.pptx
NewMind AI Weekly Chronicles - August'25-Week II
A comparative analysis of optical character recognition models for extracting...
TLE Review Electricity (Electricity).pptx
Getting Started with Data Integration: FME Form 101
cloud_computing_Infrastucture_as_cloud_p
Machine learning based COVID-19 study performance prediction
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectral efficient network and resource selection model in 5G networks
Tartificialntelligence_presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
Mobile App Security Testing_ A Comprehensive Guide.pdf

Pimp My Confluence Plugin - AtlasCamp 2011

  • 2. Confluence 4.0 Integrating your plugin as a first class citizen Ryan Thomas Developer, Atlassian http://atlss.in/confluence4 #atlascamp 2
  • 5. About Me • Confluence Developer • Worked on 4.0 since January 2010 3
  • 6. About Me • Confluence Developer • Worked on 4.0 since January 2010 • Managed a lot of the ecosystem integration 3
  • 7. About Me • Confluence Developer • Worked on 4.0 since January 2010 • Managed a lot of the ecosystem integration • Deployed 4.0 to the Atlassian internal instances 3
  • 8. Agenda 4
  • 9. Agenda 4
  • 11. Agenda • Editor Plugin Points • Transformer Pipeline 4
  • 12. Agenda • Editor Plugin Points • Transformer Pipeline • XHTML in Macros 4
  • 13. Agenda • Editor Plugin Points • Transformer Pipeline • XHTML in Macros • Demonstration 4
  • 15. Editor Terminology Rich Text Editor 5
  • 16. Editor Terminology Toolbar 5
  • 17. Editor Terminology Insert Menu 5
  • 18. Editor Terminology Formatting Menu 5
  • 20. Editor Terminology Macro Placeholder 5
  • 21. Editor Terminology Macro Property Panel 5
  • 24. Formatting Menu • Plug into the Formatting menu in the Toolbar 6
  • 25. Formatting Menu • Plug into the Formatting menu in the Toolbar • Allows you to interact with the TinyMCE formatting styles 6
  • 26. Formatting Menu • Plug into the Formatting menu in the Toolbar • Allows you to interact with the TinyMCE formatting styles • Done as a web-item 6
  • 28. Formatting Menu <web-item key="editor-awesome-format" name="Awesome Format" section="system.editor.more.formats" weight="10"> <label key="my.plugin.awesome.format"/> <link linkId="my-awesome-format"/> </web-item> 7
  • 29. Formatting Menu <web-item key="editor-awesome-format" name="Awesome Format" section="system.editor.more.formats" weight="10"> <label key="my.plugin.awesome.format"/> <link linkId="my-awesome-format"/> </web-item> $("#my-awesome-button").click(function(){ tinymce.activeEditor.execCommand("FormatBlock", false, "samp"); }); 7
  • 30. Formatting Menu <web-item key="editor-awesome-format" name="Awesome Format" section="system.editor.more.formats" weight="10"> <label key="my.plugin.awesome.format"/> <link linkId="my-awesome-format"/> </web-item> system.editor.more.formats $("#my-awesome-button").click(function(){ tinymce.activeEditor.execCommand("FormatBlock", false, "samp"); }); 7
  • 33. Insert Menu • Add your macro to the Insert menu in the Toolbar 8
  • 34. Insert Menu • Add your macro to the Insert menu in the Toolbar • Default behaviour opens Macro Browser 8
  • 35. Insert Menu • Add your macro to the Insert menu in the Toolbar • Default behaviour opens Macro Browser • Done as a web-item 8
  • 37. Insert Menu <web-item key="editor-my-macro" name="Insert Menu Link - My Macro" section="system.editor.featured.macros.default" weight="100"> <label key="my.plugin.macro"/> <link linkId="mymacro"/> </web-item> 9
  • 38. Insert Menu <web-item key="editor-my-macro" name="Insert Menu Link - My Macro" section="system.editor.featured.macros.default" weight="100"> <label key="my.plugin.macro"/> <link linkId="mymacro"/> </web-item> system.editor.featured.macros.default 9
  • 39. Overriding The Macro Browser 10
  • 40. Overriding The Macro Browser • Want to use a custom dialog? 10
  • 41. Overriding The Macro Browser • Want to use a custom dialog? • Want to perform some action before opening the Macro Browser? 10
  • 42. Overriding The Macro Browser • Want to use a custom dialog? • Want to perform some action before opening the Macro Browser? • Want your macro to appear as a native Confluence component? 10
  • 43. Overriding The Macro Browser 11
  • 44. Overriding The Macro Browser AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener: function(macro) { // Custom logic goes here } }); 11
  • 45. Overriding The Macro Browser AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener: function(macro) { // Custom logic goes here } }); • This will affect all the following areas: 11
  • 46. Overriding The Macro Browser AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener: function(macro) { // Custom logic goes here } }); • This will affect all the following areas: • Insert Menu 11
  • 47. Overriding The Macro Browser AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener: function(macro) { // Custom logic goes here } }); • This will affect all the following areas: • Insert Menu • Autocomplete 11
  • 48. Overriding The Macro Browser AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener: function(macro) { // Custom logic goes here } }); • This will affect all the following areas: • Insert Menu • Autocomplete • Property panel Edit button 11
  • 49. Overriding The Macro Browser AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener: function(macro) { // Custom logic goes here } }); • This will affect all the following areas: • Insert Menu • Autocomplete • Property panel Edit button • Manually selecting inside the macro browser 11
  • 52. Image Macro Placeholders • Replaces the Macro Placeholder 12
  • 53. Image Macro Placeholders • Replaces the Macro Placeholder • Plugins can generate their own image, or reference static images 12
  • 54. Image Macro Placeholders • Replaces the Macro Placeholder • Plugins can generate their own image, or reference static images • Only applicable to Bodiless Macros 12
  • 55. Image Macro Placeholders • Replaces the Macro Placeholder • Plugins can generate their own image, or reference static images • Only applicable to Bodiless Macros • Macro Placeholder chrome can be applied optionally 12
  • 56. Image Macro Placeholders • Replaces the Macro Placeholder • Plugins can generate their own image, or reference static images • Only applicable to Bodiless Macros • Macro Placeholder chrome can be applied optionally 12
  • 57. Image Macro Placeholders • Replaces the Macro Placeholder • Plugins can generate their own image, or reference static images • Only applicable to Bodiless Macros • Macro Placeholder chrome can be applied optionally 12
  • 59. Image Macro Placeholders public interface EditorImagePlaceholder { ImagePlaceholder getImagePlaceholder( Map<String, String> parameters, ConversionContext context); } 13
  • 60. Image Macro Placeholders public interface EditorImagePlaceholder { ImagePlaceholder getImagePlaceholder( Map<String, String> parameters, ConversionContext context); } public interface ImagePlaceholder { String getUrl(); Dimensions getDimensions(); boolean applyPlaceholderChrome(); } 13
  • 64. Macro Property Panel • Provides contextual actions for the macro 14
  • 65. Macro Property Panel • Provides contextual actions for the macro • Provides Edit and Remove buttons 14
  • 66. Macro Property Panel • Provides contextual actions for the macro • Provides Edit and Remove buttons • Custom buttons for your macros 14
  • 67. Macro Property Panel • Provides contextual actions for the macro • Provides Edit and Remove buttons • Custom buttons for your macros 14
  • 69. Macro Property Panel atlassian-plugin.xml <xhtml-macro key="status" name="status" ...> <!-- SNIP --> <property-panel> <spacer/> <button id="Grey" label=""/> <button id="Red" label=""/> <button id="Yellow" label=""/> <button id="Green" label=""/> <spacer/> </property-panel> </xhtml-macro> 15
  • 71. Macro Property Panel AJS.Confluence.PropertyPanel.Macro.registerButtonHandler("Grey", function(e, macroNode) { // Custom button logic goes here updateMacro(macroNode, "Grey"); // Plugin function }); See complete example here: https://bitbucket.org/rthomas/confluence-status-macro/ 16
  • 80. Parameter Placeholder <parameters> <default> <option key="showValueInPlaceholder" value="true" /> </default> <parameter name="key" type="string"> <option key="showKeyInPlaceholder" value="false" /> <option key="showValueInPlaceholder" value="true" /> </parameter> <parameter name="server" type="string"> <option key="showKeyInPlaceholder" value="false" /> <option key="showValueInPlaceholder" value="false" /> </parameter> </parameters> 18
  • 83. Editor Plugin Points • Formatting Menu 19
  • 84. Editor Plugin Points • Formatting Menu • Insert Menu & Overrides 19
  • 85. Editor Plugin Points • Formatting Menu • Insert Menu & Overrides • Image Placeholders 19
  • 86. Editor Plugin Points • Formatting Menu • Insert Menu & Overrides • Image Placeholders • Macro Property Panel 19
  • 87. Editor Plugin Points • Formatting Menu • Insert Menu & Overrides • Image Placeholders • Macro Property Panel • Parameter Placeholder 19
  • 90. Transformer Pipeline • Confluence 4.0 contains a completely new rendering engine 20
  • 91. Transformer Pipeline • Confluence 4.0 contains a completely new rendering engine • Part of this engine is the Transformer Pipeline 20
  • 92. Transformer Pipeline • Confluence 4.0 contains a completely new rendering engine • Part of this engine is the Transformer Pipeline • This is available to all plugins 20
  • 94. Transformer Pipeline • Confluence 4.0 stores its data in XHTML, this is known as Storage Format - (No more wiki-markup! ) 21
  • 95. Transformer Pipeline • Confluence 4.0 stores its data in XHTML, this is known as Storage Format - (No more wiki-markup! ) • We have three formats, however only the Storage Format is persisted 21
  • 96. Transformer Pipeline • Confluence 4.0 stores its data in XHTML, this is known as Storage Format - (No more wiki-markup! ) • We have three formats, however only the Storage Format is persisted • View Format: HTML 21
  • 97. Transformer Pipeline • Confluence 4.0 stores its data in XHTML, this is known as Storage Format - (No more wiki-markup! ) • We have three formats, however only the Storage Format is persisted • View Format: HTML • Editor Format: HTML with data attributes 21
  • 99. Transformer Pipeline • The pipeline controls the rendering of Confluence content from one format to another 22
  • 100. Transformer Pipeline • The pipeline controls the rendering of Confluence content from one format to another • There are three pipelines inside of the rendering engine: 22
  • 101. Transformer Pipeline • The pipeline controls the rendering of Confluence content from one format to another • There are three pipelines inside of the rendering engine: • Storage to View (viewing a page) 22
  • 102. Transformer Pipeline • The pipeline controls the rendering of Confluence content from one format to another • There are three pipelines inside of the rendering engine: • Storage to View (viewing a page) • Storage to Edit (editing a page) 22
  • 103. Transformer Pipeline • The pipeline controls the rendering of Confluence content from one format to another • There are three pipelines inside of the rendering engine: • Storage to View (viewing a page) • Storage to Edit (editing a page) • Edit to Storage (saving a page) 22
  • 105. Transformer Pipeline Storage Format View Edit Format Format 23
  • 108. Transformer Pipeline • Why? • Allows a plugin developers to intercept the Confluence content before or after Confluence operates on it 24
  • 109. Transformer Pipeline • Why? • Allows a plugin developers to intercept the Confluence content before or after Confluence operates on it • Inject content 24
  • 110. Transformer Pipeline • Why? • Allows a plugin developers to intercept the Confluence content before or after Confluence operates on it • Inject content • Modify content 24
  • 111. Transformer Pipeline • Why? • Allows a plugin developers to intercept the Confluence content before or after Confluence operates on it • Inject content • Modify content • Remove content 24
  • 112. Transformer Pipeline • Why? • Allows a plugin developers to intercept the Confluence content before or after Confluence operates on it • Inject content • Modify content • Remove content 24
  • 113. Transformer Pipeline With great power • Why? • Allows a plugin developers to intercept the Confluence content before or after Confluence operates on it • Inject content • Modify content comes • Remove content great responsibility 24
  • 114. The New Macro Interface 25
  • 115. The New Macro Interface • Confluence 4.0 introduces a new Macro interface 25
  • 116. The New Macro Interface • Confluence 4.0 introduces a new Macro interface • Required for 4.0 integration 25
  • 117. The New Macro Interface • Confluence 4.0 introduces a new Macro interface • Required for 4.0 integration • Default Macro body is rendered! (i.e. View Format - HTML) 25
  • 118. The New Macro Interface • Confluence 4.0 introduces a new Macro interface • Required for 4.0 integration • Default Macro body is rendered! (i.e. View Format - HTML) • How do you avoid this? 25
  • 119. The New Macro Interface 26
  • 120. The New Macro Interface @Override public String execute( Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException { 26
  • 121. The New Macro Interface @Override public String execute( Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException { @Override @RequiresFormat(Format.Storage) public String execute( Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException { 26
  • 122. The New Macro Interface 27
  • 123. The New Macro Interface • If you intend to output the body - You need to render it! 27
  • 124. The New Macro Interface • If you intend to output the body - You need to render it! • Confluence provides an easy mechanism to do this 27
  • 125. The New Macro Interface • If you intend to output the body - You need to render it! • Confluence provides an easy mechanism to do this • The XhtmlContent spring bean 27
  • 126. The New Macro Interface • If you intend to output the body - You need to render it! • Confluence provides an easy mechanism to do this • The XhtmlContent spring bean • Storage Format to View 27
  • 127. The New Macro Interface • If you intend to output the body - You need to render it! • Confluence provides an easy mechanism to do this • The XhtmlContent spring bean • Storage Format to View • Wiki Markup to Storage Format 27
  • 128. The New Macro Interface 28
  • 129. The New Macro Interface private final XhtmlContent xhtmlContent; public MyAwesomeMacro(XhtmlContent xhtmlContent) { this.xhtmlContent = xhtmlContent; } 28
  • 130. The New Macro Interface private final XhtmlContent xhtmlContent; public MyAwesomeMacro(XhtmlContent xhtmlContent) { this.xhtmlContent = xhtmlContent; } @Override @RequiresFormat(Format.Storage) public String execute(Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException { try { return xhtmlContent.convertStorageToView(body, context); } ... 28
  • 131. Demo 29
  • 132. Demo Eric Chiang 29
  • 133. Gliffy Confluence Plugin Confluence 3.5 30
  • 134. Gliffy Confluence Plugin Confluence 3.5 Confluence 4.0 31
  • 135. Macro Override • <web-resource> • editor scope • Overrides default macro with our own function (insert menu and autocomplete) • function gliffyCreateEdit() • Constructs an AUI Dialog • Ajax calls (getting templates, recent diagrams) • Launches the Gliffy editor 32
  • 136. Macro Image Placeholder • Shows an attachment as an image or renders it thru a pipeline 33
  • 137. Property Panel • Edit button (macro override) • Image resize buttons • Border button • More button AUI Dialog 34
  • 138. Property Panel - Image Resize • Simple macro re-render 35
  • 140. Thanks Eric 37
  • 141. Thanks Eric • Insert Menu Web Item 37
  • 142. Thanks Eric • Insert Menu Web Item • Macro Override 37
  • 143. Thanks Eric • Insert Menu Web Item • Macro Override • Property Panel 37
  • 144. Thanks Eric • Insert Menu Web Item • Macro Override • Property Panel • Image Macro Placeholder 37
  • 147. Passing The Torch • Confluence Ecosystem Integration 38
  • 148. Passing The Torch • Confluence Ecosystem Integration • Technical Point of Contact inside Confluence 38
  • 149. Passing The Torch • Confluence Ecosystem Integration • Technical Point of Contact inside Confluence • Introducing...... 38
  • 152. Joseph Clark • Confluence Team Lead • 2 Years on the Team 38
  • 153. Joseph Clark • Confluence Team Lead • 2 Years on the Team • .NET Background 38
  • 154. Joseph Clark • Confluence Team Lead • 2 Years on the Team • .NET Background • All-round awesome fellow! 38
  • 155. Joseph Clark • Confluence Team Lead • 2 Years on the Team • .NET Background • All-round awesome fellow! • jclark@atlassian.com 38
  • 158. Get Started Today • Try out your plugin in Confluence 4.0 39
  • 159. Get Started Today • Try out your plugin in Confluence 4.0 • Play with the new plugin points 39
  • 160. Get Started Today • Try out your plugin in Confluence 4.0 • Play with the new plugin points • Check out the documentation http://atlss.in/confluence4 39
  • 161. Questions ? Joseph Clark jclark@atlassian.com Ryan Thomas rthomas@atlassian.com http://atlss.in/confluence4 #atlascamp 40

Editor's Notes