Revision 38315

View differences:

tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/DiscoveryServiceClient.java
1
package org.gvsig.catalog;
2

  
3
import java.io.IOException;
4
import java.net.Authenticator;
5
import java.net.PasswordAuthentication;
6
import java.net.Socket;
7
import java.net.URI;
8
import java.net.URISyntaxException;
9
import java.net.UnknownHostException;
10
import java.util.Properties;
11

  
12
import org.apache.commons.httpclient.HttpConnection;
13

  
14
import org.gvsig.catalog.drivers.DiscoveryServiceCapabilities;
15
import org.gvsig.catalog.drivers.IDiscoveryServiceDriver;
16
import org.gvsig.catalog.exceptions.DiscoveryServiceException;
17
import org.gvsig.catalog.exceptions.NotSupportedProtocolException;
18
import org.gvsig.catalog.exceptions.NotSupportedVersionException;
19
import org.gvsig.catalog.exceptions.ServerIsNotReadyException;
20
import org.gvsig.catalog.querys.DiscoveryServiceQuery;
21
import org.gvsig.catalog.ui.search.SearchAditionalPropertiesPanel;
22
import org.gvsig.catalog.utils.URIUtils;
23

  
24

  
25

  
26
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
27
 *
28
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
29
 *
30
 * This program is free software; you can redistribute it and/or
31
 * modify it under the terms of the GNU General Public License
32
 * as published by the Free Software Foundation; either version 2
33
 * of the License, or (at your option) any later version.
34
 *
35
 * This program is distributed in the hope that it will be useful,
36
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
37
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
38
 * GNU General Public License for more details.
39
 *
40
 * You should have received a copy of the GNU General Public License
41
 * along with this program; if not, write to the Free Software
42
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
43
 *
44
 * For more information, contact:
45
 *
46
 *  Generalitat Valenciana
47
 *   Conselleria d'Infraestructures i Transport
48
 *   Av. Blasco Ib??ez, 50
49
 *   46010 VALENCIA
50
 *   SPAIN
51
 *
52
 *      +34 963862235
53
 *   gvsig@gva.es
54
 *      www.gvsig.gva.es
55
 *
56
 *    or
57
 *
58
 *   IVER T.I. S.A
59
 *   Salamanca 50
60
 *   46005 Valencia
61
 *   Spain
62
 *
63
 *   +34 963163400
64
 *   dac@iver.es
65
 */
66
/* CVS MESSAGES:
67
 *
68
 * $Id$
69
 * $Log$
70
 *
71
 */
72
/**
73
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
74
 */
