SlideShare une entreprise Scribd logo
1  sur  4
Macro Definition                                                 Referencing Confluence Objects
 Macro has a body             Anything the user types within      $body                    The body of the macro
                              the body of the macro will be       $param0-n                The parameters passed to your
                              available in the macro in the                                macro (as available)
                              $body variable.                     $param<name>             Named parameters passed to your
    Use unprocessed           The body of the macro will be                                macro (as available)
    macro body                output exactly as entered,          $config                  The BootstrapManager object,
                              including any HTML markup.                                   useful for retrieving Confluence
                              For example if the macro body is                             properties
                              '<b>body</b>', it will be           $content                 The current ContentEntity object
                              displayed as 'body' in the page.                             that this macro is a included in (if
    Escape HTML in            The body of the macro will be                                available)
    macro body                output with HTML markup             $space                   The Space object that this content
                              escaped. So if the macro body is                             object is located in (if relevant)
                              '<b>body</b>', it will be           $generalUtil             A GeneralUtil object, with useful
                              displayed as '<b>body</b>' in                                utility methods for URL encoding
                              the page.                                                    etc
    Convert macro body        The body of the macro will be       $action                  A blank ConfluenceActionSupport
    wiki markup to HTML       converted from wiki text to                                  object, useful for retrieving i18n
                              HTML markup. So if the macro                                 text if needed
                              body is '*body*', it will be        $webwork                 A VelocityWebWorkUtil object, for
                              displayed as 'body' in the page.                             its htmlEncode() method
 Output - Macro               Choose this if you want to write    $req                     The current HttpServletRequest
 generates HTML markup        your macro with HTML                                         object (if the page is rendered as a
                              elements.                                                    result of an HTTP request)
 Output - Macro               Choose this if you want to write    $res                     The corresponding
 generates wiki markup        your macro with wiki markup.                                 HttpServletResponse object (not
Velocity Markup                                                                            recommended to be played with)
                                                                  $userAccessor            For retrieving users, groups and
 ## Some text                 A comment                                                    checking membership
 #var1                        A variable                          $permissionHelper        For determining user rights
 #set($var1=”abc”)            Setting a variable                 Examples
 #if ($var1 == “abc”)         Simple if-else statement
 …                                                                ${content.id}                  Page id of current page
 #else                                                            [$762573668]                   Markup to create link to
 …                                                                                               page with that id
 #end                                                             $action.getHelper()            Referencing another user
 <a                           Embedding a variable within         .renderConfluenceMacro         macro
 href="viewpage.action?       wiki markup                         ("{anothermacro}")
 pageId=$pageid">$linkb
 ody</a>                                                         Recent Confluence versions & dependencies
 #set($page = "$              Using formal references to refer    Confluence         jQuery                Velocity
 {prefix}ref$pageid")         to a variable within a string       2.8                1.2.3                 1.5
                                                                  2.9                1.2.3                 1.5
jQuery tips
                                                                  2.10               1.2.3                 1.5
Must access as jQuery not $                                       3.0                1.2.6                 1.6.1
                                                                  3.1                1.3.2                 1.6.1
<script type="text/javascript">
jQuery(document).ready(function()                                 3.2                1.3.2                 1.6.1
{
   jQuery calls here
});
</script>

References
Confluence manual: Working with macros                           http://confluence.atlassian.com/x/eyAC
Confluence development: User macros                              http://confluence.atlassian.com/x/hRE
Confluence Shared user macro library                             http://confluence.atlassian.com/x/KoCjAg
Confluence objects accessible from Velocity                      http://confluence.atlassian.com/x/EBQD
Atlassian Confluence forum                                       http://forums.atlassian.com/forum.jspa?forumID=96
jQuery                                                           http://jquery.com/
Firebug                                                          http://getfirebug.com/
Adaptavist jQuery versions article                               https://www.adaptavist.com/display/jQuery/Versions
Macro 1: Response time

Example usage: {response-time}

