Project
Information about a project, its members and the model's schema.
Example
// to fetch the current Project var entity = insight .getView() .getProject();
Method summary
name | description |
---|---|
createAttachment | Create a new project attachment. |
createFolder | Create a new folder as a child of parent. |
createScenario | Create a new scenario inside the current project. |
getAttachmentTagNames | Get the list of attachment tag names defined by the project. |
getAttachmentTags | Get the list of attachment tags defined by the project. |
getExecutionModes | Returns the project's execution modes, indexed by name |
getId | The project's id. |
getModelSchema | The schema of the model used by this project. |
getName | The name of this project. |
getUsers | Get a list of users associated with the project. |
Methods
- createAttachment ( options ) → {Promise}
-
Create a new project attachment.
Parameters:
paramsName Type Argument Description options typeNewAttachmentOptionsoptional detailsReturns:returns tableType Description typePromiseResolves when user closes the editor or if attachment create fails Example
examples
Back to Topproject.createAttachment({filename: 'my_file.xml', tag: 'atag'}) .then(function(data) { console.log(data.attachment); });
- createFolder ( parent, name ) → {Promise.<Object>}
-
Parameters:
paramsName Type Argument Description parent typeFolderoptional the parent node to create the folder on name typestringthe name of the folder to create detailsReturns:returns tableType Description typePromise.<Object>Example
examples
Back to Top// creates a new folder on a specified parent project.createFolder(parentObj, 'my new folder'); // creates a new folder on the current project project.createFolder('my new folder');
- createScenario ( parent, name, type ) → {Promise.<Object>}
-
Parameters:
paramsName Type Argument Description parent typeFolder | Projectoptional the parent node to create the scenario on name typestringthe name of the scenario to create type typestringoptional the type of scenario to create detailsReturns:returns tableType Description typePromise.<Object>Example
examples
Back to Topproject.createScenario(parentObj, 'my new scenario', null);
- getAttachmentTagNames ( ) → {Promise.<Array.<string>>}
-
Get the list of attachment tag names defined by the project.
detailsReturns:returns tableType Description typePromise.<Array.<string>>Promise containing an array of strings or an empty array if no attachment tag names found. Example
examples
Back to Topvar attachmentTagNames = project.getAttachmentTagNames();
- getAttachmentTags ( ) → {Promise.<Array.<AttachmentTag>>}
-
Get the list of attachment tags defined by the project.
detailsReturns:returns tableType Description typePromise.<Array.<AttachmentTag>>Promise containing an array of AttachmentTag objects or an empty array if no attachment tags found. Example
examples
Back to Topvar attachmentTags = project.getAttachmentTags();
- getExecutionModes ( ) → {Object.<string, ExecutionMode>}
-
Returns the project's execution modes, indexed by name
detailsReturns:returns tableType Description typeObject.<string, ExecutionMode> - getId ( ) → {string}
-
The project's id.
detailsReturns:returns tableType Description typestringThe project's Id Example
examples
Back to Topvar id = project.getId();
- getModelSchema ( ) → {ModelSchema}
-
The schema of the model used by this project.
detailsReturns:returns tableType Description typeModelSchemaThe schema of the model used by this project Example
examples
Back to Topvar modelSchema = project.getModelSchema();
- getName ( ) → {string}
-
The name of this project.
detailsReturns:returns tableType Description typestringThe name of this project Example
examples
Back to Topvar name = project.getName();
- getUsers ( options ) → {Promise.<Array.<User>>}
-
Get a list of users associated with the project. Optionally filter the result by a custom authority.
Parameters:
paramsName Type Argument Description options typeobjectoptional fetch parameters and asynchronous callbacks Properties
paramsName Type Argument Description authorityFilter typestringoptional custom authority to filter user list by detailsReturns:returns tableType Description typePromise.<Array.<User>>Promise containing an array of User objects or an empty array if no items found. The array elements will be ordered alphanumerically by username. The User objects will only contain custom authorities. Also the User object will not contain any authority groups. Example
examples
Back to Topvar usersList = project.getUsers();
method
method
method
method
method
method
method
method
method
method