75
public class DiscoveryServiceClient {
76
	/**
77
	 * The server URI
78
	 */
79
	private URI uri = null;
80
	/**
81
	 * The driver to make the querys
82
	 */
83
	private IDiscoveryServiceDriver driver;
84
	/**
85
	 * The service capabilities
86
	 */
87
	private DiscoveryServiceCapabilities capabilities;
88
	/**
89
	 * The server status message
90
	 */
91
	private String serverStatus = null;
92

  
93
	public DiscoveryServiceClient(String sUri,IDiscoveryServiceDriver driver) {
94
		setDriver(driver);
95
		if (driver == null){
96
			serverStatus = "errorServerNotFound";
97
		}else{
98
			try {
99
				this.uri = URIUtils.createUri(sUri,
100
						driver.getDefaultSchema(),
101
						driver.getDefaultPort());
102
			} catch (URISyntaxException e) {
103
				serverStatus = "errorServerNotFound";
104
			}
105
		}
106
	}
107
	
108
	/**
109
	 * It make a getCapabilities operation
110
	 * @return the service version
111
	 * @throws ServerIsNotReadyException 
112
	 */
113
	public DiscoveryServiceCapabilities getCapabilities() throws DiscoveryServiceException {        
114
		if (serverIsReady()){
115
			try {
116
				if (getDriver().isProtocolSupported(getUri())) {
117
					capabilities = getDriver().getCapabilities(getUri());
118
					return capabilities;
119
				}
120
			} catch (NotSupportedProtocolException e) {
121
				capabilities = new DiscoveryServiceCapabilities();
122
				capabilities.setAvailable(false);
123
				capabilities.setServerMessage("notSupportedProtocol");
124
			} catch (NotSupportedVersionException e) {
125
				capabilities = new DiscoveryServiceCapabilities();
126
				capabilities.setAvailable(false);
127
				capabilities.setServerMessage("notSupportedVersion");
128
			} 
129
		}
130
		return capabilities;    
131
	} 
132

  
133
	/**
134
	 * It tries if the server is ready 
135
	 * @return boolean
136
	 * true --> server is ready
137
	 * false --> server is not ready
138
	 */
139
	public boolean serverIsReady() throws ServerIsNotReadyException {        
140
		Properties systemSettings = System.getProperties();
141

  
142

  
143
		Object isProxyEnabled = systemSettings.get("http.proxySet"); 
144
		if ((isProxyEnabled == null) || (isProxyEnabled.equals("false"))){
145
			Socket sock;
146
			try{				
147
				sock = new Socket(getUri().getHost(),
148
						getUri().getPort());
149
			} catch (UnknownHostException e) {
150
				throw new ServerIsNotReadyException(e);
151
			} catch (IOException e) {
152
				throw new ServerIsNotReadyException(e);
153
			}
154
			return (sock != null);
155
		}else{
156
			Object host = systemSettings.get("http.proxyHost"); 
157
			Object port = systemSettings.get("http.proxyPort");
158
			Object user = systemSettings.get("http.proxyUserName");
159
			Object password = systemSettings.get("http.proxyPassword");
160
			if ((host != null) && (port != null)){
161
				int iPort = 80;
162
				try{
163
					iPort = Integer.parseInt((String)port);
164
				}catch (Exception e) {
165
					//Use 80
166
				}
167
				HttpConnection connection = new HttpConnection(getUri().getHost(), 
168
						getUri().getPort());
169
				connection.setProxyHost((String)host);
170
				connection.setProxyPort(iPort);
171
				Authenticator.setDefault(new SimpleAuthenticator(
172
                        user,password));
173
				
174
				try {
175
					connection.open();
176
					connection.close();						
177
				} catch (IOException e) {
178
					throw new ServerIsNotReadyException(e);					
179
				}
180
			}			
181
		}		
182
		return true;
183
	} 
184

  
185
	/**
186
	 * @return the server URI
187
	 */
188
	public URI getUri() {
189
		return uri;
190
	}
191

  
192
	/**
193
	 * @return Return the server URI like a String
194
	 */
195
	public String getSUri() {
196
		return uri.toString();
197
	} 
198

  
199
	/**
200
	 * @return Returns the driver.
201
	 */
202
	protected IDiscoveryServiceDriver getDriver() {        
203
		return driver;
204
	}
205

  
206
	/**
207
	 * 
208
	 * @param driver the driver to set
209
	 */
210
	protected void setDriver(IDiscoveryServiceDriver driver) {
211
		this.driver = driver;
212
	} 
213

  
214
	/**
215
	 * @return the server protocol
216
	 */
217
	public String getProtocol() {        
218
		return driver.getServiceName();
219
	}
220
	
221
	/**
222
	 * Gets the aditional panel
223
	 * @return
224
	 */
225
	public SearchAditionalPropertiesPanel getAditionalSearchPanel(){
226
		return driver.getAditionalSearchPanel();
227
	}
228
	
229
	/**
230
	 * Gets a query
231
	 * @return
232
	 */
233
	public DiscoveryServiceQuery createQuery(){
234
		return driver.createQuery();
235
	}
236
	
237
	private class SimpleAuthenticator
238
	   extends Authenticator
239
	{
240
	   private String username,
241
	                  password;
242
	                     
243
	   public SimpleAuthenticator(Object username, Object password)
244
	   {
245
		   if (username != null){
246
			   this.username = (String)username;
247
		   }
248
		   if (password != null){
249
			   this.password = (String)password;
250
		   }
251
	   }
252
	   
253
	   protected PasswordAuthentication getPasswordAuthentication()
254
	   {
255
	      return new PasswordAuthentication(
256
	             username,password.toCharArray());
257
	   }
258
	}
259
}
0 260

  
tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/filters/AdditionalClauses.java
1

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

  
44
/**
45
 * This class is used like an structure. It contains the fields needed to add a new
46
 * operation to the query language.
47
 * 
48
 * 
49
 * @author Jorge Piera Llodra (piera_jor@gva.es)
50
 */
