diff --git a/CHANGELOG b/CHANGELOG index ea66d7c7d92a1daa90d8d4ad57564f10d91ef139..96e84cde4cb6ce660be1cf998ec271dd98fd36d8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,7 @@ 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 diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/TaxonomyBackend.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/TaxonomyBackend.java index 22962ff9eb49703b93d97d6d3916cbba831bd507..5ab139112cd4630eb1ea13dcd46443ab1829a8ef 100644 --- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/TaxonomyBackend.java +++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/TaxonomyBackend.java @@ -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); diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/TairAnnotator.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/TairAnnotator.java index 91850ea93b6edd63f90aa6c0f7d81089a4088880..0d52689155610ed6bed70551d3d05a54bd348478 100644 --- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/TairAnnotator.java +++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/TairAnnotator.java @@ -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; } /** diff --git a/frontend-js/src/main/js/gui/admin/UsersAdminPanel.js b/frontend-js/src/main/js/gui/admin/UsersAdminPanel.js index 5332f39c23749f849e7f56e5676dd83552bb6201..b5bb5b2b8804c69480bc545357cd8a3ce3c15fa4 100644 --- a/frontend-js/src/main/js/gui/admin/UsersAdminPanel.js +++ b/frontend-js/src/main/js/gui/admin/UsersAdminPanel.js @@ -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; }; diff --git a/persist/src/db/12.0.4/fix_db_20180830.sql b/persist/src/db/12.0.4/fix_db_20180830.sql new file mode 100644 index 0000000000000000000000000000000000000000..a33b6ad89d4881c84fb355b8c56d309760e66b70 --- /dev/null +++ b/persist/src/db/12.0.4/fix_db_20180830.sql @@ -0,0 +1 @@ +-- empty file to force directory to be commited to git repo diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/BaseController.java b/rest-api/src/main/java/lcsb/mapviewer/api/BaseController.java index d93c477c3d665b6f1da088aa16b316806ebb2985..7bc7a6182d8300741589675c677f06342c3be029 100644 --- a/rest-api/src/main/java/lcsb/mapviewer/api/BaseController.java +++ b/rest-api/src/main/java/lcsb/mapviewer/api/BaseController.java @@ -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); diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/OperationNotAllowedException.java b/rest-api/src/main/java/lcsb/mapviewer/api/OperationNotAllowedException.java new file mode 100644 index 0000000000000000000000000000000000000000..b013109551afbd0ef1f8dc1d748cd429bc2684a8 --- /dev/null +++ b/rest-api/src/main/java/lcsb/mapviewer/api/OperationNotAllowedException.java @@ -0,0 +1,39 @@ +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); + } + +} diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectRestImpl.java index 317f1afedeffa7d6e665dae8249f84cee12801df..b0d4cee6b5a1daaa65835f322cb113bcb8e89719 100644 --- a/rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectRestImpl.java +++ b/rest-api/src/main/java/lcsb/mapviewer/api/projects/ProjectRestImpl.java @@ -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); diff --git a/rest-api/src/main/java/lcsb/mapviewer/api/users/UserRestImpl.java b/rest-api/src/main/java/lcsb/mapviewer/api/users/UserRestImpl.java index 069b94fa576559ebd0505b02c523496e46c3f0a5..43398352563d06ba223e5fb2396f8f39f72629be 100644 --- a/rest-api/src/main/java/lcsb/mapviewer/api/users/UserRestImpl.java +++ b/rest-api/src/main/java/lcsb/mapviewer/api/users/UserRestImpl.java @@ -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();