Commit 169332f5 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

return background sorted by order_index column

parent ca567797
Pipeline #46601 canceled with stage
in 1 minute and 26 seconds
minerva (16.0.0~beta.2) stable; urgency=medium
* Bug fix: correct background order for old projects restored (#1533)
* Bug fix: search chemicals by target returned chemicals not bounded by
disease (#1535)
* Bug fix: problem with export map with submaps fixed (#1540)
......
......@@ -38,6 +38,14 @@ import lcsb.mapviewer.model.user.User;
import lcsb.mapviewer.persist.dao.ProjectDao;
import lcsb.mapviewer.persist.dao.cache.UploadedFileEntryDao;
import lcsb.mapviewer.persist.dao.map.species.ElementProperty;
import lcsb.mapviewer.services.ObjectExistsException;
import lcsb.mapviewer.services.ObjectNotFoundException;
import lcsb.mapviewer.services.QueryException;
import lcsb.mapviewer.services.interfaces.IElementService;
import lcsb.mapviewer.services.interfaces.IProjectBackgroundService;
import lcsb.mapviewer.services.interfaces.IProjectService;
import lcsb.mapviewer.services.interfaces.IReactionService;
import lcsb.mapviewer.services.interfaces.IUserService;
import lcsb.mapviewer.services.*;
import lcsb.mapviewer.services.interfaces.*;
import lcsb.mapviewer.services.utils.CreateProjectParams;
......@@ -77,6 +85,8 @@ public class ProjectRestImpl extends BaseRestImpl {
private ProjectDao projectDao;
private IProjectBackgroundService projectBackgroundService;
private UploadedFileEntryDao uploadedFileEntryDao;
public ProjectRestImpl(IProjectService projectService,
......@@ -85,11 +95,14 @@ public class ProjectRestImpl extends BaseRestImpl {
IUserService userService,
MeSHParser meshParser,
IElementService elementService,
IReactionService reactionService) {
IProjectBackgroundService projectBackgroundService,
IReactionService reactionService,
ServletContext context) {
this.projectService = projectService;
this.projectDao = projectDao;
this.meshParser = meshParser;
this.userService = userService;
this.projectBackgroundService = projectBackgroundService;
this.uploadedFileEntryDao = uploadedFileEntryDao;
this.elementService = elementService;
this.reactionService = reactionService;
......@@ -758,10 +771,8 @@ public class ProjectRestImpl extends BaseRestImpl {
}
public List<ProjectBackground> getBackgrounds(String projectId) throws ObjectNotFoundException {
List<ProjectBackground> result = getProjectByProjectId(projectId).getProjectBackgrounds();
for (ProjectBackground projectBackground : result) {
Hibernate.initialize(projectBackground.getProjectBackgroundImageLayer());
}
List<ProjectBackground> result = projectBackgroundService.getProjectBackgroundsByProject(getProjectByProjectId(projectId));
result.sort(ProjectBackground.ORDER_COMPARATOR);
return result;
}
......
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