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 e4580589cbf8402d5d10602785b8f7f1a1ba77ed..cc6303cc6c7dc1084e9bfdb9facf173d3a4bfc0e 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 c7c2bf93bb249d934fe67638239b6384bdb8a413..f5476a74d56f0f72713d4c678d306fa0f8405326 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. *