How do you enable a richer experience for users of your plugin? With the impending release of Confluence 4.0 we will show you not only how to make your plugins Confluence 4.0 compatible but how to dress them up to take advantage of all the new plugin points Confluence 4.0 has to offer, allowing you to give your users a richer editing experience.
Ryan Thomas, Confluence Developer
6. About Me
• Confluence Developer
• Worked on 4.0 since January
2010
• Managed a lot of the ecosystem
integration
3
7. About Me
• Confluence Developer
• Worked on 4.0 since January
2010
• Managed a lot of the ecosystem
integration
• Deployed 4.0 to the Atlassian
internal instances
3
37. Insert Menu
<web-item key="editor-my-macro"
name="Insert Menu Link - My Macro"
section="system.editor.featured.macros.default"
weight="100">
<label key="my.plugin.macro"/>
<link linkId="mymacro"/>
</web-item>
9
38. Insert Menu
<web-item key="editor-my-macro"
name="Insert Menu Link - My Macro"
section="system.editor.featured.macros.default"
weight="100">
<label key="my.plugin.macro"/>
<link linkId="mymacro"/>
</web-item>
system.editor.featured.macros.default
9
41. Overriding The Macro Browser
• Want to use a custom dialog?
• Want to perform some action before opening the Macro
Browser?
10
42. Overriding The Macro Browser
• Want to use a custom dialog?
• Want to perform some action before opening the Macro
Browser?
• Want your macro to appear as a native Confluence
component?
10
44. Overriding The Macro Browser
AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
function(macro) {
// Custom logic goes here
}
});
11
45. Overriding The Macro Browser
AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
function(macro) {
// Custom logic goes here
}
});
• This will affect all the following areas:
11
46. Overriding The Macro Browser
AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
function(macro) {
// Custom logic goes here
}
});
• This will affect all the following areas:
• Insert Menu
11
47. Overriding The Macro Browser
AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
function(macro) {
// Custom logic goes here
}
});
• This will affect all the following areas:
• Insert Menu
• Autocomplete
11
48. Overriding The Macro Browser
AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
function(macro) {
// Custom logic goes here
}
});
• This will affect all the following areas:
• Insert Menu
• Autocomplete
• Property panel Edit button
11
49. Overriding The Macro Browser
AJS.MacroBrowser.setMacroJsOverride('my-macro', {opener:
function(macro) {
// Custom logic goes here
}
});
• This will affect all the following areas:
• Insert Menu
• Autocomplete
• Property panel Edit button
• Manually selecting inside the macro browser
11
53. Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
image, or reference static images
12
54. Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
image, or reference static images
• Only applicable to Bodiless Macros
12
55. Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
image, or reference static images
• Only applicable to Bodiless Macros
• Macro Placeholder chrome can be
applied optionally
12
56. Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
image, or reference static images
• Only applicable to Bodiless Macros
• Macro Placeholder chrome can be
applied optionally
12
57. Image Macro Placeholders
• Replaces the Macro Placeholder
• Plugins can generate their own
image, or reference static images
• Only applicable to Bodiless Macros
• Macro Placeholder chrome can be
applied optionally
12
91. Transformer Pipeline
• Confluence 4.0 contains a
completely new rendering engine
• Part of this engine is the
Transformer Pipeline
20
92. Transformer Pipeline
• Confluence 4.0 contains a
completely new rendering engine
• Part of this engine is the
Transformer Pipeline
• This is available to all plugins
20
95. Transformer Pipeline
• Confluence 4.0 stores its data in XHTML, this is known
as Storage Format - (No more wiki-markup! )
• We have three formats, however only the Storage
Format is persisted
21
96. Transformer Pipeline
• Confluence 4.0 stores its data in XHTML, this is known
as Storage Format - (No more wiki-markup! )
• We have three formats, however only the Storage
Format is persisted
• View Format: HTML
21
97. Transformer Pipeline
• Confluence 4.0 stores its data in XHTML, this is known
as Storage Format - (No more wiki-markup! )
• We have three formats, however only the Storage
Format is persisted
• View Format: HTML
• Editor Format: HTML with data attributes
21
99. Transformer Pipeline
• The pipeline controls the rendering of Confluence
content from one format to another
22
100. Transformer Pipeline
• The pipeline controls the rendering of Confluence
content from one format to another
• There are three pipelines inside of the rendering
engine:
22
101. Transformer Pipeline
• The pipeline controls the rendering of Confluence
content from one format to another
• There are three pipelines inside of the rendering
engine:
• Storage to View (viewing a page)
22
102. Transformer Pipeline
• The pipeline controls the rendering of Confluence
content from one format to another
• There are three pipelines inside of the rendering
engine:
• Storage to View (viewing a page)
• Storage to Edit (editing a page)
22
103. Transformer Pipeline
• The pipeline controls the rendering of Confluence
content from one format to another
• There are three pipelines inside of the rendering
engine:
• Storage to View (viewing a page)
• Storage to Edit (editing a page)
• Edit to Storage (saving a page)
22
108. Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
content before or after Confluence operates on it
24
109. Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
content before or after Confluence operates on it
• Inject content
24
110. Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
content before or after Confluence operates on it
• Inject content
• Modify content
24
111. Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
content before or after Confluence operates on it
• Inject content
• Modify content
• Remove content
24
112. Transformer Pipeline
• Why?
• Allows a plugin developers to intercept the Confluence
content before or after Confluence operates on it
• Inject content
• Modify content
• Remove content
24
113. Transformer Pipeline
With great power
• Why?
• Allows a plugin developers to intercept the Confluence
content before or after Confluence operates on it
• Inject content
• Modify content
comes
• Remove content
great responsibility
24
115. The New Macro Interface
• Confluence 4.0 introduces a new Macro
interface
25
116. The New Macro Interface
• Confluence 4.0 introduces a new Macro
interface
• Required for 4.0 integration
25
117. The New Macro Interface
• Confluence 4.0 introduces a new Macro
interface
• Required for 4.0 integration
• Default Macro body is rendered! (i.e. View
Format - HTML)
25
118. The New Macro Interface
• Confluence 4.0 introduces a new Macro
interface
• Required for 4.0 integration
• Default Macro body is rendered! (i.e. View
Format - HTML)
• How do you avoid this?
25
123. The New Macro Interface
• If you intend to output the body - You need to
render it!
27
124. The New Macro Interface
• If you intend to output the body - You need to
render it!
• Confluence provides an easy mechanism to do
this
27
125. The New Macro Interface
• If you intend to output the body - You need to
render it!
• Confluence provides an easy mechanism to do
this
• The XhtmlContent spring bean
27
126. The New Macro Interface
• If you intend to output the body - You need to
render it!
• Confluence provides an easy mechanism to do
this
• The XhtmlContent spring bean
• Storage Format to View
27
127. The New Macro Interface
• If you intend to output the body - You need to
render it!
• Confluence provides an easy mechanism to do
this
• The XhtmlContent spring bean
• Storage Format to View
• Wiki Markup to Storage Format
27
129. The New Macro Interface
private final XhtmlContent xhtmlContent;
public MyAwesomeMacro(XhtmlContent xhtmlContent) {
this.xhtmlContent = xhtmlContent;
}
28
130. The New Macro Interface
private final XhtmlContent xhtmlContent;
public MyAwesomeMacro(XhtmlContent xhtmlContent) {
this.xhtmlContent = xhtmlContent;
}
@Override
@RequiresFormat(Format.Storage)
public String execute(Map<String, String> parameters, String body,
ConversionContext context) throws MacroExecutionException {
try {
return xhtmlContent.convertStorageToView(body, context);
}
...
28
159. Get Started Today
• Try out your plugin in
Confluence 4.0
• Play with the new plugin
points
39
160. Get Started Today
• Try out your plugin in
Confluence 4.0
• Play with the new plugin
points
• Check out the documentation
http://atlss.in/confluence4
39
161. Questions
?
Joseph Clark
jclark@atlassian.com
Ryan Thomas
rthomas@atlassian.com
http://atlss.in/confluence4
#atlascamp
40