Commit 82859b49 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

length of data table for project list is stored in user preferences

parent dcb2cd59
......@@ -45,38 +45,30 @@
"litemol": "github:dsehnal/LiteMol#a5419c696faa84530dd93acd55b747cf8136902b"
},
"dependencies": {
"ProtVista": {
"version": "git://github.com/davidhoksza/protvista.git#4e4bb737ba1e183291505bd25f8bae2e651ce21e",
"dev": true,
"requires": {
"d3": "3.5.17",
"file-saver": "1.3.3",
"jquery": "2.2.4",
"jszip": "3.1.4",
"underscore": "1.8.3"
},
"dependencies": {
"jquery": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-2.2.4.tgz",
"integrity": "sha1-LInWiJterFIqfuoywUUhVZxsvwI=",
"dev": true
}
}
},
"jquery": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz",
"integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==",
"dev": true
},
"litemol": {
"version": "github:dsehnal/LiteMol#a5419c696faa84530dd93acd55b747cf8136902b",
"dev": true,
"requires": {
"@types/react": "15.6.14",
"@types/react-dom": "15.5.7"
}
}
}
},
"ProtVista": {
"version": "git://github.com/davidhoksza/protvista.git#4e4bb737ba1e183291505bd25f8bae2e651ce21e",
"dev": true,
"requires": {
"d3": "3.5.17",
"file-saver": "1.3.3",
"jquery": "2.2.4",
"jszip": "3.1.4",
"underscore": "1.8.3"
},
"dependencies": {
"jquery": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-2.2.4.tgz",
"integrity": "sha1-LInWiJterFIqfuoywUUhVZxsvwI=",
"dev": true
}
}
},
......@@ -2058,6 +2050,14 @@
"immediate": "3.0.6"
}
},
"litemol": {
"version": "github:dsehnal/LiteMol#a5419c696faa84530dd93acd55b747cf8136902b",
"dev": true,
"requires": {
"@types/react": "15.6.14",
"@types/react-dom": "15.5.7"
}
},
"lodash": {
"version": "4.17.4",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
......
......@@ -7,6 +7,7 @@ var AddProjectDialog = require('./AddProjectDialog');
var EditProjectDialog = require('./EditProjectDialog');
var LogListDialog = require('./LogListDialog');
var PrivilegeType = require('../../map/data/PrivilegeType');
var UserPreferences = require('../../map/data/UserPreferences');
// noinspection JSUnusedLocalSymbols
var logger = require('../../logger');
......@@ -109,6 +110,18 @@ MapsAdminPanel.prototype._createProjectTableRow = function () {
title: 'Remove'
}]
});
$(projectsTable).on('length.dt', function (e, settings, len) {
return ServerConnector.getLoggedUser().then(function (user) {
var oldValue = parseInt(user.getPreferences().getGuiPreference("admin-projects-datatable-length"));
if (oldValue !== len) {
user.getPreferences().setGuiPreference("admin-projects-datatable-length", len);
var data = new UserPreferences();
data.setGuiPreference("admin-projects-datatable-length", len);
return ServerConnector.updateUserPreferences({user: user, preferences: data}).then(null, GuiConnector.alert);
}
})
});
$(projectsTable).on("click", "[name='removeProject']", function () {
var button = this;
return self.askConfirmRemoval({
......@@ -142,6 +155,12 @@ MapsAdminPanel.prototype.init = function () {
var self = this;
return ServerConnector.getProjects().then(function (projects) {
return self.setProjects(projects);
}).then(function () {
return ServerConnector.getLoggedUser();
}).then(function (user) {
var tableLength = user.getPreferences().getGuiPreference("admin-projects-datatable-length", 10);
var dataTable = $("[name='projectsTable']", self.getElement()).DataTable();
return dataTable.page.len(tableLength).draw();
});
};
......
......@@ -2,6 +2,7 @@
/* exported logger */
// noinspection JSUnusedLocalSymbols
var logger = require('../../logger');
function UserPreferences(javaObject) {
......@@ -11,12 +12,14 @@ function UserPreferences(javaObject) {
this.setElementRequiredAnnotations(javaObject["element-required-annotations"]);
this.setElementValidAnnotations(javaObject["element-valid-annotations"]);
this.setAnnotatorsParameters(javaObject["annotators-parameters"]);
this.setGuiPreferences(javaObject["gui-preferences"]);
} else {
this._projectUpload = {};
this._elementAnnotators = {};
this._elementRequiredAnnotations = {};
this._elementValidAnnotations = {};
this._annotatorsParameters = {};
this._guiPreferences = {};
}
}
......@@ -36,10 +39,27 @@ UserPreferences.prototype.getAnnotatorsParameters = function () {
UserPreferences.prototype.setAnnotatorsParameters = function (annotatorsParameters) {
this._annotatorsParameters = annotatorsParameters;
};
UserPreferences.prototype.getGuiPreferences = function () {
return this._guiPreferences;
};
UserPreferences.prototype.setGuiPreference = function (key, value) {
this._guiPreferences[key] = value;
};
UserPreferences.prototype.getGuiPreference = function (key, defaultValue) {
var result = this._guiPreferences[key];
if (result === undefined) {
return defaultValue;
} else {
return result;
}
};
UserPreferences.prototype.setGuiPreferences = function (guiPreferences) {
this._guiPreferences = guiPreferences;
};
UserPreferences.prototype.getProjectUpload = function () {
return this._projectUpload;
};
UserPreferences.prototype .setElementAnnotators = function (elementAnnotators) {
UserPreferences.prototype.setElementAnnotators = function (elementAnnotators) {
this._elementAnnotators = elementAnnotators;
};
UserPreferences.prototype.getElementAnnotators = function (className) {
......@@ -86,7 +106,7 @@ UserPreferences.prototype.toExport = function () {
var data = this._elementRequiredAnnotations[key];
requiredAnnotations[key] = {
"require-at-least-one": data.requiredAtLeastOnce,
"annotation-list": data.list,
"annotation-list": data.list
};
}
}
......@@ -103,7 +123,8 @@ UserPreferences.prototype.toExport = function () {
"element-annotators": this._elementAnnotators,
"element-valid-annotations": this._elementValidAnnotations,
"element-required-annotations": requiredAnnotations,
"annotators-parameters": this.getAnnotatorsParameters()
"annotators-parameters": this.getAnnotatorsParameters(),
"gui-preferences": this.getGuiPreferences()
};
};
......
......@@ -24,4 +24,20 @@ describe('UserPreferences', function () {
assert.equal(0, logger.getWarnings().length);
});
});
describe("getGuiPreference", function () {
it("non existing", function () {
var object = new UserPreferences();
assert.ok(object.getGuiPreference("test") === undefined);
});
it("with default value", function () {
var object = new UserPreferences();
assert.ok(object.getGuiPreference("test", 'val') === 'val');
});
});
it("setGuiPreference", function () {
var object = new UserPreferences();
object.setGuiPreference("test", "val");
assert.ok(object.getGuiPreference("test") === "val");
});
});
{"preferences":{"annotators-parameters":{},"element-annotators":{"lcsb.mapviewer.model.map.BioEntity":[],"lcsb.mapviewer.model.map.compartment.BottomSquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.Compartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.LeftSquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.OvalCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.PathwayCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.RightSquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.SquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.TopSquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.reaction.Reaction":[],"lcsb.mapviewer.model.map.reaction.type.BooleanLogicGateReaction":[],"lcsb.mapviewer.model.map.reaction.type.DissociationReaction":[],"lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction":[],"lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction":[],"lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction":[],"lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction":[],"lcsb.mapviewer.model.map.reaction.type.ReducedModulationReaction":[],"lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction":[],"lcsb.mapviewer.model.map.reaction.type.ReducedTriggerReaction":[],"lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction":[],"lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction":[],"lcsb.mapviewer.model.map.reaction.type.TranslationReaction":[],"lcsb.mapviewer.model.map.reaction.type.TransportReaction":[],"lcsb.mapviewer.model.map.reaction.type.TruncationReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedModulationReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedPhysicalStimulationReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedTriggerReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction":[],"lcsb.mapviewer.model.map.species.AntisenseRna":[],"lcsb.mapviewer.model.map.species.Chemical":["Chebi"],"lcsb.mapviewer.model.map.species.Complex":["Gene Ontology"],"lcsb.mapviewer.model.map.species.Degraded":[],"lcsb.mapviewer.model.map.species.Drug":[],"lcsb.mapviewer.model.map.species.Element":[],"lcsb.mapviewer.model.map.species.Gene":["HGNC"],"lcsb.mapviewer.model.map.species.GenericProtein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.Ion":["Chebi"],"lcsb.mapviewer.model.map.species.IonChannelProtein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.Phenotype":["Gene Ontology"],"lcsb.mapviewer.model.map.species.Protein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.ReceptorProtein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.Rna":["HGNC"],"lcsb.mapviewer.model.map.species.SimpleMolecule":["Chebi"],"lcsb.mapviewer.model.map.species.Species":[],"lcsb.mapviewer.model.map.species.TruncatedProtein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.Unknown":[]},"element-required-annotations":{"lcsb.mapviewer.model.map.BioEntity":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.BottomSquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.Compartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.LeftSquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.OvalCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.PathwayCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.RightSquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.SquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.TopSquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.Reaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.BooleanLogicGateReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.DissociationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.ReducedModulationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.ReducedTriggerReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.TranslationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.TransportReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.TruncationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownReducedModulationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownReducedPhysicalStimulationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownReducedTriggerReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.AntisenseRna":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Chemical":{"annotation-list":["CHEBI","PUBCHEM","PUBCHEM_SUBSTANCE"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Complex":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Degraded":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Drug":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Element":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Gene":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.GenericProtein":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Ion":{"annotation-list":["CHEBI","PUBCHEM","PUBCHEM_SUBSTANCE"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.IonChannelProtein":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Phenotype":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Protein":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.ReceptorProtein":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Rna":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.SimpleMolecule":{"annotation-list":["CHEBI","PUBCHEM","PUBCHEM_SUBSTANCE"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Species":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.TruncatedProtein":{"annotation-list":["HGNC","HGNC_SYMBOL","CHEMBL_COMPOUND"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Unknown":{"annotation-list":[],"require-at-least-one":true}},"element-valid-annotations":{"lcsb.mapviewer.model.map.BioEntity":["PUBMED"],"lcsb.mapviewer.model.map.compartment.BottomSquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.Compartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.LeftSquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.OvalCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.PathwayCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.RightSquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.SquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.TopSquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.reaction.Reaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.BooleanLogicGateReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.DissociationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.ReducedModulationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.ReducedTriggerReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.TranslationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.TransportReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.TruncationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedModulationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedPhysicalStimulationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedTriggerReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.species.AntisenseRna":["PUBMED"],"lcsb.mapviewer.model.map.species.Chemical":["CHEBI","HMDB","KEGG_COMPOUND","PUBCHEM","PUBCHEM_SUBSTANCE","PUBMED"],"lcsb.mapviewer.model.map.species.Complex":["CHEMBL_TARGET","EC","GO","INTERPRO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.species.Degraded":["PUBMED"],"lcsb.mapviewer.model.map.species.Drug":["CHEBI","CHEMBL_COMPOUND","DRUGBANK","HMDB","PUBMED"],"lcsb.mapviewer.model.map.species.Element":["PUBMED"],"lcsb.mapviewer.model.map.species.Gene":["ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT"],"lcsb.mapviewer.model.map.species.GenericProtein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM"],"lcsb.mapviewer.model.map.species.Ion":["CHEBI","HMDB","KEGG_COMPOUND","PUBCHEM","PUBCHEM_SUBSTANCE","PUBMED"],"lcsb.mapviewer.model.map.species.IonChannelProtein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM"],"lcsb.mapviewer.model.map.species.Phenotype":["GO","MESH_2012","OMIM","PUBMED"],"lcsb.mapviewer.model.map.species.Protein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM","CHEMBL_COMPOUND"],"lcsb.mapviewer.model.map.species.ReceptorProtein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM"],"lcsb.mapviewer.model.map.species.Rna":["ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT"],"lcsb.mapviewer.model.map.species.SimpleMolecule":["CHEBI","HMDB","KEGG_COMPOUND","PUBCHEM","PUBCHEM_SUBSTANCE","PUBMED"],"lcsb.mapviewer.model.map.species.Species":["PUBMED"],"lcsb.mapviewer.model.map.species.TruncatedProtein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM","CHEMBL_COMPOUND"],"lcsb.mapviewer.model.map.species.Unknown":["PUBMED"]},"gui-preferences":{"admin-projects-datatable-length":"10"},"project-upload":{"annotate-model":false,"auto-resize":true,"cache-data":false,"sbgn":false,"semantic-zooming":false,"validate-miriam":true}}}
\ No newline at end of file
{"preferences":{"annotators-parameters":{},"element-annotators":{"lcsb.mapviewer.model.map.BioEntity":[],"lcsb.mapviewer.model.map.compartment.BottomSquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.Compartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.LeftSquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.OvalCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.PathwayCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.RightSquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.SquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.compartment.TopSquareCompartment":["Gene Ontology"],"lcsb.mapviewer.model.map.reaction.Reaction":[],"lcsb.mapviewer.model.map.reaction.type.BooleanLogicGateReaction":[],"lcsb.mapviewer.model.map.reaction.type.DissociationReaction":[],"lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction":[],"lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction":[],"lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction":[],"lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction":[],"lcsb.mapviewer.model.map.reaction.type.ReducedModulationReaction":[],"lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction":[],"lcsb.mapviewer.model.map.reaction.type.ReducedTriggerReaction":[],"lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction":[],"lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction":[],"lcsb.mapviewer.model.map.reaction.type.TranslationReaction":[],"lcsb.mapviewer.model.map.reaction.type.TransportReaction":[],"lcsb.mapviewer.model.map.reaction.type.TruncationReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedModulationReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedPhysicalStimulationReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedTriggerReaction":[],"lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction":[],"lcsb.mapviewer.model.map.species.AntisenseRna":[],"lcsb.mapviewer.model.map.species.Chemical":["Chebi"],"lcsb.mapviewer.model.map.species.Complex":["Gene Ontology"],"lcsb.mapviewer.model.map.species.Degraded":[],"lcsb.mapviewer.model.map.species.Drug":[],"lcsb.mapviewer.model.map.species.Element":[],"lcsb.mapviewer.model.map.species.Gene":["HGNC"],"lcsb.mapviewer.model.map.species.GenericProtein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.Ion":["Chebi"],"lcsb.mapviewer.model.map.species.IonChannelProtein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.Phenotype":["Gene Ontology"],"lcsb.mapviewer.model.map.species.Protein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.ReceptorProtein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.Rna":["HGNC"],"lcsb.mapviewer.model.map.species.SimpleMolecule":["Chebi"],"lcsb.mapviewer.model.map.species.Species":[],"lcsb.mapviewer.model.map.species.TruncatedProtein":["Biocompendium","HGNC"],"lcsb.mapviewer.model.map.species.Unknown":[]},"element-required-annotations":{"lcsb.mapviewer.model.map.BioEntity":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.BottomSquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.Compartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.LeftSquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.OvalCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.PathwayCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.RightSquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.SquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.compartment.TopSquareCompartment":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.Reaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.BooleanLogicGateReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.DissociationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.ReducedModulationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.ReducedTriggerReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.TranslationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.TransportReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.TruncationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownReducedModulationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownReducedPhysicalStimulationReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownReducedTriggerReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction":{"annotation-list":["PUBMED"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.AntisenseRna":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Chemical":{"annotation-list":["CHEBI","PUBCHEM","PUBCHEM_SUBSTANCE"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Complex":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Degraded":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Drug":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Element":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Gene":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.GenericProtein":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Ion":{"annotation-list":["CHEBI","PUBCHEM","PUBCHEM_SUBSTANCE"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.IonChannelProtein":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Phenotype":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Protein":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.ReceptorProtein":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Rna":{"annotation-list":["HGNC","HGNC_SYMBOL"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.SimpleMolecule":{"annotation-list":["CHEBI","PUBCHEM","PUBCHEM_SUBSTANCE"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Species":{"annotation-list":[],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.TruncatedProtein":{"annotation-list":["HGNC","HGNC_SYMBOL","CHEMBL_COMPOUND"],"require-at-least-one":true},"lcsb.mapviewer.model.map.species.Unknown":{"annotation-list":[],"require-at-least-one":true}},"element-valid-annotations":{"lcsb.mapviewer.model.map.BioEntity":["PUBMED"],"lcsb.mapviewer.model.map.compartment.BottomSquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.Compartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.LeftSquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.OvalCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.PathwayCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.RightSquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.SquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.compartment.TopSquareCompartment":["GO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.reaction.Reaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.BooleanLogicGateReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.DissociationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.HeterodimerAssociationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.KnownTransitionOmittedReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.NegativeInfluenceReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.PositiveInfluenceReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.ReducedModulationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.ReducedPhysicalStimulationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.ReducedTriggerReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.StateTransitionReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.TranscriptionReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.TranslationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.TransportReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.TruncationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownNegativeInfluenceReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownPositiveInfluenceReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedModulationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedPhysicalStimulationReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownReducedTriggerReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.reaction.type.UnknownTransitionReaction":["KEGG_PATHWAY","KEGG_REACTION","PUBMED","REACTOME"],"lcsb.mapviewer.model.map.species.AntisenseRna":["PUBMED"],"lcsb.mapviewer.model.map.species.Chemical":["CHEBI","HMDB","KEGG_COMPOUND","PUBCHEM","PUBCHEM_SUBSTANCE","PUBMED"],"lcsb.mapviewer.model.map.species.Complex":["CHEMBL_TARGET","EC","GO","INTERPRO","MESH_2012","PUBMED"],"lcsb.mapviewer.model.map.species.Degraded":["PUBMED"],"lcsb.mapviewer.model.map.species.Drug":["CHEBI","CHEMBL_COMPOUND","DRUGBANK","HMDB","PUBMED"],"lcsb.mapviewer.model.map.species.Element":["PUBMED"],"lcsb.mapviewer.model.map.species.Gene":["ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT"],"lcsb.mapviewer.model.map.species.GenericProtein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM"],"lcsb.mapviewer.model.map.species.Ion":["CHEBI","HMDB","KEGG_COMPOUND","PUBCHEM","PUBCHEM_SUBSTANCE","PUBMED"],"lcsb.mapviewer.model.map.species.IonChannelProtein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM"],"lcsb.mapviewer.model.map.species.Phenotype":["GO","MESH_2012","OMIM","PUBMED"],"lcsb.mapviewer.model.map.species.Protein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM","CHEMBL_COMPOUND"],"lcsb.mapviewer.model.map.species.ReceptorProtein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM"],"lcsb.mapviewer.model.map.species.Rna":["ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT"],"lcsb.mapviewer.model.map.species.SimpleMolecule":["CHEBI","HMDB","KEGG_COMPOUND","PUBCHEM","PUBCHEM_SUBSTANCE","PUBMED"],"lcsb.mapviewer.model.map.species.Species":["PUBMED"],"lcsb.mapviewer.model.map.species.TruncatedProtein":["CHEMBL_TARGET","EC","ENSEMBL","ENTREZ","HGNC","HGNC_SYMBOL","INTERPRO","KEGG_GENES","MGD","PANTHER","PUBMED","REFSEQ","UNIPROT","UNIPROT_ISOFORM","CHEMBL_COMPOUND"],"lcsb.mapviewer.model.map.species.Unknown":["PUBMED"]},"gui-preferences":{"admin-projects-datatable-length":"10"},"project-upload":{"annotate-model":false,"auto-resize":true,"cache-data":false,"sbgn":false,"semantic-zooming":false,"validate-miriam":true}}}
\ No newline at end of file
......@@ -212,7 +212,15 @@ public class UserRestImpl extends BaseRestImpl {
private void updateGuiPreferences(UserAnnotationSchema schema, Map<String, Object> data) throws QueryException {
for (String key : data.keySet()) {
String value = (String) data.get(key);
Object object = data.get(key);
String value = "";
if (object instanceof Integer) {
value = object + "";
} else if (object instanceof String) {
value = (String) data.get(key);
} else {
throw new InvalidArgumentException("Invalid value class: " + value);
}
schema.setGuiPreference(key, value);
}
}
......@@ -474,7 +482,7 @@ public class UserRestImpl extends BaseRestImpl {
}
modifiedUser.setAnnotationSchema(schema);
getUserService().updateUser(modifiedUser, token);
return getUser(token, login, "");
return getUser(token, login, "preferences");
} catch (IllegalArgumentException e) {
throw new QueryException("Invalid input", e);
}
......
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