Search in sources :

Example 71 with GetMapping

use of org.springframework.web.bind.annotation.GetMapping in project easy-tests by malinink.

the class TopicsController method update.

@GetMapping("update/{topicId}/")
public String update(Model model, @PathVariable Integer topicId, @PathVariable("subjectId") Integer subjectId) {
    final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, false);
    final TopicModelInterface topicModel = this.getTopicModel(topicId, subjectId);
    final TopicDto topic = new TopicDto();
    topic.map(topicModel);
    setUpdateBehaviour(model);
    model.addAttribute("topic", topic);
    model.addAttribute("subjectId", subjectId);
    return "topics/form";
}
Also used : TopicDto(easytests.personal.dto.TopicDto) SubjectModelInterface(easytests.core.models.SubjectModelInterface) TopicModelInterface(easytests.core.models.TopicModelInterface) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 72 with GetMapping

use of org.springframework.web.bind.annotation.GetMapping in project easy-tests by malinink.

the class TopicsController method deleteConfirmation.

@GetMapping("delete/{topicId}")
public String deleteConfirmation(Model model, @PathVariable("topicId") Integer topicId, @PathVariable("subjectId") Integer subjectId) {
    final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, false);
    final TopicModelInterface topicModel = this.getTopicModel(topicId, subjectId);
    model.addAttribute("subjectId", subjectId);
    return "topics/delete";
}
Also used : SubjectModelInterface(easytests.core.models.SubjectModelInterface) TopicModelInterface(easytests.core.models.TopicModelInterface) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 73 with GetMapping

use of org.springframework.web.bind.annotation.GetMapping in project easy-tests by malinink.

the class TopicsController method read.

@GetMapping("{topicId}")
public String read(Model model, @PathVariable("subjectId") Integer subjectId, @PathVariable("topicId") Integer topicId) {
    final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, false);
    final TopicModelInterface topicModel = getTopicModel(topicId, subjectId);
    model.addAttribute("topic", topicModel);
    model.addAttribute("subjectId", subjectId);
    return "topics/view";
}
Also used : SubjectModelInterface(easytests.core.models.SubjectModelInterface) TopicModelInterface(easytests.core.models.TopicModelInterface) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 74 with GetMapping

use of org.springframework.web.bind.annotation.GetMapping in project easy-tests by malinink.

the class TopicsController method list.

@GetMapping("")
public String list(Model model, @PathVariable("subjectId") Integer subjectId) {
    final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, true);
    final List<TopicModelInterface> topics = subjectModel.getTopics();
    model.addAttribute("topics", topics);
    model.addAttribute("subjectId", subjectId);
    return "topics/list";
}
Also used : SubjectModelInterface(easytests.core.models.SubjectModelInterface) TopicModelInterface(easytests.core.models.TopicModelInterface) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 75 with GetMapping

use of org.springframework.web.bind.annotation.GetMapping in project easy-tests by malinink.

the class TopicsController method create.

@GetMapping("create/")
public String create(Model model, @PathVariable("subjectId") Integer subjectId) {
    final SubjectModelInterface subjectModel = getCurrentSubjectModel(subjectId, false);
    final TopicDto topic = new TopicDto();
    setCreateBehaviour(model);
    model.addAttribute("topic", topic);
    model.addAttribute("subjectId", subjectId);
    return "topics/form";
}
Also used : TopicDto(easytests.personal.dto.TopicDto) SubjectModelInterface(easytests.core.models.SubjectModelInterface) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

GetMapping (org.springframework.web.bind.annotation.GetMapping)756 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)114 ResponseEntity (org.springframework.http.ResponseEntity)80 ArrayList (java.util.ArrayList)52 List (java.util.List)49 ModelAndView (org.springframework.web.servlet.ModelAndView)48 WebMessageException (org.hisp.dhis.dxf2.webmessage.WebMessageException)45 HttpHeaders (org.springframework.http.HttpHeaders)41 Map (java.util.Map)40 HashMap (java.util.HashMap)38 lombok.val (lombok.val)38 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)36 Grid (org.hisp.dhis.common.Grid)35 IOException (java.io.IOException)34 RequestParam (org.springframework.web.bind.annotation.RequestParam)34 ApiOperation (io.swagger.annotations.ApiOperation)31 RootNode (org.hisp.dhis.node.types.RootNode)31 PathVariable (org.springframework.web.bind.annotation.PathVariable)31 HttpServletRequest (javax.servlet.http.HttpServletRequest)30 FieldFilterParams (org.hisp.dhis.fieldfilter.FieldFilterParams)28