svn-gvsig-desktop / trunk / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / querys / CSWQuery.java @ 2658
History | View | Annotate | Download (1.79 KB)
1 |
/*
|
---|---|
2 |
* Created on 22-abr-2005
|
3 |
*
|
4 |
* TODO To change the template for this generated file go to
|
5 |
* Window - Preferences - Java - Code Style - Code Templates
|
6 |
*/
|
7 |
package es.gva.cit.catalogClient.querys; |
8 |
|
9 |
|
10 |
import es.gva.cit.catalogClient.languages.FilterEncoding; |
11 |
|
12 |
|
13 |
/**
|
14 |
* @author jpiera
|
15 |
*
|
16 |
* TODO Query used by CSW protocol
|
17 |
*/
|
18 |
public class CSWQuery extends Query implements IQuery { |
19 |
|
20 |
public CSWQuery(Query query){ |
21 |
super(query.getTitle(),
|
22 |
query.getTitleFilter(), |
23 |
query.getAbstract(), |
24 |
query.getThemeKey(), |
25 |
query.getTopic(), |
26 |
query.getScale(), |
27 |
query.getProvider(), |
28 |
query.getDateFrom(), |
29 |
query.getDateTo(), |
30 |
query.getCoordenates(), |
31 |
query.getCoordenatesFilter()); |
32 |
} |
33 |
|
34 |
/**
|
35 |
* Return a CQL-Text query
|
36 |
*
|
37 |
* @return String
|
38 |
*/
|
39 |
public String getQuery(){ |
40 |
String pregunta = null; |
41 |
|
42 |
FilterEncoding query = new FilterEncoding("ogc:","*","#","!","xmlns:ogc=\"http://www.opengis.net/ogc\""); |
43 |
|
44 |
if (this.getTitle() != null) |
45 |
query.addClauses("Title",this.getTitle(),this.getTitleFilter()); |
46 |
|
47 |
if (this.getAbstract() != null) |
48 |
query.addClauses("Abstract",this.getAbstract(),"E"); |
49 |
|
50 |
if (this.getThemeKey() != null) |
51 |
//query.addClauses("2002", "6", "3", this.getThemeKey(),"Y");
|
52 |
|
53 |
if (this.getScale() != null) |
54 |
//query.addClauses("1024", "109", "1", this.getScale(),"E");
|
55 |
|
56 |
if (this.getProvider() != null) |
57 |
//query.addClauses("1005", "6", "3",this.getProvider(),"E");
|
58 |
|
59 |
//Beginning Date (begdate, 2072), Date(210)
|
60 |
if (this.getDateFrom() != null) |
61 |
//query.addClauses("Modified",this.getDateFrom(),"E");
|
62 |
|
63 |
//Ending Date (enddate, 2073), Date(210)
|
64 |
if (this.getDateTo() != null) |
65 |
//query.addClauses("Modified",this.getDateTo(),"E");
|
66 |
|
67 |
if (this.getCoordenates() != null) |
68 |
|
69 |
pregunta = query.toString(); |
70 |
|
71 |
return pregunta;
|
72 |
} |
73 |
|
74 |
|
75 |
|
76 |
|
77 |
} |