Admin API
Contents
This API provides admin-related functions.
Usage
Add the following to your build.gradle file:
dependencies {
  include "com.enonic.xp:lib-admin:${xpVersion}"
}
    Add the import statement to your controller:
import adminLib from '/lib/xp/admin';
    You are now ready to use the API.
Functions
widgetUrl
Returns the URL for a widget.
Parameters
| Name | Kind | Details | 
|---|---|---|
| 
         application  | 
       
         string  | 
       
         Full application name. (f.ex, 'com.enonic.xp.app.main')  | 
      
| 
         widget  | 
       
         string  | 
       
         Name of the widget. (f.ex, 'launcher')  | 
      
| 
         type  | 
       
         string  | 
       
         Either   | 
      
| 
         params  | 
       
         object  | 
       
         Custom query parameters to append to the url.  | 
      
Returns
string : URL of the requested admin tool.
getToolUrl
Returns URL of an admin tool in an application.
Parameters
| Name | Kind | Details | 
|---|---|---|
| 
         application  | 
       
         string  | 
       
         Full application name (f.ex, 'com.enonic.app')  | 
      
| 
         tool  | 
       
         string  | 
       
         Name of the tool inside an app (f.ex, 'main')  | 
      
Returns
string : URL of the requested admin tool.
getHomeToolUrl
Returns the URL for the Home admin tool.
Parameters
An object with the following keys and their values:
| Name | Kind | Details | 
|---|---|---|
| 
         type  | 
       
         string  | 
       
         Either   | 
      
Returns
string : The URL pointing to the Home Tool
getVersion
Returns version of XP installation.
Parameters
None
Returns
string : The version number of the XP runtime.