use of ubic.gemma.web.util.EntityNotFoundException in project Gemma by PavlidisLab.
the class BibliographicReferenceControllerImpl method delete.
@Override
public ModelAndView delete(HttpServletRequest request, HttpServletResponse response) {
String pubMedId = request.getParameter("acc");
if (pubMedId == null) {
// should be a validation error.
throw new EntityNotFoundException("Must provide a PubMed Id");
}
BibliographicReference bibRef = bibliographicReferenceService.findByExternalId(pubMedId);
if (bibRef == null) {
String message = "There is no reference with accession=" + pubMedId + " in the system any more.";
this.saveMessage(request, message);
return new ModelAndView("bibRefView").addObject("errors", message);
}
return this.doDelete(request, bibRef);
}
use of ubic.gemma.web.util.EntityNotFoundException in project Gemma by PavlidisLab.
the class ExpressionExperimentController method showBioAssays.
@RequestMapping(value = { "/showBioAssaysFromExpressionExperiment.html", "/bioAssays" })
public ModelAndView showBioAssays(HttpServletRequest request, HttpServletResponse response) {
String idStr = request.getParameter("id");
if (idStr == null) {
// should be a validation error, on 'submit'.
throw new EntityNotFoundException(identifierNotFound);
}
Long id = Long.parseLong(idStr);
ExpressionExperiment expressionExperiment = expressionExperimentService.load(id);
expressionExperiment = expressionExperimentService.thawLite(expressionExperiment);
if (expressionExperiment == null) {
throw new EntityNotFoundException(id + " not found");
}
request.setAttribute("id", id);
ModelAndView mv = new ModelAndView("bioAssays").addObject("bioAssays", bioAssayService.thaw(expressionExperiment.getBioAssays()));
this.addQCInfo(expressionExperiment, mv);
mv.addObject("expressionExperiment", expressionExperiment);
return mv;
}
use of ubic.gemma.web.util.EntityNotFoundException in project Gemma by PavlidisLab.
the class ExpressionExperimentController method showSubSet.
/**
* shows a list of BioAssays for an expression experiment subset
*
* @param request request
* @param response response
* @return model and view
*/
@RequestMapping(value = { "/showExpressionExperimentSubSet.html", "/showSubset" })
public ModelAndView showSubSet(HttpServletRequest request, HttpServletResponse response) {
Long id = Long.parseLong(request.getParameter("id"));
ExpressionExperimentSubSet subset = expressionExperimentSubSetService.load(id);
if (subset == null) {
throw new EntityNotFoundException(id + " not found");
}
// request.setAttribute( "id", id );
return new ModelAndView("bioAssays").addObject("bioAssays", subset.getBioAssays());
}
use of ubic.gemma.web.util.EntityNotFoundException in project Gemma by PavlidisLab.
the class BioAssayController method show.
@RequestMapping(value = { "/showBioAssay.html", "/" })
public ModelAndView show(HttpServletRequest request, HttpServletResponse response) {
BioAssayController.log.debug(request.getParameter("id"));
Long id;
try {
id = Long.parseLong(request.getParameter("id"));
} catch (NumberFormatException e) {
return new ModelAndView(WebConstants.HOME_PAGE).addObject("message", BioAssayController.identifierNotFound);
}
BioAssay bioAssay = bioAssayService.load(id);
if (bioAssay == null) {
throw new EntityNotFoundException(id + " not found");
}
bioAssayService.thaw(bioAssay);
request.setAttribute("id", id);
return new ModelAndView("bioAssay.detail").addObject("bioAssay", new BioAssayValueObject(bioAssay, false));
}
use of ubic.gemma.web.util.EntityNotFoundException in project Gemma by PavlidisLab.
the class BioAssayController method showAllBioAssays.
@RequestMapping("/showAllBioAssays.html")
public ModelAndView showAllBioAssays(HttpServletRequest request, HttpServletResponse response) {
String sId = request.getParameter("id");
Collection<BioAssay> bioAssays = new ArrayList<>();
if (StringUtils.isBlank(sId)) {
/*
* Probably not desirable ... there are >70,000 of them
*/
bioAssays = bioAssayService.loadAll();
} else {
String[] idList = StringUtils.split(sId, ',');
for (String anIdList : idList) {
Long id = Long.parseLong(anIdList);
BioAssay bioAssay = bioAssayService.load(id);
if (bioAssay == null) {
throw new EntityNotFoundException(id + " not found");
}
bioAssayService.thaw(bioAssay);
bioAssays.add(bioAssay);
}
}
return new ModelAndView("bioAssays").addObject("bioAssays", bioAssays);
}
Aggregations