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

configuration returns information about unit types

parent 76e497fd
No related branches found
No related tags found
1 merge request!186Resolve "upload of sbml"
......@@ -32,5 +32,9 @@ public enum SbmlUnitType {
TESLA,
VOLT,
WATT,
WEBER,
WEBER,;
public String getCommonName() {
return this.name().toLowerCase();
}
}
......@@ -9,7 +9,6 @@ import javax.servlet.ServletContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -53,6 +52,7 @@ public class ConfigurationController extends BaseController {
result.put("reactionTypes", configurationController.getReactionTypes(token));
result.put("miriamTypes", configurationController.getMiriamTypes(token));
result.put("mapTypes", configurationController.getMapTypes(token));
result.put("unitTypes", configurationController.getUnitTypes(token));
result.put("modificationStateTypes", configurationController.getModificationStateTypes(token));
result.put("privilegeTypes", configurationController.getPrivilegeTypes(token));
result.put("version", configurationService.getSystemSvnVersion(context.getRealPath("/")));
......
......@@ -22,6 +22,7 @@ import lcsb.mapviewer.converter.IConverter;
import lcsb.mapviewer.converter.graphics.AbstractImageGenerator;
import lcsb.mapviewer.converter.graphics.ImageGenerators;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.kinetics.SbmlUnitType;
import lcsb.mapviewer.model.map.model.SubmodelType;
import lcsb.mapviewer.model.map.reaction.Reaction;
import lcsb.mapviewer.model.map.species.Element;
......@@ -291,4 +292,15 @@ public class ConfigurationRestImpl extends BaseRestImpl {
return result;
}
public List<Map<String, Object>> getUnitTypes(String token) {
List<Map<String, Object>> result = new ArrayList<>();
for (SbmlUnitType type : SbmlUnitType.values()) {
Map<String, Object> row = new HashMap<>();
row.put("id", type.name());
row.put("name", type.getCommonName());
result.add(row);
}
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