Confluence Connector

This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Confluence Connector

DRAFT DOCUMENT

The Confluence connector allows you to connect to Confluence, an online team collaboration software. The connector uses the Confluence 5.4.3 SOAP API to connect to confluence, manage users and groups, change global/space permissions, manage labels and more.

The following sections describe how to perform various operations with the connector. For general information on using connectors and their operations in your ESB configurations, see Using a Connector.


Supported ESB Version

WSO2 ESB 4.9.0 supports this connector. You can download WSO2 ESB 4.9.0 from here.

Connecting to Confluence

To use the Confluence connector, add the <confluence.init> element in your configuration before any Confluence operations. This Confluence configuration authenticates with Confluence by specifying the user name, password, and URI of the Confluence instance.

init
<confluence.init> <username>xxxx@wso2.com</username> <password>{wso2:vault-lookup('xxxx.email.login')}</password> <uri>https://xxx:xx/xx</uri> </confluence.init>
Entering secure data

For security purposes, you should store your SID and token in the WSO2 secure vault and reference it by using an alias instead of hard-coding the actual values in the configuration file. For more information, see Working with Passwords.

Re-using JIRA configurations

For best results, save the Confluence configuration as a local entry.  You can then easily reference it with the configKey attribute in your Confluence operations. For example, if you saved the above <confluence.init> entry as a local entry named confluenceConfig,  you could reference it from an operation like  getUser  as follows:

<confluence.getUser configKey="confluenceConfig"> <username>Bob</username> </confluence.getUser>

 


Working with administrative operations

Operation

Description

Operation

Description

exportSite

Exports a Confluence instance and returns a string holding the URL for the download.

getClusterInformation

Returns information about the cluster to which this node belongs.

getClusterNodeStatuses

Returns a vector of NodeStatus objects containing information about each node in the cluster.

isPluginEnabled

Returns true if the plugin is installed and enabled. If not, the value is false.

Exporting Site  

exportSite
<confluence.exportSite configKey="confluenceConfig"> <exportAttachments>true</exportAttachments> </confluence.exportSite>

To export a site, use confluence.exportSite and s pecify the following properties. If successful, Confluence responds with a export site URL.

Properties
  • exportAttachments :  A boolean argument indicates whether or not attachments ought to be included in the export.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#exportSite (java.lang.String, boolean)

Getting ClusterInformation

getClusterInformation
<confluence.getClusterInformation configKey="confluenceConfig"/>

To get cluster information, use confluence.getClusterInformation. If successful, Confluence responds with information about the cluster to which the node belongs.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getClusterInformation(java.lang.String)

Getting ClusterNodeStatuses

ClusterNodeStatuses
<confluence.getClusterNodeStatuses configKey="confluenceConfig"/>

To get cluster note status, use confluence.getClusterNodeStatus. If successful, Confluence responds with node status.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getClusterNodeStatuses(java.lang.String)

Checking whether pluging is enabled  

isPluginEnabled
<confluence.isPluginEnabled configKey="confluenceConfig"> <pluginKey>Key</pluginKey> </confluence.isPluginEnabled>

To check whether a particular plugin is enabled, use confluence.isPluginEnabled and specify the following properties. If successful, Confluence responds with true or false.

Properties
  • pluginKey: A string argument that indicates the plugin key.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getClusterNodeStatuses(java.lang.String)

Working with attachments

Operation

Description

Operation

Description

getAttachment

Retrieves a paginated list of attachment content entities within a single container.

getAttachmentData

Gets the contents of an attachment.

removeAttachment

Removes an attachment from a content entity object.

Getting an attachment  

getAttachment
<confluence.getAttachment> <limit>{$ctx:limit}</limit> <id>{$ctx:id}</id> <start>{$ctx:start}</start> <fileName>{$ctx:fileName}</fileName> <expand>{$ctx:expand}</expand> <mediaType>{$ctx:mediaType}</mediaType> </confluence.getAttachment>

This operation retrieves a paginated list of attachment content entities within a single container.

