Commit e1222bd64d3f260b2d2643fc3d97b62fe4f531b5
1 parent
8a39b260
Exists in
master
Use working query by default
Showing
2 changed files
with
11 additions
and
9 deletions
Show diff stats
src/main/java/eu/omp/irap/vespa/epntapclient/utils/Queries.java
@@ -46,10 +46,10 @@ public final class Queries { | @@ -46,10 +46,10 @@ public final class Queries { | ||
46 | * The default query, with these parameters, respectively: max_rows, target_name, time_min, | 46 | * The default query, with these parameters, respectively: max_rows, target_name, time_min, |
47 | * time_max, dataproduct_type, spectral_range_min, spectral_range_max. | 47 | * time_max, dataproduct_type, spectral_range_min, spectral_range_max. |
48 | */ | 48 | */ |
49 | - public static final String SAMPLE_AMDA_QUERY = "SELECT TOP %s target_name, resource_type, instrument_name " | ||
50 | - + "FROM amdadb.epn_core " | ||
51 | - + "WHERE target_name = '%s', time_min=%f, time_max=%f, dataproduct_type=%s, " | ||
52 | - + "spectral_range_min=%f, spectral_range_max=%f"; | 49 | + public static final String SAMPLE_AMDA_QUERY = "SELECT TOP %s index, target_name, target_class " |
50 | + + "FROM amdadb.epn_core WHERE target_name LIKE '%%%s%%'"; | ||
51 | + // + "WHERE target_name = '%s' AND time_min=%f AND time_max=%f AND dataproduct_type='%s' AND " | ||
52 | + // + "spectral_range_min=%f AND spectral_range_max=%f"; | ||
53 | 53 | ||
54 | /** Constructor to hide the implicit public one. */ | 54 | /** Constructor to hide the implicit public one. */ |
55 | private Queries() { | 55 | private Queries() { |
src/main/java/eu/omp/irap/vespa/epntapclient/view/RequestView.java
@@ -77,13 +77,13 @@ public class RequestView extends JPanel implements ActionListener { | @@ -77,13 +77,13 @@ public class RequestView extends JPanel implements ActionListener { | ||
77 | * @return A JPanel containing graphical elements for the service parameters. | 77 | * @return A JPanel containing graphical elements for the service parameters. |
78 | */ | 78 | */ |
79 | private JPanel buildParamPanel() { | 79 | private JPanel buildParamPanel() { |
80 | - JTextField jtfTargetName = new JTextField("Jupiter"); | 80 | + JTextField jtfTargetName = new JTextField("Galileo"); |
81 | JFormattedTextField jtfMinTime = new JFormattedTextField(new Float(0.0)); | 81 | JFormattedTextField jtfMinTime = new JFormattedTextField(new Float(0.0)); |
82 | JFormattedTextField jtfMaxTime = new JFormattedTextField(new Float(1.0)); | 82 | JFormattedTextField jtfMaxTime = new JFormattedTextField(new Float(1.0)); |
83 | JTextField jtfProductType = new JTextField("SpectralRange"); | 83 | JTextField jtfProductType = new JTextField("SpectralRange"); |
84 | JFormattedTextField jtfMinSpectralRange = new JFormattedTextField(new Float(0.0)); | 84 | JFormattedTextField jtfMinSpectralRange = new JFormattedTextField(new Float(0.0)); |
85 | JFormattedTextField jtfMaxSpectralRange = new JFormattedTextField(new Float(1.0)); | 85 | JFormattedTextField jtfMaxSpectralRange = new JFormattedTextField(new Float(1.0)); |
86 | - JFormattedTextField jtfMaxRows = new JFormattedTextField(new Integer(100)); | 86 | + JFormattedTextField jtfMaxRows = new JFormattedTextField(new Integer(10)); |
87 | 87 | ||
88 | DocumentListener paramListener = new DocumentListener() { | 88 | DocumentListener paramListener = new DocumentListener() { |
89 | @Override | 89 | @Override |
@@ -201,8 +201,11 @@ public class RequestView extends JPanel implements ActionListener { | @@ -201,8 +201,11 @@ public class RequestView extends JPanel implements ActionListener { | ||
201 | */ | 201 | */ |
202 | private void updateQueryArea(int max_rows, String target_name, float time_min, float time_max, | 202 | private void updateQueryArea(int max_rows, String target_name, float time_min, float time_max, |
203 | String dataproduct_type, float spectral_range_min, float spectral_range_max) { | 203 | String dataproduct_type, float spectral_range_min, float spectral_range_max) { |
204 | - queryArea.setText(String.format(Queries.SAMPLE_AMDA_QUERY, max_rows, target_name, time_min, | ||
205 | - time_max, dataproduct_type, spectral_range_min, spectral_range_max)); | 204 | + queryArea.setText( |
205 | + String.format(Queries.SAMPLE_AMDA_QUERY, max_rows, target_name)); | ||
206 | + // queryArea.setText(String.format(Queries.SAMPLE_AMDA_QUERY, max_rows, target_name, | ||
207 | + // time_min, | ||
208 | + // time_max, dataproduct_type, spectral_range_min, spectral_range_max)); | ||
206 | } | 209 | } |
207 | 210 | ||
208 | /** | 211 | /** |
@@ -222,7 +225,6 @@ public class RequestView extends JPanel implements ActionListener { | @@ -222,7 +225,6 @@ public class RequestView extends JPanel implements ActionListener { | ||
222 | 225 | ||
223 | @Override | 226 | @Override |
224 | public void actionPerformed(ActionEvent evt) { | 227 | public void actionPerformed(ActionEvent evt) { |
225 | - System.out.println("blah"); | ||
226 | if (((JButton) evt.getSource()).getName() == "btnSend") { | 228 | if (((JButton) evt.getSource()).getName() == "btnSend") { |
227 | try { | 229 | try { |
228 | mainView.getController().sendQuery(queryArea.getText()); | 230 | mainView.getController().sendQuery(queryArea.getText()); |