Skip to content
Snippets Groups Projects
Commit 75a5cfce authored by pkupczyk's avatar pkupczyk
Browse files

SP-202 / BIS-122 : Webuis available from openBIS UI:

- add function for setting sessionId to be used by openbis object
- properly decode '+' in web application context parameters

SVN: 26309
parent afd0a270
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,10 @@ openbis.prototype.restoreSession = function() { ...@@ -104,6 +104,10 @@ openbis.prototype.restoreSession = function() {
this.sessionToken = readCookie('openbis'); this.sessionToken = readCookie('openbis');
} }
openbis.prototype.useSession = function(sessionToken){
this.sessionToken = sessionToken;
}
openbis.prototype.isSessionActive = function(action) { openbis.prototype.isSessionActive = function(action) {
ajaxRequest({ ajaxRequest({
url: this.generalInfoServiceUrl, url: this.generalInfoServiceUrl,
...@@ -371,8 +375,8 @@ openbisWebAppContext.prototype.getEntityPermId = function(){ ...@@ -371,8 +375,8 @@ openbisWebAppContext.prototype.getEntityPermId = function(){
openbisWebAppContext.prototype.getParameter = function(parameterName){ openbisWebAppContext.prototype.getParameter = function(parameterName){
var match = location.search.match(RegExp("[?|&]"+parameterName+'=(.+?)(&|$)')); var match = location.search.match(RegExp("[?|&]"+parameterName+'=(.+?)(&|$)'));
if(match){ if(match && match[1]){
return decodeURIComponent(match[1]); return decodeURIComponent(match[1].replace(/\+/g,' '));
}else{ }else{
return null; return null;
} }
......
...@@ -106,6 +106,10 @@ openbis.prototype.restoreSession = function() { ...@@ -106,6 +106,10 @@ openbis.prototype.restoreSession = function() {
this.sessionToken = readCookie('openbis'); this.sessionToken = readCookie('openbis');
} }
openbis.prototype.useSession = function(sessionToken){
this.sessionToken = sessionToken;
}
openbis.prototype.isSessionActive = function(action) { openbis.prototype.isSessionActive = function(action) {
ajaxRequest({ ajaxRequest({
url: this.generalInfoServiceUrl, url: this.generalInfoServiceUrl,
...@@ -426,8 +430,8 @@ openbisWebAppContext.prototype.getEntityPermId = function(){ ...@@ -426,8 +430,8 @@ openbisWebAppContext.prototype.getEntityPermId = function(){
openbisWebAppContext.prototype.getParameter = function(parameterName){ openbisWebAppContext.prototype.getParameter = function(parameterName){
var match = location.search.match(RegExp("[?|&]"+parameterName+'=(.+?)(&|$)')); var match = location.search.match(RegExp("[?|&]"+parameterName+'=(.+?)(&|$)'));
if(match){ if(match && match[1]){
return decodeURIComponent(match[1]); return decodeURIComponent(match[1].replace(/\+/g,' '));
}else{ }else{
return null; return null;
} }
......
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