@RequestMapping(value = "/new/dilution/{dilutionId}", method = RequestMethod.GET)
public ModelAndView setupFormWithDilution(@PathVariable Long dilutionId,
ModelMap model) throws IOException {
try {
User user = securityManager.getUserByLoginName(SecurityContextHolder.getContext().getAuthentication().getName());
IlluminaPool pool = dataObjectFactory.getIlluminaPool(user);
model.put("title", "New Illumina Pool");
if (pool == null) {
throw new SecurityException("No such Illumina Pool");
}
if (!pool.userCanRead(user)) {
throw new SecurityException("Permission denied.");
}
if (dilutionId != null) {
LibraryDilution ld = requestManager.getLibraryDilutionById(dilutionId);
if (ld != null) {
pool.addPoolableElement(ld);
}
}
model.put("formObj", pool);
model.put("pool", pool);