SlideShare a Scribd company logo
Making Confluence
Macros Easy
(for the user)
(in 5 minutes)
Throw your hands in the air!
• Written a Confluence plugin?
• Written a Confluence macro?
• Added basic metadata for all macros?
• For all macro parameters?
• With a custom user interface?
Fear & Loathing
• Confluence 4.0 == no wiki markup editor
• Macro metadata or bust
Always look on the bright side
• Macro Browser is your advertisement
• Browse / Search
• No more notation guide
• Five minutes
What’s covered?
• Basic metadata - the browser
• Parameter metadata - the macro form
• JavaScript hook intro
• Demo (FIVE MINUTES)
Who’s talking?
• David Taylor
• Confluence Developer
• 3 years on front-end features
• Co-wrote the Macro Browser
Macro Browser
History 101
June 2009 - Confluence 3.0
December 2009 - Confluence 3.1
March 2010 - Confluence 3.2
July 2010 - Confluence 3.3
Basic Metadata
The Sample macro
• Just tests input/output
• Keeps your eyes on the form,
ignores the rendered output
The generated descriptor.
<macro name="confluence-macro-metadata-plugin"
class="demo.ExampleMacro"
key="my-macro">
<!-- TODO: Add macro description -->
<!-- <description></description> -->
</macro>
Your macro looks like... meh
You might have
missed that?
You need:
NINJA HAMSTER
<macro name="my-macro"
class="demo.ExampleMacro"
key="my-macro"
icon="/download/resources/my-plugin
/images/ninja-hamster.png" >
<description>A macro that tests metadata</description>
</macro>
Some basic metadata
<resource type="download" key="images" name="images/"
location="demo/images"/>
<resource type="i18n" name="i18n" location="demo/i18n" />
my-plugin.my-macro.label=Awesome Macro
my-plugin.my-macro.desc=
An awesome test macro that displays the parameters
you pass it.
I18N by convention
Now yo pimpin’
Search on description
Autocomplete on the cheap
<macro name="my-macro"
class="demo.ExampleMacro"
key="my-macro"
icon="/download/resources/my-plugin
/images/ninja-hamster.png"
documentation-url="http://atlassian.com">
<description>A macro that tests metadata</description>
</macro>
documentation-url
The basic Macro form
The basic Macro form
<parameters>
But first...
Categories
<macro name="my-macro"
class="demo.ExampleMacro"
key="my-macro"
icon="/download/resources/my-plugin
/images/ninja-hamster.png"
documentation-url="http://atlassian.com">
<description>A macro that tests metadata</description>
<category>admin</category>
</macro>
Eh? Where’s the Awesome?
Parameters Matter
<macro name="my-macro"
class="demo.ExampleMacro"
key="my-macro"
icon="/download/resources/my-plugin
/images/ninja-hamster.png"
documentation-url="http://atlassian.com">
<description>A macro that tests metadata</description>
<category>admin</category>
<parameters/>
</macro>
Browsing is GO
<parameters/>
ALWAYS
ADD
And your little form, too!
<parameter>
Basic types - string
<parameters>
<parameter name="string-param" type="string"/>
</parameters>
my-plugin.my-macro.param.string-param.label=
A String Parameter
my-plugin.my-macro.param.string-param.desc=
This field just takes a string. Anything will do.
I18N by convention 2
That’s Some String...
But my parameters aren’t named!
{my-macro:foo}
<parameters>
<parameter name="" type="string"/>
<parameters>
my-plugin.my-macro.param..label=
A String Parameter
But my parameters aren’t named!
{my-macro:foo}
{my-macro:foo|bar}
<parameters>
<parameter name="" type="string"/>
<parameters>
<parameters>
<parameter name="" type="string"/>
<parameter name="" type="string"/>
<parameters>
<parameters>
<parameter name="" type="string">
<alias name="str-prm"/>
<alias name="string-param"/>
</parameter>
<parameters>
Multiple names? Aliases!
{my-macro:foo}
{my-macro:str-prm=foo}
{my-macro:string-param=foo}
my-plugin.my-macro.param..label=
A String Parameter
<parameters>
<parameter name="string-param" type="string">
<alias name=""/>
<alias name="str-prm"/>
</parameter>
<parameters>
Multiple names? Aliases!
{my-macro:foo}
{my-macro:str-prm=foo}
{my-macro:string-param=foo}
my-plugin.my-macro.param.string-param.label=
A String Parameter
Making fields required
<parameters>
<parameter name="string-param" type="string"
required="true"/>
<parameters>
NoValue, No Insert
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
Body just works
public boolean hasBody()
{
return false;
}
public boolean hasBody()
{
return true;
}
my-plugin.my-macro.body.label=
Macro Body Here
my-plugin.my-macro.body.desc=
Text in here gets rendered in the macro output
Body just works
Body just works
Eviction Notice
Beyond The String
Basic types - boolean
<parameters>
...
<parameter name="boolean-param" type="boolean"/>
...
</parameters>
Basic types - enum
<parameter name="enum-param" type="enum" required="true">
<value name=""/>
<value name="foo"/>
<value name="bar"/>
<value name="baz"/>
</parameter>
Basic types - other
<parameter name="int-param" type="int"/>
<parameter name="relativedate-param" type="relativedate"/>
<parameter name="url-param" type="url"/>
<parameter name="color-param" type="color"/>
<parameter name="label-param" type="label"/>
<parameter name="date-param" type="date"/>
<parameter name="group-param" type="group"/>
PARKED
Defaults - just for looks
<parameter name="int-param" type="int" default="42"/>
Order matters
<parameter name="username-param"
type="username"
required="true"/>
<parameter name="boolean-param"
type="boolean"/>
<parameter name="string-param"
type="string"/>
<parameter name="int-param"
type="int"/>
Funky Shit
(oh my god, that’s some)
Autocomplete fields - Hard?
Not really
<parameter name="content-param" type="confluence-content"/>
Filtering? <option>
<parameter name="content-param" type="confluence-content">
<option key="type" value="page"/>
</parameter>
Spaces, Users, Easy
<parameter name="spacekey-param" type="spacekey"/>
<parameter name="username-param" type="username"/>
Here there be Dragons
Multiples? Er. Um.
<parameter name="username-param" type="username"
multiple="true"/>
JavaScript hooks
<web-resource key="macro-browser-smart-fields"
name="Macro Browser Smart Fields">
<resource type="download"
name="oc-macro-fields.js"
location="javascript/oc-macro-fields.js" />
<dependency>confluence.editor.actions:
editor-macro-browser</dependency>
<context>macro-browser</context>
</web-resource>
No API, No docs, No worries
AJS.MacroBrowser.setMacroJsOverride(macroName, override)
The override object has optional properties:
- fields,
- beforeParamsSet,
- beforeParamsRetrieved
- and some _really_ obscure ones
No API, No docs, No worries
override.fields
- overrides the parameter field UI based on
parameter type or parameter name
override.fields.string[“my-param”] = function(param) {
return AJS.MacroBrowser.ParameterFields["_hidden"]
(param, {});
}
- uses a hidden HTML text field for the “my-param” string
parameter.
No API, No docs, No worries
override.beforeParamsSet
- a function to run before an existing macro is loaded into
the parameter form fields
override.beforeParamsRetrieved
- a function to run before the form fields are converted
into a macro parameter string
Office Connector
JS madness, then
a 5 minute demo...
...using the Atlassian SDK...
• atlas-run
• atlas-cli
... and FastDev
• Bleeding edge!
• Re-installs the plugin on page refresh, based
on a URL filter
Your move!
• This slideshow in the usual place
• List your macros
• Update for the Browser
• Update for the Form
• Go nuts with the JavaScript
Questions?
• david.taylor@atlassian.com
• CAC - http://confluence.atlassian.com/display/
CONFDEV/Including+Information+in+your
+Macro+for+the+Macro+Browser
54321

