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

REST API returns info about modification state types

parent 243d33a6
No related branches found
No related tags found
1 merge request!68Resolve "Modification of proteins are not displayed"
......@@ -29,6 +29,7 @@ public class ConfigurationController extends BaseController {
result.put("elementTypes", configurationController.getElementTypes(token));
result.put("reactionTypes", configurationController.getReactionTypes(token));
result.put("miriamTypes", configurationController.getMiriamTypes(token));
result.put("modificationStateTypes", configurationController.getModificationStateTypes(token));
return result;
}
......
......@@ -25,6 +25,7 @@ import lcsb.mapviewer.model.map.BioEntity;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.reaction.Reaction;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.field.ModificationState;
import lcsb.mapviewer.modelutils.map.ClassTreeNode;
import lcsb.mapviewer.modelutils.map.ElementUtils;
import lcsb.mapviewer.services.SecurityException;
......@@ -188,4 +189,19 @@ public class ConfigurationRestImpl {
return result;
}
public Object getModificationStateTypes(String token) {
Map<String, Object> result = new HashMap<>();
for (ModificationState type : ModificationState.values()) {
result.put(type.name(), createModificationStateResponse(type));
}
return result;
}
private Map<String, Object> createModificationStateResponse(ModificationState type) {
Map<String, Object> result = new HashMap<>();
result.put("commonName", type.getFullName());
result.put("abbreviation", type.getAbbreviation());
return result;
}
}
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