Advertisement
Guest User

HarryPetas

a guest
Aug 17th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 71.96 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5.  
  6. package multimedia;
  7.  
  8.  
  9. import java.io.FileOutputStream;
  10. import java.io.IOException;
  11. import java.io.PrintWriter;
  12. import java.io.RandomAccessFile;
  13. import java.io.UnsupportedEncodingException;
  14. import java.net.URLEncoder;
  15. import java.nio.channels.FileChannel;
  16. import java.nio.channels.FileLock;
  17. import java.nio.channels.OverlappingFileLockException;
  18. import java.util.List;
  19. import java.util.logging.Level;
  20. import java.util.logging.Logger;
  21. import javax.servlet.ServletException;
  22. import javax.servlet.http.HttpServlet;
  23. import javax.servlet.http.HttpServletRequest;
  24. import javax.servlet.http.HttpServletResponse;
  25. import javax.xml.ws.WebServiceRef;
  26. import org.apache.commons.fileupload.FileItem;
  27. import org.apache.commons.fileupload.FileItemFactory;
  28. import org.apache.commons.fileupload.disk.DiskFileItemFactory;
  29. import org.apache.commons.fileupload.servlet.ServletFileUpload;
  30. import org.netbeans.j2ee.wsdl.bpelinvocador.wsdlbpelinvocador.WsdlbpelInvocador;
  31. //import org.netbeans.j2ee.wsdl.ejbadhierete.wsdladhierete.WsdladhiereteService;
  32. //import org.netbeans.j2ee.wsdl.ejbelabora.wsdlelabora.WsdlelaboraService;
  33.  
  34.  
  35.  
  36.  
  37. /**
  38. *
  39. * @author tomas
  40. */
  41. public class Multimedia extends HttpServlet {
  42. @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_9080/wsdlbpelInvocadorService/wsdlbpelInvocador.wsdl")
  43. private WsdlbpelInvocador service;
  44.  
  45.  
  46.  
  47. protected void processRequest(HttpServletRequest request, HttpServletResponse response)
  48. throws ServletException, IOException {
  49. response.setContentType("text/html;charset=UTF-8");
  50. PrintWriter out = response.getWriter();
  51. try {
  52.  
  53.  
  54. String tit = "";
  55. String des = "";
  56. String cat = "";
  57. String tipo = "";
  58. String usuario = "";
  59. String opcion = "";
  60. String vidyouurl = "";
  61. String contexto="elabora";
  62.  
  63. byte[] buffer = new byte[500 * 1024];
  64. byte[] archiveData = null;
  65. boolean uploaded = false;
  66. if (ServletFileUpload.isMultipartContent(request)) {//Es un formulario multipart
  67. // Create a factory for disk-based file items
  68. try {
  69. request.setCharacterEncoding("ISO-8859-1");
  70. //Es un formulario multipart
  71. // Create a factory for disk-based file items
  72. FileItemFactory factory = new DiskFileItemFactory();
  73. // Create a new file upload handler
  74. ServletFileUpload upload = new ServletFileUpload(factory);
  75. // Parse the request
  76. List<FileItem> items = upload.parseRequest(request);
  77. for (FileItem item : items) {
  78. if (item.isFormField()) {
  79. // Tratamos los parametros que vienen en el request
  80. String namePar = item.getFieldName();
  81. String valorPar = item.getString();
  82.  
  83. if (namePar.equals("titulo")) {
  84.  
  85. tit = valorPar;
  86. System.out.println("Valor Titulo"+tit);
  87. } else if (namePar.equals("descripcion")) {
  88. des = valorPar;
  89. System.out.println("Valor Descripcion"+des);
  90. } else if (namePar.equals("categoria")) {
  91. cat = valorPar;
  92. System.out.println("Valor categoria"+cat);
  93. } else if (namePar.equals("tipo")) {
  94. tipo = valorPar;
  95. System.out.println("Valor Tipo"+tipo);
  96. } else if (namePar.equals("usr")) {
  97. usuario = valorPar;
  98. System.out.println("Valor usr"+usuario);
  99. } else if (namePar.equals("radio-choice")) {
  100. opcion = valorPar;
  101. } else if (namePar.equals("vidyouurl")) {
  102. vidyouurl = valorPar;
  103. } else if (namePar.equals("contexto")) {
  104. contexto = valorPar;
  105. System.out.println("Valor contexto"+contexto);
  106. }
  107.  
  108. } else {
  109.  
  110. if (item.get().length > 0) {
  111. buffer = item.get();
  112. int readBytes = (int) item.getSize();
  113. if (readBytes <= 0) {
  114. out.write("<h2>Archivo no válido</h2>");
  115. } else {
  116. uploaded = true;
  117. }
  118. if (uploaded) {
  119. archiveData = new byte[readBytes];
  120. for (int i = 0; i < readBytes; i++) {
  121. archiveData[i] = buffer[i];
  122. }
  123. if (readBytes > 10) {
  124. //BufferedImage origImage = ImageIO.read(new ByteArrayInputStream(photoData));
  125.  
  126. if (contexto.contentEquals("adhierete")) {
  127.  
  128. System.out.println("Estoy dentro de Adhierete");
  129. if (tipo.contentEquals("imagen")) {
  130.  
  131.  
  132.  
  133.  
  134. /*try { // Call Web Service Operation
  135. org.netbeans.j2ee.wsdl.ejbadhierete.wsdladhierete.WsdladhieretePortType port = service_1.getWsdladhieretePort();
  136. // TODO initialize WS operation arguments here
  137. java.lang.String titulo = tit;
  138. java.lang.String descripcion = des;
  139. java.lang.String categoria = cat;
  140. // TODO process result here
  141. java.lang.String result = port.subirFoto(titulo, descripcion, categoria, usuario);
  142. FileOutputStream foto = new FileOutputStream(result);
  143. foto.write(archiveData);
  144. ImageUtils.Reescaler(result);
  145. foto.close();
  146. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto"))
  147. result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  148. out.write("<h2>" + result + "</h2>");
  149. } catch (Exception ex) {
  150. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  151. }*/
  152.  
  153.  
  154. try { // Call Web Service Operation
  155.  
  156. // TODO initialize WS operation arguments here
  157. java.lang.String dirWSDL = "http://localhost:8080/wsdladhiereteService/AdhiereteService";
  158. java.lang.String operacion = "subirFoto";
  159. java.lang.String titulo = tit;
  160. java.lang.String descripcion = des;
  161. java.lang.String categoria = cat;
  162. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  163.  
  164. // TODO process result here
  165. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  166. FileOutputStream foto = new FileOutputStream(result);
  167. foto.write(archiveData);
  168. ImageUtils.Reescaler(result);
  169. foto.close();
  170. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto"))
  171. result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  172. out.write("<h2>" + result + "</h2>");
  173. out.println("Result = "+result);
  174.  
  175. } catch (Exception ex) {
  176. // TODO handle custom exceptions here
  177. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  178. ex.printStackTrace();
  179. }
  180.  
  181.  
  182.  
  183. } else if (tipo.contentEquals("audio")) {
  184.  
  185. /*try { // Call Web Service Operation
  186. org.netbeans.j2ee.wsdl.ejbadhierete.wsdladhierete.WsdladhieretePortType port = service_1.getWsdladhieretePort();
  187. // TODO initialize WS operation arguments here
  188. java.lang.String titulo = tit;
  189. java.lang.String descripcion = des;
  190. java.lang.String categoria = cat;
  191. // TODO process result here
  192. java.lang.String result = port.subirAudio(titulo, descripcion, categoria, usuario);
  193. FileOutputStream audio = new FileOutputStream(result);
  194. audio.write(archiveData);
  195. audio.close();
  196. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir audio"))
  197. result = "El archivo de audio se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  198. out.write("<h2>" + result + "</h2>");
  199. } catch (Exception ex) {
  200. out.write("<h2>Se ha producido un error al intentar subir el archivo de audio al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  201. }*/
  202.  
  203. try { // Call Web Service Operation
  204.  
  205. // TODO initialize WS operation arguments here
  206. java.lang.String dirWSDL = "http://localhost:8080/wsdladhiereteService/AdhiereteService";
  207. java.lang.String operacion = "subirAudio";
  208. java.lang.String titulo = tit;
  209. java.lang.String descripcion = des;
  210. java.lang.String categoria = cat;
  211. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  212. // TODO process result here
  213. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  214. FileOutputStream audio = new FileOutputStream(result);
  215. audio.write(archiveData);
  216. audio.close();
  217. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir audio"))
  218. result = "El archivo de audio se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  219. out.write("<h2>" + result + "</h2>");
  220. out.println("Result = "+result);
  221. } catch (Exception ex) {
  222. // TODO handle custom exceptions here
  223. out.write("<h2>Se ha producido un error al intentar subir el archivo de audio al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  224. ex.printStackTrace();
  225. }
  226.  
  227. } else if (tipo.contentEquals("foto_usuario")) {
  228.  
  229. /*try { // Call Web Service Operation
  230. org.netbeans.j2ee.wsdl.ejbadhierete.wsdladhierete.WsdladhieretePortType port = service_1.getWsdladhieretePort();
  231. // TODO initialize WS operation arguments here
  232. java.lang.String titulo = tit;
  233. java.lang.String descripcion = "foto_usuario";
  234. java.lang.String categoria = "foto_usuario";
  235. // TODO process result here
  236. java.lang.String result = port.subirFoto(titulo, descripcion, categoria, usuario);
  237.  
  238. System.out.println("INVADERS "+ tit + " " + result);
  239. port.consultaBBDD("3", tit+"#foto#"+result.substring(0, result.indexOf("/home")));
  240. FileOutputStream foto = new FileOutputStream(result.substring(result.indexOf("/home")));
  241. foto.write(archiveData);
  242. ImageUtils.Reescaler(result.substring(result.indexOf("/home")));
  243. foto.close();
  244. System.out.println("INVADERS despues");
  245. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto"))
  246. result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  247. out.write("<h2>" + result + "</h2>");
  248. } catch (Exception ex) {
  249. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  250. }*/
  251.  
  252. try { // Call Web Service Operation
  253.  
  254. // TODO initialize WS operation arguments here
  255. java.lang.String dirWSDL = "http://localhost:8080/wsdladhiereteService/AdhiereteService";
  256. java.lang.String operacion = "subirFoto";
  257. java.lang.String titulo = tit;
  258. java.lang.String descripcion = "foto_usuario";
  259. java.lang.String categoria = "foto_usuario";
  260. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  261. // TODO process result here
  262. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  263. System.out.println("INVADERS "+ tit + " " + result);
  264. invocacion(dirWSDL, "consultaBBDD", "#tipo=3#parametros="+tit+"(;;almohadilla;;)foto(;;almohadilla;;)"+result.substring(0, result.indexOf("/home")));
  265. //port.consultaBBDD("3", tit+"#foto#"+result.substring(0, result.indexOf("/home")));
  266. FileOutputStream foto = new FileOutputStream(result.substring(result.indexOf("/home")));
  267. foto.write(archiveData);
  268. ImageUtils.Reescaler(result.substring(result.indexOf("/home")));
  269. foto.close();
  270. System.out.println("INVADERS despues");
  271. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto"))
  272. result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  273. out.write("<h2>" + result + "</h2>");
  274. out.println("Result = "+result);
  275. } catch (Exception ex) {
  276. // TODO handle custom exceptions here
  277. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  278. ex.printStackTrace();
  279. }
  280.  
  281.  
  282. }
  283. }else{
  284.  
  285. if (tipo.contentEquals("imagen")) {
  286.  
  287. /*try { // Call Web Service Operation
  288. org.netbeans.j2ee.wsdl.ejbelabora.wsdlelabora.WsdlelaboraPortType port = service.getWsdlelaboraPort();
  289. // TODO initialize WS operation arguments here
  290. java.lang.String titulo = tit;
  291. java.lang.String descripcion = des;
  292. java.lang.String categoria = cat;
  293. // TODO process result here
  294. java.lang.String result = port.subirFoto(titulo, descripcion, categoria, usuario);
  295. FileOutputStream foto = new FileOutputStream(result);
  296. foto.write(archiveData);
  297. ImageUtils.Reescaler(result);
  298. foto.close();
  299. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto"))
  300. result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  301. out.write("<h2>" + result + "</h2>");
  302. } catch (Exception ex) {
  303. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  304. }*/
  305.  
  306.  
  307. try { // Call Web Service Operation
  308.  
  309. // TODO initialize WS operation arguments here
  310. java.lang.String dirWSDL = "http://localhost:8080/wsdlelaboraService/ElaboraService";
  311. java.lang.String operacion = "subirFoto";
  312. java.lang.String titulo = tit;
  313. java.lang.String descripcion = des;
  314. java.lang.String categoria = cat;
  315. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  316. // TODO process result here
  317. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  318. FileOutputStream foto = new FileOutputStream(result);
  319. foto.write(archiveData);
  320. ImageUtils.Reescaler(result);
  321. foto.close();
  322. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto"))
  323. result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  324. out.write("<h2>" + result + "</h2>");
  325. out.println("Result = "+result);
  326. } catch (Exception ex) {
  327. // TODO handle custom exceptions here
  328. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  329. ex.printStackTrace();
  330. }
  331.  
  332.  
  333.  
  334. } else if (tipo.contentEquals("imagenMultimedia")){
  335.  
  336. try { // Call Web Service Operation
  337. // TODO initialize WS operation arguments here
  338. java.lang.String dirWSDL = "http://localhost:8080/wsdlelaboraService/ElaboraService";
  339. java.lang.String operacion = "subirFoto";
  340. java.lang.String titulo = tit;
  341. java.lang.String descripcion = des;
  342. java.lang.String categoria = cat;
  343. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  344. // TODO process result here
  345. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  346. FileOutputStream foto = new FileOutputStream(result);
  347. foto.write(archiveData);
  348. ImageUtils.Reescaler(result);
  349. foto.close();
  350. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto")){
  351. String res1[] = result.split("/");
  352. String idMul = res1[8];
  353. result = res1[8] + "#" + "La imagen se ha subido correctamente al servidor. Será redirigido a la página pricipal de multimedia.";
  354. }
  355. out.println(result);
  356. } catch (Exception ex) {
  357. out.write("Se ha producido un error al intentar subir la imagen al servidor. Será redirigido a la página pricipal de multimedia.");
  358. ex.printStackTrace();
  359. }
  360.  
  361. } else if (tipo.contentEquals("audio")) {
  362.  
  363. /*try { // Call Web Service Operation
  364. org.netbeans.j2ee.wsdl.ejbelabora.wsdlelabora.WsdlelaboraPortType port = service.getWsdlelaboraPort();
  365. // TODO initialize WS operation arguments here
  366. java.lang.String titulo = tit;
  367. java.lang.String descripcion = des;
  368. java.lang.String categoria = cat;
  369. // TODO process result here
  370. java.lang.String result = port.subirAudio(titulo, descripcion, categoria, usuario);
  371. FileOutputStream audio = new FileOutputStream(result);
  372. audio.write(archiveData);
  373. audio.close();
  374. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir audio"))
  375. result = "El archivo de audio se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  376. out.write("<h2>" + result + "</h2>");
  377. } catch (Exception ex) {
  378. out.write("<h2>Se ha producido un error al intentar subir el archivo de audio al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  379. }*/
  380.  
  381. try { // Call Web Service Operation
  382. // TODO initialize WS operation arguments here
  383. java.lang.String dirWSDL = "http://localhost:8080/wsdlelaboraService/ElaboraService";
  384. java.lang.String operacion = "subirAudio";
  385. java.lang.String titulo = tit;
  386. java.lang.String descripcion = des;
  387. java.lang.String categoria = cat;
  388. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  389. // TODO process result here
  390. java.lang.String result =invocacion(dirWSDL, operacion, parVal);
  391. FileOutputStream audio = new FileOutputStream(result);
  392. audio.write(archiveData);
  393. audio.close();
  394. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir audio"))
  395. result = "El archivo de audio se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  396. out.write("<h2>" + result + "</h2>");
  397. out.println("Result = "+result);
  398. } catch (Exception ex) {
  399. // TODO handle custom exceptions here
  400. out.write("<h2>Se ha producido un error al intentar subir el archivo de audio al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  401. ex.printStackTrace();
  402. }
  403.  
  404. } else if(tipo.contentEquals("audioMultimedia")){
  405.  
  406. try { // Call Web Service Operation
  407. // TODO initialize WS operation arguments here
  408. java.lang.String dirWSDL = "http://localhost:8080/wsdlelaboraService/ElaboraService";
  409. java.lang.String operacion = "subirAudio";
  410. java.lang.String titulo = tit;
  411. java.lang.String descripcion = des;
  412. java.lang.String categoria = cat;
  413. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  414. // TODO process result here
  415. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  416. FileOutputStream audio = new FileOutputStream(result);
  417. audio.write(archiveData);
  418. audio.close();
  419. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir el audio")){
  420. String res1[] = result.split("/");
  421. String idMul = res1[8];
  422. result = res1[8] + "#" + "El audio se ha subido correctamente al servidor. Será redirigido a la página pricipal de multimedia.";
  423. }
  424. out.println(result);
  425. } catch (Exception ex) {
  426. out.write("Se ha producido un error al intentar subir el audio al servidor. Será redirigido a la página pricipal de multimedia.");
  427. ex.printStackTrace();
  428. }
  429.  
  430. } else if (tipo.contentEquals("foto_usuario")) {
  431.  
  432. /*try { // Call Web Service Operation
  433. org.netbeans.j2ee.wsdl.ejbelabora.wsdlelabora.WsdlelaboraPortType port = service.getWsdlelaboraPort();
  434. // TODO initialize WS operation arguments here
  435. java.lang.String titulo = tit;
  436. java.lang.String descripcion = "foto_usuario";
  437. java.lang.String categoria = "foto_usuario";
  438. // TODO process result here
  439. java.lang.String result = port.subirFoto(titulo, descripcion, categoria, usuario);
  440.  
  441. System.out.println("INVADERS "+ tit + " " + result);
  442. port.consultaBBDD("3", tit+"#foto#"+result.substring(0, result.indexOf("/home")));
  443. FileOutputStream foto = new FileOutputStream(result.substring(result.indexOf("/home")));
  444. foto.write(archiveData);
  445. ImageUtils.Reescaler(result.substring(result.indexOf("/home")));
  446. foto.close();
  447. System.out.println("INVADERS despues");
  448. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto"))
  449. result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  450. out.write("<h2>" + result + "</h2>");
  451. } catch (Exception ex) {
  452. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  453. }*/
  454.  
  455. try { // Call Web Service Operation
  456.  
  457. // TODO initialize WS operation arguments here
  458. java.lang.String dirWSDL = "http://localhost:8080/wsdlelaboraService/ElaboraService";
  459. java.lang.String operacion = "subirFoto";
  460. java.lang.String titulo = tit;
  461. java.lang.String descripcion = "foto_usuario";
  462. java.lang.String categoria = "foto_usuario";
  463. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  464. // TODO process result here
  465. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  466. System.out.println("INVADERS "+ tit + " " + result);
  467. invocacion(dirWSDL, "consultaBBDD", "#tipo=3#parametros="+tit+"(;;almohadilla;;)foto(;;almohadilla;;)"+result.substring(0, result.indexOf("/home")));
  468. //port.consultaBBDD("3", tit+"#foto#"+result.substring(0, result.indexOf("/home")));
  469. FileOutputStream foto = new FileOutputStream(result.substring(result.indexOf("/home")));
  470. foto.write(archiveData);
  471. ImageUtils.Reescaler(result.substring(result.indexOf("/home")));
  472. foto.close();
  473. System.out.println("INVADERS despues");
  474. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto"))
  475. result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  476. out.write("<h2>" + result + "</h2>");
  477. out.println("Result = "+result);
  478. } catch (Exception ex) {
  479. // TODO handle custom exceptions here
  480. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  481. ex.printStackTrace();
  482. }
  483.  
  484.  
  485. }else if (tipo.contentEquals("foto_grupo")) {
  486.  
  487. /*try { // Call Web Service Operation
  488. org.netbeans.j2ee.wsdl.ejbelabora.wsdlelabora.WsdlelaboraPortType port = service.getWsdlelaboraPort();
  489. // TODO initialize WS operation arguments here
  490. java.lang.String titulo = tit;
  491. java.lang.String descripcion = "foto_usuario";
  492. java.lang.String categoria = "foto_usuario";
  493. // TODO process result here
  494. java.lang.String result = port.subirFoto(titulo, descripcion, categoria, usuario);
  495.  
  496. System.out.println("INVADERS "+ tit + " " + result);
  497. port.consultaBBDD("3", tit+"#foto#"+result.substring(0, result.indexOf("/home")));
  498. FileOutputStream foto = new FileOutputStream(result.substring(result.indexOf("/home")));
  499. foto.write(archiveData);
  500. ImageUtils.Reescaler(result.substring(result.indexOf("/home")));
  501. foto.close();
  502. System.out.println("INVADERS despues");
  503. if(!result.contentEquals("No existe la categoria")&&!result.contentEquals("Error al subir foto"))
  504. result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  505. out.write("<h2>" + result + "</h2>");
  506. } catch (Exception ex) {
  507. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  508. }*/
  509.  
  510. try { // Call Web Service Operation
  511.  
  512. // TODO initialize WS operation arguments here
  513. java.lang.String dirWSDL = "http://localhost:8080/wsdlelaboraService/ElaboraService";
  514. java.lang.String operacion = "subirFoto";
  515. java.lang.String titulo = tit;
  516. tipo = "foto_usuario";
  517. java.lang.String descripcion = "foto_usuario";
  518. java.lang.String categoria = "foto_usuario";
  519. java.lang.String parVal = "#titulo=" + titulo + "#descripcion=" + descripcion + "#categoria=" + categoria + "#usuario=" + usuario;
  520. // TODO process result here
  521. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  522. System.out.println("result" + result);
  523.  
  524. //invocacion(dirWSDL, "consultaBBDD", "#tipo=3#parametros=" + tit + "(;;almohadilla;;)foto(;;almohadilla;;)" + result.substring(0, result.indexOf("/home")));
  525. //port.consultaBBDD("3", tit+"#foto#"+result.substring(0, result.indexOf("/home")));
  526. FileOutputStream foto = new FileOutputStream(result.substring(result.indexOf("/home")));
  527. foto.write(archiveData);
  528. ImageUtils.Reescaler(result.substring(result.indexOf("/home")));
  529. foto.close();
  530. System.out.println("INVADERS despues");
  531.  
  532. if (!result.contentEquals("No existe la categoria") && !result.contentEquals("Error al subir foto")) {
  533. // result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  534. String directorio=result.substring(result.indexOf("recursos"));
  535. String idFoto= result.substring(0, result.indexOf("/home"));
  536. result=idFoto+"#"+directorio;
  537. }
  538. out.write( result );
  539. // out.println("Result = " + result);
  540. } catch (Exception ex) {
  541. // TODO handle custom exceptions here
  542. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  543. ex.printStackTrace();
  544. }
  545.  
  546.  
  547. }else if (tipo.contentEquals("foto_cat")) {
  548.  
  549.  
  550.  
  551. try { // Call Web Service Operation
  552.  
  553. // TODO initialize WS operation arguments here
  554. java.lang.String dirWSDL = "http://localhost:8080/Comunicador/wsdlComunicadorService";
  555. java.lang.String operacion = "subirFoto";
  556. java.lang.String titulo = tit;
  557. tipo = "foto_cat";
  558. java.lang.String descripcion = "foto_usuario";
  559. java.lang.String categoria = "foto_usuario";
  560. java.lang.String parVal = "#titulo=" + titulo + "#descripcion=" + descripcion + "#categoria=" + "0" + "#usuario=" + usuario;
  561. // TODO process result here
  562. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  563. System.out.println("result" + result);
  564.  
  565. //invocacion(dirWSDL, "consultaBBDD", "#tipo=3#parametros=" + tit + "(;;almohadilla;;)foto(;;almohadilla;;)" + result.substring(0, result.indexOf("/home")));
  566. //port.consultaBBDD("3", tit+"#foto#"+result.substring(0, result.indexOf("/home")));
  567. System.out.println("RUTAAAAAAAAAA :" + result.substring(result.indexOf("/home")));
  568. FileOutputStream foto = new FileOutputStream(result.substring(result.indexOf("/home")));
  569.  
  570. foto.write(archiveData);
  571. ImageUtils.Reescaler(result.substring(result.indexOf("/home")));
  572. foto.close();
  573. System.out.println("INVADERS despues");
  574.  
  575. if (!result.contentEquals("No existe la categoria") && !result.contentEquals("Error al subir foto")) {
  576. // result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  577. String directorio=result.substring(result.indexOf("recursos"));
  578. String idFoto= result.substring(0, result.indexOf("/home"));
  579. result=idFoto+"#"+directorio;
  580. }
  581. out.write( result );
  582. // out.println("Result = " + result);
  583. } catch (Exception ex) {
  584. // TODO handle custom exceptions here
  585. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  586. ex.printStackTrace();
  587. }
  588.  
  589.  
  590. }
  591. else if (tipo.contentEquals("foto_mensaje")) {
  592.  
  593.  
  594.  
  595. try { // Call Web Service Operation
  596.  
  597. // TODO initialize WS operation arguments here
  598. java.lang.String dirWSDL = "http://localhost:8080/Comunicador/wsdlComunicadorService";
  599. java.lang.String operacion = "subirFoto";
  600. java.lang.String titulo = tit;
  601. tipo = "foto_mensaje";
  602. java.lang.String descripcion = "foto_usuario";
  603. java.lang.String categoria = "foto_usuario";
  604. java.lang.String parVal = "#titulo=" + titulo + "#descripcion=" + descripcion + "#categoria=" + "0" + "#usuario=" + usuario;
  605. // TODO process result here
  606. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  607. System.out.println("result" + result);
  608.  
  609. //invocacion(dirWSDL, "consultaBBDD", "#tipo=3#parametros=" + tit + "(;;almohadilla;;)foto(;;almohadilla;;)" + result.substring(0, result.indexOf("/home")));
  610. //port.consultaBBDD("3", tit+"#foto#"+result.substring(0, result.indexOf("/home")));
  611. System.out.println("RUTAAAAAAAAAA :" + result.substring(result.indexOf("/home")));
  612. FileOutputStream foto = new FileOutputStream(result.substring(result.indexOf("/home")));
  613.  
  614. foto.write(archiveData);
  615. ImageUtils.Reescaler(result.substring(result.indexOf("/home")));
  616. foto.close();
  617. System.out.println("INVADERS despues");
  618.  
  619. if (!result.contentEquals("No existe la categoria") && !result.contentEquals("Error al subir foto")) {
  620. // result = "La imagen se ha subido correctamente al servidor. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  621. String directorio=result.substring(result.indexOf("recursos"));
  622. String idFoto= result.substring(0, result.indexOf("/home"));
  623. result=idFoto+"#"+directorio;
  624. }
  625. out.write( result );
  626. // out.println("Result = " + result);
  627. } catch (Exception ex) {
  628. // TODO handle custom exceptions here
  629. out.write("<h2>Se ha producido un error al intentar subir la imagen al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  630. ex.printStackTrace();
  631. }
  632.  
  633.  
  634. }
  635.  
  636. }
  637. }
  638. }
  639. } else {
  640. out.write("<h2>Error al subir el archivo</h2>");
  641. }
  642. }
  643.  
  644. }
  645.  
  646.  
  647. if (contexto.contentEquals("adhierete")) {
  648.  
  649. System.out.println("Estoy dentro de Adhierete");
  650. if (tipo.contentEquals("video")){
  651. System.out.println("Estoy en video");
  652. if (opcion.contentEquals("vidyou")){
  653. System.out.println("Estoy en video youtube");
  654. /*try { // Call Web Service Operation
  655. org.netbeans.j2ee.wsdl.ejbadhierete.wsdladhierete.WsdladhieretePortType port = service_1.getWsdladhieretePort();
  656. // TODO initialize WS operation arguments here
  657. java.lang.String titulo = tit;
  658. java.lang.String descripcion = des;
  659. java.lang.String categoria = cat;
  660. java.lang.String localizacion = vidyouurl;
  661. // TODO process result here
  662. java.lang.String result = port.subirLinkYoutube(titulo, descripcion, categoria, localizacion, usuario);
  663. if(result.contentEquals("Correcto")){
  664. result = "El video se ha subido correctamente. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  665. } else {
  666. result = "Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.";
  667. }
  668. out.write("<h2>" + result + "</h2>");
  669. } catch (Exception ex) {
  670. out.write("<h2>Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  671. }*/
  672.  
  673.  
  674. try { // Call Web Service Operation
  675.  
  676. // TODO initialize WS operation arguments here
  677. java.lang.String titulo = tit;
  678. java.lang.String descripcion = des;
  679. java.lang.String categoria = cat;
  680. java.lang.String localizacionEncoder=URLEncoder.encode(vidyouurl, "UTF-8");
  681.  
  682. java.lang.String localizacion = localizacionEncoder;
  683. java.lang.String dirWSDL = "http://localhost:8080/wsdladhiereteService/AdhiereteService";
  684. java.lang.String operacion = "subirLinkYoutube";
  685. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#localizacion="+localizacion+"#usuario="+usuario;
  686. // TODO process result here
  687. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  688. //out.println("Result = "+result);
  689. if(result.contentEquals("Correcto")){
  690. result = "El video se ha subido correctamente. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  691. } else {
  692. result = "Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.";
  693. }
  694. out.write("<h2>" + result + "</h2>");
  695. } catch (Exception ex) {
  696. out.write("<h2>Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  697. }
  698.  
  699.  
  700.  
  701. } else if (opcion.contentEquals("vidprop")){
  702. /*try { // Call Web Service Operation
  703. org.netbeans.j2ee.wsdl.ejbadhierete.wsdladhierete.WsdladhieretePortType port = service_1.getWsdladhieretePort();
  704. // TODO initialize WS operation arguments here
  705. java.lang.String titulo = tit;
  706. java.lang.String descripcion = des;
  707. java.lang.String categoria = cat;
  708. // TODO process result here
  709. java.lang.String result = port.subirVideo(titulo, descripcion, categoria, usuario);
  710. if (result.contentEquals("Error")){
  711. result = "Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.";
  712. out.write("<h2>" + result + "</h2>");
  713. } else {
  714. out.write(result);
  715. }
  716. } catch (Exception ex) {
  717. out.write("<h2>Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  718. }*/
  719.  
  720. try { // Call Web Service Operation
  721. // TODO initialize WS operation arguments here
  722. java.lang.String titulo = tit;
  723. java.lang.String descripcion = des;
  724. java.lang.String categoria = cat;
  725.  
  726. java.lang.String dirWSDL = "http://localhost:8080/wsdladhiereteService/AdhiereteService";
  727. java.lang.String operacion = "subirVideo";
  728. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  729. // TODO process result here
  730. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  731. //out.println("Result = "+result);
  732. if (result.contentEquals("Error")){
  733. result = "Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.";
  734. out.write("<h2>" + result + "</h2>");
  735. } else {
  736. out.write(result);
  737. }
  738. out.write("<h2>" + result + "</h2>");
  739. } catch (Exception ex) {
  740. out.write("<h2>Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  741. }
  742.  
  743.  
  744.  
  745.  
  746. }
  747.  
  748. }
  749. }else{
  750.  
  751.  
  752. if (tipo.contentEquals("video")){
  753. System.out.println("Estoy en video");
  754. if (opcion.contentEquals("vidyou")){
  755. System.out.println("Estoy en video youtube");
  756. /*try { // Call Web Service Operation
  757. org.netbeans.j2ee.wsdl.ejbelabora.wsdlelabora.WsdlelaboraPortType port = service.getWsdlelaboraPort();
  758. // TODO initialize WS operation arguments here
  759. java.lang.String titulo = tit;
  760. java.lang.String descripcion = des;
  761. java.lang.String categoria = cat;
  762. java.lang.String localizacion = vidyouurl;
  763. // TODO process result here
  764. java.lang.String result = port.subirLinkYoutube(titulo, descripcion, categoria, localizacion, usuario);
  765. if(result.contentEquals("Correcto")){
  766. result = "El video se ha subido correctamente. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  767. } else {
  768. result = "Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.";
  769. }
  770. out.write("<h2>" + result + "</h2>");
  771. } catch (Exception ex) {
  772. out.write("<h2>Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  773. }*/
  774.  
  775. try { // Call Web Service Operation
  776.  
  777. // TODO initialize WS operation arguments here
  778. java.lang.String titulo = tit;
  779. java.lang.String descripcion = des;
  780. java.lang.String categoria = cat;
  781.  
  782. java.lang.String localizacionEncoder=URLEncoder.encode(vidyouurl, "UTF-8");
  783.  
  784. java.lang.String localizacion = localizacionEncoder;
  785. java.lang.String dirWSDL = "http://localhost:8080/wsdlelaboraService/ElaboraService";
  786. java.lang.String operacion = "subirLinkYoutube";
  787. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#localizacion="+localizacion+"#usuario="+usuario;
  788. // TODO process result here
  789. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  790. //out.println("Result = "+result);
  791. if(result.contentEquals("Correcto")){
  792. result = "El video se ha subido correctamente. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  793. } else {
  794. result = "Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.";
  795. }
  796. out.write("<h2>" + result + "</h2>");
  797. } catch (Exception ex) {
  798. out.write("<h2>Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  799. }
  800.  
  801.  
  802. } else if(opcion.contains("vidyouMultimedia")){
  803.  
  804. try { // Call Web Service Operation
  805.  
  806. // TODO initialize WS operation arguments here
  807. java.lang.String titulo = tit;
  808. java.lang.String descripcion = des;
  809. java.lang.String categoria = cat;
  810.  
  811. java.lang.String localizacionEncoder=URLEncoder.encode(vidyouurl, "UTF-8");
  812.  
  813. java.lang.String localizacion = localizacionEncoder;
  814. java.lang.String dirWSDL = "http://localhost:8080/wsdlelaboraService/ElaboraService";
  815. java.lang.String operacion = "subirLinkYoutube";
  816. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#localizacion="+localizacion+"#usuario="+usuario;
  817. // TODO process result here
  818. java.lang.String result = invocacion(dirWSDL, operacion, parVal);
  819.  
  820. if(!result.contentEquals("Error")){
  821. result = result + "# El video se ha subido correctamente. Pulse sobre el botón \"Volver\" para refrescar el contenido.";
  822. } else {
  823. result = "Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.";
  824. }
  825. out.write(result);
  826.  
  827. } catch (Exception ex) {
  828. out.write("Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo");
  829. }
  830.  
  831. } else if (opcion.contentEquals("vidprop")){
  832. /*try { // Call Web Service Operation
  833. org.netbeans.j2ee.wsdl.ejbelabora.wsdlelabora.WsdlelaboraPortType port = service.getWsdlelaboraPort();
  834. // TODO initialize WS operation arguments here
  835. java.lang.String titulo = tit;
  836. java.lang.String descripcion = des;
  837. java.lang.String categoria = cat;
  838. // TODO process result here
  839. java.lang.String result = port.subirVideo(titulo, descripcion, categoria, usuario);
  840. if (result.contentEquals("Error")){
  841. result = "Se ha producido un errelaboraor al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.";
  842. out.write("<h2>" + result + "</h2>");
  843. } else {
  844. out.write(result);
  845. }
  846. } catch (Exception ex) {
  847. out.write("<h2>Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  848. }*/
  849.  
  850. try { // Call Web Service Operation
  851.  
  852. // TODO initialize WS operation arguments here
  853. java.lang.String titulo = tit;
  854. java.lang.String descripcion = des;
  855. java.lang.String categoria = cat;
  856.  
  857. java.lang.String dirWSDL = "http://localhost:8080/wsdlelaboraService/ElaboraService";
  858. java.lang.String operacion = "subirVideo";
  859. java.lang.String parVal = "#titulo="+titulo+"#descripcion="+descripcion+"#categoria="+categoria+"#usuario="+usuario;
  860. // TODO process result here
  861. java.lang.String result =invocacion(dirWSDL, operacion, parVal);
  862. //out.println("Result = "+result);
  863. if (result.contentEquals("Error")){
  864. result = "Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.";
  865. out.write("<h2>" + result + "</h2>");
  866. } else {
  867. out.write(result);
  868. }
  869. out.write("<h2>" + result + "</h2>");
  870. } catch (Exception ex) {
  871. out.write("<h2>Se ha producido un error al intentar subir el video al servidor. Por favor, pulse sobre el botón \"Volver\" e inténtelo de nuevo.</h2>");
  872. }
  873. }
  874.  
  875. }
  876.  
  877. }
  878. } catch (Exception e) {
  879. e.printStackTrace();
  880. }
  881.  
  882.  
  883. }
  884.  
  885. } catch (Exception e) {
  886. e.printStackTrace();
  887. out.write("<h2>Error al subir el archivo</h2>");
  888.  
  889.  
  890.  
  891.  
  892. } finally {
  893. out.close();
  894. }
  895. }
  896.  
  897. private org.fve.fachada.binding.configuracion.Sistema jaxbUnmarshalFromFileConfiguracion(java.io.File file) throws java.io.FileNotFoundException, javax.xml.bind.JAXBException, IOException {
  898.  
  899. boolean ficheronobloqueado=true;
  900. boolean mostradomensajebloqueo=false;
  901.  
  902. // Get a file channel for the file
  903.  
  904. FileChannel channel = new RandomAccessFile(file, "rw").getChannel();
  905.  
  906. // Use the file channel to create a lock on the file.
  907. FileLock lock=null;
  908.  
  909. // This method blocks until it can retrieve the lock.
  910.  
  911. //FileLock lock = channel.lock();
  912.  
  913. // Try acquiring the lock without blocking. This method returns
  914. // null or throws an exception if the file is already locked.
  915.  
  916. while(ficheronobloqueado){
  917.  
  918. try {
  919. lock = channel.tryLock();
  920. ficheronobloqueado=false;
  921. //System.out.print("ATENCION MARCA BLOQUEO-------------BLOQUEO ESTABLECIDO");
  922.  
  923. } catch (OverlappingFileLockException e) {
  924. if(mostradomensajebloqueo==false){
  925.  
  926. //System.out.print("ATENCION MARCA BLOQUEO-------------FICHERO YA BLOQUEADO POR OTRO PROCESO");
  927. mostradomensajebloqueo=true;
  928.  
  929. }
  930. }
  931.  
  932. }
  933.  
  934. org.fve.fachada.binding.configuracion.Sistema ret = null;
  935. java.io.InputStream is = null;
  936. try {
  937. javax.xml.bind.JAXBContext jaxbCtx = javax.xml.bind.JAXBContext.newInstance(org.fve.fachada.binding.configuracion.Sistema.class.getPackage().getName());
  938. javax.xml.bind.Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
  939. is = new java.io.FileInputStream(file);
  940. ret = (org.fve.fachada.binding.configuracion.Sistema) unmarshaller.unmarshal(is);
  941. } finally {
  942. try {
  943. is.close();
  944.  
  945. // Release the lock
  946. lock.release();
  947. //System.out.print("ATENCION MARCA BLOQUEO-------------BLOQUEADO ELIMINADO");
  948.  
  949. // Close the file
  950. channel.close();
  951.  
  952. ficheronobloqueado=true;
  953.  
  954. } catch (Exception ex) {
  955. java.util.logging.Logger.getLogger("global").log(java.util.logging.Level.SEVERE, null, ex);
  956. }
  957. }
  958. return ret;
  959. }
  960.  
  961.  
  962. // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
  963. /**
  964. * Handles the HTTP <code>GET</code> method.
  965. * @param request servlet request
  966. * @param response servlet response
  967. * @throws ServletException if a servlet-specific error occurs
  968. * @throws IOException if an I/O error occurs
  969. */
  970. @Override
  971. protected void doGet(HttpServletRequest request, HttpServletResponse response)
  972. throws ServletException, IOException {
  973. processRequest(request, response);
  974. }
  975.  
  976. /**
  977. * Handles the HTTP <code>POST</code> method.
  978. * @param request servlet request
  979. * @param response servlet response
  980. * @throws ServletException if a servlet-specific error occurs
  981. * @throws IOException if an I/O error occurs
  982. */
  983. @Override
  984. protected void doPost(HttpServletRequest request, HttpServletResponse response)
  985. throws ServletException, IOException {
  986. processRequest(request, response);
  987. }
  988.  
  989. /**
  990. * Returns a short description of the servlet.
  991. * @return a String containing servlet description
  992. */
  993. @Override
  994. public String getServletInfo() {
  995. return "Short description";
  996. }// </editor-fold>
  997.  
  998. private String invocacion(java.lang.String dirWSDL, java.lang.String operacion, java.lang.String parVal) {
  999. org.netbeans.j2ee.wsdl.bpelinvocador.wsdlbpelinvocador.WsdlbpelInvocadorPortType port = service.getWsdlbpelInvocadorPort();
  1000. return port.invocacion(dirWSDL, operacion, parVal);
  1001. }
  1002.  
  1003.  
  1004. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement