Statistics
| Revision:

root / trunk / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / querys / Query.java @ 2985

History | View | Annotate | Download (7.15 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
*
3
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
*
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License
7
* as published by the Free Software Foundation; either version 2
8
* of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
*
19
* For more information, contact:
20
*
21
*  Generalitat Valenciana
22
*   Conselleria d'Infraestructures i Transport
23
*   Av. Blasco Ib??ez, 50
24
*   46010 VALENCIA
25
*   SPAIN
26
*
27
*      +34 963862235
28
*   gvsig@gva.es
29
*      www.gvsig.gva.es
30
*
31
*    or
32
*
33
*   IVER T.I. S.A
34
*   Salamanca 50
35
*   46005 Valencia
36
*   Spain
37
*
38
*   +34 963163400
39
*   dac@iver.es
40
*/
41
package es.gva.cit.catalogClient.querys;
42

    
43

    
44
/**
45
 * This class implements a general query. It contains an attribute
46
 * for each parameter that can be showed in the search form.
47
 * 
48
 * @author Jorge Piera Llodra (piera_jor@gva.es)
49
 */
50
public class Query {
51
    private String title;
52
    private String titleFilter;
53
    private String abstract_;
54
    private String themeKey;
55
    private String topic;
56
    private String scale;
57
    private String provider;
58
    private String DateFrom;
59
    private String DateTo;
60
    private Coordinates coordinates;
61
    private String coordinatesFilter;
62
    private boolean isMinimized;
63

    
64

    
65
    /**
66
         * @param title
67
         * @param titleFilter
68
         * @param abstract_
69
         * @param themeKey
70
         * @param topic
71
         * @param scale
72
         * @param provider
73
         * @param dateFrom
74
         * @param dateTo
75
         * @param coordinates
76
         * @param coordinatesFilter
77
         */
78
    public Query(String title, String titleFilter, String abstract_,
79
        String themeKey, String topic, String scale, String provider,
80
        String dateFrom, String dateTo, Coordinates coordinates,
81
        String coordinatesFilter) {
82
        super();
83
        this.title = title;
84
        this.titleFilter = titleFilter;
85
        this.abstract_ = abstract_;
86
        this.themeKey = themeKey;
87
        this.topic = topic;
88
        this.scale = scale;
89
        this.provider = provider;
90

    
91
        //Date
92
        this.DateFrom = dateFrom;
93
        this.DateTo = dateTo;
94

    
95
        //Coordinates
96
        this.coordinates = coordinates;
97

    
98
        if (this.coordinates != null) {
99
            if (this.coordinates.getUlx().equals("") ||
100
                    this.coordinates.getUlx().equals("") ||
101
                    this.coordinates.getBrx().equals("") ||
102
                    this.coordinates.getBry().equals("")) {
103
                this.coordinates = null;
104
            } else {
105
                try {
106
                    Double.parseDouble(this.coordinates.getUlx());
107
                    Double.parseDouble(this.coordinates.getUlx());
108
                    Double.parseDouble(this.coordinates.getBrx());
109
                    Double.parseDouble(this.coordinates.getBry());
110
                    this.coordinates = coordinates;
111
                } catch (Exception e) {
112
                    this.coordinates = null;
113
                    System.out.println("JJ");
114
                }
115
            }
116
        }
117

    
118
        this.coordinatesFilter = coordinatesFilter;
119
        
120
        setMinimized(false);
121
    }
122

    
123
    /**
124
     * Return logic operators
125
     * @param titleKeys
126
     * E,A o Y --> Exact, All, anY
127
     * @return String
128
     *
129
     */
130
    public String getOperator(String concordancia) {
131
        if (concordancia.equals("Y")) {
132
            return "Or";
133
        } else {
134
            return "And";
135
        }
136
    }
137

    
138
    /**
139
     * @return Returns the abstract_.
140
     */
141
    public String getAbstract() {
142
        return abstract_;
143
    }
144

    
145
    /**
146
     * @param abstract_ The abstract_ to set.
147
     */
148
    public void setAbstract(String abstract_) {
149
        this.abstract_ = abstract_;
150
    }
151

    
152
    /**
153
     * @return Returns the coordinates.
154
     */
155
    public Coordinates getCoordenates() {
156
        return coordinates;
157
    }
158

    
159
    /**
160
     * @param coordenates The coordinates to set.
161
     */
162
    public void setCoordenates(Coordinates coordenates) {
163
        this.coordinates = coordenates;
164
    }
165

    
166
    /**
167
     * @return Returns the coordinatesFilter.
168
     */
169
    public String getCoordenatesFilter() {
170
        return coordinatesFilter;
171
    }
172

    
173
    /**
174
     * @param coordenatesFilter The coordenatesFilter to set.
175
     */
176
    public void setCoordenatesFilter(String coordenatesFilter) {
177
        this.coordinatesFilter = coordenatesFilter;
178
    }
179

    
180
    /**
181
     * @return Returns the dateFrom.
182
     */
183
    public String getDateFrom() {
184
        return DateFrom;
185
    }
186

    
187
    /**
188
     * @param dateFrom The dateFrom to set.
189
     */
190
    public void setDateFrom(String dateFrom) {
191
        DateFrom = dateFrom;
192
    }
193

    
194
    /**
195
     * @return Returns the dateTo.
196
     */
197
    public String getDateTo() {
198
        return DateTo;
199
    }
200

    
201
    /**
202
     * @param dateTo The dateTo to set.
203
     */
204
    public void setDateTo(String dateTo) {
205
        DateTo = dateTo;
206
    }
207

    
208
    /**
209
     * @return Returns the provider.
210
     */
211
    public String getProvider() {
212
        return provider;
213
    }
214

    
215
    /**
216
     * @param provider The provider to set.
217
     */
218
    public void setProvider(String provider) {
219
        this.provider = provider;
220
    }
221

    
222
    /**
223
     * @return Returns the scale.
224
     */
225
    public String getScale() {
226
        return scale;
227
    }
228

    
229
    /**
230
     * @param scale The scale to set.
231
     */
232
    public void setScale(String scale) {
233
        this.scale = scale;
234
    }
235

    
236
    /**
237
     * @return Returns the themeKey.
238
     */
239
    public String getThemeKey() {
240
        return themeKey;
241
    }
242

    
243
    /**
244
     * @param themeKey The themeKey to set.
245
     */
246
    public void setThemeKey(String themeKey) {
247
        this.themeKey = themeKey;
248
    }
249

    
250
    /**
251
     * @return Returns the title.
252
     */
253
    public String getTitle() {
254
        return title;
255
    }
256

    
257
    /**
258
     * @param title The title to set.
259
     */
260
    public void setTitle(String title) {
261
        this.title = title;
262
    }
263

    
264
    /**
265
     * @return Returns the titleFilter.
266
     */
267
    public String getTitleFilter() {
268
        return titleFilter;
269
    }
270

    
271
    /**
272
     * @param titleFilter The titleFilter to set.
273
     */
274
    public void setTitleFilter(String titleFilter) {
275
        this.titleFilter = titleFilter;
276
    }
277

    
278
    /**
279
     * @return Returns the topic.
280
     */
281
    public String getTopic() {
282
        return topic;
283
    }
284

    
285
    /**
286
     * @param topic The topic to set.
287
     */
288
    public void setTopic(String topic) {
289
        this.topic = topic;
290
    }
291
    
292
    /**
293
     * @return Returns the isMinimized.
294
     */
295
    public boolean isMinimized() {
296
        return isMinimized;
297
    }
298
    /**
299
     * @param isMinimized The isMinimized to set.
300
     */
301
    public void setMinimized(boolean isMinimized) {
302
        this.isMinimized = isMinimized;
303
        this.setAbstract(getTitle());
304
    }
305
}