More Related Content

KEY
Pimp My Confluence Plugin - AtlasCamp 2011
Atlassian
 
PPTX
Javascript Design Patterns
Iván Fernández Perea
 
PDF
Secure your SPA with Auth0
Joel Lord
 
PPTX
Getting Started with React.js
Smile Gupta
 
PPTX
Js: master prototypes
Barak Drechsler
 
PDF
Advanced front-end automation with npm scripts
k88hudson
 
PDF
Aura Framework Overview
rajdeep
 
PDF
slingmodels
Ankur Chauhan
 
Pimp My Confluence Plugin - AtlasCamp 2011
Atlassian
 
Javascript Design Patterns
Iván Fernández Perea
 
Secure your SPA with Auth0
Joel Lord
 
Getting Started with React.js
Smile Gupta
 
Js: master prototypes
Barak Drechsler
 
Advanced front-end automation with npm scripts
k88hudson
 
Aura Framework Overview
rajdeep
 
slingmodels
Ankur Chauhan
 

What's hot (20)

PPTX
Apache maven 2 overview
Return on Intelligence
 
PDF
Hands On with Maven
Sid Anand
 
PDF
Gradle Introduction
Dmitry Buzdin
 
PDF
AEM Sightly Template Language
Gabriel Walt
 
PPTX
Selenium-Locators
Mithilesh Singh
 
PPS
Selenium Demo
ankitslide
 
PPTX
SwtBot: Unit Testing Made Easy
Ankit Goel
 
PDF
Software Design Patterns in Laravel by Phill Sparks
Phill Sparks
 
PDF
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Edureka!
 
PPSX
CSS Box Model Presentation
Reed Crouch
 
