How can my Extension know if XWiki supports Nested Spaces?

Version 1.1 by Vincent Massol on 2016/02/09

Imagine that you're writing an Extension and that you wish that it supports both an XWiki version prior to Nested Spaces and one after Nested Spaces.

You could check if the current XWiki version supports Nested Spaces by using from Velocity:

#set ($supportsNS = $services.extension.core.getCoreExtension('org.xwiki.platform:xwiki-platform-model').id.version.compareTo($services.extension.parseVersion('7.2')) >= 0)
#if ($supportsNS)
  ...
#else
  ...
#end

Get Connected