} finally {
if (jbpmContext != null) jbpmContext.close();
}
if (dossierId != null) {
BIObject dossier = DAOFactory.getBIObjectDAO().loadBIObjectById(dossierId);
IDossierPresentationsDAO dpDAO = DAOFactory.getDossierPresentationDAO();
DossierPresentation presentation = dpDAO.getCurrentPresentation(dossierId, workflowProcessId);
byte[] finalDocBytes = presentation.getContent();
response.setHeader("Content-Disposition","attachment; filename=\"" + dossier.getName() + ".ppt" + "\";");
response.setContentLength(finalDocBytes.length);
out.write(finalDocBytes);
out.flush();
} else {
logger.error("Dossier configuration path not found!");
}
return;
} else if(task.equalsIgnoreCase(DossierConstants.DOSSIER_SERVICE_TASK_DOWN_PRESENTATION_VERSION)) {
String dossierIdStr = (String) serviceRequest.getAttribute(DossierConstants.DOSSIER_ID);
Integer dossierId = new Integer(dossierIdStr);
String versionStr = (String) serviceRequest.getAttribute(DossierConstants.VERSION_ID);
Integer versionId = new Integer(versionStr);
BIObject dossier = DAOFactory.getBIObjectDAO().loadBIObjectById(dossierId);
IDossierPresentationsDAO dpDAO = DAOFactory.getDossierPresentationDAO();
byte[] finalDocBytes = dpDAO.getPresentationVersionContent(dossierId, versionId);
response.setHeader("Content-Disposition","attachment; filename=\"" + dossier.getName() + ".ppt" + "\";");
response.setContentLength(finalDocBytes.length);
out.write(finalDocBytes);
return;