diff --git a/api-openbis-javascript/bin/build.sh b/api-openbis-javascript/bin/build.sh index 57377a9d8571fda6bd04283a9300850bbc96d2ab..e0737d0fa7f4a85f3ba58fdb0facd696c228260f 100755 --- a/api-openbis-javascript/bin/build.sh +++ b/api-openbis-javascript/bin/build.sh @@ -15,7 +15,7 @@ mkdir -p $TEMP_DIR # create a list of all *.js files from chosen V3 folders cd $V3_DIR -find ./as ./dss ./util -name "*.js" | sed 's/^.\//"/g' | sed 's/.js$/",/g' > $TEMP_DIR/files.js +find ./as ./dss ./imaging ./util -name "*.js" | sed 's/^.\//"/g' | sed 's/.js$/",/g' > $TEMP_DIR/files.js # create config files from their templates by replacing '__FILES__' with a content of 'files.js' cd $CURRENT_DIR diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetConfig.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetConfig.js new file mode 100644 index 0000000000000000000000000000000000000000..5d625fba26f35dab9fdad1c6822d8a64fe28cec4 --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetConfig.js @@ -0,0 +1,91 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingDataSetConfig = function() { + }; + stjs.extend(ImagingDataSetConfig, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingDataSetConfig'; + constructor.serialVersionUID = 1; + prototype.adaptor = null; + prototype.version = null; + prototype.speeds = null; + prototype.resolutions = null; + prototype.playable = null; + prototype.exports = null; + prototype.inputs = null; + prototype.metadata = null; + + prototype.getAdaptor = function() { + return this.adaptor; + }; + prototype.setAdaptor = function(adaptor) { + this.adaptor = adaptor; + }; + prototype.getVersion = function() { + return this.version; + }; + prototype.setVersion = function(version) { + this.version = version; + }; + prototype.getSpeeds = function() { + return this.speeds; + }; + prototype.setSpeeds = function(speeds) { + this.speeds = speeds; + }; + prototype.getResolutions = function() { + return this.resolutions; + }; + prototype.setResolutions = function(resolutions) { + this.resolutions = resolutions; + }; + prototype.getPlayable = function() { + return this.playable; + }; + prototype.setPlayable = function(playable) { + this.playable = playable; + }; + prototype.getExports = function() { + return this.exports; + }; + prototype.setExports = function(exports) { + this.exports = exports; + }; + prototype.getInputs = function() { + return this.inputs; + }; + prototype.setInputs = function(inputs) { + this.inputs = inputs; + }; + prototype.getMetadata = function() { + return this.metadata; + }; + prototype.setMetadata = function(metadata) { + this.metadata = metadata; + }; + prototype.toString = function() { + return "ImagingDataSetConfig: " + this.adaptor; + }; + + }, { + resolutions : { + name : "List", + arguments : [ "String"] + }, + speeds : { + name : "List", + arguments : [ "Integer"] + }, + exports : { + name : "List", + arguments : [ "ImagingDataSetControl"] + }, + inputs : { + name : "List", + arguments : [ "ImagingDataSetControl"] + }, + metadata : { + name : "Map", + arguments : [ "String", "String" ] + } + }); + return ImagingDataSetConfig; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetControl.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetControl.js new file mode 100644 index 0000000000000000000000000000000000000000..464b8452d40b7ae297d3743b2dc6088822af2591 --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetControl.js @@ -0,0 +1,112 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingDataSetControl = function() { + }; + stjs.extend(ImagingDataSetControl, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingDataSetControl'; + constructor.serialVersionUID = 1; + prototype.label = null; + prototype.section = null; + prototype.type = null; + prototype.values = null; + prototype.unit = null; + prototype.range = null; + prototype.multiselect = null; + prototype.playable = null; + prototype.speeds = null; + prototype.visibility = null; + prototype.metadata = null; + + prototype.getLabel = function() { + return this.label; + }; + prototype.setLabel = function(label) { + this.label = label; + }; + prototype.getSection = function() { + return this.section; + }; + prototype.setSection = function(section) { + this.section = section; + }; + prototype.getType = function() { + return this.type; + }; + prototype.setType = function(type) { + this.type = type; + }; + prototype.getValues = function() { + return this.values; + }; + prototype.setValues = function(values) { + this.values = values; + }; + prototype.getUnit = function() { + return this.unit; + }; + prototype.setUnit = function(unit) { + this.unit = unit; + }; + prototype.getRange = function() { + return this.range; + }; + prototype.setRange = function(range) { + this.range = range; + }; + prototype.getMultiselect = function() { + return this.multiselect; + }; + prototype.setMultiselect = function(multiselect) { + this.multiselect = multiselect; + }; + prototype.getPlayable = function() { + return this.playable; + }; + prototype.setPlayable = function(playable) { + this.playable = playable; + }; + prototype.getSpeeds = function() { + return this.speeds; + }; + prototype.setSpeeds = function(speeds) { + this.speeds = speeds; + }; + prototype.getVisibility = function() { + return this.visibility; + }; + prototype.setVisibility = function(visibility) { + this.visibility = visibility; + }; + prototype.getMetadata = function() { + return this.metadata; + }; + prototype.setMetadata = function(metadata) { + this.metadata = metadata; + }; + prototype.toString = function() { + return "ImagingDataSetControl: " + this.label; + }; + + }, { + values : { + name : "List", + arguments : [ "String"] + }, + visibility: { + name : "List", + arguments : [ "ImagingDataSetControlVisibility"] + }, + range : { + name : "List", + arguments : [ "String"] + }, + speeds : { + name : "List", + arguments : [ "Integer"] + }, + metadata : { + name : "Map", + arguments : [ "String", "String" ] + } + }); + return ImagingDataSetControl; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetControlVisibility.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetControlVisibility.js new file mode 100644 index 0000000000000000000000000000000000000000..a7d67e033d470627b18748cbb2764c33195bd5e2 --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetControlVisibility.js @@ -0,0 +1,51 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingDataSetControlVisibility = function() { + }; + stjs.extend(ImagingDataSetControlVisibility, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingDataSetControlVisibility'; + constructor.serialVersionUID = 1; + prototype.label = null; + prototype.values = null; + prototype.range = null; + prototype.unit = null; + + prototype.getLabel = function() { + return this.label; + }; + prototype.setLabel = function(label) { + this.label = label; + }; + prototype.getValues = function() { + return this.values; + }; + prototype.setValues = function(values) { + this.values = values; + }; + prototype.getUnit = function() { + return this.unit; + }; + prototype.setUnit = function(unit) { + this.unit = unit; + }; + prototype.getRange = function() { + return this.range; + }; + prototype.setRange = function(range) { + this.range = range; + }; + prototype.toString = function() { + return "ImagingDataSetControlVisibility: " + this.label; + }; + + }, { + values : { + name : "List", + arguments : [ "String"] + }, + range : { + name : "List", + arguments : [ "String"] + } + }); + return ImagingDataSetControlVisibility; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetExport.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetExport.js new file mode 100644 index 0000000000000000000000000000000000000000..16d5eb8b3830b01012932b7ca8c24d142f928dba --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetExport.js @@ -0,0 +1,37 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingDataSetExport = function() { + }; + stjs.extend(ImagingDataSetExport, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingDataSetExport'; + constructor.serialVersionUID = 1; + prototype.config = null; + prototype.metadata = null; + + prototype.getConfig = function() { + return this.config; + }; + prototype.setConfig = function(config) { + this.config = config; + }; + prototype.getMetadata = function() { + return this.metadata; + }; + prototype.setMetadata = function(metadata) { + this.metadata = metadata; + }; + prototype.toString = function() { + return "ImagingDataSetExport: " + this.config; + }; + + }, { + config : { + name : "Map", + arguments : [ "String", "Serializable" ] + }, + metadata : { + name : "Map", + arguments : [ "String", "String" ] + } + }); + return ImagingDataSetExport; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetImage.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetImage.js new file mode 100644 index 0000000000000000000000000000000000000000..f38c1c2f6c595c5f0fd06eb4ba1b9432775cd162 --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetImage.js @@ -0,0 +1,55 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingDataSetImage = function() { + }; + stjs.extend(ImagingDataSetImage, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingDataSetImage'; + constructor.serialVersionUID = 1; + prototype.previews = null; + prototype.config = null; + prototype.index = null; + prototype.metadata = null; + + prototype.getPreviews = function() { + return this.previews; + }; + prototype.setPreviews = function(previews) { + this.previews = previews; + }; + prototype.getConfig = function() { + return this.config; + }; + prototype.setConfig = function(config) { + this.config = config; + }; + prototype.getIndex = function() { + return this.index; + }; + prototype.setIndex = function(index) { + this.index = index; + }; + prototype.getMetadata = function() { + return this.metadata; + }; + prototype.setMetadata = function(metadata) { + this.metadata = metadata; + }; + prototype.toString = function() { + return "ImagingDataSetImage: " + this.previews; + }; + + }, { + previews : { + name : "List", + arguments : [ "ImagingDataSetPreview"] + }, + config : { + name : "Map", + arguments : [ "String", "Serializable" ] + }, + metadata : { + name : "Map", + arguments : [ "String", "Serializable" ] + } + }); + return ImagingDataSetImage; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetMultiExport.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetMultiExport.js new file mode 100644 index 0000000000000000000000000000000000000000..55a2801e0f59081afd8aa7114b379795e73ba6aa --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetMultiExport.js @@ -0,0 +1,51 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingDataSetMultiExport = function() { + }; + stjs.extend(ImagingDataSetMultiExport, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingDataSetMultiExport'; + constructor.serialVersionUID = 1; + prototype.permId = null; + prototype.index = null; + prototype.config = null; + prototype.metadata = null; + + prototype.getPermId = function() { + return this.permId; + }; + prototype.setPermId = function(permId) { + this.permId = permId; + }; + prototype.getIndex = function() { + return this.index; + }; + prototype.setIndex = function(index) { + this.index = index; + }; + prototype.getConfig = function() { + return this.config; + }; + prototype.setConfig = function(config) { + this.config = config; + }; + prototype.getMetadata = function() { + return this.metadata; + }; + prototype.setMetadata = function(metadata) { + this.metadata = metadata; + }; + prototype.toString = function() { + return "ImagingDataSetExport: " + this.config; + }; + + }, { + config : { + name : "Map", + arguments : [ "String", "Serializable" ] + }, + metadata : { + name : "Map", + arguments : [ "String", "Serializable" ] + } + }); + return ImagingDataSetMultiExport; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetPreview.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetPreview.js new file mode 100644 index 0000000000000000000000000000000000000000..51a2746e1e5c67ad4b4c323345e9bad767c5b9a1 --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetPreview.js @@ -0,0 +1,79 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingDataSetPreview = function() { + }; + stjs.extend(ImagingDataSetPreview, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingDataSetPreview'; + constructor.serialVersionUID = 1; + prototype.config = null; + prototype.format = null; + prototype.bytes = null; + prototype.show = null; + prototype.width = null; + prototype.height = null; + prototype.index = null; + prototype.metadata = null; + + prototype.getConfig = function() { + return this.config; + }; + prototype.setConfig = function(config) { + this.config = config; + }; + prototype.getFormat = function() { + return this.format; + }; + prototype.setFormat = function(format) { + this.format = format; + }; + prototype.getBytes = function() { + return this.bytes; + }; + prototype.setBytes = function(bytes) { + this.bytes = bytes; + }; + prototype.isShow = function() { + return this.show; + }; + prototype.setShow = function(show) { + this.show = show; + }; + prototype.getWidth = function() { + return this.bytes; + }; + prototype.setWidth = function(width) { + this.width = width; + }; + prototype.getHeight = function() { + return this.height; + }; + prototype.setHeight = function(height) { + this.height = height; + }; + prototype.getIndex = function() { + return this.index; + }; + prototype.setIndex = function(index) { + this.index = index; + }; + prototype.getMetadata = function() { + return this.metadata; + }; + prototype.setMetadata = function(metadata) { + this.metadata = metadata; + }; + prototype.toString = function() { + return "ImagingDataSetPreview: " + this.config; + }; + + }, { + config : { + name : "Map", + arguments : [ "String", "Serializable" ] + }, + metadata : { + name : "Map", + arguments : [ "String", "Serializable" ] + } + }); + return ImagingDataSetPreview; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetPropertyConfig.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetPropertyConfig.js new file mode 100644 index 0000000000000000000000000000000000000000..26c4226f907152bb315800b08e09c511f7e3e040 --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingDataSetPropertyConfig.js @@ -0,0 +1,34 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingDataSetPropertyConfig = function() { + }; + stjs.extend(ImagingDataSetPropertyConfig, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingDataSetPropertyConfig'; + constructor.serialVersionUID = 1; + prototype.config = null; + prototype.images = null; + + prototype.getConfig = function() { + return this.config; + }; + prototype.setConfig = function(config) { + this.config = config; + }; + prototype.getImages = function() { + return this.images; + }; + prototype.setSection = function(images) { + this.images = images; + }; + + prototype.toString = function() { + return "ImagingDataSetPropertyConfig: " + this.label; + }; + + }, { + images : { + name : "List", + arguments : [ "ImagingDataSetImage"] + } + }); + return ImagingDataSetPropertyConfig; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingExportContainer.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingExportContainer.js new file mode 100644 index 0000000000000000000000000000000000000000..80dbafa42cdc1c05162c04a94531f39ff2b24ec9 --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingExportContainer.js @@ -0,0 +1,58 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingExportContainer = function() { + }; + stjs.extend(ImagingExportContainer, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingExportContainer'; + constructor.serialVersionUID = 1; + prototype.permId = null; + prototype.type = null; + prototype.error = null; + prototype.index = null; + prototype.export = null; + prototype.url = null; + + prototype.getPermId = function() { + return this.permId; + }; + prototype.setPermId = function(permId) { + this.permId = permId; + }; + prototype.getType = function() { + return this.type; + }; + prototype.setType = function(type) { + this.type = type; + }; + prototype.getError = function() { + return this.error; + }; + prototype.setError = function(error) { + this.error = error; + }; + prototype.getIndex = function() { + return this.index; + }; + prototype.setIndex = function(index) { + this.index = index; + }; + prototype.getExport = function() { + return this.export; + }; + prototype.setExport = function(exportVar) { + this.export = exportVar; + }; + prototype.getUrl = function() { + return this.url; + }; + prototype.setUrl = function(url) { + this.url = url; + }; + prototype.toString = function() { + return "ImagingExportContainer: " + this.permId; + }; + + }, { + + }); + return ImagingExportContainer; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingMultiExportContainer.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingMultiExportContainer.js new file mode 100644 index 0000000000000000000000000000000000000000..3946f8cd8867c0294ff2ba231f3d905a56d86c60 --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingMultiExportContainer.js @@ -0,0 +1,47 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingMultiExportContainer = function() { + }; + stjs.extend(ImagingMultiExportContainer, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingMultiExportContainer'; + constructor.serialVersionUID = 1; + prototype.type = null; + prototype.error = null; + prototype.exports = null; + prototype.url = null; + + prototype.getType = function() { + return this.type; + }; + prototype.setType = function(type) { + this.type = type; + }; + prototype.getError = function() { + return this.error; + }; + prototype.setError = function(error) { + this.error = error; + }; + prototype.getExports = function() { + return this.exports; + }; + prototype.setExports = function(exports) { + this.exports = exports; + }; + prototype.getUrl = function() { + return this.url; + }; + prototype.setUrl = function(url) { + this.url = url; + }; + prototype.toString = function() { + return "ImagingMultiExportContainer: "; + }; + + }, { + exports : { + name : "List", + arguments : [ "ImagingDataSetMultiExport"] + } + }); + return ImagingMultiExportContainer; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/imaging/dto/ImagingPreviewContainer.js b/api-openbis-javascript/src/v3/imaging/dto/ImagingPreviewContainer.js new file mode 100644 index 0000000000000000000000000000000000000000..501b0a83cfce8ed9b27c8df18b44f7c134011eeb --- /dev/null +++ b/api-openbis-javascript/src/v3/imaging/dto/ImagingPreviewContainer.js @@ -0,0 +1,51 @@ +define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) { + var ImagingPreviewContainer = function() { + }; + stjs.extend(ImagingPreviewContainer, null, [], function(constructor, prototype) { + prototype['@type'] = 'imaging.dto.ImagingPreviewContainer'; + constructor.serialVersionUID = 1; + prototype.permId = null; + prototype.type = null; + prototype.error = null; + prototype.index = null; + prototype.preview = null; + + prototype.getPermId = function() { + return this.permId; + }; + prototype.setPermId = function(permId) { + this.permId = permId; + }; + prototype.getType = function() { + return this.type; + }; + prototype.setType = function(type) { + this.type = type; + }; + prototype.getError = function() { + return this.error; + }; + prototype.setError = function(error) { + this.error = error; + }; + prototype.getIndex = function() { + return this.index; + }; + prototype.setIndex = function(index) { + this.index = index; + }; + prototype.getPreview = function() { + return this.preview; + }; + prototype.setPreview = function(preview) { + this.preview = preview; + }; + prototype.toString = function() { + return "ImagingPreviewContainer: " + this.permId; + }; + + }, { + + }); + return ImagingPreviewContainer; +}) \ No newline at end of file diff --git a/api-openbis-javascript/src/v3/openbis.js b/api-openbis-javascript/src/v3/openbis.js index f7b04ec5da23c81b264ce065f74219d5761a1c17..a03482949705d8c6667cfe4fb257bdc79a376d1b 100644 --- a/api-openbis-javascript/src/v3/openbis.js +++ b/api-openbis-javascript/src/v3/openbis.js @@ -295,6 +295,28 @@ define([ 'jquery', 'util/Json', 'as/dto/datastore/search/DataStoreSearchCriteria return dfd.promise(); } + this.executeCustomDSSService = function(serviceId, options) { + var dfd = jquery.Deferred(); + this._getDataStores().done(function(dataStores) { + if (dataStores.length === 1) { + facade._private.ajaxRequest({ + url: createUrl(dataStores[0]), + data: { + "method": "executeCustomDSSService", + "params": [facade._private.sessionToken, serviceId, options] + } + }).done(function (response) { + dfd.resolve(response); + }).fail(function (error) { + dfd.reject(error); + }); + } else { + dfd.reject("Please specify exactly one data store"); + } + }); + return dfd.promise(); + } + function getUUID() { return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) @@ -2347,27 +2369,16 @@ define([ 'jquery', 'util/Json', 'as/dto/datastore/search/DataStoreSearchCriteria }); } - this.executeExport = function(exportData, exportOptions) { - var thisFacade = this; - return thisFacade._private.ajaxRequest({ - url : openbisUrl, - data : { - "method" : "executeExport", - "params" : [ thisFacade._private.sessionToken, exportData, exportOptions ] - } - }); - } - - this.isSessionActive = function() { - var thisFacade = this; - return thisFacade._private.ajaxRequest({ - url : openbisUrl, - data : { - "method" : "isSessionActive", - "params" : [ thisFacade._private.sessionToken ] - } - }); - } + this.isSessionActive = function() { + var thisFacade = this; + return thisFacade._private.ajaxRequest({ + url : openbisUrl, + data : { + "method" : "isSessionActive", + "params" : [ thisFacade._private.sessionToken ] + } + }); + } this.getDataStoreFacade = function() { var dataStoreCodes = [];