Skip to content
Snippets Groups Projects
Commit 09b90670 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '121-showing-big-data-overlay-takes-plenty-of-time' into 'master'

when querying for too many elments POST is used instead of GET

Closes #121

See merge request !24
parents 7ec7490b ddd0bc72
No related branches found
No related tags found
1 merge request!24when querying for too many elments POST is used instead of GET
......@@ -301,7 +301,8 @@ ServerConnector.getReferenceGenomeUrl = function(queryParams, filterParams) {
var version = this.getIdOrAsterisk(queryParams.version);
return this.getApiUrl({
type : "genomics/taxonomies/" + queryParams.organism + "/genomeTypes/" + queryParams.type + "/versions/" + version + "/",
type : "genomics/taxonomies/" + queryParams.organism + "/genomeTypes/" + queryParams.type + "/versions/" + version
+ "/",
params : filterParams
});
};
......@@ -747,7 +748,11 @@ ServerConnector.getAliases = function(aliasIds, projectId, columns) {
};
return self.getProjectId(projectId).then(function(result) {
queryParams.projectId = result;
return self.readFile(self.getAliasesUrl(queryParams, filterParams));
if (filterParams.id.length > 100) {
return self.sendPostRequest(self.getAliasesUrl(queryParams), filterParams);
} else {
return self.readFile(self.getAliasesUrl(queryParams, filterParams));
}
}).then(function(content) {
var array = JSON.parse(content);
var result = [];
......
......@@ -64,6 +64,9 @@ SearchDbOverlay.prototype.getElementsByQuery = function(query) {
};
SearchDbOverlay.prototype._getFirstVisibleParentOrObject = function(identifiedElement, zoomLevel, coordinates) {
if (identifiedElement === undefined) {
return Promise.resolve();
}
var self = this;
var model = self.getMap().getSubmapById(identifiedElement.getModelId()).getModel();
return model.getByIdentifiedElement(identifiedElement, true).then(function(fullElement) {
......
......@@ -21,7 +21,7 @@ public class ElementsController extends BaseController {
@Autowired
private ElementsRestImpl projectController;
@RequestMapping(value = "/projects/{projectId}/models/{modelId}/bioEntities/elements/", method = { RequestMethod.GET },
@RequestMapping(value = "/projects/{projectId}/models/{modelId}/bioEntities/elements/", method = { RequestMethod.GET, RequestMethod.POST },
produces = { MediaType.APPLICATION_JSON_VALUE })
public List<Map<String, Object>> getElements(//
@PathVariable(value = "projectId") String projectId, //
......
......@@ -21,7 +21,7 @@ public class ReactionsController extends BaseController {
@Autowired
private ReactionsRestImpl reactionController;
@RequestMapping(value = "/projects/{projectId}/models/{modelId}/bioEntities/reactions/", method = { RequestMethod.GET },
@RequestMapping(value = "/projects/{projectId}/models/{modelId}/bioEntities/reactions/", method = { RequestMethod.GET, RequestMethod.POST },
produces = { MediaType.APPLICATION_JSON_VALUE })
public List<Map<String, Object>> getReactions(//
@PathVariable(value = "projectId") String projectId, //
......
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