use of uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryTemplate in project miso-lims by miso-lims.
the class EditLibraryTemplateController method create.
@GetMapping("/new")
public ModelAndView create(@RequestParam(name = "projectId", required = false) Long projectId, ModelMap model) throws IOException {
LibraryTemplate template = isDetailedSampleEnabled() ? new DetailedLibraryTemplate() : new LibraryTemplate();
if (projectId != null) {
Project project = projectService.get(projectId);
if (project == null) {
throw new ClientErrorException("No project found with ID: " + projectId);
}
template.getProjects().add(project);
}
model.put(PageMode.PROPERTY, PageMode.CREATE.getLabel());
model.put("title", "New Library Template");
return libraryTemplatePage(template, model);
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryTemplate in project miso-lims by miso-lims.
the class DefaultLibraryTemplateService method applyChanges.
@Override
protected void applyChanges(LibraryTemplate target, LibraryTemplate source) {
target.setAlias(source.getAlias());
target.setPlatformType(source.getPlatformType());
target.setLibraryType(source.getLibraryType());
target.setLibrarySelectionType(source.getLibrarySelectionType());
target.setLibraryStrategyType(source.getLibraryStrategyType());
target.setKitDescriptor(source.getKitDescriptor());
target.setIndexFamily(source.getIndexFamily());
target.setDefaultVolume(source.getDefaultVolume());
target.setVolumeUnits(source.getVolumeUnits());
applyProjectChanges(target.getProjects(), source.getProjects());
if (target instanceof DetailedLibraryTemplate) {
DetailedLibraryTemplate dSource = (DetailedLibraryTemplate) source;
DetailedLibraryTemplate dTarget = (DetailedLibraryTemplate) target;
dTarget.setLibraryDesign(dSource.getLibraryDesign());
dTarget.setLibraryDesignCode(dSource.getLibraryDesignCode());
}
applyIndexChanges(target.getIndexOnes(), source.getIndexOnes());
applyIndexChanges(target.getIndexTwos(), source.getIndexTwos());
}
use of uk.ac.bbsrc.tgac.miso.core.data.impl.DetailedLibraryTemplate in project miso-lims by miso-lims.
the class Dtos method toDetailedLibraryTemplate.
public static DetailedLibraryTemplate toDetailedLibraryTemplate(DetailedLibraryTemplateDto from) {
if (from == null)
return null;
DetailedLibraryTemplate to = new DetailedLibraryTemplate();
setObject(to::setLibraryDesign, LibraryDesign::new, from.getDesignId());
setObject(to::setLibraryDesignCode, LibraryDesignCode::new, from.getDesignCodeId());
return to;
}
Aggregations