use of uk.ac.bbsrc.tgac.miso.core.data.type.StatusType in project miso-lims by miso-lims.
the class EditProjectController method setupForm.
private ModelAndView setupForm(Project project, ModelMap model) throws IOException {
if (project.isSaved()) {
Collection<Subproject> subprojects = subprojectService.listByProjectId(project.getId());
model.put("subprojects", Dtos.asSubprojectDtos(subprojects));
model.put("title", "Project " + project.getId());
MisoWebUtils.addIssues(issueTrackerManager, () -> issueTrackerManager.getIssuesByTag(project.getShortName()), model);
model.put("projectReportLinks", externalUriBuilder.getUris(project));
}
model.put("project", project);
ObjectMapper mapper = new ObjectMapper();
model.put("projectDto", mapper.writeValueAsString(Dtos.asDto(project)));
ObjectNode formConfig = mapper.createObjectNode();
MisoWebUtils.addJsonArray(mapper, formConfig, "statusOptions", Arrays.asList(StatusType.values()), StatusType::getKey);
ObjectNode namingConfig = formConfig.putObject("naming");
addNamingSchemeConfig(namingConfig, "primary", namingSchemeHolder.getPrimary(), project);
addNamingSchemeConfig(namingConfig, "secondary", namingSchemeHolder.getSecondary(), project);
model.put("formConfig", mapper.writeValueAsString(formConfig));
return new ModelAndView("/WEB-INF/pages/editProject.jsp", model);
}
Aggregations