[6] | 1 | <html> |
---|
| 2 | |
---|
| 3 | <META HTTP-EQUIV="Cache-Control" content="no-cache"> |
---|
| 4 | <META HTTP-EQUIV="Pragma" content="no-cache"> |
---|
| 5 | <META HTTP-EQUIV="Expires" content="Mon, 01 Jan 1990 12:00:00 GMT"> |
---|
| 6 | |
---|
| 7 | <%@ page import="fr.alcatel.ether.tools.*" %> |
---|
| 8 | <%@ page import="fr.alcatel.ether.app.common.*" %> |
---|
| 9 | <%@ page import="fr.alcatel.ether.app.exception.*" %> |
---|
| 10 | <%@ page import="java.rmi.*" %> |
---|
| 11 | <%@ page import="fr.alcatel.ether.bean.ServiceInfoBean" %> |
---|
| 12 | |
---|
| 13 | <title>lancement d'un service interactif</title> |
---|
| 14 | <head> |
---|
| 15 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
| 16 | </head> |
---|
| 17 | |
---|
| 18 | <body background="/images/Ether_Fond1.gif"> |
---|
| 19 | <% |
---|
| 20 | |
---|
| 21 | ServiceInfoBean serviceInteractifInfo = (ServiceInfoBean) request.getAttribute("serviceInteractifInfo"); |
---|
| 22 | |
---|
| 23 | if (serviceInteractifInfo != null ) |
---|
| 24 | { |
---|
| 25 | // activation du service depuis l'espace utilisateur |
---|
| 26 | |
---|
| 27 | try { |
---|
| 28 | |
---|
| 29 | FileManager fileMgr = (FileManager)FileManager.instance( FileManager.class.toString() ); |
---|
| 30 | |
---|
| 31 | // create all directories |
---|
| 32 | if ( !fileMgr.mkdir( new RemoteFileImpl(serviceInteractifInfo.getServiceHost(),serviceInteractifInfo.getInServiceDir()) ) ) { |
---|
| 33 | //erreur |
---|
| 34 | throw new EtherException("Error creating directories"); |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | if ( !fileMgr.mkdir( new RemoteFileImpl(serviceInteractifInfo.getServiceHost(),serviceInteractifInfo.getOutServiceDir()) ) ) { |
---|
| 38 | //erreur |
---|
| 39 | throw new EtherException("Error creating directories"); |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | // copie des fichiers |
---|
| 43 | for ( int i = 0 ; i < serviceInteractifInfo.size() ; i++ ) |
---|
| 44 | { |
---|
| 45 | fileMgr.copy(serviceInteractifInfo.getUserRemoteFile(i),serviceInteractifInfo.getServiceRemoteFile(i)); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | StringBuffer urlService = new StringBuffer("/servlet/InteractifServiceServlet?action=1"); |
---|
| 49 | urlService.append("&user=" + serviceInteractifInfo.getUser().getEmail()); |
---|
| 50 | urlService.append("&inFile=" + serviceInteractifInfo.getServiceRemoteFile(0).getAbsolutePath()); |
---|
| 51 | urlService.append("&outDir=" + serviceInteractifInfo.getOutServiceDir()); |
---|
| 52 | |
---|
| 53 | session.putValue("interactifInfo",serviceInteractifInfo); |
---|
| 54 | |
---|
| 55 | response.sendRedirect(urlService.toString()); |
---|
| 56 | |
---|
| 57 | } |
---|
| 58 | catch ( RemoteException e ) |
---|
| 59 | { |
---|
| 60 | out.println("<p class=\"titrePage\" align=\"center\">Ether - Erreur RMI</p>"); |
---|
| 61 | e.printStackTrace(); |
---|
| 62 | } |
---|
| 63 | catch ( EtherException e ) |
---|
| 64 | { |
---|
| 65 | out.println("<p class=\"titrePage\" align=\"center\">Ether - Erreur interne</p>"); |
---|
| 66 | e.printStackTrace(); |
---|
| 67 | |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | } |
---|
| 71 | else |
---|
| 72 | { |
---|
| 73 | // activation du service depuis la page des SVA |
---|
| 74 | response.sendRedirect("http://www.wanadoo.fr/"); |
---|
| 75 | } |
---|
| 76 | |
---|
| 77 | %> |
---|
| 78 | </body> |
---|
| 79 | </html> |
---|