Please see this page for full listing: http://confluence.atlassian.com/display/DISC/Response+Time


Macro 2: color-table (final version)

Example usage: {color-table:A2C1D5|BFEBEF}

## Macro name: color-table
## Macro has a body: N
## Body format: n/a
## Output: HTML
##
## Developed by: Charles Hall
## Developed for: All users
## Date created: 23/02/2010
## Installed by: Charles Hall

## Apply coloring to alternate rows of any tables with the class of confluenceTable.

#set($oddcolor= $param0)
#set($evencolor= $param1)

## Check for valid odd color, otherwise use default
#if (!$oddcolor)
 #set ($oddcolor="ffffff")
#end

## Check for valid even color, otherwise use default
#if (!$evencolor)
 #set ($evencolor="ededed")
#end

<script type="text/javascript" defer="defer">
jQuery(document).ready(function()
{
  //colour code odd and even table rows
  jQuery("table.confluenceTable tr:nth-child(odd)").css("background-color", "#$oddcolor");
  jQuery("table.confluenceTable tr:nth-child(even)").css("background-color", "#$evencolor");
});
</script>



Macro 3: watermark (final version)

Example usage: {watermark: logo.gif|no-repeat|1000}
## Macro name: astrium-watermark
## Macro has a body: N
## Body format: n/a
## Output: HTML
##
## Developed by: Charles Hall
## Developed for: Astrium wiki
## Date created: 31/03/2010
## Installed by: Charles Hall

## define a watermark image for the current page

#set($image= $param0)
#set($repeat = $param1)
#set($minheight= $param2 + 'px')

<script type="text/javascript" defer="defer">
jQuery(document).ready(function() {

/*Default theme*/
if (jQuery("#header-menu-bar").length)
{
  jQuery('#content').css('background-image', 'url($config.getBaseUrl()
$content.getAttachmentNamed("$image").getDownloadPath())');
## Add the specified repeat behaviour
#if ($repeat)
  jQuery('#content').css('background-repeat', '$repeat');
#end
## Check for a specified minimum height
#if ($minheight)
  jQuery('#content').css('height', '$minheight');
#end
  jQuery('#content').css('vertical-align', 'top');
}


/*Left nav theme*/
if (jQuery(".sidebar div.leftnav").length)
{
  jQuery('#mainViewPane').css('background-image', 'url($config.getBaseUrl()
$content.getAttachmentNamed("$image").getDownloadPath())');
## Add the specified repeat behaviour
#if ($repeat)
  jQuery('#mainViewPane').css('background-repeat', '$repeat');
#end
## Check for a specified minimum height
#if ($minheight)
  jQuery('#mainViewPane').css('height', '$minheight');
#end
  jQuery('#mainViewPane').css('vertical-align', 'top');
}


/*Clickr theme*/
if (jQuery("#MegaFooter").length)
{
jQuery('#main').css('background-image', 'url($config.getBaseUrl()
$content.getAttachmentNamed("$image").getDownloadPath())');
## Add the specified repeat behaviour
#if ($repeat)
  jQuery('#main').css('background-repeat', '$repeat');
#end
## Check for a specified minimum height
#if ($minheight)
  jQuery('#main').css('height', '$minheight');
#end
  jQuery('#main').css('vertical-align', 'top');
}

});
</script>



Macro 4: draft-watermark

Example usage: {draft-watermark}

## Macro name: draft-watermark
## Macro has a body: N
## Body format: n/a
## Output: HTML
##
## Developed by: Charles Hall
## Developed for: All users
## Date created: 19/04/2010
## Installed by: Charles Hall

## inserts a Draft watermark image for the current page

## N.B. Calls the watermark user macro
## draft.gif must reside in "company" space

#set($url="http://globalcorp.com/confluence/download/attachments/74416134/draft.gif")

$action.getHelper().renderConfluenceMacro("{watermark:$url|no-repeat|1000}")

Contenu connexe

En vedette

