Documentation
Confluence Modules
Modules are UI extension points that add-ons can use to insert content into various areas of the host application's interface. You implement a page module (along with others type of module you can use with Atlassian Connect, like webhooks) by declaring it in the add-on descriptor and implementing the add-on code that composes it.
Each application has module types that are specific for it, but there are some common types as well. For instance, both JIRA and Confluence support the generalPages
module, but only Confluence has profilePage
.
An add-on can implement as many modules as needed. For example, a typical add-on would likely provide modules for at least one lifecycle element, a configuration page, and possibly multiple general pages.
Here's an example of a module declaration:
{ "name": "My Addon", "modules": { "webItems": [{ "conditions": [ { "condition": "sub_tasks_enabled" }, { "condition": "is_issue_editable" }, { "condition": "is_issue_unresolved" } ], "location": "operations-subtasks", "url": "/dialog", "name": { "value": "Create Sub-Tasks" }, "target": { "type": "dialog" } }] } }
In this case, we're declaring a web item which opens as a dialog. This declaration adds a dialog box to JIRA that users can open by clicking a "Create Sub-Tasks" link on an issue.
Conditions
You can specify the conditions in which the link (and therefore access to this page) appears. The Atlassian application ensures that the link only appears if it is appropriate for it to do so. In the example, the module should only appear if subtasks are enabled and the issue is both editable and unresolved.. The condition elements state conditions that must be true for the module to be in effect. Note, the condition only applies to the presence or absence of the link. You should still permission the URL that the link references if appropriate.
URLs
All module declarations must have a url
attribute. The url attribute identifies the path on the add-on host to the resource that implements the module. The URL value must be valid relative to the baseUrl
value in the add-on descriptor.
The url value in our example is /dialog
. This must be a resource that is accessible on your server (relative to the base URL of the add-on). It presents the content that appears in the iframe dialog; in other words, the HTML, JavaScript, or other type of web content source that composes the iframe content.
Note: for a webhook, the URL should be the address to which the Atlassian application posts notifications. For other modules, such as generalPages
or webItems
, the URL identifies the web content to be used to compose the page.
You can request certain pieces of contextual data, such as a project or space key, to be included in the URLs requested from your add-on. See passing Context Parameters.
Properties
adminPages
Type
Page
, … ]Description
An admin page module is used to provide an administration chrome for add-on content.
blueprints
Type
Blueprints
, … ]Description
Blueprints allow your connect add on provide content creation templates.
confluenceContentProperties
Type
Content Property
, … ]Description
Definition of a content property index schema for an add-on. It allows extracting specific parts of the JSON documents stored as a content property values, and write them to a search index. Once stored, they can participate in a content search using CQL.
dynamicContentMacros
Type
Dynamic Content Macro
, … ]Description
Dynamic content macros allow you to add a macro into a Confluence page which is rendered as an iframe.
generalPages
Type
Page
, … ]Description
A general page module is used to provide a generic chrome for add-on content in the product.
configurePage
Type
Description
A configure page module is a page module used to configure the addon itself. It's link will appear in the add-ons entry in 'Manage Add-ons'.
profilePages
Type
Page
, … ]Description
A User Profile Page module is used to add new elements to Confluence user profiles.
spaceToolsTabs
Type
Space Tools Tab
, … ]Description
The Space Tools Tab module allows you to add new tabs to the Space Tools area of Confluence.
staticContentMacros
Type
Static Content Macro
, … ]Description
Static content macros allow you to add a macro into a Confluence page which is stored with the Confluence page itself. The add-on is responsible for generating the rendered XHTML in Confluence Storage Format
webPanels
Type
Web Panel
, … ]Description
The Web Panel module allows you to define panels, or sections, on an HTML page. A panel is an iFrame that will be inserted into a page.
webhooks
Type
Webhook
, … ]Description
The Web Hook module allows you be notified of key events that occur in the host product
webSections
Type
Web Section
, … ]Description
The Web Section plugin module allows you to define new sections in application menus.
webItems
Type
Web Item
, … ]Description
The Web Item module allows you to define new links in application menus.