51
public class AdditionalClauses {
52

  
53
/**
54
 * 
55
 * 
56
 */
57
    private String property;
58

  
59
/**
60
 * 
61
 * 
62
 */
63
    private String value;
64

  
65
/**
66
 * 
67
 * 
68
 */
69
    private String concorancia;
70

  
71
/**
72
 * 
73
 * 
74
 */
75
    private String relationship;
76

  
77
/**
78
 * 
79
 * 
80
 */
81
    private String type;
82

  
83
/**
84
 * 
85
 * 
86
 * 
87
 * @param property 
88
 * @param value 
89
 * @param concorancia 
90
 * @param relationship 
91
 * @param type 
92
 */
93
    public  AdditionalClauses(String property, String value, String concorancia, String relationship, String type) {        
94
        super();
95
        this.property = property;
96
        this.value = value;
97
        this.concorancia = concorancia;
98
        this.relationship = relationship;
99
        this.type = type;
100
    } 
101

  
102
/**
103
 * 
104
 * 
105
 * 
106
 * @return Returns the concorancia.
107
 */
108
    public String getConcorancia() {        
109
        return concorancia;
110
    } 
111

  
112
/**
113
 * 
114
 * 
115
 * 
116
 * @return Returns the property.
117
 */
118
    public String getProperty() {        
119
        return property;
120
    } 
121

  
122
/**
123
 * 
124
 * 
125
 * 
126
 * @return Returns the relationship.
127
 */
128
    public String getRelationship() {        
129
        return relationship;
130
    } 
131

  
132
/**
133
 * 
134
 * 
135
 * 
136
 * @return Returns the type.
137
 */
138
    public String getType() {        
139
        return type;
140
    } 
141

  
142
/**
143
 * 
144
 * 
145
 * 
146
 * @return Returns the value.
147
 */
148
    public String getValue() {        
149
        return value;
150
    } 
151
 }
0 152

  
tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/filters/AbstractFilter.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
*
4
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
*
20
* For more information, contact:
21
*
22
*  Generalitat Valenciana
23
*   Conselleria d'Infraestructures i Transport
24
*   Av. Blasco Ib??ez, 50
25
*   46010 VALENCIA
26
*   SPAIN
27
*
28
*      +34 963862235
29
*   gvsig@gva.es
30
*      www.gvsig.gva.es
31
*
32
*    or
33
*
34
*   IVER T.I. S.A
35
*   Salamanca 50
36
*   46005 Valencia
37
*   Spain
38
*
39
*   +34 963163400
40
*   dac@iver.es
41
*/
42
/*
43
* CVS MESSAGES:
44
*
45
* $Id: AbstractFilter.java 561 2007-07-27 06:49:30 +0000 (Fri, 27 Jul 2007) jpiera $
46
* $Log$
47
* Revision 1.4  2006/01/18 09:57:01  jorpiell
48
* Eliminados algunos ficheros innecesarios
49
*
50
* Revision 1.3  2006/01/12 13:52:24  jorpiell
51
* Se ha a?adido un boton close en las dos pantallas de connect. Adem?s se ha cambiado el comportamiento de las ventanas para adaptarlo a la nueva forma de buscar multihilo
52
*
53
* Revision 1.2  2006/01/10 09:32:48  jorpiell
54
* Se ha echo un commit de las versiones modificadas del catalogo y del gazetteer usando el Poseidon. Se han renombrado algunas clases por considerar que tenian un nombre confuso y se han cambiado algunas relaciones entre clases (con la intenci?n de separar GUI de la parte de control). Han habido clases que no han sido tocadas, pero como han sido formateadas usando el Poseidon TODAS las CLASES del proyecto han cambiado de versi?n.
55
*
56
* Revision 1.1  2005/12/22 08:31:43  jorpiell
57
* Aqui tambien se han producido muchos cambis, porque hemos acabado de cambiar la estructura del cat?logo: Se han creado todas las clases "XXXMessages", que sacan toda la parte de los mensajes de los drivers. Ademas se ha incluido en "CatalogClient" la operaci?n "getCapabilities", que libera a la interfaz de algunas operaciones que hac?a anteriormente.
58
*
59
*
60
*/
61
package org.gvsig.catalog.filters;
62

  
63
/**
64
 * 
65
 * 
66
 */
67
public abstract class AbstractFilter implements IFilter {
68
 }
0 69

  
tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/filters/IFilter.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
*
4
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
*
20
* For more information, contact:
21
*
22
*  Generalitat Valenciana
23
*   Conselleria d'Infraestructures i Transport
24
*   Av. Blasco Ib??ez, 50
25
*   46010 VALENCIA
26
*   SPAIN
27
*
28
*      +34 963862235
29
*   gvsig@gva.es
30
*      www.gvsig.gva.es
31
*
32
*    or
33
*
34
*   IVER T.I. S.A
35
*   Salamanca 50
36
*   46005 Valencia
37
*   Spain
38
*
39
*   +34 963163400
40
*   dac@iver.es
41
*/
42
package org.gvsig.catalog.filters;
43
import org.gvsig.catalog.querys.CatalogQuery;
44
/**
45
 * All the clases that implement a "Query" class must to
46
 * implemet this interface
47
 * 
48
 * 
49
 * @author Jorge Piera Llodra (piera_jor@gva.es)
50
 */