User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012
User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012
User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012Atlassian
 
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave TaylorAtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave TaylorAtlassian
 
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...Atlassian
 
JavaScript? In MY Confluence? - Atlassian Summit 2012
JavaScript? In MY Confluence? - Atlassian Summit 2012JavaScript? In MY Confluence? - Atlassian Summit 2012
JavaScript? In MY Confluence? - Atlassian Summit 2012Atlassian
 
Building a kick-ass Confluence page in under 10 minutes: The Sequel
Building a kick-ass Confluence page in under 10 minutes: The SequelBuilding a kick-ass Confluence page in under 10 minutes: The Sequel
Building a kick-ass Confluence page in under 10 minutes: The SequelAtlassian
 
A Habit of Innovation
A Habit of InnovationA Habit of Innovation
A Habit of InnovationAtlassian
 
Optimizing the Confluence User Experience
Optimizing the Confluence User ExperienceOptimizing the Confluence User Experience
Optimizing the Confluence User ExperienceCprime
 
AtlasCamp 2014: Writing Connect Add-ons for Confluence
AtlasCamp 2014: Writing Connect Add-ons for ConfluenceAtlasCamp 2014: Writing Connect Add-ons for Confluence
AtlasCamp 2014: Writing Connect Add-ons for ConfluenceAtlassian
 
Build Amazing Add-ons for Atlassian JIRA and Confluence
Build Amazing Add-ons for Atlassian JIRA and ConfluenceBuild Amazing Add-ons for Atlassian JIRA and Confluence
Build Amazing Add-ons for Atlassian JIRA and ConfluenceK15t
 
Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...
Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...
Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...Nicholas Muldoon
 
CIP Do-Gooder Entry
CIP Do-Gooder EntryCIP Do-Gooder Entry
CIP Do-Gooder EntryAtlassian
 
Using HipChat for Work and Fun - Sean Conaty
Using HipChat for Work and Fun - Sean ConatyUsing HipChat for Work and Fun - Sean Conaty
Using HipChat for Work and Fun - Sean ConatyAtlassian
 
A/B Testing – How to Break Things and Fail Fast (Without Breaking Things) - M...
A/B Testing – How to Break Things and Fail Fast (Without Breaking Things) - M...A/B Testing – How to Break Things and Fail Fast (Without Breaking Things) - M...
A/B Testing – How to Break Things and Fail Fast (Without Breaking Things) - M...Atlassian
 
Maslow's hierarchy of needs
Maslow's hierarchy of needsMaslow's hierarchy of needs
Maslow's hierarchy of needsAnita Andziak
 
Confluence Insiders Webinar: Four ways every team can collaborate in Confluence
Confluence Insiders Webinar: Four ways every team can collaborate in ConfluenceConfluence Insiders Webinar: Four ways every team can collaborate in Confluence
Confluence Insiders Webinar: Four ways every team can collaborate in ConfluenceAtlassian
 
Macro environment
Macro environmentMacro environment
Macro environmentParth1815
 
How to create 360 images with google street view app
How to create 360 images with google street view app How to create 360 images with google street view app
How to create 360 images with google street view app proyectoste
 
Agile documentation with Confluence and Sparx Enterprise Architect
Agile documentation with Confluence and Sparx Enterprise ArchitectAgile documentation with Confluence and Sparx Enterprise Architect
Agile documentation with Confluence and Sparx Enterprise ArchitectPer Spilling
 
The Big Migration: How Cerner Moved From Confluence 3.5 to 5.8
The Big Migration: How Cerner Moved From Confluence 3.5 to 5.8The Big Migration: How Cerner Moved From Confluence 3.5 to 5.8
The Big Migration: How Cerner Moved From Confluence 3.5 to 5.8Atlassian
 

En vedette (20)

User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012
User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012
User Macros: Making Your Own Improvements to Confluence - Atlassian Summit 2012
 
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave TaylorAtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
AtlasCamp 2010: Making Confluence Macros Easy (for the user) - Dave Taylor
 
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
 
