use of ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject in project Gemma by PavlidisLab.
the class ArrayDesignFormController method onSubmit.
@Override
public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
ArrayDesignValueObject ad = (ArrayDesignValueObject) command;
ArrayDesign existing = arrayDesignService.load(ad.getId());
if (existing == null) {
errors.addError(new ObjectError(command.toString(), null, null, "No such platform with id=" + ad.getId()));
return processFormSubmission(request, response, command, errors);
}
// existing = arrayDesignService.thawLite( existing );
existing.setDescription(ad.getDescription());
existing.setName(ad.getName());
existing.setShortName(ad.getShortName());
String technologyType = ad.getTechnologyType();
if (StringUtils.isNotBlank(technologyType)) {
existing.setTechnologyType(TechnologyType.fromString(technologyType));
}
arrayDesignService.update(existing);
saveMessage(request, "object.updated", new Object[] { ad.getClass().getSimpleName().replaceFirst("Impl", ""), ad.getName() }, "Saved");
// go back to the aray we just edited.
return new ModelAndView(new RedirectView("/arrays/showArrayDesign.html?id=" + ad.getId(), true));
}
Aggregations