protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception
{
ACrisObject cris = getCRISObject(request);
if (!"submit_exit".equalsIgnoreCase(UIUtil.getSubmitButton(request, "exit")))
{
Context context = UIUtil.obtainContext(request);
ManageRelationDTO dto = (ManageRelationDTO) command;
String relationType = getRelationType(request);
boolean doneChange = false;
doneChange = relationService.unlink(context, cris, relationType,
dto.getToUnLink())
|| doneChange;
doneChange = relationService.active(context, cris, relationType,
dto.getToActivate())
|| doneChange;
doneChange = relationService.hide(context, cris, relationType,
dto.getToHide())
|| doneChange;
List<String> newSelectedItems = dto.getOrderedSelected();
doneChange = relationService.select(context, cris, relationType,
newSelectedItems) || doneChange;
if (doneChange)
{
// make sure to commit the SOLR change
((SolrServiceImpl) searcher).commit();
}
}
return new ModelAndView(getSuccessView() + cris.getUuid());
}