JavaScript? In MY Confluence? - Atlassian Summit 2012
JavaScript? In MY Confluence? - Atlassian Summit 2012JavaScript? In MY Confluence? - Atlassian Summit 2012
JavaScript? In MY Confluence? - Atlassian Summit 2012
 
Building a kick-ass Confluence page in under 10 minutes: The Sequel
Building a kick-ass Confluence page in under 10 minutes: The SequelBuilding a kick-ass Confluence page in under 10 minutes: The Sequel
Building a kick-ass Confluence page in under 10 minutes: The Sequel
 
A Habit of Innovation
A Habit of InnovationA Habit of Innovation
A Habit of Innovation
 
Optimizing the Confluence User Experience
Optimizing the Confluence User ExperienceOptimizing the Confluence User Experience
Optimizing the Confluence User Experience
 
AtlasCamp 2014: Writing Connect Add-ons for Confluence
AtlasCamp 2014: Writing Connect Add-ons for ConfluenceAtlasCamp 2014: Writing Connect Add-ons for Confluence
AtlasCamp 2014: Writing Connect Add-ons for Confluence
 
Build Amazing Add-ons for Atlassian JIRA and Confluence
Build Amazing Add-ons for Atlassian JIRA and ConfluenceBuild Amazing Add-ons for Atlassian JIRA and Confluence
Build Amazing Add-ons for Atlassian JIRA and Confluence
 
Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...
Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...
Collaborating Across an Enterprise: Quarterly Planning at Twitter with JIRA a...
 
CIP Do-Gooder Entry
CIP Do-Gooder EntryCIP Do-Gooder Entry
CIP Do-Gooder Entry
 
Using HipChat for Work and Fun - Sean Conaty
Using HipChat for Work and Fun - Sean ConatyUsing HipChat for Work and Fun - Sean Conaty
Using HipChat for Work and Fun - Sean Conaty
 
Referencing Autumn 2009
Referencing Autumn 2009Referencing Autumn 2009
Referencing Autumn 2009
 
A/B Testing – How to Break Things and Fail Fast (Without Breaking Things) - M...
A/B Testing – How to Break Things and Fail Fast (Without Breaking Things) - M...A/B Testing – How to Break Things and Fail Fast (Without Breaking Things) - M...
A/B Testing – How to Break Things and Fail Fast (Without Breaking Things) - M...
 
Maslow's hierarchy of needs
Maslow's hierarchy of needsMaslow's hierarchy of needs
Maslow's hierarchy of needs
 
Confluence Insiders Webinar: Four ways every team can collaborate in Confluence
Confluence Insiders Webinar: Four ways every team can collaborate in ConfluenceConfluence Insiders Webinar: Four ways every team can collaborate in Confluence
Confluence Insiders Webinar: Four ways every team can collaborate in Confluence
 
Macro environment
Macro environmentMacro environment
Macro environment
 
How to create 360 images with google street view app
How to create 360 images with google street view app How to create 360 images with google street view app
How to create 360 images with google street view app
 
Agile documentation with Confluence and Sparx Enterprise Architect
Agile documentation with Confluence and Sparx Enterprise ArchitectAgile documentation with Confluence and Sparx Enterprise Architect
Agile documentation with Confluence and Sparx Enterprise Architect
 
The Big Migration: How Cerner Moved From Confluence 3.5 to 5.8
The Big Migration: How Cerner Moved From Confluence 3.5 to 5.8The Big Migration: How Cerner Moved From Confluence 3.5 to 5.8
The Big Migration: How Cerner Moved From Confluence 3.5 to 5.8
 

Similaire à No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian Summit 2010

jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Foreverstephskardal
 
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatiasapientindia
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTHSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTAAFREEN SHAIKH
 
