package eu.dnetlib.is.context; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import eu.dnetlib.errors.InformationServiceException; import eu.dnetlib.is.model.context.Category; import eu.dnetlib.is.model.context.Context; import eu.dnetlib.is.model.context.CtxChildInfo; @RestController @RequestMapping("/ajax/contexts") public class ContextAjaxController extends AbstractContextController { @GetMapping("/{ctxId}") public Context getContext(@PathVariable final String ctxId) throws InformationServiceException { return contextService.getContext(ctxId); } @GetMapping("/{parent}/categories") public Iterable listCategories(@PathVariable final String parent) { return contextService.listCategories(parent); } @GetMapping("/{level}/{parent}/concepts") public Iterable listCategories(@PathVariable final int level, @PathVariable final String parent) throws InformationServiceException { return contextService.listConcepts(level, parent); } }