diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-dto.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-dto.js index ec85a7511572ff11caec72564d1207515e0dfa7b..2c1d7e92ab5f5b61b3e4bb0213cff9ca64dc1b33 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-dto.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-dto.js @@ -59,7 +59,7 @@ define([ 'test/common' ], function(common) { require([ 'dto/common/search/' + criteriaClassName ], function(Criteria) { var criteria = new Criteria(name, type); - criteria.equalTo(42); + criteria.thatEquals(42); assertAttributes(assert, criteria, name, type, "NumberEqualToValue", 42); done(); }); diff --git a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-login.js b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-login.js index 7243d6e0ca04bc4fadb9ad741d31682f572de8d0..962baaf75b2551159c2dd313dcfbd98339ee8d61 100644 --- a/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-login.js +++ b/js-test/servers/common/core-plugins/tests/1/as/webapps/openbis-v3-api-test/html/test/test-login.js @@ -36,6 +36,7 @@ define([ 'jquery', 'underscore', 'openbis', 'test/common' ], function($, _, open return facade.loginAsAnonymousUser().then(function() { return facade.searchSpaces(criteria, fetchOptions).then(function(spaces) { c.assertTrue(spaces.getTotalCount() == 1) + c.finish(); }); }); }).fail(function(error) { diff --git a/js-test/servers/common/openBIS-server/etc/service.properties b/js-test/servers/common/openBIS-server/etc/service.properties index 14b5d5affec2f2a4edd5b65ee3974f4e7da90fa1..3c35ceaa76823da25d8423cc3c8887fa116f3fcb 100644 --- a/js-test/servers/common/openBIS-server/etc/service.properties +++ b/js-test/servers/common/openBIS-server/etc/service.properties @@ -100,7 +100,7 @@ ldap.timeToWaitAfterFailure= # Anonymous login configuration (optional) # --------------------------------------------------------------------------- # 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 diff --git a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApi.java b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApi.java index b4ad6161b05448775222567f7cc37e4624f17bb7..eada9e5de19c346ee7846fc4cb3e6cd5c02dffb6 100644 --- a/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApi.java +++ b/openbis/source/java/ch/ethz/sis/openbis/generic/server/asapi/v3/ApplicationServerApi.java @@ -219,7 +219,7 @@ public class ApplicationServerApi extends AbstractServer<IApplicationServerApi> @Autowired private ISearchServiceMethodExecutor searchServiceExecutor; - + @Autowired private IDeleteSpaceMethodExecutor deleteSpaceExecutor; @@ -274,6 +274,7 @@ public class ApplicationServerApi extends AbstractServer<IApplicationServerApi> } @Override + @Transactional public String loginAsAnonymousUser() { SessionContextDTO session = tryAuthenticateAnonymously(); diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/dto/service/ExecutionOptions.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/dto/service/ExecutionOptions.js index a6f18d7074a942eb290ec883a28294697ac3740a..7b97bafd871fa466a228c3c911fabdb8031ee7c0 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/dto/service/ExecutionOptions.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/dto/service/ExecutionOptions.js @@ -9,7 +9,7 @@ define([ "stjs"], function(stjs) { prototype.withParameter = function(parameterName, value) { this.parameters[parameterName] = value; } - proptotype.getParameters = function() { + prototype.getParameters = function() { return this.parameters; } }, { diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/openbis.js b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/openbis.js index 0c6073ea8a7063c22578c2b792a99f2914b94ddf..1fe8aa379bd0d54ab5f97f5ce20959b0e371e917 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/openbis.js +++ b/openbis/source/java/ch/systemsx/cisd/openbis/public/resources/api/v3/openbis.js @@ -48,12 +48,12 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { return dfd.promise(); }; - this.loginCommon = function(user, response) { + this.loginCommon = function(user, isAnonymousUser, response) { var thisPrivate = this; var dfd = $.Deferred(); response.done(function(sessionToken) { - if (sessionToken && sessionToken.indexOf(user) > -1) { + if (sessionToken && (isAnonymousUser || sessionToken.indexOf(user) > -1)) { thisPrivate.sessionToken = sessionToken; dfd.resolve(sessionToken); } else { @@ -82,7 +82,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { this.login = function(user, password) { var thisFacade = this; - return thisFacade._private.loginCommon(user, thisFacade._private.ajaxRequest({ + return thisFacade._private.loginCommon(user, false, thisFacade._private.ajaxRequest({ url : openbisUrl, data : { "method" : "login", @@ -93,7 +93,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { this.loginAs = function(user, password, asUserId) { var thisFacade = this; - return thisFacade._private.loginCommon(asUserId, thisFacade._private.ajaxRequest({ + return thisFacade._private.loginCommon(asUserId, false, thisFacade._private.ajaxRequest({ url : openbisUrl, data : { "method" : "loginAs", @@ -104,11 +104,11 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { this.loginAsAnonymousUser = function() { var thisFacade = this; - return thisFacade._private.loginCommon(user, thisFacade._private.ajaxRequest({ + return thisFacade._private.loginCommon(null, true, thisFacade._private.ajaxRequest({ url : openbisUrl, data : { "method" : "loginAsAnonymousUser", - "params" : [ ] + "params" : [] } })); } @@ -378,7 +378,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { } }); } - + this.searchServices = function(criteria, fetchOptions) { var thisFacade = this; return thisFacade._private.ajaxRequest({ @@ -488,7 +488,7 @@ define([ 'jquery', 'util/Json' ], function($, stjsUtil) { } }); } - + this.executeService = function(serviceId, parameters) { var thisFacade = this; return thisFacade._private.ajaxRequest({