웹기반 Ajax개발을 위한 프레임워크 - metaworks3 (메타웍스3)
웹기반 Ajax개발을 위한 프레임워크 - metaworks3 (메타웍스3)웹기반 Ajax개발을 위한 프레임워크 - metaworks3 (메타웍스3)
웹기반 Ajax개발을 위한 프레임워크 - metaworks3 (메타웍스3)uEngine Solutions
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's NewTed Pennings
 
MVC pattern for widgets
MVC pattern for widgetsMVC pattern for widgets
MVC pattern for widgetsBehnam Taraghi
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Michał Orman
 
Documenting from the Trenches
Documenting from the TrenchesDocumenting from the Trenches
Documenting from the TrenchesXavier Noria
 
Key Insights into Development Design Patterns for Magento 2 - Magento Live UK
Key Insights into Development Design Patterns for Magento 2 - Magento Live UKKey Insights into Development Design Patterns for Magento 2 - Magento Live UK
Key Insights into Development Design Patterns for Magento 2 - Magento Live UKMax Pronko
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSPGeethu Mohan
 
React on Rails - RailsConf 2017 (Phoenix)
 React on Rails - RailsConf 2017 (Phoenix) React on Rails - RailsConf 2017 (Phoenix)
React on Rails - RailsConf 2017 (Phoenix)Jo Cranford
 

Similaire à No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian Summit 2010 (20)

jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Forever
 
Metaworks3
Metaworks3Metaworks3
Metaworks3
 
11-DWR-and-JQuery
11-DWR-and-JQuery11-DWR-and-JQuery
11-DWR-and-JQuery
 
11-DWR-and-JQuery
11-DWR-and-JQuery11-DWR-and-JQuery
11-DWR-and-JQuery
 
Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatia
 
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPTHSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
HSC INFORMATION TECHNOLOGY CHAPTER 3 ADVANCED JAVASCRIPT
 
웹기반 Ajax개발을 위한 프레임워크 - metaworks3 (메타웍스3)
웹기반 Ajax개발을 위한 프레임워크 - metaworks3 (메타웍스3)웹기반 Ajax개발을 위한 프레임워크 - metaworks3 (메타웍스3)
웹기반 Ajax개발을 위한 프레임워크 - metaworks3 (메타웍스3)
 
Spring 3: What's New
Spring 3: What's NewSpring 3: What's New
Spring 3: What's New
 
MVC pattern for widgets
MVC pattern for widgetsMVC pattern for widgets
MVC pattern for widgets
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
 
Documenting from the Trenches
Documenting from the TrenchesDocumenting from the Trenches
Documenting from the Trenches
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
J Query
J QueryJ Query
J Query
 
Key Insights into Development Design Patterns for Magento 2 - Magento Live UK
Key Insights into Development Design Patterns for Magento 2 - Magento Live UKKey Insights into Development Design Patterns for Magento 2 - Magento Live UK
Key Insights into Development Design Patterns for Magento 2 - Magento Live UK
 
Jquery Basics
Jquery BasicsJquery Basics
Jquery Basics
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
 
React on Rails - RailsConf 2017 (Phoenix)
 React on Rails - RailsConf 2017 (Phoenix) React on Rails - RailsConf 2017 (Phoenix)
React on Rails - RailsConf 2017 (Phoenix)
 
Lift Framework
Lift FrameworkLift Framework
Lift Framework
 
Web2 - jQuery
Web2 - jQueryWeb2 - jQuery
Web2 - jQuery
 

Plus de Atlassian

International Women's Day 2020
International Women's Day 2020International Women's Day 2020
International Women's Day 2020Atlassian
 
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 2020Atlassian
 
Forge App Showcase
Forge App ShowcaseForge App Showcase
Forge App ShowcaseAtlassian
 
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 UIAtlassian
 
Meet the Forge Runtime
Meet the Forge RuntimeMeet the Forge Runtime
Meet the Forge RuntimeAtlassian
 
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 ExperienceAtlassian
 
Take Action with Forge Triggers
Take Action with Forge TriggersTake Action with Forge Triggers
Take Action with Forge TriggersAtlassian
 
