Commit af01620c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'devel_12.0.x' into devel_12.1.x

parents d84dff3b 5c8ed669
Pipeline #6358 passed with stage
in 1 minute and 51 seconds
minerva (12.1.0~beta.0) experimental; urgency=medium
* Small improvement: option to remove additional overlays generated by custom
* Small improvement: option to remove additional overlays generated by custom
semantic zoom
* Small improvement: 'Reduced modulation' edge was displayed differently in
* Small improvement: 'Reduced modulation' edge was displayed differently in
CellDesigner and Minerva
* Small improvement: user-friendly documentation for plugin URL field
* Small improvement: plugins have to access information about active submap
......@@ -24,6 +24,17 @@ minerva (12.1.0~alpha.0) experimental; urgency=medium
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 03 Aug 2018 10:00:00 +0200
minerva (12.0.4) stable; urgency=medium
* Bug fix: CellDesigner modifications that are drawn as reaction are handled
properly (like catalysis)
* Bug fix: Removing of guest (anonymous) account is forbidden - system is
unstable after removing such user
* Bug fix: Tair database moved to https
* Bug fix: Taxnomy database changed html output that resulted in problems
with resolving species name to the id
-- Piotr Gawron <piotr.gawron@uni.lu> Wed, 12 Sep 2018 17:00:00 +0200
minerva (12.0.3) stable; urgency=medium
* Bug fix: SBML model annotations caused errors on upload
* Bug fix: Export of some models to SBML didn't work properly
......
......@@ -108,7 +108,7 @@ public class TaxonomyBackend extends CachableInterface implements IExternalServi
queryTerm = URLEncoder.encode(queryTerm, "UTF-8");
String url = "https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?lvl=0&name=" + queryTerm;
String page = getWebPageContent(url);
Pattern idPattern = Pattern.compile("<em>Taxonomy ID: </em>([0-9]+)");
Pattern idPattern = Pattern.compile("Taxonomy ID: ([0-9]+)");
Matcher matcher = idPattern.matcher(page);
if (!matcher.find()) {
logger.warn("Unknown organism: " + term);
......
......@@ -107,7 +107,7 @@ public class TairAnnotator extends ElementAnnotator implements IExternalService
* @return URL to TAIR page about the TAIR entry
*/
private String getTairUrl(String tairId) {
return "http://arabidopsis.org/servlets/TairObject?type=locus&name=" + tairId;
return "https://arabidopsis.org/servlets/TairObject?type=locus&name=" + tairId;
}
/**
......
......@@ -333,7 +333,11 @@ UsersAdminPanel.prototype.userToTableRow = function (user, row) {
}
row[5] = "<button name='showEditDialog' data='" + user.getLogin() + "'><i class='fa fa-edit' style='font-size:17px'></i></button>";
row[6] = "<button name='removeUser' data='" + user.getLogin() + "'><i class='fa fa-trash-o' style='font-size:17px'></i></button>";
var disabled = "";
if (user.getLogin() === "anonymous") {
disabled = " disabled ";
}
row[6] = "<button name='removeUser' " + disabled + " data='" + user.getLogin() + "'><i class='fa fa-trash-o' style='font-size:17px'></i></button>";
return row;
};
......
-- empty file to force directory to be commited to git repo
......@@ -36,6 +36,8 @@ public abstract class BaseController {
return createErrorResponse("Object not found.", e.getMessage(), new HttpHeaders(), HttpStatus.NOT_FOUND);
} else if (e instanceof ObjectExistsException) {
return createErrorResponse("Object already exists.", e.getMessage(), new HttpHeaders(), HttpStatus.CONFLICT);
} else if (e instanceof OperationNotAllowedException) {
return createErrorResponse("Operation not allowed.", e.getMessage(), new HttpHeaders(), HttpStatus.METHOD_NOT_ALLOWED);
} else if (e instanceof QueryException) {
logger.error(e, e);
return createErrorResponse("Query server error.", e.getMessage(), new HttpHeaders(), HttpStatus.BAD_REQUEST);
......
package lcsb.mapviewer.api;
/**
* Thrown when API operation is not allowed, but operation is valid. This can
* happen when user tries to remove default map.
*
* @author Piotr Gawron
*
*/
public class OperationNotAllowedException extends QueryException {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Default constructor.
*
* @param message
* error message
*/
public OperationNotAllowedException(String message) {
super(message);
}
/**
* Constructor with error message and parent exception.
*
* @param message
* error message
* @param reason
* parent exception that caused this one
*/
public OperationNotAllowedException(String message, Exception reason) {
super(message, reason);
}
}
......@@ -31,6 +31,7 @@ import org.springframework.util.MultiValueMap;
import lcsb.mapviewer.api.BaseRestImpl;
import lcsb.mapviewer.api.ObjectExistsException;
import lcsb.mapviewer.api.ObjectNotFoundException;
import lcsb.mapviewer.api.OperationNotAllowedException;
import lcsb.mapviewer.api.QueryException;
import lcsb.mapviewer.api.projects.models.publications.PublicationsRestImpl;
import lcsb.mapviewer.commands.ClearColorModelCommand;
......@@ -740,7 +741,7 @@ public class ProjectRestImpl extends BaseRestImpl {
throws SecurityException, QueryException {
Project project = getProjectService().getProjectByProjectId(projectId, token);
if (getConfigurationService().getConfigurationValue(ConfigurationElementType.DEFAULT_MAP).equals(project.getProjectId())) {
throw new QueryException("You cannot remove default map");
throw new OperationNotAllowedException("You cannot remove default map");
}
getProjectService().removeProject(project, path, true, token);
return getProject(projectId, token);
......
......@@ -14,7 +14,9 @@ import org.springframework.util.MultiValueMap;
import lcsb.mapviewer.api.BaseRestImpl;
import lcsb.mapviewer.api.ObjectNotFoundException;
import lcsb.mapviewer.api.OperationNotAllowedException;
import lcsb.mapviewer.api.QueryException;
import lcsb.mapviewer.common.Configuration;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.Project;
import lcsb.mapviewer.model.map.MiriamType;
......@@ -622,7 +624,9 @@ public class UserRestImpl extends BaseRestImpl {
throw new SecurityException("Access denied");
}
if (user == null) {
throw new QueryException("user doesn't exists");
throw new ObjectNotFoundException("user doesn't exists");
} else if (user.getLogin().equals(Configuration.ANONYMOUS_LOGIN)) {
throw new OperationNotAllowedException("guest account cannot be removed");
}
getUserService().deleteUser(user);
return okStatus();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment