Instance API
API related to the XWiki instance (e.g. compute a unique id for the instance) |
Type | JAR |
Category | |
Developed by | |
Rating | |
License | GNU Lesser General Public License 2.1 |
Bundled With | XWiki Standard |
Compatibility | Feature added in XWiki 5.2M2 |
Description
At the moment the only API provided is one to generate and retrieve an id unique per XWiki instance. This can be used to identify uniquely a XWiki instance, even across restarts and across upgrades since the unique id is stored in XWiki's database.
To get the InstanceIdManager:
private Provider<InstanceIdManager> idManagerProvider;
Note the usage of a Provider. This is required only when the component in which you're injecting the Instance Id Manager is loaded before the XWiki Store has been initialized.
The API is:
{
/**
* @return the Instance id or null if it isn't set
*/
InstanceId getInstanceId();
}
Script service
Getting the XWiki instance id:
$services.instance.getInstanceId()
{{/velocity}}
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).
You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.
Dependencies
Dependencies for this extension (org.xwiki.platform:xwiki-platform-instance 16.10.1):
- org.xwiki.commons:xwiki-commons-component-api 16.10.1
- org.xwiki.platform:xwiki-platform-oldcore 16.10.1