cogAPI related to the XWiki instance (e.g. compute a unique id for the instance)
TypeJAR
Developed by

XWiki Development Team

Active Installs0
Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1
Bundled With

XWiki Enterprise

Compatibility

Feature added in XWiki 5.2M2

Installable with the Extension Manager

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:

@Inject
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:

public interface InstanceIdManager
{
   /**
     * @return the Instance id or null if it isn't set
     */

    InstanceId getInstanceId();
}

Script service

Since 8.3RC1 Getting the XWiki instance id:

{{velocity}}
  $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). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

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 9.9):

Tags:
Created by Vincent Massol on 2013/09/09 07:44
    

Get Connected