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

SSDM-2903 : V3 AS API - fix inconsistencies between Java and JS DTOs found by automated test

SVN: 35388
parent ecdfbc86
No related branches found
No related tags found
No related merge requests found
...@@ -59,7 +59,7 @@ define([ 'test/common' ], function(common) { ...@@ -59,7 +59,7 @@ define([ 'test/common' ], function(common) {
require([ 'dto/common/search/' + criteriaClassName ], function(Criteria) { require([ 'dto/common/search/' + criteriaClassName ], function(Criteria) {
var criteria = new Criteria(name, type); var criteria = new Criteria(name, type);
criteria.equalTo(42); criteria.thatEquals(42);
assertAttributes(assert, criteria, name, type, "NumberEqualToValue", 42); assertAttributes(assert, criteria, name, type, "NumberEqualToValue", 42);
done(); done();
}); });
......
...@@ -36,6 +36,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/common' ], function($, _, open ...@@ -36,6 +36,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/common' ], function($, _, open
return facade.loginAsAnonymousUser().then(function() { return facade.loginAsAnonymousUser().then(function() {
return facade.searchSpaces(criteria, fetchOptions).then(function(spaces) { return facade.searchSpaces(criteria, fetchOptions).then(function(spaces) {
c.assertTrue(spaces.getTotalCount() == 1) c.assertTrue(spaces.getTotalCount() == 1)
c.finish();
}); });
}); });
}).fail(function(error) { }).fail(function(error) {
......
...@@ -100,7 +100,7 @@ ldap.timeToWaitAfterFailure= ...@@ -100,7 +100,7 @@ ldap.timeToWaitAfterFailure=
# Anonymous login configuration (optional) # Anonymous login configuration (optional)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Login of the existing user whose settings will be used for anonymous login # Login of the existing user whose settings will be used for anonymous login
#user-for-anonymous-login = <user-login> user-for-anonymous-login = observer
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Client configuration # Client configuration
......
...@@ -219,7 +219,7 @@ public class ApplicationServerApi extends AbstractServer<IApplicationServerApi> ...@@ -219,7 +219,7 @@ public class ApplicationServerApi extends AbstractServer<IApplicationServerApi>
@Autowired @Autowired
private ISearchServiceMethodExecutor searchServiceExecutor; private ISearchServiceMethodExecutor searchServiceExecutor;
@Autowired @Autowired
private IDeleteSpaceMethodExecutor deleteSpaceExecutor; private IDeleteSpaceMethodExecutor deleteSpaceExecutor;
...@@ -274,6 +274,7 @@ public class ApplicationServerApi extends AbstractServer<IApplicationServerApi> ...@@ -274,6 +274,7 @@ public class ApplicationServerApi extends AbstractServer<IApplicationServerApi>
} }
@Override @Override
@Transactional
public String loginAsAnonymousUser() public String loginAsAnonymousUser()
{ {
SessionContextDTO session = tryAuthenticateAnonymously(); SessionContextDTO session = tryAuthenticateAnonymously();
......
...@@ -9,7 +9,7 @@ define([ "stjs"], function(stjs) { ...@@ -9,7 +9,7 @@ define([ "stjs"], function(stjs) {
prototype.withParameter = function(parameterName, value) { prototype.withParameter = function(parameterName, value) {
this.parameters[parameterName] = value; this.parameters[parameterName] = value;
} }
proptotype.getParameters = function() { prototype.getParameters = function() {
return this.parameters; return this.parameters;
} }
}, { }, {
......
...@@ -48,12 +48,12 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { ...@@ -48,12 +48,12 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) {
return dfd.promise(); return dfd.promise();
}; };
this.loginCommon = function(user, response) { this.loginCommon = function(user, isAnonymousUser, response) {
var thisPrivate = this; var thisPrivate = this;
var dfd = $.Deferred(); var dfd = $.Deferred();
response.done(function(sessionToken) { response.done(function(sessionToken) {
if (sessionToken && sessionToken.indexOf(user) > -1) { if (sessionToken && (isAnonymousUser || sessionToken.indexOf(user) > -1)) {
thisPrivate.sessionToken = sessionToken; thisPrivate.sessionToken = sessionToken;
dfd.resolve(sessionToken); dfd.resolve(sessionToken);
} else { } else {
...@@ -82,7 +82,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { ...@@ -82,7 +82,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) {
this.login = function(user, password) { this.login = function(user, password) {
var thisFacade = this; var thisFacade = this;
return thisFacade._private.loginCommon(user, thisFacade._private.ajaxRequest({ return thisFacade._private.loginCommon(user, false, thisFacade._private.ajaxRequest({
url : openbisUrl, url : openbisUrl,
data : { data : {
"method" : "login", "method" : "login",
...@@ -93,7 +93,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { ...@@ -93,7 +93,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) {
this.loginAs = function(user, password, asUserId) { this.loginAs = function(user, password, asUserId) {
var thisFacade = this; var thisFacade = this;
return thisFacade._private.loginCommon(asUserId, thisFacade._private.ajaxRequest({ return thisFacade._private.loginCommon(asUserId, false, thisFacade._private.ajaxRequest({
url : openbisUrl, url : openbisUrl,
data : { data : {
"method" : "loginAs", "method" : "loginAs",
...@@ -104,11 +104,11 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { ...@@ -104,11 +104,11 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) {
this.loginAsAnonymousUser = function() { this.loginAsAnonymousUser = function() {
var thisFacade = this; var thisFacade = this;
return thisFacade._private.loginCommon(user, thisFacade._private.ajaxRequest({ return thisFacade._private.loginCommon(null, true, thisFacade._private.ajaxRequest({
url : openbisUrl, url : openbisUrl,
data : { data : {
"method" : "loginAsAnonymousUser", "method" : "loginAsAnonymousUser",
"params" : [ ] "params" : []
} }
})); }));
} }
...@@ -378,7 +378,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { ...@@ -378,7 +378,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) {
} }
}); });
} }
this.searchServices = function(criteria, fetchOptions) { this.searchServices = function(criteria, fetchOptions) {
var thisFacade = this; var thisFacade = this;
return thisFacade._private.ajaxRequest({ return thisFacade._private.ajaxRequest({
...@@ -488,7 +488,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { ...@@ -488,7 +488,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) {
} }
}); });
} }
this.executeService = function(serviceId, parameters) { this.executeService = function(serviceId, parameters) {
var thisFacade = this; var thisFacade = this;
return thisFacade._private.ajaxRequest({ return thisFacade._private.ajaxRequest({
......
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