Bueno principalmente hice una aplicación, en la cual nuesto maestro, nos dejo hacer así como un tipo radio, el cual funciona entre dos computadoras, una como cliente y ps la otra como servidor, usando el winamp con shoutcast para realizar ese servicio, pero como saben pues esto funciona de forma que el servidor reproduce una canción y el cliente oye lo que reproduce el servidor.
Lo que se nos pidió fue hacer que el cliente viera una lista de canciones que le mostramos en una base de datos mysql, y que seleccionara la que quisiera escuchar, y se reproduciera en el servidor, y al hacer esto el winamp pues la reproducía y el cliente la oía.
Todo esto lo realice con JSP y Java Servlets, ahora nos dejarón hacer esto pero usando Drupal, lo cual no tengo mucha idea como se usa, pero he investigado y creo que solo permite php y html, como podría modificar mi pagina para que funcione en Drupal.
En mi index.jsp que es el que ve el usuario, solo es un combobox que muestra la lista de mis canciones, así que no tiene gran cosa, y contiene un botón que manda a llamar mi servlet ApplicationLauncher
Código:
El código principal de mi servlet es este:<form action="http://localhost/Radio/ApplicationLauncher" name="form1" method="POST"> Selecciona una cancion: <select name="selector">
Código:
Pues como lo haria para ponerlo en drupal, alguna sugerencia?? public class ApplicationLauncher extends HttpServlet { String user="root"; String clave=""; String ruta="jdbc:mysql://localhost/canciones"; Connection conexion=null; Statement Sentencias = null; ResultSet tabla = null; ResultSet tabla2 = null; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); String song=request.getParameter("selector"); tabla2=Sentencias.executeQuery("select Ruta from datos where Cancion like '%"+song+"%'"); while(tabla2.next()){ String direc = tabla2.getString("Ruta"); launchDefaultViewer(direc); } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } @Override public String getServletInfo() { return "Short description"; }// </editor-fold> public static Process launchURL(String url){ try{ if (System.getProperty("os.name").toUpperCase().indexOf("95") != -1) return Runtime.getRuntime().exec( new String[]{"command.com", "/C", "start", url} ); if (System.getProperty("os.name").toUpperCase().indexOf("WINDOWS") != -1) return Runtime.getRuntime().exec( new String[]{"cmd.exe", "/C", "start", url} ); if (System.getProperty("os.name").toUpperCase().indexOf("MAC") != -1) return Runtime.getRuntime().exec( new String[]{"open", url} ); } catch(IOException ioex){System.out.println(ioex);} return null; } public static Process launchDefaultViewer(String filepath){ return launchURL( new File(filepath).getAbsolutePath()); }