Skip to content
Snippets Groups Projects
Commit fde6cd76 authored by juanf's avatar juanf
Browse files

SSDM-6001 : Microservice server, openBIS UI integration

SVN: 39140
parent 447e9c9c
No related branches found
No related tags found
No related merge requests found
...@@ -42,11 +42,13 @@ function DataSetViewerModel(containerId, profile, entity, serverFacade, datastor ...@@ -42,11 +42,13 @@ function DataSetViewerModel(containerId, profile, entity, serverFacade, datastor
if(this.isLinkDataset(datasetCode)) { if(this.isLinkDataset(datasetCode)) {
var cc = this.getDownloadableContentCopy(datasetCode); var cc = this.getDownloadableContentCopy(datasetCode);
downloadUrl = profile.EDMSs[cc.externalDms.code] + "?sessionToken=" + encodeURIComponent(mainController.serverFacade.getSession()) if(cc) {
downloadUrl = profile.EDMSs[cc.externalDms.code] + "?sessionToken=" + encodeURIComponent(mainController.serverFacade.getSession())
+ "&datasetPermId=" + encodeURIComponent(datasetCode) + "&datasetPermId=" + encodeURIComponent(datasetCode)
+ "&externalDMSCode=" + encodeURIComponent(cc.externalDms.code) + "&externalDMSCode=" + encodeURIComponent(cc.externalDms.code)
+ "&contentCopyPath=" + encodeURIComponent(cc.path) + "&contentCopyPath=" + encodeURIComponent(cc.path)
+ "&datasetPathToFile=" + encodeURIComponent(datasetFile.pathInDataSet); + "&datasetPathToFile=" + encodeURIComponent(datasetFile.pathInDataSet);
}
} else { } else {
downloadUrl = this.datastoreDownloadURL + '/' + datasetCode + "/" + encodeURIComponent(datasetFile.pathInDataSet) + "?sessionID=" + mainController.serverFacade.getSession(); downloadUrl = this.datastoreDownloadURL + '/' + datasetCode + "/" + encodeURIComponent(datasetFile.pathInDataSet) + "?sessionID=" + mainController.serverFacade.getSession();
} }
...@@ -61,13 +63,18 @@ function DataSetViewerModel(containerId, profile, entity, serverFacade, datastor ...@@ -61,13 +63,18 @@ function DataSetViewerModel(containerId, profile, entity, serverFacade, datastor
} }
var size = Math.floor(size * 10) / 10; //Rounded to one decimal var size = Math.floor(size * 10) / 10; //Rounded to one decimal
var $link = $("<a>").attr("href", downloadUrl) var $link = null;
if(downloadUrl) {
$link = $("<a>").attr("href", downloadUrl)
.attr("target", "_blank") .attr("target", "_blank")
.append(datasetFile.pathInListing) .append(datasetFile.pathInListing)
.append(" ("+ size + unit +")") .append(" ("+ size + unit +")")
.click(function(event) { .click(function(event) {
event.stopPropagation(); event.stopPropagation();
}); });
} else {
$link = datasetFile.pathInListing;
}
return $link; return $link;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment