diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js index 3a485af7465f8447f316302631c668957f945d0f..247ca79425151d085f6e3179840ba8c506dab500 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/config/Profile.js @@ -59,7 +59,7 @@ $.extend(DefaultProfile.prototype, { } this.directLinkEnabled = true; - this.directLinkURL = null; //To be set during initialization using info retrieved from the DSS configuration by the reporting plugin + this.directFileServer = null; //To be set during initialization using info retrieved from the DSS configuration by the reporting plugin this.copyPastePlainText = false; this.hideCodes = true; this.hideTypes = { @@ -659,12 +659,7 @@ $.extend(DefaultProfile.prototype, { var _this = this; this.serverFacade.getDirectLinkURL(function(error, result) { if(!error) { - var hostName = window.location.hostname; - var directLinkURL = result.data; - if(directLinkURL) { - directLinkURL = directLinkURL.replace("$URL", hostName); - } - _this.directLinkURL = directLinkURL; + _this.directFileServer = result.data; } callback(); }); diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/Util.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/Util.js index c8afabdcc3776394fb21b1cc173fde68a22e1ceb..72e6f2599841e6e43a29811670bd5c17c02104b3 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/Util.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/util/Util.js @@ -226,7 +226,7 @@ var Util = new function() { }); } - this.showDirectLink = function(directLink) { + this.showDirectLink = function(path) { var css = { 'text-align' : 'left', 'top' : '15%', @@ -236,6 +236,16 @@ var Util = new function() { 'overflow' : 'hidden' }; + var hostName = window.location.hostname; + var protocol = profile.directFileServer.protocol; + var suffix = profile.directFileServer.UNCsuffix; + if(!suffix) { + suffix = ""; + } + var port = profile.directFileServer.protocol; + + directLinkUnix = protocol + "://" + hostName + ":" + port + "/" + suffix + path; + directLinkWin = "\\\\" + hostName + "\\" + (new String(suffix + path).replace(new RegExp("/", 'g'),"\\")); var $close = $("<div>", { style : "float:right;" }) .append($("<a>", { class : 'btn btn-default' }).append($("<span>", { class : 'glyphicon glyphicon-remove' }))).click(function() { Util.unblockUI(); @@ -246,7 +256,11 @@ var Util = new function() { .append($("<br>")) .append("Directly clicking on it will open the default application.") .append($("<br>")) - .append($("<a>", { "href" : directLink, "target" : "_blank"}).append(directLink)); + .append($("<b>Mac/Unix: </b>")) + .append($("<a>", { "href" : directLinkUnix, "target" : "_blank"}).append(directLinkUnix)) + .append($("<br>")) + .append($("<b>Windows (Copy link on Explorer): </b>")) + .append($("<a>", { "href" : directLinkWin, "target" : "_blank"}).append(directLinkWin)); $window.css("margin-bottom", "10px"); $window.css("margin-left", "10px"); $window.css("margin-right", "10px"); diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerModel.js b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerModel.js index bfea081d4414a458c7bccbd29b38caa42dc8a420..efaa39380b990919f5a8ec11af5eb183d7c33416 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerModel.js +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/js/views/DataSetForm/widgets/DatasetViewerModel.js @@ -69,9 +69,9 @@ function DataSetViewerModel(containerId, profile, sample, serverFacade, datastor this.getDirectDirectoryLink = function(datasetCode, datasetFile) { var directLinkComponent = null; - if(profile.directLinkEnabled && profile.directLinkURL) { - var directLink = profile.directLinkURL + this.sample.experimentIdentifierOrNull.substring(1) + "/" + datasetCode + "/" + datasetFile.pathInDataSet + "/"; - directLinkComponent = "<span onclick=\"" + "Util.showDirectLink('" + directLink + "')" + "\" class='glyphicon glyphicon-hdd'></span>"; + if(profile.directLinkEnabled && profile.directFileServer) { + var path = this.sample.experimentIdentifierOrNull.substring(1) + "/" + datasetCode + "/" + datasetFile.pathInDataSet + "/"; + directLinkComponent = "<span onclick=\"" + "Util.showDirectLink('" + path + "')" + "\" class='glyphicon glyphicon-hdd'></span>"; } return directLinkComponent; } diff --git a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py index 4ec9a0f698199c85fd988c77c7f311d6294555e0..afcb17d79b7cc22697345dd7f36a47de0b6b7caf 100644 --- a/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py +++ b/openbis_standard_technologies/dist/core-plugins/eln-lims/1/dss/reporting-plugins/eln-lims-api/script.py @@ -93,10 +93,11 @@ def getDirectLinkURL(): protocol = None; port = None; - + UNCsuffix = None; if (cifsServerEnable == "true") and (cifsServerPort is not None): protocol = "cifs" port = cifsServerPort; + UNCsuffix = "STORE/"; elif (sftpPort is not None): protocol = "sftp"; port = sftpPort; @@ -106,14 +107,12 @@ def getDirectLinkURL(): port = ftpPort; elif ftpPortLegacy is not None: port = ftpPortLegacy; - - directLinkURL = None; - if protocol is not None: - directLinkURL = protocol + "://$URL:" + str(port) + "/"; - if protocol == "cifs": - directLinkURL += "STORE/"; - - return getJsonForData(directLinkURL); + + return getJsonForData({ + "protocol" : protocol, + "port" : port, + "UNCsuffix" : UNCsuffix + }); def getProperties(tr, parameters): sessionToken = parameters.get("sessionToken");