Extend the Confluence URL Mapping

Last modified by Raphaël Jakse on 2026/03/23 14:34

Content

Steps

First, make sure you are familar with the concepts of the URL Mapping module.

You can add your own custom mappers that will be picked up by the Confluence URL prefix handler.

For this, you can take model on https://github.com/xwiki-contrib/confluence/tree/master/confluence-url-mapping, and especially the URLMapper class.

  1. Write components that extend the ConfluenceURLMapper interface
    1. call super(your regex) in the constructor
    2. implement convert such that it returns the desired resource reference. It can return null if the url isn't handled after all
  2. Make sure the `pom.xml` file of the extension that will hold these clases specifies that the module be installed on the root namespace: <properties> <xwiki.extension.namespaces>{root}</xwiki.extension.namespaces> </properties>

Get Connected