PDF
Introduction to Vue.js
Meir Rotstein
 
PPTX
Blazor - An Introduction
JamieTaylor112
 
PPTX
Python games
molw
 
PPTX
Spring MVC
Emprovise
 
PDF
Forge UI: A New Way to Customize the Atlassian User Experience
Atlassian
 
PDF
Object Oriented Programming in JavaScript
zand3rs
 
PDF
React JS & Functional Programming Principles
Andrii Lundiak
 
PDF
Customizing Theme and Style for Material Design : Droid Kaigi 2016
Yuki Anzai
 
PDF
React new features and intro to Hooks
Soluto
 
KEY
Introduction to Django
James Casey
 
Apache maven 2 overview
Return on Intelligence
 
Hands On with Maven
Sid Anand
 
Gradle Introduction
Dmitry Buzdin
 
AEM Sightly Template Language
Gabriel Walt
 
Selenium-Locators
Mithilesh Singh
 
Selenium Demo
ankitslide
 
SwtBot: Unit Testing Made Easy
Ankit Goel
 
Software Design Patterns in Laravel by Phill Sparks
Phill Sparks
 
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Edureka!
 
CSS Box Model Presentation
Reed Crouch
 
Introduction to Vue.js
Meir Rotstein
 
Blazor - An Introduction
JamieTaylor112
 
Python games
molw
 
Spring MVC
Emprovise
 
Forge UI: A New Way to Customize the Atlassian User Experience
Atlassian
 
Object Oriented Programming in JavaScript
zand3rs
 
React JS & Functional Programming Principles
Andrii Lundiak
 
Customizing Theme and Style for Material Design : Droid Kaigi 2016
Yuki Anzai
 
React new features and intro to Hooks
Soluto
 
Introduction to Django
James Casey
 
Ad

Viewers also liked (11)

PDF
Agile documentation with Confluence and Sparx Enterprise Architect
Per Spilling
 
DOC
No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...
Atlassian
 
PPTX
User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012
Atlassian
 
PDF
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
Atlassian
 
PDF
AtlasCamp 2010: The Atlassian Plugin SDK For Fun & Profit - Ben Speakmon
Atlassian
 
PDF
AtlasCamp 2014: Writing Connect Add-ons for Confluence
Atlassian
 
KEY
JavaScript? In MY Confluence? - Atlassian Summit 2012
Atlassian
 
PDF
Build Amazing Add-ons for Atlassian JIRA and Confluence
K15t
 
PDF
Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...
Nicholas Muldoon
 
PPTX
Enterprise Architect - Sparx Systems
Saldit Software
 
PDF
A Habit of Innovation
Atlassian
 
Agile documentation with Confluence and Sparx Enterprise Architect
Per Spilling
 
No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian ...
Atlassian
 
User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012
Atlassian
 
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
Atlassian
 
AtlasCamp 2010: The Atlassian Plugin SDK For Fun & Profit - Ben Speakmon
Atlassian
 
AtlasCamp 2014: Writing Connect Add-ons for Confluence
Atlassian
 
JavaScript? In MY Confluence? - Atlassian Summit 2012
Atlassian
 
Build Amazing Add-ons for Atlassian JIRA and Confluence
K15t
 
Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...
Nicholas Muldoon
 
Enterprise Architect - Sparx Systems
Saldit Software
 
A Habit of Innovation
Atlassian
 
Ad

Similar to AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor (9)

PPTX
Hypermedia APIs
Paulo Gandra de Sousa
 
PDF
AtlasCamp 2013: Confluence patterns
colleenfry
 
PPT
20130305 SFAUG Confluence Case Study
Anthony Pelosi
 
PPT
iOpus iMacros Introduction
Mathias Roth
 
PDF
Supercharge Your Pages - New Ways to Extend the Confluence Editor
Atlassian
 
PDF
YUI 介紹 @YZU
Joseph Chiang
 
KEY
Preparing for Confluence 4.1
Atlassian
 
PPT
Embellish bureau
siraj10
 
PPT
05-06 HTML lecture FOR BS STUDENTS IUB.ppt
allsoftwarekeys
 
Hypermedia APIs
Paulo Gandra de Sousa
 
AtlasCamp 2013: Confluence patterns
colleenfry
 
20130305 SFAUG Confluence Case Study
Anthony Pelosi
 
iOpus iMacros Introduction
Mathias Roth
 
Supercharge Your Pages - New Ways to Extend the Confluence Editor
Atlassian
 
YUI 介紹 @YZU
Joseph Chiang
 
Preparing for Confluence 4.1
Atlassian
 
Embellish bureau
siraj10
 
05-06 HTML lecture FOR BS STUDENTS IUB.ppt
allsoftwarekeys
 

More from Atlassian (20)

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

Recently uploaded (20)

PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Doc9.....................................
SofiaCollazos
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 

AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor