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

Api for getting list of miriamTypes

parent abe5c647
No related branches found
No related tags found
1 merge request!58some refactoring giving additional Rest API functionlaity
......@@ -28,6 +28,7 @@ public class ConfigurationController extends BaseController {
result.put("overlayTypes", configurationController.getOverlayTypes(token));
result.put("elementTypes", configurationController.getElementTypes(token));
result.put("reactionTypes", configurationController.getReactionTypes(token));
result.put("miriamTypes", configurationController.getMiriamTypes(token));
return result;
}
......
......@@ -22,6 +22,7 @@ import lcsb.mapviewer.converter.graphics.ImageGenerators;
import lcsb.mapviewer.converter.model.celldesigner.CellDesignerXmlParser;
import lcsb.mapviewer.converter.model.sbgnml.SbgnmlXmlConverter;
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.modelutils.map.ClassTreeNode;
......@@ -169,4 +170,22 @@ public class ConfigurationRestImpl {
return getClassStringTypesList(Reaction.class);
}
public Map<String, Object> getMiriamTypes(String id) {
Map<String, Object> result = new HashMap<>();
for (MiriamType type : MiriamType.values()) {
result.put(type.name(), createMiriamTypeResponse(type));
}
return result;
}
private Map<String, Object> createMiriamTypeResponse(MiriamType type) {
Map<String, Object> result = new HashMap<>();
result.put("commonName", type.getCommonName());
result.put("homepage", type.getDbHomepage());
result.put("registryIdentifier", type.getRegistryIdentifier());
result.put("uris", type.getUris());
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