Server-Side Javascript ES6 API Reference
RMPProject
Methods for the Management of Projects
Get Project Vault
Retrieve the project vault associated with the project containing the current request.
Syntax : RMPProject.getProjectVault();
Parameters : None
Returns : The current request project vault. A project vault value depends on the current request execution mode.
Type : Map
Call Example :
<@script env="js">
var f = RMPProject.getProjectVault();
RMPData.setOutput(f);
</@script>
Save Project Vault
Modify or create a project vault.
Syntax : RMPProject.saveProjectVault(data);
Parameters :
Name | Type | Description |
---|---|---|
vault | Map | Configurable object representing the vault associated with the current project. |
Returns : The updated project vault.
Type : Map
Call Example :
<@script env="js">
var payload = {"project":"TEST","value":"Value test"};
var f = RMPProject.saveProjectVault(payload);
RMPData.setOutput(f);
</@script>
Delete Project Vault
Delete a project vault.
Syntax : RMPProject.deleteProjectVault();
Parameters : None
Returns : True if the project vault has been found and deleted, false otherwise.
Type : Boolean
Call Example :
<@script env="js">
var f = RMPProject.deleteProjectVault();
RMPData.setOutput(f);
</@script>
Get Access URL
Update the metadata of a project.
Syntax : RMPProject.getAccessUrl(includeProtocol);
Parameters :
Name | Type | Description |
---|---|---|
includeProtocol | Boolean | Whether or not including the protocol in the URL. |
Returns : URL with or without protocol.
Type : String
Call Example :
<@script env="js">
var f = RMPProject.getAccessUrl(true);
RMPData.setOutput(f);
</@script>
Get Custom List
Get the content of a custom list.
Syntax : RMPProject.getCustomList(listId);
Parameters :
Name | Type | Description |
---|---|---|
listId | String | Identifier of a custom list. |
Returns : The custom list
Type : Array of maps
Data Structure
[{"label":"{String}","value":"{String}"}, ...]}
Call Example :
<@script env="js">
var f = RMPProject.getCustomList("b1eeebf5-d26a-4374-bf4c-03d340f17596");
RMPData.setOutput(f);
</@script>
Save Custom List
Update a custom list with new content.
Syntax : RMPRequest.saveCustomList(listID, Map data);
Parameters :
Name | Type | Description |
---|---|---|
listID | String | Identifier of a custom list |
listId | Array | New content of the custom list |
Throws : Custom list not found
Returns : New content.
Type : Array
Call Example :
<@script env="js">
var payload = [{"label":"ab","value":"c"},{"label":"cd","value":"d"}]
var v = RMPProject.saveCustomList("b1eeebf5-d26a-4374-bf4c-03d340f17596", payload);
RMPData.setOutput(v);
</@script>
Get Project Metadata
Get the metadata of a project.
Syntax :
- RMPProject.getProjectMetadata();
- RMPProject.getProjectMetadata(projectId);
Parameters :
Name | Type | Description |
---|---|---|
projectId (optional) | Integer | Identifier of the project. Default: current project |
Returns : Project metadata.
Type : Map
Call Example :
<@script env="js">
var f = RMPProject.getProjectMetadata(23324452);
RMPData.setOutput(f);
</@script>
Save Project Metadata
Update the metadata of a project.
Syntax :
- RMPProject.saveProjectMetadata(projectId, name,metaData);
- RMPProject.saveProjectMetadata(name,metaData);
Parameters :
Name | Type | Description |
---|---|---|
projectId (optional) | Long | The project ID. Default: current project |
name | String | Identifier of the metadata entry. |
metaData | Map | Project metadata |
Returns : Project metadata name.
Type : String
Call Example :
<@script env="js">
var f = RMPProject.saveProjectMetadata("testProjectMeta",{"name":"test3"});
RMPData.setOutput(f);
</@script>
Get OAuth2 Token
Retrieve an OAuth2 service token.
Syntax : RMPProject.getOAuth2Token(service);
Parameters :
Name | Type | Description |
---|---|---|
service | string | Name of the OAuth2 service which token is to be retrieved. |
Returns :
The OAuth2 token is associated with the specified service. If found this token will contain at least an access_token
field. This can be used for example in the token field of an OAuth2 connector configuration: RMPProject.getOAuth2Token("my_service").access_token
. An OAuth2 service token value depends on the current request execution mode.
Type : Map
Data Structure
{"access_token", "{String}",
"refresh_token", "{String}",
"expires_in", {Long},
"mode", "{String}",
"status", "{String}"
Note: status is either "Ok" or an error message
Call Example :
<@script env="js">
var j = RMPProject.getOAuth2Token("google");
RMPData.setOutput(j);
</@script>
Please give details of the problem