RenderUtils.invalidateViewState();  request.setAttribute("publicationBean", bean); if(bean!=null && bean.getIdInternal()!=null) { return prepareEditData(mapping, form, request, response); } return mapping.findForward("PreparedToCreate");
if (bean != null) { ResultPublicationType type = bean.getPublicationType(); if (type != null) { bean = bean.convertTo(type); if (bean.getIdInternal() != null) { final ResultPublication result = (ResultPublication) Result.readByOid(bean .getIdInternal()); if (result != null) { if (!(ResultPublicationType.getTypeFromPublication(result) == type)) { if (result.hasAnyResultDocumentFiles()) { request.setAttribute("typeChanged", "true"); } } else { bean = ResultPublicationBean.getBeanToEdit(result); bean.setPerson(getLoggedPerson(request)); request.setAttribute("typeChanged", "false"); } } } } }  RenderUtils.invalidateViewState();  request.setAttribute("publicationBean", bean); if (bean != null && bean.getIdInternal() != null) { verifyMessageForTypeChange(request); return mapping.findForward("PreparedToEdit"); } return mapping.findForward("PreparedToCreate");
    public ActionForward changeType(ActionMapping mapping, ActionForm form, HttpServletRequest request,	    HttpServletResponse response) throws FenixFilterException, FenixServiceException {	ResultPublicationBean bean = (ResultPublicationBean)getRenderedObject("publicationData");		if (bean!=null) {	    ResultPublicationType type = bean.getPublicationType();	    if (type!=null) {		bean = bean.convertTo(type);		if(bean.getIdInternal()!=null) {		    final ResultPublication result = (ResultPublication)Result.readByOid(bean.getIdInternal());		    if (result!= null) {			if(!(ResultPublicationType.getTypeFromPublication(result)==type)) {			    if (result.hasAnyResultDocumentFiles()) {				request.setAttribute("typeChanged", "true");			    }			} else {			    bean = ResultPublicationBean.getBeanToEdit(result);			    bean.setPerson(getLoggedPerson(request));			    request.setAttribute("typeChanged", "false");			}		    }		}	    }	}	RenderUtils.invalidateViewState();		request.setAttribute("publicationBean", bean);	if(bean!=null && bean.getIdInternal()!=null) {	    return prepareEditData(mapping, form, request, response);	}	return mapping.findForward("PreparedToCreate");    }