}
public ActionForward substituteDocument(final ActionMapping mapping, final HttpServletRequest request,
final boolean dissertationFile) throws Exception {
final Thesis thesis = getDomainObject(request, "thesisOid");
ThesisFileBean bean = getRenderedObject();
RenderUtils.invalidateViewState();
if (bean != null && bean.getFile() != null) {
byte[] bytes = ByteStreams.toByteArray(bean.getFile());
if (dissertationFile) {
CreateThesisDissertationFile.runCreateThesisDissertationFile(thesis, bytes, bean.getSimpleFileName(),
bean.getTitle(), bean.getSubTitle(), bean.getLanguage());
} else {
CreateThesisAbstractFile.runCreateThesisAbstractFile(thesis, bytes, bean.getSimpleFileName(), bean.getTitle(),
bean.getSubTitle(), bean.getLanguage());
}
}
return showThesisDetails(mapping, request, thesis);
}