Statistics
| Revision:

svn-gvsig-desktop / trunk / applications / appCatalogYNomenclatorClient / src / es / gva / cit / catalogClient / schemas / DublinCoreSchema.java @ 3509

History | View | Annotate | Download (4.46 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.schemas;
42

    
43
import es.gva.cit.catalogClient.filters.AdditionalClauses;
44

    
45

    
46
/**
47
 * This class is used to define the DublinCore fields that have to be
48
 * used to do a search.
49
 * @author Jorge Piera Llodra (piera_jor@gva.es)
50
 */
51
public class DublinCoreSchema implements ISchemas{
52

    
53
    /* (non-Javadoc)
54
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
55
     */
56
    public String getTitle() {
57
        return "title";
58
    }
59

    
60
    /* (non-Javadoc)
61
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
62
     */
63
    public String getAbstract() {
64
        return "subject";
65
    }
66

    
67
    /* (non-Javadoc)
68
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
69
     */
70
    public String getThemeKey() {
71
        return "key";
72
    }
73

    
74
    /* (non-Javadoc)
75
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
76
     */
77
    public String getScale() {
78
        return "scale";
79
    }
80

    
81
    /* (non-Javadoc)
82
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
83
     */
84
    public String getProvider() {
85
        return "publisher";
86
    }
87

    
88
    /* (non-Javadoc)
89
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
90
     */
91
    public String getDateFrom() {
92
        return "date";
93
    }
94
    
95
    /* (non-Javadoc)
96
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
97
     */
98
    public String getDateTo() {
99
        return "date";
100
    }
101
    
102
    /* (non-Javadoc)
103
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
104
     */
105
    public String getTopic() {
106
        return "topic";
107
    }
108
    
109
    /* (non-Javadoc)
110
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
111
     */
112
    public String getCoordinates() {
113
        return "spatial";
114
    }
115
  
116
    /* (non-Javadoc)
117
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
118
     */
119
    public AdditionalClauses[] getAdditionalClauses(String[] dataset) {
120
        return new AdditionalClauses[0];
121
    }
122
    
123
    /* (non-Javadoc)
124
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getProviderValue(java.lang.String)
125
     */
126
        public String getTitleValue(String title, String filter) {
127
            return envolveWithJokers(title,filter);
128
        }        
129
        
130
        /* (non-Javadoc)
131
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getCoordinates()
132
     */
133
    public String getTopicValue(String topic) {
134
        return topic;
135
    }
136
    
137

    
138
    /* (non-Javadoc)
139
     * @see es.gva.cit.catalogClient.languages.cswProfiles.IProfiles#getProviderValue(java.lang.String)
140
     */
141
    public String getProviderValue(String provider) {
142
        return envolveWithJokers(provider,"E");
143
    }
144
    
145
    /**
146
     * This funcion envolves the array with an spacial char like *
147
     * @param array
148
     * @param filter
149
     * @return
150
     */    
151
    public String envolveWithJokers(String array, String filter){
152
        if (!(filter.equals("E"))){
153
            String[] split = array.split(" ");
154
            String aux = "";
155
            for (int i=0 ; i<split.length ; i++){
156
                aux = aux + "*" + split[i] + "* ";
157
            }
158
            return aux;
159
        }
160
        return "*" + array + "*";
161
    }
162

    
163

    
164
    
165
}