SlideShare uma empresa Scribd logo
1 de 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}")

Mais conteúdo relacionado

Mais procurados

Minutes ict team meeting
Minutes   ict team meetingMinutes   ict team meeting
Minutes ict team meeting
kylemckendrick
 
Architectures de virtualisation
Architectures de virtualisationArchitectures de virtualisation
Architectures de virtualisation
Antoine Benkemoun
 

Mais procurados (14)

configuration vpn-ipsec-routeur
 configuration vpn-ipsec-routeur configuration vpn-ipsec-routeur
configuration vpn-ipsec-routeur
 
Minutes ict team meeting
Minutes   ict team meetingMinutes   ict team meeting
Minutes ict team meeting
 
VPN WINDOWS LINUX OPENVPN
VPN WINDOWS LINUX OPENVPNVPN WINDOWS LINUX OPENVPN
VPN WINDOWS LINUX OPENVPN
 
Les fondamentaux de UI UX Design .pdf
Les fondamentaux de UI UX Design .pdfLes fondamentaux de UI UX Design .pdf
Les fondamentaux de UI UX Design .pdf
 
Architectures de virtualisation
Architectures de virtualisationArchitectures de virtualisation
Architectures de virtualisation
 
DNS: EdgeCast Route - Technical DNS Service Overview
DNS: EdgeCast Route - Technical DNS Service Overview DNS: EdgeCast Route - Technical DNS Service Overview
DNS: EdgeCast Route - Technical DNS Service Overview
 
Vpn
VpnVpn
Vpn
 
Introduction to RCU
Introduction to RCUIntroduction to RCU
Introduction to RCU
 
Buzz et bad buzz
Buzz et bad buzzBuzz et bad buzz
Buzz et bad buzz
 
OpenStack Neutronの機能概要 - OpenStack最新情報セミナー 2014年12月
OpenStack Neutronの機能概要 - OpenStack最新情報セミナー 2014年12月OpenStack Neutronの機能概要 - OpenStack最新情報セミナー 2014年12月
OpenStack Neutronの機能概要 - OpenStack最新情報セミナー 2014年12月
 
Virtualisation.pptx
Virtualisation.pptxVirtualisation.pptx
Virtualisation.pptx
 
OpenStack-Ansibleで作るOpenStack HA環境 手順書解説 - OpenStack最新情報セミナー 2016年3月
OpenStack-Ansibleで作るOpenStack HA環境 手順書解説 - OpenStack最新情報セミナー 2016年3月OpenStack-Ansibleで作るOpenStack HA環境 手順書解説 - OpenStack最新情報セミナー 2016年3月
OpenStack-Ansibleで作るOpenStack HA環境 手順書解説 - OpenStack最新情報セミナー 2016年3月
 
TripleO Deep Dive 1.1
TripleO Deep Dive 1.1TripleO Deep Dive 1.1
TripleO Deep Dive 1.1
 
mis en place dun vpn site à site
mis en place dun vpn site à site mis en place dun vpn site à site
mis en place dun vpn site à site
 

Destaque

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
Atlassian
 
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
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 2012
Atlassian
 
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
Atlassian
 
Optimizing the Confluence User Experience
Optimizing the Confluence User ExperienceOptimizing the Confluence User Experience
Optimizing the Confluence User Experience
Cprime
 
CIP Do-Gooder Entry
CIP Do-Gooder EntryCIP Do-Gooder Entry
CIP Do-Gooder Entry
Atlassian
 

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

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

Rp 6 session 2 naresh bhatia
Rp 6  session 2 naresh bhatiaRp 6  session 2 naresh bhatia
Rp 6 session 2 naresh bhatia
sapientindia
 
웹기반 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 New
Ted Pennings
 
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
Michał Orman
 
Documenting from the Trenches
Documenting from the TrenchesDocumenting from the Trenches
Documenting from the Trenches
Xavier Noria
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
Geethu Mohan
 

Semelhante a 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
 

Mais de Atlassian

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

Mais de Atlassian (20)

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

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

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}")