use of org.hisp.dhis.schema.Schemas in project dhis2-core by dhis2.
the class SchemaController method getSchemas.
@RequestMapping
@ResponseBody
public RootNode getSchemas() {
List<String> fields = Lists.newArrayList(contextService.getParameterValues("fields"));
if (fields.isEmpty()) {
fields.add("*");
}
Schemas schemas = new Schemas(schemaService.getSortedSchemas());
linkService.generateSchemaLinks(schemas.getSchemas());
RootNode rootNode = NodeUtils.createRootNode("schemas");
CollectionNode collectionNode = fieldFilterService.filter(Schema.class, schemas.getSchemas(), fields);
collectionNode.setWrapping(false);
rootNode.addChild(collectionNode);
return rootNode;
}
Aggregations