Top Banner
59
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building Content-centric Add-ons for Confluence
Page 2: Building Content-centric Add-ons for Confluence

NIRAJ BHAWNANI • CONFLUENCE DEVELOPER • ATLASS IAN • @NIRAJBHAWNANI

Building Content-centric Add-ons for Confluence

Page 3: Building Content-centric Add-ons for Confluence

What is a “content-centric add-on?”

Page 4: Building Content-centric Add-ons for Confluence

Types of content-centric add-ons

Macros Blueprints SpaceBlueprints

Page 5: Building Content-centric Add-ons for Confluence

Ok, but why do I care?

Page 6: Building Content-centric Add-ons for Confluence

• Confluence guru

• introduced Confluence to BigCorp

• talented plugin developer

Bob, Senior Developer

Page 7: Building Content-centric Add-ons for Confluence

• not very tech savvy

• “How can I create an event page?”

• Bob writes him an “Event” macro

Jason, Events Coordinator

Page 8: Building Content-centric Add-ons for Confluence

Creating an event page from scratch

Page 9: Building Content-centric Add-ons for Confluence

Creating an event page from scratch

Page 10: Building Content-centric Add-ons for Confluence
Page 11: Building Content-centric Add-ons for Confluence

• Confluence power user

• discovers a new use-case for Bob’s new macro

Alice, Project Manager

Page 12: Building Content-centric Add-ons for Confluence
Page 13: Building Content-centric Add-ons for Confluence

• Event macro has 2 use-cases:

• company event

• team demo meeting

Bob writes some blueprints

Page 14: Building Content-centric Add-ons for Confluence

Creating an event page using blueprints

Page 15: Building Content-centric Add-ons for Confluence

Creating an event page using blueprints

Page 16: Building Content-centric Add-ons for Confluence

And everyone’s happy!

Thanks, Bob!

Page 17: Building Content-centric Add-ons for Confluence

... but Bob’s not done yet!• Writes 2 space

blueprints:

• team space

• project space

Page 18: Building Content-centric Add-ons for Confluence

Creating a team space

Page 19: Building Content-centric Add-ons for Confluence

Now everyone’s really happy!

Great work, Bob!

Page 20: Building Content-centric Add-ons for Confluence

DEVELOPMENT

FEATURES

OVERVIEW

Blueprints

Page 21: Building Content-centric Add-ons for Confluence

OVERVIEW

• Blueprints allow you to surface your macros for a specific use case.

• Confluence 5.1+

• Examples - Decisions, meeting notes, file lists

When should you use blueprints?

Page 22: Building Content-centric Add-ons for Confluence

The “blank page” problem

Page 23: Building Content-centric Add-ons for Confluence

DEVELOPMENT

OVERVIEW

FEATURES

Blueprints

Page 24: Building Content-centric Add-ons for Confluence

“How to” guide

1

2

Edit

meeting

label

Label Report

Wizard View/Index

@@@@@@

Page Properties

Custom

Blueprint features

Guidance

Create

Flow

ABC

Content

Page 25: Building Content-centric Add-ons for Confluence

FEATURES

OVERVIEW

DEVELOPMENT

Blueprints

Page 26: Building Content-centric Add-ons for Confluence

DEVELOPMENT

With the Atlassian SDK$ atlas-update

$ atlas-create-confluence-plugin-module

Page 27: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<blueprint>

<content-template>

...

content-template.xml

ContextProvider.java

Page 28: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<blueprint>

<content-template>

...

content-template.xml

ContextProvider.java

Page 29: Building Content-centric Add-ons for Confluence

DEVELOPMENT

Create dialog web-item<web-item key="file-list-item" i18n-name-key="file.list.blueprint.name" section="system.create.dialog/content">

<description key="file.list.blueprint.description"/>

<resource name="icon" type="download" location="images/icon-filelist.png"/>

<param name="blueprintKey" value="file-list-blueprint"/>

</web-item>

Page 30: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<blueprint>

<content-template>

...

content-template.xml

ContextProvider.java

Page 31: Building Content-centric Add-ons for Confluence

DEVELOPMENT

Blueprint descriptor<blueprint key="file-list-blueprint" name="File List Blueprint" i18n-name-key="file.list.title" create-result="view" index-key="file-list" index-template-key="file-list-index-page" i18n-index-title-key= "file.list.index.page.title">

<content-template ref="file-list-page"/>

<dialog-wizard key="file-list-blueprint-wizard"> <dialog-page id="file-list-page1" template-key="Confluence.Templates.FileList.dialogForm" title-key="file.list.wizard.title" description-header-link-key="file.list.wizard.about.link" description-header-key="file.list.wizard.about.heading" description-content-key="file.list.wizard.about.description"/> </dialog-wizard>

</blueprint>

Page 32: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<blueprint>

<content-template>

...

content-template.xml

ContextProvider.java

Page 33: Building Content-centric Add-ons for Confluence

DEVELOPMENT

Content-template descriptor<content-template key="file-list-page" i18n-name-key="file.list.content.template.name">

<description key="file.list.content.template.description"/>

<resource name="template" type="download" location="xml/content-template.xml"/>

<context-provider class="com.atlassian.examples.FileListContextProvider"/>

</content-template>

Page 34: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<blueprint>

<content-template>

content-template.xml

ContextProvider.java

...

Page 35: Building Content-centric Add-ons for Confluence

DEVELOPMENT

Blueprint context providerpublic class FileListContextProvider implements ContextProvider{ public FileListContextProvider(...) { }

@Override public void init(Map<String, String> params) throws PluginParseException { }

@Override public Map<String, Object> getContextMap(Map<String, Object> context) { context.put("simpleVariable", "Hello world!"); context.put("rawXhtmlVariable", "<ac:structured-macro ac:name="cheese" />"); return context; }

}