Observability and Troubleshooting in Forge
Observability and Troubleshooting in ForgeObservability and Troubleshooting in Forge
Observability and Troubleshooting in ForgeAtlassian
 
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 ModelAtlassian
 
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 SystemAtlassian
 
Forge: Under the Hood
Forge: Under the HoodForge: Under the Hood
Forge: Under the HoodAtlassian
 
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 APIsAtlassian
 
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 PluginAtlassian
 
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 BuildingAtlassian
 
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 MatterAtlassian
 
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 MindAtlassian
 
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...Atlassian
 
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 TeamsAtlassian
 
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 TeamAtlassian
 
Building Apps With Enterprise in Mind
Building Apps With Enterprise in MindBuilding Apps With Enterprise in Mind
Building Apps With Enterprise in MindAtlassian
 

Plus 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
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
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...apidays
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Dernier (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

No Coding Necessary: Building Confluence User Macros Cheat Sheet - Atlassian Summit 2010

  • 1. Macro Definition Referencing Confluence Objects Macro has a body Anything the user types within $body The body of the macro the body of the macro will be $param0-n The parameters passed to your available in the macro in the macro (as available) $body variable. $param<name> Named parameters passed to your Use unprocessed The body of the macro will be macro (as available) macro body output exactly as entered, $config The BootstrapManager object, including any HTML markup. useful for retrieving Confluence For example if the macro body is properties '<b>body</b>', it will be $content The current ContentEntity object displayed as 'body' in the page. that this macro is a included in (if Escape HTML in The body of the macro will be available) macro body output with HTML markup $space The Space object that this content escaped. So if the macro body is object is located in (if relevant) '<b>body</b>', it will be $generalUtil A GeneralUtil object, with useful displayed as '<b>body</b>' in utility methods for URL encoding the page. etc Convert macro body The body of the macro will be $action A blank ConfluenceActionSupport wiki markup to HTML converted from wiki text to object, useful for retrieving i18n HTML markup. So if the macro text if needed body is '*body*', it will be $webwork A VelocityWebWorkUtil object, for displayed as 'body' in the page. its htmlEncode() method Output - Macro Choose this if you want to write $req The current HttpServletRequest generates HTML markup your macro with HTML object (if the page is rendered as a elements. result of an HTTP request) Output - Macro Choose this if you want to write $res The corresponding generates wiki markup your macro with wiki markup. HttpServletResponse object (not Velocity Markup recommended to be played with) $userAccessor For retrieving users, groups and ## Some text A comment checking membership #var1 A variable $permissionHelper For determining user rights #set($var1=”abc”) Setting a variable Examples #if ($var1 == “abc”) Simple if-else statement … ${content.id} Page id of current page #else [$762573668] Markup to create link to … page with that id #end $action.getHelper() Referencing another user <a Embedding a variable within .renderConfluenceMacro macro href="viewpage.action? wiki markup ("{anothermacro}") pageId=$pageid">$linkb ody</a> Recent Confluence versions & dependencies #set($page = "$ Using formal references to refer Confluence jQuery Velocity {prefix}ref$pageid") to a variable within a string 2.8 1.2.3 1.5 2.9 1.2.3 1.5 jQuery tips 2.10 1.2.3 1.5 Must access as jQuery not $ 3.0 1.2.6 1.6.1 3.1 1.3.2 1.6.1 <script type="text/javascript"> jQuery(document).ready(function() 3.2 1.3.2 1.6.1 { jQuery calls here }); </script> References Confluence manual: Working with macros http://confluence.atlassian.com/x/eyAC Confluence development: User macros http://confluence.atlassian.com/x/hRE Confluence Shared user macro library http://confluence.atlassian.com/x/KoCjAg Confluence objects accessible from Velocity http://confluence.atlassian.com/x/EBQD Atlassian Confluence forum http://forums.atlassian.com/forum.jspa?forumID=96 jQuery http://jquery.com/ Firebug http://getfirebug.com/ Adaptavist jQuery versions article https://www.adaptavist.com/display/jQuery/Versions
  • 2. Macro 1: Response time Example usage: {response-time} Please see this page for full listing: http://confluence.atlassian.com/display/DISC/Response+Time Macro 2: color-table (final version) Example usage: {color-table:A2C1D5|BFEBEF} ## Macro name: color-table ## Macro has a body: N ## Body format: n/a ## Output: HTML ## ## Developed by: Charles Hall ## Developed for: All users ## Date created: 23/02/2010 ## Installed by: Charles Hall ## Apply coloring to alternate rows of any tables with the class of confluenceTable. #set($oddcolor= $param0) #set($evencolor= $param1) ## Check for valid odd color, otherwise use default #if (!$oddcolor) #set ($oddcolor="ffffff") #end ## Check for valid even color, otherwise use default #if (!$evencolor) #set ($evencolor="ededed") #end <script type="text/javascript" defer="defer"> jQuery(document).ready(function() { //colour code odd and even table rows jQuery("table.confluenceTable tr:nth-child(odd)").css("background-color", "#$oddcolor"); jQuery("table.confluenceTable tr:nth-child(even)").css("background-color", "#$evencolor"); }); </script> Macro 3: watermark (final version) Example usage: {watermark: logo.gif|no-repeat|1000}
  • 3. ## Macro name: astrium-watermark ## Macro has a body: N ## Body format: n/a ## Output: HTML ## ## Developed by: Charles Hall ## Developed for: Astrium wiki ## Date created: 31/03/2010 ## Installed by: Charles Hall ## define a watermark image for the current page #set($image= $param0) #set($repeat = $param1) #set($minheight= $param2 + 'px') <script type="text/javascript" defer="defer"> jQuery(document).ready(function() { /*Default theme*/ if (jQuery("#header-menu-bar").length) { jQuery('#content').css('background-image', 'url($config.getBaseUrl() $content.getAttachmentNamed("$image").getDownloadPath())'); ## Add the specified repeat behaviour #if ($repeat) jQuery('#content').css('background-repeat', '$repeat'); #end ## Check for a specified minimum height #if ($minheight) jQuery('#content').css('height', '$minheight'); #end jQuery('#content').css('vertical-align', 'top'); } /*Left nav theme*/ if (jQuery(".sidebar div.leftnav").length) { jQuery('#mainViewPane').css('background-image', 'url($config.getBaseUrl() $content.getAttachmentNamed("$image").getDownloadPath())'); ## Add the specified repeat behaviour #if ($repeat) jQuery('#mainViewPane').css('background-repeat', '$repeat'); #end ## Check for a specified minimum height #if ($minheight) jQuery('#mainViewPane').css('height', '$minheight'); #end jQuery('#mainViewPane').css('vertical-align', 'top'); } /*Clickr theme*/ if (jQuery("#MegaFooter").length) {
  • 4. jQuery('#main').css('background-image', 'url($config.getBaseUrl() $content.getAttachmentNamed("$image").getDownloadPath())'); ## Add the specified repeat behaviour #if ($repeat) jQuery('#main').css('background-repeat', '$repeat'); #end ## Check for a specified minimum height #if ($minheight) jQuery('#main').css('height', '$minheight'); #end jQuery('#main').css('vertical-align', 'top'); } }); </script> Macro 4: draft-watermark Example usage: {draft-watermark} ## Macro name: draft-watermark ## Macro has a body: N ## Body format: n/a ## Output: HTML ## ## Developed by: Charles Hall ## Developed for: All users ## Date created: 19/04/2010 ## Installed by: Charles Hall ## inserts a Draft watermark image for the current page ## N.B. Calls the watermark user macro ## draft.gif must reside in "company" space #set($url="http://globalcorp.com/confluence/download/attachments/74416134/draft.gif") $action.getHelper().renderConfluenceMacro("{watermark:$url|no-repeat|1000}")