<%intslidesCount=0;ResourceBundlemsgs=ResourceBundle.getBundle("br.com.cpqd.www.dmd.Messages",request.getLocale());ResourceBundlebundle=ResourceBundle.getBundle("br.com.cpqd.www.dmd.dmdweb_config");Presentationp=null;StringpresentationURL=null;longid=Long.parseLong(request.getParameter("presentationID"));Longhid=null;try{DAOdao=DAOFactory.getDAOInstance(DAOFactory.PRESENTATION_DAO,request.getLocale());p=(Presentation)dao.getObject(id);try{HistoryEntryh=newHistoryEntry();h.setPresentationID(newLong(id));h.setUserID(((User)((HttpServletRequest)request).getSession().getAttribute("user")).getId());h.setStartTime(newTimestamp(System.currentTimeMillis()));DAOhistDao=DAOFactory.getDAOInstance(DAOFactory.HISTORY_DAO);histDao.createObject(h);hid=h.getId();}catch(Exceptione){System.out.println("Error while processing history information: "+e);e.printStackTrace();}if(p.getPresentationType().equals(Presentation.LIVE_PRESENTATION)){slidesCount=newFile(p.getPath(),"slides").listFiles(newFileFilter(){publicbooleanaccept(Filefile){returnfile.getName().toLowerCase().endsWith(".jpg")||file.getName().toLowerCase().endsWith(".png");}//accept}).length;StringbaseUrl=bundle.getString("presentation.base.url");StringbaseDir=bundle.getString("presentation.directory");StringpresentationDir=p.getPath().getAbsolutePath().substring(baseDir.length());presentationDir.replace('\\','/');//in case this is running on windowsif(!presentationDir.endsWith("/")){presentationDir=presentationDir+"/";}if(!(presentationDir.startsWith("/")||(baseUrl.endsWith("/")))){presentationURL=baseUrl+"/"+presentationDir;}else{presentationURL=baseUrl+presentationDir;}br.com.cpqd.www.dmd.comm.PresentationManager.setLastAccessTime(id,newLong(System.currentTimeMillis()));}}catch(Exceptione){System.out.println("Error while processing presentation information: "+e);e.printStackTrace();}%>