Page 36: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<blueprint>

<content-template>

...

content-template.xml

ContextProvider.java

Page 37: Building Content-centric Add-ons for Confluence

DEVELOPMENT

Content template XML<at:var at:name="simpleVariable"></at:var>

<at:var at:name="rawXhtmlVariable" at:rawxhtml="true"></at:var>

Hello World!

<at:var at:name="rawXhtmlVariable" at:rawxhtml="true"></at:var>

Hello World!

<ac:structured-macro ac:name="cheese" />

Page 39: Building Content-centric Add-ons for Confluence

• Blueprints package an entire use-case into a single create experience.

• Blueprints more than templates

• Easily created with the Atlassian SDK

Blueprints summary

Page 40: Building Content-centric Add-ons for Confluence

DEVELOPMENT

FEATURES

OVERVIEW

Space Blueprints

Page 41: Building Content-centric Add-ons for Confluence

OVERVIEW

• When you want to create a type of space with:

• prepackaged content

• certain blueprints promoted

• a custom homepage tying everything together

• Confluence 5.3+

• Examples - team space, knowledge base space

When should you use space blueprints?

Page 42: Building Content-centric Add-ons for Confluence

OVERVIEW

How does it work?

Page 43: Building Content-centric Add-ons for Confluence

DEVELOPMENT

OVERVIEW

FEATURES

Space Blueprints

Page 44: Building Content-centric Add-ons for Confluence

“How to” guide

1

2

Wizard

Space blueprint features

Guidance

Custom

SpaceSettings

ABC

Content

Page hierarchy

HomepagePromoted Blueprints

team

project

SpaceCategories

Page 45: Building Content-centric Add-ons for Confluence

FEATURES

OVERVIEW

DEVELOPMENT

Space Blueprints

Page 46: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<space-blueprint>

<content-template>

...

content-template.xml

ContextProvider.java

Page 47: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<space-blueprint>

<content-template>

...

content-template.xml

ContextProvider.java

Page 48: Building Content-centric Add-ons for Confluence

<web-item key='team-space-blueprint-item' i18n-name-key='confluence.team.space.name' section='system.create.space.dialog/content'>

<resource name='icon' type='download' location='/images/icon-space-team-48.png'/>

<description key='confluence.team.space.description'/>

<param name='blueprintKey' value='team-space-blueprint'/>

</web-item>

DEVELOPMENT

Create space dialog web-item

Page 49: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<space-blueprint>

<content-template>

...

content-template.xml

ContextProvider.java

Page 50: Building Content-centric Add-ons for Confluence

DEVELOPMENT

Space blueprint descriptor<space-blueprint key="team-space-blueprint" i18n-name-key="confluence.team.space.name" category="teams">

<content-template ref="team-space-homepage-template"/>

<promoted-blueprints> ... <blueprint ref="com.atlassian.confluence.plugins.confluence-create-content-plugin:create-blank-page"/> <blueprint ref="com.atlassian.confluence.plugins.confluence-create-content-plugin:create-blog-post"/> </promoted-blueprints>

<dialog-wizard key="team-space-blueprint-wizard"> <dialog-page id="teamSpaceId" template-key="Confluence.SpaceBlueprints.Team.dialogForm" title-key="confluence.team.space.create.title" description-header-key="confluence.team.space.create.heading" description-content-key="confluence.team.space.create.description" last="true"/> </dialog-wizard>

</space-blueprint>

Page 51: Building Content-centric Add-ons for Confluence

atlassian-plugin.xml

DEVELOPMENT

Code structure

<web-item>

<space-blueprint>

<content-template>

...

content-template.xml

ContextProvider.java

Page 52: Building Content-centric Add-ons for Confluence

DEVELOPMENT

Content template descriptor<content-template key="team-space-homepage-template" i18n-name-key="confluence.team.space.homepage.name"> <description key="confluence.team.space.homepage.desc"/> <resource name="template" type="download" location="xml/team-space-home.xml"/>

<content-template key="team-space-child-page" i18n-name-key="confluence.team.space.homepage.name"> <description key="confluence.team.space.childpage.desc"/> <resource name="template" type="download" location="xml/team-space-child.xml"/> </content-template>

</content-template>

Page 53: Building Content-centric Add-ons for Confluence

DEVELOPMENT

Developer resourceshttp://go.atlassian.com/dev-space-

blueprints

Page 54: Building Content-centric Add-ons for Confluence

• Like blueprints, they package a use-case but at the space level.

• Space blueprints let you create a type of space with:

• a custom homepage

• prepackaged content

• promoted blueprints

Space blueprints summary

Page 55: Building Content-centric Add-ons for Confluence

Where to go from here?

Page 56: Building Content-centric Add-ons for Confluence

• Grab the Atlassian SDK

• Check out our developer documentation:

• Write your own! Submit them to the Marketplace.

Where to go from here?

http://go.atlassian.com/sdk

http://go.atlassian.com/dev-macros

http://go.atlassian.com/dev-blueprints

http://go.atlassian.com/dev-space-blueprints

Page 57: Building Content-centric Add-ons for Confluence

• Think of use-cases in your organization

• Write Blueprints to solve them!

Be like Bob!

Page 58: Building Content-centric Add-ons for Confluence

Thank you!

NIRAJ BHAWNANI • CONFLUENCE DEVELOPER • ATLASS IAN • @NIRAJBHAWNANI

Page 59: Building Content-centric Add-ons for Confluence

Text code below to 22333or visit http://bit.ly/19dVZcc

Building Content-Centric Add-ons for Confluence

To join this session, send text 136888 to

AWESOME = 16

PRETTY GOOD = 15

NOT BAD = 14

MEH = 13

Rate this Talk