Interface: Icat

Icat

Methods

facility() → {Facility}

Returns the Facility that this particular Icat belongs to.
Source:
Returns:
Type
Facility

getSize(entityType, entityId, options) → {Promise.<number>}

Gets the total file size of a particular entity.
Parameters:
Name Type Description
entityType string the type of entity can be 'investigation', 'dataset' or 'datafile'
entityId number the id of the entity
options object as specified in the Angular documentation
Source:
Returns:
the defered size in bytes
Type
Promise.<number>

getSize(entityType, entityId, timeout) → {Promise.<number>}

Gets the total file size of a particular entity.
Parameters:
Name Type Description
entityType string the type of entity can be 'investigation', 'dataset' or 'datafile'
entityId number the id of the entity
timeout Promise if resolved will cancel the request
Source:
Returns:
the defered size in bytes
Type
Promise.<number>

getSize(entityType, entityId) → {Promise.<number>}

Gets the total file size of a particular entity.
Parameters:
Name Type Description
entityType string the type of entity can be 'investigation', 'dataset' or 'datafile'
entityId number the id of the entity
Source:
Returns:
the defered size in bytes
Type
Promise.<number>

login(plugin, credentials) → {Promise}

Logs a user into this Icat with a username and password.
Parameters:
Name Type Description
plugin string The type of authentication mechanism
credentials object
Source:
Returns:
Type
Promise

login(plugin, username, password) → {Promise}

Logs a user into this Icat with a username and password.
Parameters:
Name Type Description
plugin string The type of authentication mechanism
username string
password string
Source:
Returns:
Type
Promise

logout(isSoft)

Destroys a users session
Parameters:
Name Type Description
isSoft boolean if true the session will only be destroyed in the browser but not on the server
Source:
Returns:
Promise

logout()

Destroys a users session
Source:
Returns:
Promise

query(query, options) → {Promise.<Array.<IcatEntity>>}

Performs Icat JPQL queries and returns the results.
Parameters:
Name Type Description
query array the jqpl expression
options object as specified in the Angular documentation
Source:
Returns:
a deferred array of entities
Type
Promise.<Array.<IcatEntity>>
Example
var investigationId = 3456;
var defered = $q.defer();
var page = 2;
var pageSize = 10;

tc.icat('LILS').query([
    "select dataset from Dataset dataset, dataset.investigation as investigation",
    "where id = ?", investigationId,
    "limit ?, ?", page, pageSize
], {
    cache: false,
    timeout: defered.promise
}).then(function(datasets){
     console.log(datasets);
});

query(timeout, query) → {Promise.<Array.<IcatEntity>>}

Performs Icat JPQL queries and returns the results.
Parameters:
Name Type Description
timeout Promise if resolved will cancel the request
query array the jqpl expression
Source:
Returns:
a deferred array of entities
Type
Promise.<Array.<IcatEntity>>
Example
var investigationId = 3456;
var defered = $q.defer();
var page = 2;
var pageSize = 10;

tc.icat('LILS').query(defered.promise, [
    "select dataset from Dataset dataset, dataset.investigation as investigation",
    "where id = ?", investigationId,
    "limit ?, ?", page, pageSize
]).then(function(datasets){
     console.log(datasets);
});

query(timeout, query) → {Promise.<Array.<IcatEntity>>}

Performs Icat JPQL queries and returns the results.
Parameters:
Name Type Description
timeout Promise if resolved will cancel the request
query string the jqpl expression
Source:
Returns:
a deferred array of entities
Type
Promise.<Array.<IcatEntity>>
Example
var defered = $q.defer();
var query = "select dataset from Dataset dataset, dataset.investigation as investigation where investigation.id = 2342";

tc.icat('LILS').query(defered.promise, query).then(function(datasets){
     console.log(datasets);
});

query(query) → {Promise.<Array.<IcatEntity>>}

Performs Icat JPQL queries and returns the results.
Parameters:
Name Type Description
query array the jqpl expression
Source:
Returns:
a deferred array of entities
Type
Promise.<Array.<IcatEntity>>
Example
var investigationId = 3456;
var page = 2;
var pageSize = 10;

tc.icat('LILS').query([
    "select dataset from Dataset dataset, dataset.investigation as investigation",
    "where id = ?", investigationId,
    "limit ?, ?", page, pageSize
]).then(function(datasets){
     console.log(datasets);
});

query(query) → {Promise.<Array.<IcatEntity>>}

Performs Icat JPQL queries and returns the results.
Parameters:
Name Type Description
query string the jqpl expression
Source:
Returns:
a deferred array of entities
Type
Promise.<Array.<IcatEntity>>
Example
var query = "select dataset from Dataset dataset, dataset.investigation as investigation where investigation.id = 2342";

tc.icat('LILS').query(query).then(function(datasets){
     console.log(datasets);
});

queryBuilder(entityType) → {IcatQueryBuilder}

Returns a new IcatQueryBuilder for this Icat.
Parameters:
Name Type Description
entityType string the type of entities you wish to return e.g. 'dataset' or 'investigation' etc
Source:
Returns:
Type
IcatQueryBuilder

refreshSession() → {Promise}

Refreshes the session's time to live.
Source:
Returns:
Type
Promise

session() → {object}

Returns and object containing the data stored within this session.
Source:
Returns:
Type
object

version() → {Promise.<string>}

Returns the current version of this Icat.
Source:
Returns:
Type
Promise.<string>

write(entities, options) → {Promise.<Array.<number>>}

Creates or updates entities for this Icat.
Parameters:
Name Type Description
entities Array.<object> an array of entities to be written to this Icat
options object as specified in the Angular documentation
Source:
Returns:
a deferred array of entity ids that have been created
Type
Promise.<Array.<number>>

write(timeout, entities) → {Promise.<Array.<number>>}

Creates or updates entities for this Icat.
Parameters:
Name Type Description
timeout Promise if resolved will cancel the request
entities Array.<object> an array of entities to be written to this Icat
Source:
Returns:
a deferred array of entity ids that have been created
Type
Promise.<Array.<number>>

write(entities) → {Promise.<Array.<number>>}

Creates or updates entities for this Icat.
Parameters:
Name Type Description
entities Array.<object> an array of entities to be written to this Icat
Source:
Returns:
a deferred array of entity ids that have been created
Type
Promise.<Array.<number>>