From eb157360e2dcacbb66dc27aeb4be9a187211b721 Mon Sep 17 00:00:00 2001 From: pkupczyk <pkupczyk> Date: Fri, 9 Aug 2013 06:42:02 +0000 Subject: [PATCH] SP-789 / BIS-503 : SOB-125 exception logged when calling load data sets - add js tests SVN: 29617 --- .../as/webapps/openbis-test/html/openbis-test.js | 12 ++++++++++++ .../cisd/openbis/public/resources/js/openbis.js | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js index e4580589cbf..cc6303cc6c7 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-test/html/openbis-test.js @@ -1534,6 +1534,18 @@ test("getPathToDataSet()", function(){ }); }); +test("tryGetPathToDataSet()", function(){ + createFacadeAndLogin(function(facade){ + var dataSetCode = "20130412152036861-380"; + var overrideStoreRootPathOrNull = ""; + + facade.tryGetPathToDataSet(dataSetCode, overrideStoreRootPathOrNull, function(response){ + equal(response.result, "/1/1FD3FF61-1576-4908-AE3D-296E60B4CE06/7e/71/80/20130412152036861-380", "Data set path is correct"); + facade.close(); + }); + }); +}); + test("listAllShares()", function(){ createFacadeAndLogin(function(facade){ try{ diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js index c7c2bf93bb2..f5476a74d56 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/js/openbis.js @@ -1534,6 +1534,22 @@ openbis.prototype.getPathToDataSet = function(dataSetCode, overrideStoreRootPath }); } +/** + * @see IDssServiceRpcGeneric.tryGetPathToDataSet(String, String, String) + * @method + */ +openbis.prototype.tryGetPathToDataSet = function(dataSetCode, overrideStoreRootPathOrNull, action) { + var openbisObj = this; + this._internal.getDataStoreApiUrlForDataSetCode(dataSetCode, function(dataStoreApiUrl){ + openbisObj._internal.ajaxRequest({ + url: dataStoreApiUrl, + data: { "method" : "tryGetPathToDataSet", + "params" : [ openbisObj.getSession(), dataSetCode, overrideStoreRootPathOrNull ] }, + success: action + }); + }); +} + /** * List shares from the default data store. * -- GitLab