Search in sources :

Example 1 with SubjectDto

use of easytests.personal.dto.SubjectDto in project easy-tests by malinink.

the class SubjectsController method read.

@GetMapping("{id}")
public String read(@PathVariable("id") Integer id, Model model) {
    final SubjectsOptionsInterface subjectsOptions = new SubjectsOptions().withIssueStandard(new IssueStandardsOptions());
    final SubjectModelInterface subjectModel = getSubjectModel(id, subjectsOptions);
    final SubjectDto subject = new SubjectDto();
    subject.map(subjectModel);
    model.addAttribute("subject", subject);
    model.addAttribute("issueStandardId", subjectModel.getIssueStandard().getId());
    return "subjects/view";
}
Also used : SubjectDto(easytests.personal.dto.SubjectDto) SubjectsOptions(easytests.core.options.SubjectsOptions) IssueStandardsOptions(easytests.core.options.IssueStandardsOptions) SubjectsOptionsInterface(easytests.core.options.SubjectsOptionsInterface) SubjectModelInterface(easytests.core.models.SubjectModelInterface)

Example 2 with SubjectDto

use of easytests.personal.dto.SubjectDto in project easy-tests by malinink.

the class SubjectsController method update.

@GetMapping("update/{id}")
public String update(@PathVariable("id") Integer id, Model model) {
    model.addAttribute("methodType", "update");
    final SubjectModelInterface subjectModel = getSubjectModel(id);
    final SubjectDto subject = new SubjectDto();
    subject.map(subjectModel);
    model.addAttribute("subject", subject);
    return "subjects/form";
}
Also used : SubjectDto(easytests.personal.dto.SubjectDto) SubjectModelInterface(easytests.core.models.SubjectModelInterface)

Example 3 with SubjectDto

use of easytests.personal.dto.SubjectDto in project easy-tests by malinink.

the class SubjectsController method deleteConfirmation.

@GetMapping("delete/{id}")
public String deleteConfirmation(@PathVariable("id") Integer id, Model model) {
    final SubjectDto subjectDto = new SubjectDto();
    final SubjectModelInterface subjectModel = getSubjectModel(id);
    subjectDto.map(subjectModel);
    model.addAttribute("subject", subjectDto);
    return "subjects/delete";
}
Also used : SubjectDto(easytests.personal.dto.SubjectDto) SubjectModelInterface(easytests.core.models.SubjectModelInterface)

Example 4 with SubjectDto

use of easytests.personal.dto.SubjectDto in project easy-tests by malinink.

the class SubjectsController method create.

@GetMapping("create")
public String create(Model model) {
    final SubjectDto subject = new SubjectDto();
    subject.setName("");
    subject.setDescription("");
    model.addAttribute("methodType", "create");
    model.addAttribute("subject", subject);
    return "subjects/form";
}
Also used : SubjectDto(easytests.personal.dto.SubjectDto)

Aggregations

SubjectDto (easytests.personal.dto.SubjectDto)4 SubjectModelInterface (easytests.core.models.SubjectModelInterface)3 IssueStandardsOptions (easytests.core.options.IssueStandardsOptions)1 SubjectsOptions (easytests.core.options.SubjectsOptions)1 SubjectsOptionsInterface (easytests.core.options.SubjectsOptionsInterface)1