Confluence Resolvers
Last modified by Raphaël Jakse on 2026/03/23 13:17
Content
Reference
The Confluence resolvers extension provides:
- APIs to resolve Confluence entities in XWiki,
- a default implementation of these APIs that uses other implementations of the APIs present in the wiki
- an implementation based on the ConfluencePageClass objects, which can be optionally imported when using Confluence XML.
The following (@Role) interface are defined:
- ConfluencePageIdResolver to find a document by its Confluence ID
- ConfluencePageTitleResolver to find a document from a space key and a page title
- ConfluenceSpaceKeyResolver to find a XWiki space from the key of a Confluence space.
The definition of these interfaces, as well as their implementations which can be used as examples can be found at https://github.com/xwiki-contrib/confluence/tree/master/confluence-resolvers/src/main/java/org/xwiki/contrib/confluence/resolvers.
For convenience, we reproduce the interface here, without the imports and the license header (however, the definitive reference would be the source code).
@Role
public interface ConfluencePageIdResolver
{
/**
* @return the document in XWiki, or null if the document is not found.
* @param id the Confluence ID of the document
*/
EntityReference getDocumentById(long id) throws ConfluenceResolverException;
}@Role
public interface ConfluenceSpaceKeyResolver
{
/**
* @return the space (EntityType.SPACE) in XWiki, or null if the space is not found.
* @param spaceKey the Confluence space key
*/
EntityReference getSpaceByKey(String spaceKey) throws ConfluenceResolverException;
}@Role
public interface ConfluencePageTitleResolver
{
/**
* @return the document in XWiki, or null if the document is not found.
* @param spaceKey the Confluence space of the document
* @param title the Confluence title of the document
*/
EntityReference getDocumentByTitle(String spaceKey, String title) throws ConfluenceResolverException;
}See also reference-handling.