Search in sources :

Example 26 with ArrayDesignValueObject

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));
}
Also used : ObjectError(org.springframework.validation.ObjectError) ArrayDesign(ubic.gemma.model.expression.arrayDesign.ArrayDesign) ArrayDesignValueObject(ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject) ModelAndView(org.springframework.web.servlet.ModelAndView) RedirectView(org.springframework.web.servlet.view.RedirectView)

Aggregations

ArrayDesignValueObject (ubic.gemma.model.expression.arrayDesign.ArrayDesignValueObject)26 ArrayDesign (ubic.gemma.model.expression.arrayDesign.ArrayDesign)7 BioMaterialValueObject (ubic.gemma.model.expression.biomaterial.BioMaterialValueObject)4 BioAssayValueObject (ubic.gemma.model.expression.bioAssay.BioAssayValueObject)3 StopWatch (org.apache.commons.lang3.time.StopWatch)2 Test (org.junit.Test)2 ExpressionExperimentDetailsValueObject (ubic.gemma.model.expression.experiment.ExpressionExperimentDetailsValueObject)2 ExpressionExperimentValueObject (ubic.gemma.model.expression.experiment.ExpressionExperimentValueObject)2 FactorValue (ubic.gemma.model.expression.experiment.FactorValue)2 FactorValueValueObject (ubic.gemma.model.expression.experiment.FactorValueValueObject)2 BaseSpringWebTest (ubic.gemma.web.util.BaseSpringWebTest)2 DoubleArrayList (cern.colt.list.DoubleArrayList)1 MapperException (com.sdicons.json.mapper.MapperException)1 Date (java.util.Date)1 JspException (javax.servlet.jsp.JspException)1 Secured (org.springframework.security.access.annotation.Secured)1 ObjectError (org.springframework.validation.ObjectError)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1 RedirectView (org.springframework.web.servlet.view.RedirectView)1 SearchResult (ubic.gemma.core.search.SearchResult)1