Properties
  • limit : Specifies how many items should be returned after the start index.

  • id : A string containing the ID of the attachments content container.

  • start : The index of the first item within the result set that should be returned.

  • fileName : A filter parameter to return only the attachment with the matching file name.

  • expand : A comma separated list of properties to expand on the attachments returned.

  • mediaType : A filter parameter to return only attachments with a matching Media-Type.

Related Confluence documentation

https://docs.atlassian.com/atlassian-confluence/REST/latest/#d3e1021

Getting an attachment data  

getAttachmentData
<confluence.getAttachmentData configKey="confluenceConfig"> <pageId>1245678</pageId> <fileName>file.txt</fileName> <versionNumber>0</versionNumber> </confluence.getAttachmentData>

To get an attachment data, use confluence.getAttachmentData and specify the following properties. If successful, Confluence responds with the attachment data.

Properties
  • pageID : The id of the ContentEntityObject the attachemt belongs to.

  • fileName : The name of the attachment.

  • version : The version number of the attachment. To retrieve information or content from the current version of an attachment, use a versionNumber 0

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getAttachmentData(java.lang.String, long, java.lang.String, int)

Removing an attachment  

removeAttachment
<confluence.removeAttachment configKey="confluenceConfig"> <contentId>12345678</contentId> <fileName>file.pgn</fileName> </confluence.removeAttachment>

To remove an attachment, use confluence.removeAttachment and specifiy the following properties. if successful, Confluence removes the particular attachment.

Properties
  • contentId : The id of the ContentEntityObject to which the attachment belongs.

  • fileName : The name of the attachment.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#removeAttachment(java.lang.String, long, java.lang.String)

Working with blogs

Operation

Description

Operation

Description

getBlogEntries

Returns all the summaries in the space.

getBlogEntry

Returns a single entry

Getting blog entries  

getBlogEntries
<confluence.getBlogEntries configKey="confluenceConfig"> <spaceKey>SPK</spaceKey> </confluence.getBlogEntries>

To get blog entries of a space, use confluence.getBlogEntries and specify the following properties. If successful, Confluence responds with a list of blog entries.

Properties
  • spaceKey : The value of the space key

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getBlogEntries(java.lang.String, java.lang.String)

Getting a blog entry  

getBlogEntry
<confluence.getBlogEntry configKey="confluenceConfig"> <pageId>123456789</pageId> </confluence.getBlogEntry>

To get a particular blog entry of a space, use confluence.getBlogEntry and specify the following properties. If successful, Confluence responds with the blog entry.

Properties
  • pageId : The page ID of the blog entry.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getBlogEntry(java.lang.String, long)

Working with general operations

Operation

Description

Operation

Description

getServerInfo

Retrieves some basic information about the server to which the connection is made.

Getting server information  

getServerInfo
<confluence.getServerInfo configKey="confluenceConfig" />

To get the server information, use confluence.getServerInfo and specify the following properties. If successful, Confluence responds with the server details.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getServerInfo(java.lang.String)

Working with labels

Operation

Description

Operation

Description

addLabelByNameToSpace

Adds a label to the object with the given ContentEntityObject ID.

getLabelContentByName

Returns the content for a given label name.

getMostPopularLabels

Returns the most popular labels for the Confluence instance with a specified maximum number.

getRecentlyUsedLabels

Returns the recently used labels for the Confluence instance with a specified maximum number of results.

getSpacesWithLabel

Returns an array of spaces that have been labelled with labelName.

addContentLabels

Adds a list of labels to the specified content. 

getContentLabels

Retrieves the list of labels on a piece of content. 

removeContentLabel

Deletes labels to the specified content. 

Adding a label by name to space  

addLabelByNameToSpace
<confluence.addLabelByNameToSpace configKey="confluenceConfig"> <labelNamer>label-1</labelNamer> <spaceKey>SPK</spaceKey> </confluence.addLabelByNameToSpace>

To add label to a space by the name, use confluence.addLabelByNameToSpace and specify the following properties. If successful, Confluence adds the label to space and responds with true.

Properties
  • labelName : The name of the label(s) to be added to the space in the form of a space-separated string.

  • spaceKey : The space to which the label should be added.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#addLabelByNameToSpace(java.lang.String, java.lang.String, java.lang.String)

Getting a label content by name  

