From e1222bd64d3f260b2d2643fc3d97b62fe4f531b5 Mon Sep 17 00:00:00 2001 From: Nathanael Jourdane Date: Wed, 2 Mar 2016 16:18:16 +0100 Subject: [PATCH] Use working query by default --- src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java | 8 ++++---- src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java b/src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java index 94ffd7c..cb9b992 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java @@ -46,10 +46,10 @@ public final class Queries { * The default query, with these parameters, respectively: max_rows, target_name, time_min, * time_max, dataproduct_type, spectral_range_min, spectral_range_max. */ - public static final String SAMPLE_AMDA_QUERY = "SELECT TOP %s target_name, resource_type, instrument_name " - + "FROM amdadb.epn_core " - + "WHERE target_name = '%s', time_min=%f, time_max=%f, dataproduct_type=%s, " - + "spectral_range_min=%f, spectral_range_max=%f"; + public static final String SAMPLE_AMDA_QUERY = "SELECT TOP %s index, target_name, target_class " + + "FROM amdadb.epn_core WHERE target_name LIKE '%%%s%%'"; + // + "WHERE target_name = '%s' AND time_min=%f AND time_max=%f AND dataproduct_type='%s' AND " + // + "spectral_range_min=%f AND spectral_range_max=%f"; /** Constructor to hide the implicit public one. */ private Queries() { diff --git a/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java b/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java index 9fec11e..dedaecb 100644 --- a/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java +++ b/src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java @@ -77,13 +77,13 @@ public class RequestView extends JPanel implements ActionListener { * @return A JPanel containing graphical elements for the service parameters. */ private JPanel buildParamPanel() { - JTextField jtfTargetName = new JTextField("Jupiter"); + JTextField jtfTargetName = new JTextField("Galileo"); JFormattedTextField jtfMinTime = new JFormattedTextField(new Float(0.0)); JFormattedTextField jtfMaxTime = new JFormattedTextField(new Float(1.0)); JTextField jtfProductType = new JTextField("SpectralRange"); JFormattedTextField jtfMinSpectralRange = new JFormattedTextField(new Float(0.0)); JFormattedTextField jtfMaxSpectralRange = new JFormattedTextField(new Float(1.0)); - JFormattedTextField jtfMaxRows = new JFormattedTextField(new Integer(100)); + JFormattedTextField jtfMaxRows = new JFormattedTextField(new Integer(10)); DocumentListener paramListener = new DocumentListener() { @Override @@ -201,8 +201,11 @@ public class RequestView extends JPanel implements ActionListener { */ private void updateQueryArea(int max_rows, String target_name, float time_min, float time_max, String dataproduct_type, float spectral_range_min, float spectral_range_max) { - queryArea.setText(String.format(Queries.SAMPLE_AMDA_QUERY, max_rows, target_name, time_min, - time_max, dataproduct_type, spectral_range_min, spectral_range_max)); + queryArea.setText( + String.format(Queries.SAMPLE_AMDA_QUERY, max_rows, target_name)); + // queryArea.setText(String.format(Queries.SAMPLE_AMDA_QUERY, max_rows, target_name, + // time_min, + // time_max, dataproduct_type, spectral_range_min, spectral_range_max)); } /** @@ -222,7 +225,6 @@ public class RequestView extends JPanel implements ActionListener { @Override public void actionPerformed(ActionEvent evt) { - System.out.println("blah"); if (((JButton) evt.getSource()).getName() == "btnSend") { try { mainView.getController().sendQuery(queryArea.getText()); -- libgit2 0.21.2