return;
}
} else {
// recover office document sbidomains
IDomainDAO domainDAO = DAOFactory.getDomainDAO();
Domain officeDocDom = domainDAO.loadDomainByCodeAndValue("BIOBJ_TYPE", "OFFICE_DOC");
// recover development sbidomains
Domain devDom = domainDAO.loadDomainByCodeAndValue("STATE", "DEV");
// recover engine
IEngineDAO engineDAO = DAOFactory.getEngineDAO();
List engines = engineDAO.loadAllEnginesForBIObjectType(officeDocDom.getValueCd());
Engine engine = (Engine)engines.get(0);
// load the template
UploadedFile uploadedFile = new UploadedFile();
IDossierPresentationsDAO dpDAO = DAOFactory.getDossierPresentationDAO();
Integer dossierId = new Integer(dossierIdStr);
Integer versionId = new Integer(versionIdStr);
byte[] tempCont = dpDAO.getPresentationVersionContent(dossierId, versionId);
BIObject dossier = DAOFactory.getBIObjectDAO().loadBIObjectById(dossierId);
String bookName = dossier.getName();
ObjTemplate templ = new ObjTemplate();
templ.setActive(new Boolean(true));
templ.setName(bookName + ".ppt");
templ.setContent(tempCont);
// load all functionality
List storeInFunctionalities = new ArrayList();
List functIds = request.getAttributeAsList("FUNCT_ID");
Iterator iterFunctIds = functIds.iterator();
while(iterFunctIds.hasNext()) {
String functIdStr = (String)iterFunctIds.next();
Integer functId = new Integer(functIdStr);
storeInFunctionalities.add(functId);
}
// create biobject
BIObject biobj = new BIObject();
biobj.setCreationUser(userId);
biobj.setDescription(description);
biobj.setLabel(label);
biobj.setName(name);
biobj.setEncrypt(new Integer(0));
biobj.setEngine(engine);
biobj.setDataSourceId(null);
biobj.setRelName("");
biobj.setBiObjectTypeCode(officeDocDom.getValueCd());
biobj.setBiObjectTypeID(officeDocDom.getValueId());
biobj.setStateCode(devDom.getValueCd());
biobj.setStateID(devDom.getValueId());
biobj.setVisible(new Integer(0));
biobj.setFunctionalities(storeInFunctionalities);
biobj.setStateCode(stateCode);
biobj.setStateID(stateId);
biobj.setVisible((visible? new Integer(1): new Integer(0)));