getLabelContentByName
<confluence.getLabelContentByName configKey="confluenceConfig"> <labelName>label-1</labelName> </confluence.getLabelContentByName>

To get label content by the label name, use confluence.getLabelContentByName and specify the following properties. If successful, Confluence responds with the label content.

Properties
  • labelName : The name of the label(s) to be retrieved.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getLabelContentByName(java.lang.String, java.lang.String)

Getting most popular labels  

getMostPopularLabels
<confluence.getMostPopularLabels configKey="confluenceConfig"> <maxCount>10</maxCount> </confluence.getMostPopularLabels>

To get most popular labels, use confluence.getMostPopularLabels and specify the following properties. If successful, Confluence responds a list of most popular labels.

Properties
  • maxCount : The maximum limit of the most popular labels

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getMostPopularLabels(java.lang.String, int)

Getting recently used labels  

getRecentlyUsedLabels
<confluence.getRecentlyUsedLabels configKey="confluenceConfig"> <maxResults>10</maxResults> </confluence.getRecentlyUsedLabels>

To get most recently used labels, use confluence.getRecentlyUsedLabels and specify the following properties. If successful, Confluence responds a list of most recently used labels.

Properties
  • maxCount : The maximum limit of the most recently used labels

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getRecentlyUsedLabels(java.lang.String, int)

Getting spaces with label  

getSpacesWithLabel
<confluence.getSpacesWithLabel configKey="confluenceConfig"> <labelName>label-1</labelName> </confluence.getSpacesWithLabel>

To get spaces containing the a particular label, use confluence.getSpacesWithLabel and specify the following properties. If successful, Confluence responds a list of spaces IDs.

Properties
  • labelName : The name of the label with which one needs to get the spaces.

Related Confluence documentation

https://developer.atlassian.com/static/javadoc/confluence/4.2.13/reference/com/atlassian/confluence/rpc/soap/ConfluenceSoapService.html#getSpacesWithLabel(java.lang.String, java.lang.String)

Adding a list of labels to the specified content

addContentLabels
<confluence.addContentLabels> <id>{$url:id}</id> </confluence.addContentLabels>

This operation adds a list of labels to the specified content.

Properties
  • id : A string containing the ID of the labels content container.

Related Confluence documentation

https://docs.atlassian.com/atlassian-confluence/REST/latest/#d3e80 

Retrieving the list of labels on a piece of content

getContentLabels
<confluence.getContentLabels> <limit>{$ctx:limit}</limit> <id>{$ctx:id}</id> <start>{$ctx:start}</start> <prefix>{$ctx:prefix}</prefix> </confluence.getContentLabels>

This operation retrieves the list of labels on a piece of content.

Properties
  • limit : The limit of the number of labels to return, this may be restricted by fixed system limits.

  • id : A string containing the ID of the labels content container.

  • start : The start point of the collection to return.

  • prefix : The prefixes to filter the labels with.

Related Confluence documentation

https://docs.atlassian.com/atlassian-confluence/REST/latest/#d3e55

Deleting labels to the specified content

removeContentLabel
<confluence.removeContentLabel> <id>{$ctx:id}</id> <name>{$ctx:name}</name> </confluence.removeContentLabel>

This operation deletes labels to the specified content.

Properties
  • id : A string containing the ID of the labels content container.

  • name: The name of the label to be removed from the content.

Related Confluence documentation

https://docs.atlassian.com/atlassian-confluence/REST/latest/#d3e104

Working with pages

Operation

Description

Operation

Description

movePage

Moves the position of a page in the hierarchy.

movePageToTopLevel

Moves a page to the top level of the target space.

removePage

Removes a page.

getContentPermissionSets

Returns all the page level permissions for this page as content permission sets.

getPage

Returns a single page

getPages

Returns all the summaries in the space.

Moving a page  

movePage
<confluence.movePage configKey="confluenceConfig"> <sourcePageId>123456789</sourcePageId> <targetPageId>987654321</targetPageId> <position>above</position> </confluence.movePage>

To move a page in the hierarchy, use confluence.movePage and specify the following properties. If successful, Confluence moves the page to the target page location.

Properties
  • sourcePageId : Page ID to be moved.