/Prototipo/PrototipoMemoria/src/java/memoria/beans/QueryBean.java

http://prototipomemoria.googlecode.com/ · Java · 105 lines · 72 code · 24 blank · 9 comment · 0 complexity · 7eed3b9c1eb7dfe2283f4f999d58483d MD5 · raw file

  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package memoria.beans;
  6. import java.io.IOException;
  7. import java.net.URI;
  8. import java.net.URISyntaxException;
  9. import java.util.logging.Level;
  10. import java.util.logging.Logger;
  11. import javax.faces.bean.ManagedBean;
  12. import javax.faces.bean.SessionScoped;
  13. import javax.faces.context.FacesContext;
  14. /**
  15. *
  16. * @author diego
  17. */
  18. @ManagedBean
  19. @SessionScoped
  20. public class QueryBean {
  21. private double latcenter;
  22. private double loncenter;
  23. private double SWlat;
  24. private double SWlon;
  25. private double NElat;
  26. private double NElon;
  27. public double getNElat() {
  28. return NElat;
  29. }
  30. public void setNElat(double NElat) {
  31. this.NElat = NElat;
  32. }
  33. public double getNElon() {
  34. return NElon;
  35. }
  36. public void setNElon(double NElon) {
  37. this.NElon = NElon;
  38. }
  39. public double getSWlat() {
  40. return SWlat;
  41. }
  42. public void setSWlat(double SWlat) {
  43. this.SWlat = SWlat;
  44. }
  45. public double getSWlon() {
  46. return SWlon;
  47. }
  48. public void setSWlon(double SWlon) {
  49. this.SWlon = SWlon;
  50. }
  51. public double getLatcenter() {
  52. return latcenter;
  53. }
  54. public void setLatcenter(double latcenter) {
  55. this.latcenter = latcenter;
  56. }
  57. public double getLoncenter() {
  58. return loncenter;
  59. }
  60. public void setLoncenter(double loncenter) {
  61. this.loncenter = loncenter;
  62. }
  63. /** Creates a new instance of QueryBean */
  64. public QueryBean() {
  65. }
  66. public void ejecutarQuery(){
  67. try {
  68. String proc = "java -jar D:/facu/Memoria/prototipo-googlecode/Prototipo/wsConsume/dist/wsConsume.jar "+this.SWlat+" "+this.SWlon+" "+this.NElat+" "+this.NElon;
  69. System.out.println("ejecutando: "+proc);
  70. Process p = Runtime.getRuntime().exec(proc);
  71. p.waitFor();
  72. java.awt.Desktop.getDesktop().browse(new URI("D:/facu/Memoria/prototipo-googlecode/Prototipo/wsConsume/MyFirstMap.html"));
  73. } catch (InterruptedException ex) {
  74. Logger.getLogger(QueryBean.class.getName()).log(Level.SEVERE, null, ex);
  75. } catch (IOException ex) {
  76. Logger.getLogger(QueryBean.class.getName()).log(Level.SEVERE, null, ex);
  77. } catch (URISyntaxException ex){
  78. Logger.getLogger(QueryBean.class.getName()).log(Level.SEVERE, null, ex);
  79. }
  80. }
  81. }