Class: repository

CTS.repository. repository

new repository(endpoint, version, namespace)

CTS Repository object
Parameters:
Name Type Description
endpoint string Endpoint of the repository
version integer Version used by CTS API
namespace string Namespace for xml nodes
Properties:
Name Type Description
version integer Version used by CTS API
namespace namespace Namespace used for XML parsing
inventory dict Dictionaries of inventory's label
inventories dict Dictionaries of inventory object
endpoint CTS.endpoint.Endpoint Endpoint instance where the repository should make request

Methods

<static> addInventory(name, label)

Add an inventory to the Repository Object
Parameters:
Name Type Argument Description
name string Database name of the inventory
label string <nullable>
Pretty name for UI (optional)

<static> delInventory(name)

Remove an inventory
Parameters:
Name Type Description
name string Database name of the inventory

<static> load(callback, error_callback, inventory_name)

Get the repository from source url
Parameters:
Name Type Argument Description
callback function <nullable>
Function to call when data are loaded
error_callback function <nullable>
Function to call when data are not loaded
inventory_name ?Array.<string> <nullable>
Name of the inventory to load

<static> setEndpoint(url)

Set the endpoint URL of the object
Parameters:
Name Type Description
url Array.<string> A url for the repository

<static> setInventory(dict)

Set the inventories
Parameters:
Name Type Description
dict dict A dictionary where keys are inventory's name and value a label

fromObject(object)

Converts a json Object to CTS Abstractions
Parameters:
Name Type Description
object Object.<string, Object> List of inventories