51
public interface IFilter {
52
/**
53
 * 
54
 * 
55
 * 
56
 * @return 
57
 * @param query 
58
 * @param profile 
59
 */
60
    public String getQuery(CatalogQuery query);
61
}
62
//Return the query that will be used for the driver
63

  
64

  
0 65

  
tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/CatalogAP.java
1

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

  
47
import javax.swing.UIManager;
48
import javax.swing.UnsupportedLookAndFeelException;
49

  
50
import org.gvsig.catalog.ui.serverconnect.ServerConnectDialog;
51
import org.gvsig.i18n.Messages;
52
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
53

  
54

  
55
/**
56
 * This class is the launcher application
57
 * 
58
 * 
59
 * @author Jorge Piera Llodra (piera_jor@gva.es)
60
 */
61
public class CatalogAP {
62

  
63
	/**
64
	 * @param args 
65
	 */
66
	public static void main(String[] args) {
67
		new DefaultLibrariesInitializer().fullInitialize();
68
		
69
		Messages.addLocale(Locale.getDefault());
70
		try {
71
			Messages.addResourceFamily("text", new File("."));
72
		} catch (MalformedURLException e1) {
73
			System.err.println("Error obteniendo recurso de traduccion");
74

  
75
		}
76

  
77
		//Get the currently installed look and feel
78
		UIManager.getLookAndFeel();
79
		// Install a different look and feel; specifically, the Windows look and feel
80
		try {
81
			UIManager.setLookAndFeel(
82
					"com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
83
		} catch (InstantiationException e) {
84
		} catch (ClassNotFoundException e) {
85
		} catch (UnsupportedLookAndFeelException e) {
86
		} catch (IllegalAccessException e) {
87
		}
88

  
89

  
90

  
91
		//ServerConnectDialogPanel frame = new ServerConnectDialogPanel();
92
		new ServerConnectDialog();
93
	} 
94
}
0 95

  
tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/srw/parsers/SrwCapabilitiesParser.java
1

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

  
45
import org.gvsig.catalog.metadataxml.XMLNode;
46
import org.gvsig.catalog.metadataxml.XMLTree;
47
import org.gvsig.catalog.srw.drivers.SRWCatalogServiceDriver;
48

  
49

  
50
/**
51
 * This class is used to parse the SRW capabilities
52
 * 
53
 * 
54
 * @author Jorge Piera Llodra (piera_jor@gva.es)
55
 */
56
public class SrwCapabilitiesParser {
57
/**
58
 * 
59
 * 
60
 */
61
    private SRWCatalogServiceDriver driver;
62

  
63
/**
64
 * 
65
 * 
66
 * 
67
 * @param driver 
68
 */
69
    public  SrwCapabilitiesParser(SRWCatalogServiceDriver driver) {        
70
        this.driver = driver;
71
    } 
72

  
73
/**
74
 * 
75
 * 
76
 * 
77
 * @return 
78
 * @param node 
79
 */
80
    public boolean parse(XMLNode node) {        
81
        if ((node == null) || (node.getName() == null)){
82
            driver.setServerAnswerReady("errorNotSupportedProtocol");
83
            return false;
84
        }
85
        
86
        if (node.getName().toLowerCase().equals("serviceexceptionreport")){
87
            driver.setServerAnswerReady("errorServerException");
88
            return false;
89
        }
90
       
91
            String prefix = new StringTokenizer(node.getName(), ":").nextToken();
92
            prefix = prefix + ":";
93
            driver.setOutputSchema(XMLTree.searchNodeValue(node,
94
                    prefix + "record->" + prefix + "recordSchema"));
95
            driver.setOutputFormat(XMLTree.searchNodeValue(node,
96
                    prefix + "record->" + prefix + "recordPacking"));
97
            driver.setStartPosition("1");
98
            driver.setMaxRecords("10");
99
            driver.setRecordXPath("");
100
            driver.setResultSetTTL("0");
101
            String title = XMLTree.searchNodeValue(node,
102
                    prefix + "record->" + prefix +
103
            "recordData->explain->databaseInfo->title");
104
            
105
            String description = XMLTree.searchNodeValue(node,
106
                    prefix + "record->" + prefix +
107
            "recordData->explain->databaseInfo->description");
108
            
109
            if (title != null){
110
            	driver.setServerAnswerReady(title + "\n");
111
            	if (description != null){
112
            		driver.setServerAnswerReady(driver.getServerAnswerReady() + 
113
            				description + "\n");
114
            	}            	
115
            }else{
116
            	driver.setServerAnswerReady("");
117
            	if (description != null){
118
            		driver.setServerAnswerReady(description + "\n");
119
            	}
120
            }         	         
121
          
122
            
123
            
124
            return true;
125
        
126
    } 
127
 }
0 128

  
tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/srw/filters/IDEESRWFilter.java
1

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

  
49

  
50
/**
51
 * This class creates a RSW query for the IDEE server 
52
 * 
53
 * @author Jorge Piera Llodra (piera_jor@gva.es)
54
 */
55
public class IDEESRWFilter extends AbstractFilter {
56
	
57
	public  IDEESRWFilter() {        
58
		super();
59
	} 
60

  
61
	/**
62
	 * Return a CQL-Text query
63
	 * @param query 
64
	 * @return String
65
	 * @param profile 
66
	 */
67
	public String getQuery(CatalogQuery query) {        
68
		String pregunta = null;
69

  
70
		FilterEncoding filter = new FilterEncoding("", "*", "?", "\\");    
71

  
72
		if (query.getTitle() != null) {
73
			filter.addClauses("title", query.getTitle(), query.getTitleFilter(),
74
					"PropertyIsLike", "L", "And");
75
		}     
76

  
77
		if (query.isMinimized()){
78
			if (query.getAbstract() != null) {
79
				filter.addClauses("subject", Strings.addAsteriscsFromAnArray(query.getAbstract()),
80
						"Y", "PropertyIsLike", "L", "Or");
81
			}
82
		}else{
83
			if (query.getAbstract() != null) {
84
				filter.addClauses("subject", Strings.addAsteriscsFromAnArray(query.getAbstract()),
85
						"Y", "PropertyIsLike", "L", "And");
86
			}
87

  
88

  
89
		}
90

  
91
		pregunta = filter.toString();
92
		return pregunta;
93
	} 
94

  
95
	/**
96
	 * This function returns true only when the user has choosen the
97
	 * "Fully Outside Of" of the coordinates option.
98
	 * 
99
	 * 
100
	 * @return 
101
	 * @param translator 
102
	 * @param coordinatesOption 
103
	 */
104
	public boolean getCoordinatesOption(String coordinatesOption) {        
105
		if ((coordinatesOption.equals(Messages.getText("coordinatesEqual"))) ||
106
				(coordinatesOption.equals(Messages.getText("coordinatesContains"))) ||
107
				(coordinatesOption.equals(Messages.getText("coordinatesEnclose"))))
108
			return false;
109

  
110
		return true; 
111
	} 
112

  
113
}
0 114

  
tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/srw/filters/SRWFilter.java
1

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

  
46
/**
47
 * This class create que query in the language suported by the SRW protocol
48
 * 
49
 * 
50
 * @author Jorge Piera Llodra (piera_jor@gva.es)
51
 */
52
public class SRWFilter extends AbstractFilter {
53

  
54
/**
55
 * 
56
 * 
57
 */
58
    public  SRWFilter() {        
59
        super();
60
    } 
61

  
62
/**
63
 * Devuelve un query en el lenguaje que soporte el protocolo SRW
64
 * 
65
 * 
66
 * @param query 
67
 * @return String : query en el lenguaje soportado
68
 * @param profile 
69
 */
70
    public String getQuery(org.gvsig.catalog.querys.CatalogQuery query) {        
71
        String pregunta = null;
72
        // Construimos una RemoteBooleanQuery
73
        CommonQueryLanguage filter = new CommonQueryLanguage();
74
        
75
        if (query.getTitle() != null) {
76
            filter.addClauses("dc.title", query.getTitle(), query.getTitleFilter(),"And");
77
        }
78
        
79
        if (query.isMinimized()){
80
        	if (query.getAbstract() != null) {
81
        		filter.addClauses("dc.subject", query.getAbstract(), "E", "Or");
82
        	}
83
        }else{
84
        	if (query.getAbstract() != null) {
85
        		filter.addClauses("dc.subject", query.getAbstract(), "E", "And");
86
        	}
87
        	
88
        	if (query.getProvider() != null) {
89
                filter.addClauses("dc.creator", query.getProvider(), "E","And");
90
            }
91
        }        	
92
        	
93
        //if (this.getThemeKey() != null) 
94
        //query.addClauses("", this.getThemeKey(),"Y");
95
        //if (this.getScale() != null) 
96
        //query.addClauses("map_scale", this.getScale(),"E");
97
        
98
        //if (this.getDateFrom() != null) 
99
        //query.addClauses("2072", "210", "4",this.getDateFrom(),"E");
100
        //if (this.getDateTo() != null) 
101
        //query.addClauses("2073", "210", "2",this.getDateTo(),"E");
102
        pregunta = filter.toString();
103
        System.out.println(pregunta);
104
        return pregunta;
105
    } 
106
 }
0 107

  
tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/srw/drivers/SRWCatalogServiceDriver.java
1

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

  
49
import org.gvsig.catalog.drivers.AbstractCatalogServiceDriver;
50
import org.gvsig.catalog.drivers.CatalogCapabilities;
51
import org.gvsig.catalog.drivers.DiscoveryServiceCapabilities;
52
import org.gvsig.catalog.drivers.GetRecordsReply;
53
import org.gvsig.catalog.metadataxml.XMLNode;
54
import org.gvsig.catalog.metadataxml.XMLTree;
55
import org.gvsig.catalog.protocols.HTTPGetProtocol;
56
import org.gvsig.catalog.protocols.SOAPProtocol;
57
import org.gvsig.catalog.querys.CatalogQuery;
58
import org.gvsig.catalog.srw.parsers.SrwCapabilitiesParser;
59
import org.gvsig.utils.swing.jcomboServer.ServerData;
60

  
61

  
62

  
63
/**
64
 * This class implements the CSW protocol.
65
 * 
66
 * 
67
 * @author Jorge Piera Llodra (piera_jor@gva.es)
68
 * @see http://www.loc.gov/z3950/agency/zing/srw/
69
 */
70
public class SRWCatalogServiceDriver extends AbstractCatalogServiceDriver {
71
	private String version = "1.1";
72
	private String recordXPath;
73
	private String resultSetTTL;
74

  
75
	/*
76
	 * (non-Javadoc)
77
	 * @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getCapabilities(java.net.URI)
78
	 */
79
	public DiscoveryServiceCapabilities getCapabilities(URI uri) {        
80
		URL url = null;
81
		try {
82
			url = uri.toURL();
83
		} catch (MalformedURLException e) {
84
			setServerAnswerReady("errorServerNotFound");
85
			return null;
86
		}        
87
		SRWMessages messages = new SRWMessages(this);
88
		Collection nodes = new HTTPGetProtocol().doQuery(url,
89
				messages.getHTTPGETCapabilities(true), 0);
90

  
91
		nodes = new SOAPProtocol().doQuery(url, messages.getSOAPCapabilities(), 0);
92
		new SrwCapabilitiesParser(this).parse((XMLNode)nodes.toArray()[0]);
93
		CatalogCapabilities capabilities = new CatalogCapabilities();
94
		capabilities.setVersion(version);
95
		capabilities.setServerMessage(getServerAnswerReady());
96
		return capabilities;
97
	} 
98

  
99
	/*
100
	 * (non-Javadoc)
101
	 * @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getRecords(java.net.URI, es.gva.cit.catalogClient.querys.Query, int)
102
	 */
103
	public GetRecordsReply getRecords(URI uri, CatalogQuery query, int firstRecord) {        
104
		URL url = null;
105
		try {
106
			url = uri.toURL();
107
		} catch (MalformedURLException e) {
108
			setServerAnswerReady("errorServerNotFound");
109
			return null;
110
		}        
111
		setQuery(query);
112
		SRWMessages messages = new SRWMessages(this);
113
		Collection nodes = new java.util.ArrayList();
114

  
115
		//TODO remove this comparation
116
		if (url.getHost().equals("idee.unizar.es")){
117
			try {
118
				url = new URL("http://idee.unizar.es/SRW/servlet/search/SRW");
119
			} catch (MalformedURLException e) {
120
				// It will never throws
121
			}
122
		}
123
	      
124
		XMLNode root = null;
125
		nodes = new SOAPProtocol().doQuery(url,
126
				messages.getSOAPRecords(getQuery(), firstRecord), firstRecord);
127
		root = (XMLNode)nodes.toArray()[0];
128
		root = root.getSubNode(0).getSubNode(0);
129

  
130
		String prefix = new StringTokenizer(root.getName(), ":").nextToken();
131
		if (prefix.equals(root.getName())) {
132
			prefix = "";
133
		} else {
134
			prefix = prefix + ":";
135
		}        
136
		int numberOfRecords = getNumberOfRecords(root,
137
				prefix + "numberOfRecords",
138
				null);
139

  
140
		if (numberOfRecords == -1) {
141
			return null;
142
		}   
143
		GetRecordsReply recordsReply = new GetRecordsReply(numberOfRecords);
144

  
145
		parseRecords(root,recordsReply,uri,prefix,numberOfRecords,firstRecord);		
146
		return recordsReply;
147
	} 
148

  
149
	/**
150
	 * Parser the XML
151
	 * @param node
152
	 * @param recordsReply
153
	 * @param uri
154
	 * @param prefix
155
	 * @param numberOfRecords
156
	 * @param firstRecord
157
	 */
158
	private void parseRecords(XMLNode node, GetRecordsReply recordsReply, URI uri, String prefix, int numberOfRecords, int firstRecord) {        
159

  
160
		XMLNode[] auxNodes = XMLTree.searchMultipleNode(node,
161
				prefix + "records->" + prefix + "record");
162
		for (int i = 1;	(i <= numberOfRecords) && (i <= 10) &&	(i <= (numberOfRecords - firstRecord + 1)); i++){
163
			recordsReply.addRecord(uri, auxNodes[i - 1]);
164
		}
165

  
166
	} 
167

  
168
	/**
169
	 * 
170
	 * 
171
	 * 
172
	 * @return Returns the recordXPath.
173
	 */
174
	public String getRecordXPath() {        
175
		return recordXPath;
176
	} 
177

  
178
	/**
179
	 * 
180
	 * 
181
	 * 
182
	 * @param recordXPath The recordXPath to set.
183
	 */
184
	public void setRecordXPath(String recordXPath) {        
185
		this.recordXPath = recordXPath;
186
	} 
187

  
188
	/**
189
	 * 
190
	 * 
191
	 * 
192
	 * @return Returns the resultSetTTL.
193
	 */
194
	public String getResultSetTTL() {        
195
		return resultSetTTL;
196
	} 
197

  
198
	/**
199
	 * 
200
	 * 
201
	 * 
202
	 * @param resultSetTTL The resultSetTTL to set.
203
	 */
204
	public void setResultSetTTL(String resultSetTTL) {        
205
		this.resultSetTTL = resultSetTTL;
206
	} 
207

  
208
	/**
209
	 * 
210
	 * 
211
	 * 
212
	 * @return Returns the version.
213
	 */
214
	public String getVersion() {        
215
		return version;
216
	} 
217

  
218
	/**
219
	 * 
220
	 * 
221
	 * 
222
	 * @param version The version to set.
223
	 */
224
	public void setVersion(String version) {        
225
		this.version = version;
226
	} 
227

  
228
	/*
229
	 * (non-Javadoc)
230
	 * @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#isProtocolSupported(java.net.URI)
231
	 */
232
	public boolean isProtocolSupported(URI uri) {        
233
		return SOAPProtocol.isProtocolSupported(null);
234
	} 
235

  
236
	/*
237
	 * (non-Javadoc)
238
	 * @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getServiceName()
239
	 */
240
	public String getServiceName() {
241
		return ServerData.SERVER_SUBTYPE_CATALOG_SRW;
242
	}
243

  
244
	/*
245
	 * (non-Javadoc)
246
	 * @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getDefaultPort()
247
	 */
248
	public int getDefaultPort() {		
249
		return 80;
250
	}
251

  
252
	/*
253
	 * (non-Javadoc)
254
	 * @see es.gva.cit.catalogClient.drivers.ICatalogServiceDriver#getDefaultSchema()
255
	 */
256
	public String getDefaultSchema() {
257
		return "http";
258
	} 
259
}
0 260

  
tags/v2_0_0_Build_2047/applications/appCatalog/appCatalog/src/org/gvsig/catalog/srw/drivers/SRWMessages.java
1

  
2
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
3
*
4
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
5
*
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
19
*
20
* For more information, contact:
21
*
22
*  Generalitat Valenciana
23
*   Conselleria d'Infraestructures i Transport
24
*   Av. Blasco Ib??ez, 50
25
*   46010 VALENCIA
26
*   SPAIN
27
*
28
*      +34 963862235
29
*   gvsig@gva.es
30
*      www.gvsig.gva.es
31
*
32
*    or
33
*
34
*   IVER T.I. S.A
35
*   Salamanca 50
36
*   46005 Valencia
37
*   Spain
38
*
39
*   +34 963163400
40
*   dac@iver.es
41
*/
42
/*
43
* CVS MESSAGES:
44
*
45
* $Id: SRWMessages.java 585 2007-09-03 10:21:55 +0000 (Mon, 03 Sep 2007) jpiera $
46
* $Log$
47
* Revision 1.6.10.1  2007/07/10 11:18:04  jorpiell
48
* Added the registers
49
*
50
* Revision 1.6  2006/03/21 07:13:52  jorpiell
51
* El gazetteer ya reproyecta. Se han tenido que modificar los parsers de todos los protocolos.
52
*
53
* Revision 1.4.2.2  2006/03/14 07:18:45  jorpiell
54
* Se ha a?adido la goma de borrar y se ha cambiado el tama?o de los botones
55
*
56
* Revision 1.5  2006/03/01 13:23:20  jorpiell
57
* Se ha a?adido al Head lo de la 0.6 y se ha hecho un commit
58
*
59
* Revision 1.4.2.1  2006/02/02 13:44:59  jorpiell
60
* Se ha tenido que cambiar el driver SRW para acceder al servidor de cat?logo de la IDEE. Adem?s se ha creado un nuevo filtro para este servidor
61
*
62
* Revision 1.4  2006/01/12 13:52:24  jorpiell
63
* Se ha a?adido un boton close en las dos pantallas de connect. Adem?s se ha cambiado el comportamiento de las ventanas para adaptarlo a la nueva forma de buscar multihilo
64
*
65
* Revision 1.3  2006/01/10 17:23:23  jorpiell
66
* Se ha hecho una peque?a modificaci?n en el gazeteer: ahora funcionan las b?squedas restringiendo el ?rea en el WFSG. Hay muchos cambios porque se ha hecho un CONTROL+SHIFT+O sobre todo el proyecto para eliminar los imports y para ordenarlos
67
*
68
* Revision 1.2  2006/01/10 09:32:49  jorpiell
69
* Se ha echo un commit de las versiones modificadas del catalogo y del gazetteer usando el Poseidon. Se han renombrado algunas clases por considerar que tenian un nombre confuso y se han cambiado algunas relaciones entre clases (con la intenci?n de separar GUI de la parte de control). Han habido clases que no han sido tocadas, pero como han sido formateadas usando el Poseidon TODAS las CLASES del proyecto han cambiado de versi?n.
70
*
71
* Revision 1.1  2005/12/22 08:31:43  jorpiell
72
* Aqui tambien se han producido muchos cambis, porque hemos acabado de cambiar la estructura del cat?logo: Se han creado todas las clases "XXXMessages", que sacan toda la parte de los mensajes de los drivers. Ademas se ha incluido en "CatalogClient" la operaci?n "getCapabilities", que libera a la interfaz de algunas operaciones que hac?a anteriormente.
73
*
74
*
75
*/
76
package org.gvsig.catalog.srw.drivers;
77
import org.apache.commons.httpclient.NameValuePair;
78
import org.gvsig.catalog.drivers.IProtocolMessages;
79
import org.gvsig.catalog.protocols.SOAPProtocol;
80
import org.gvsig.catalog.querys.CatalogQuery;
81
import org.gvsig.catalog.srw.filters.IDEESRWFilter;
82
import org.gvsig.catalog.srw.filters.SRWFilter;
83

  
84

  
85
/**
86
 * This class create the SRW protocol messages
87
 * 
88
 * 
89
 * @author Jorge Piera Llodra (piera_jor@gva.es)
90
 */
91
public class SRWMessages implements IProtocolMessages {
92
/**
93
 * 
94
 * 
95
 */
96
    private SRWCatalogServiceDriver driver;
97

  
98
/**
99
 * 
100
 * 
101
 * 
102
 * @param driver 
103
 */
104
    public  SRWMessages(SRWCatalogServiceDriver driver) {        
105
        this.driver = driver;
106
    } 
107

  
108
/**
109
 * 
110
 * 
111
 * 
112
 * @return 
113
 * @param upper 
114
 */
115
    public NameValuePair[] getHTTPGETCapabilities(boolean upper) {        
116
     NameValuePair nvp1 = new NameValuePair("OPERATION", "explain");
117
     NameValuePair nvp2 = new NameValuePair("VERSION", driver.getVersion());
118
        return new NameValuePair[] { nvp1, nvp2 };
119
    } 
120

  
121
/**
122
 * 
123
 * 
124
 * 
125
 * @return 
126
 */
127
    public NameValuePair[] getHTTPGETDescribeRecords() {        
128
        // TODO Auto-generated method stub
129
        return null;
130
    } 
131

  
132
/**
133
 * 
134
 * 
135
 * 
136
 * @return 
137
 * @param query 
138
 * @param firstRecord 
139
 */
140
    public NameValuePair[] getHTTPGETRecords(CatalogQuery query, int firstRecord) {        
141
       
142
        NameValuePair nvp1 = new NameValuePair("operation", "searchRetrieve");
143
        NameValuePair nvp2 = new NameValuePair("version", driver.getVersion());
144
        NameValuePair nvp3 = new NameValuePair("query", new SRWFilter().getQuery(query));
145
        NameValuePair nvp4 = new NameValuePair("maximumRecords", "10");
146
        NameValuePair nvp5 = new NameValuePair("recordPacking",
147
                driver.getOutputFormat());
148
        NameValuePair nvp6 = new NameValuePair("startRecord",
149
                new String(new Integer(firstRecord).toString()));
150
        return new NameValuePair[] { nvp1, nvp2, nvp3, nvp4, nvp5, nvp6 };
151
    } 
152

  
153
/**
154
 * 
155
 * 
156
 * 
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff