Building Content-centric Add-ons for Confluence

867 views

Published on

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
867
On SlideShare
0
From Embeds
0
Number of Embeds
109
Actions
Shares
0
Downloads
14
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Building Content-centric Add-ons for Confluence

  1. 1. Building Content-centric Add-ons for Confluence NIRAJ BHAWNANI • CONFLUENCE DEVELOPER • ATLASSIAN • @NIRAJBHAWNANI
  2. 2. What is a “contentcentric add-on?”
  3. 3. Types of content-centric addons Macros Blueprints Space Blueprints
  4. 4. Ok, but why do I care?
  5. 5. Bob, Senior Developer • Confluence guru • introduced Confluence to BigCorp • talented plugin developer
  6. 6. Jason, Events Coordinator • not very tech savvy • “How can I create an event page?” • Bob writes him an “Event” macro
  7. 7. Creating an event page from scratch
  8. 8. Creating an event page from scratch
  9. 9. Alice, Project Manager • Confluence power user • discovers a new usecase for Bob’s new macro
  10. 10. Bob writes some blueprints • Event macro has 2 use-cases: • company event • team demo meeting
  11. 11. Creating an event page using blueprints
  12. 12. Creating an event page using blueprints
  13. 13. And everyone’s happy! Thanks, Bob!
  14. 14. ... but Bob’s not done yet! • Writes 2 space blueprints: • team space • project space
  15. 15. Creating a team space
  16. 16. Now everyone’s really happy! Great work, Bob!
  17. 17. Blueprints O VER VIEW F EA T U R ES DEV ELOP ME N T
  18. 18. OVERVIEW When should you use blueprints? • Blueprints allow you to surface your macros for a specific use case. • Confluence 5.1+ • Examples - Decisions, meeting notes, file lists
  19. 19. The “blank page” problem
  20. 20. Blueprints O VER VIEW F EA T U R ES DEV ELOP ME N T
  21. 21. Blueprint features 1 A B C Create 2 meeting label Guidance “How to” guide Flow Edit Content Label Report @ @ @ @ @ @ Wizard View/Index Custom Page Properties
  22. 22. Blueprints O VER VIEW F EA T U R ES DEV ELOP ME N T
  23. 23. DEVELOPMENT With the Atlassian SDK $ atlas-update $ atlas-create-confluence-plugin-module
  24. 24. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <blueprint> ContextProvider.java <content-template> content-template.xml ...
  25. 25. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <blueprint> ContextProvider.java <content-template> content-template.xml ...
  26. 26. 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>
  27. 27. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <blueprint> ContextProvider.java <content-template> content-template.xml ...
  28. 28. 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>
  29. 29. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <blueprint> ContextProvider.java <content-template> content-template.xml ...
  30. 30. 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>
  31. 31. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <blueprint> ContextProvider.java <content-template> content-template.xml ...
  32. 32. DEVELOPMENT Blueprint context provider public 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; } }
  33. 33. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <blueprint> ContextProvider.java <content-template> content-template.xml ...
  34. 34. DEVELOPMENT Content template XML Hello World! <at:var at:name="simpleVariable"></at:var> <ac:structured-macro ac:name="cheese" /> <at:var at:name="rawXhtmlVariable" at:rawxhtml="true"></at:var>
  35. 35. DEVELOPMENT Developer resources http://go.atlassian.com/devblueprints http://go.atlassian.com/storageformat
  36. 36. Blueprints summary • Blueprints package an entire use-case into a single create experience. • Blueprints more than templates • Easily created with the Atlassian SDK
  37. 37. Space Blueprints O VER VIEW F EA T U R ES DEV ELOP ME N T
  38. 38. OVERVIEW When should you use space blueprints? • 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
  39. 39. OVERVIEW How does it work?
  40. 40. Space Blueprints O VER VIEW F EA T U R ES DEV ELOP ME N T
  41. 41. Space blueprint features 1 A B C 2 Guidance “How to” guide Content Homepage Space Settings Promoted Blueprints team project Wizard Page hierarchy Space Categories Custom
  42. 42. Space Blueprints O VER VIEW F EA T U R ES DEV ELOP ME N T
  43. 43. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <space-blueprint> ContextProvider.java <content-template> content-template.xml ...
  44. 44. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <space-blueprint> ContextProvider.java <content-template> content-template.xml ...
  45. 45. DEVELOPMENT Create space dialog web-item <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>
  46. 46. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <space-blueprint> ContextProvider.java <content-template> content-template.xml ...
  47. 47. 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:createblank-page"/> <blueprint ref="com.atlassian.confluence.plugins.confluence-create-content-plugin:createblog-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>
  48. 48. DEVELOPMENT Code structure atlassian-plugin.xml <web-item> <space-blueprint> ContextProvider.java <content-template> content-template.xml ...
  49. 49. 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>
  50. 50. DEVELOPMENT Developer resources http://go.atlassian.com/dev-spaceblueprints
  51. 51. Space blueprints summary • 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
  52. 52. Where to go from here?
  53. 53. Where to go from here? • Grab the Atlassian SDK http://go.atlassian.com/ sdk • Check out our developer documentation: http://go.atlassian.com/devmacros http://go.atlassian.com/devblueprints http://go.atlassian.com/dev-spaceblueprints • Write your own! Submit them to the Marketplace.
  54. 54. Be like Bob! • Think of use-cases in your organization • Write Blueprints to solve them!
  55. 55. Thank you! NIRAJ BHAWNANI • CONFLUENCE DEVELOPER • ATLASSIAN • @NIRAJBHAWNANI
  56. 56. Rate this Talk Building Content-Centric Add-ons for Confluence Text code below to 22333 or visit http://bit.ly/19dVZcc MEH = 13 NO T BA D = 14 P R ET T Y GO O D = 15 A WES O ME = 16 To join this session, send text 136888 to

×