Revision 37871
branches/v2_0_0_prep/extensions/extGazetteer/src/org/gvsig/gazetteer/gui/ConnectDialog.java | ||
---|---|---|
80 | 80 |
} |
81 | 81 |
|
82 | 82 |
public static void addServer(ServerData server) { |
83 |
ServerConnectDialogPanel.addTreeMapServer(server);
|
|
83 |
addTreeMapServer(server); |
|
84 | 84 |
} |
85 | 85 |
|
86 | 86 |
/* |
branches/v2_0_0_prep/extensions/extGazetteer/src/org/gvsig/gazetteer/GazetteerExtension.java | ||
---|---|---|
57 | 57 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
58 | 58 |
*/ |
59 | 59 |
public class GazetteerExtension extends Extension { |
60 |
// private GazetteerLibrary gazetteerLibrary = null; |
|
61 |
// private DefaultGazetteerLibrary defaultGazetteerLibrary = null; |
|
62 | 60 |
|
63 | 61 |
public static void main(String[] args) { |
62 |
|
|
64 | 63 |
} |
65 | 64 |
|
66 |
/* |
|
67 |
* (non-Javadoc) |
|
68 |
* |
|
69 |
* @see com.iver.andami.plugins.Extension#inicializar() |
|
70 |
*/ |
|
71 | 65 |
public void initialize() { |
72 |
// gazetteerLibrary = new GazetteerLibrary(); |
|
73 |
// gazetteerLibrary.initialize(); |
|
74 |
// |
|
75 |
// defaultGazetteerLibrary = new DefaultGazetteerLibrary(); |
|
76 |
// defaultGazetteerLibrary.initialize(); |
|
77 | 66 |
registerIcons(); |
78 | 67 |
} |
79 | 68 |
|
... | ... | |
84 | 73 |
"images/GazzButton.png")); |
85 | 74 |
} |
86 | 75 |
|
87 |
/* |
|
88 |
* (non-Javadoc) |
|
89 |
* |
|
90 |
* @see com.iver.andami.plugins.Extension#postInitialize() |
|
91 |
*/ |
|
92 | 76 |
public void postInitialize() { |
93 |
// gazetteerLibrary.postInitialize(); |
|
94 |
// defaultGazetteerLibrary.postInitialize(); |
|
77 |
|
|
95 | 78 |
} |
96 | 79 |
|
97 |
/* |
|
98 |
* (non-Javadoc) |
|
99 |
* |
|
100 |
* @see com.iver.andami.plugins.Extension#execute(java.lang.String) |
|
101 |
*/ |
|
102 | 80 |
public void execute(String actionCommand) { |
103 |
// JToolBar toolBar = |
|
104 |
// (JToolBar)PluginServices.getMainFrame().getComponentByName("Catalogo"); |
|
105 |
// System.out.println("gjkmgbghb"); |
|
106 |
// for (int i=0 ; i<toolBar.getComponentCount() ; i++){ |
|
107 |
// System.out.println(((JButton)toolBar.getComponentAtIndex(i)).getName()); |
|
108 |
// } |
|
109 | 81 |
actionConnectDialogStart(); |
110 | 82 |
} |
111 | 83 |
|
112 |
/** |
|
113 |
* |
|
114 |
* |
|
115 |
*/ |
|
116 | 84 |
private void actionConnectDialogStart() { |
117 | 85 |
System.out.println("Bot?n de Gazeteer pulsado"); |
118 | 86 |
restoreServerList(); |
... | ... | |
162 | 130 |
* @return |
163 | 131 |
*/ |
164 | 132 |
private ServerData[] getDefaultServers() { |
165 |
ServerData[] servers = new ServerData[3];
|
|
133 |
ServerData[] servers = new ServerData[0];
|
|
166 | 134 |
Calendar cal = new GregorianCalendar(); |
167 | 135 |
Date date = cal.getTime(); |
168 | 136 |
|
169 |
servers[0] = new ServerData( |
|
170 |
"http://middleware.alexandria.ucsb.edu/gaz/adlgaz/dispatch",
|
|
171 |
date, date, ServerData.SERVER_TYPE_GAZETTEER, |
|
172 |
ServerData.SERVER_SUBTYPE_GAZETTEER_ADL); |
|
173 |
servers[1] = new ServerData( |
|
174 |
"http://demo.deegree.org:8080/gazetteer/wfs-g", date, date, |
|
175 |
ServerData.SERVER_TYPE_GAZETTEER, |
|
176 |
ServerData.SERVER_SUBTYPE_GAZETTEER_WFSG); |
|
177 |
servers[2] = new ServerData( |
|
178 |
"http://193.144.250.29/webservices/services/IDEC_GeoServeisPort",
|
|
179 |
date, date, ServerData.SERVER_TYPE_GAZETTEER, |
|
180 |
ServerData.SERVER_SUBTYPE_GAZETTEER_IDEC); |
|
137 |
// servers[0] = new ServerData(
|
|
138 |
// "httpdescargamedee://middleware.alexandria.ucsb.edu/gaz/adlgaz/dispatch",
|
|
139 |
// date, date, ServerData.SERVER_TYPE_GAZETTEER,
|
|
140 |
// ServerData.SERVER_SUBTYPE_GAZETTEER_ADL);
|
|
141 |
// servers[1] = new ServerData(
|
|
142 |
// "http://demo.deegree.org:8080/gazetteer/wfs-g", date, date,
|
|
143 |
// ServerData.SERVER_TYPE_GAZETTEER,
|
|
144 |
// ServerData.SERVER_SUBTYPE_GAZETTEER_WFSG);
|
|
145 |
// servers[2] = new ServerData(
|
|
146 |
// "http://delta.icc.es/webservices/services/IDEC_GeoServeisPort",
|
|
147 |
// date, date, ServerData.SERVER_TYPE_GAZETTEER,
|
|
148 |
// ServerData.SERVER_SUBTYPE_GAZETTEER_IDEC);
|
|
181 | 149 |
|
182 | 150 |
return servers; |
183 | 151 |
} |
184 | 152 |
|
185 |
/* |
|
186 |
* (non-Javadoc) |
|
187 |
* |
|
188 |
* @see com.iver.andami.plugins.Extension#isEnabled() |
|
189 |
*/ |
|
190 | 153 |
public boolean isEnabled() { |
191 | 154 |
return true; |
192 | 155 |
} |
193 | 156 |
|
194 |
/* |
|
195 |
* (non-Javadoc) |
|
196 |
* |
|
197 |
* @see com.iver.andami.plugins.Extension#isVisible() |
|
198 |
*/ |
|
199 | 157 |
public boolean isVisible() { |
200 | 158 |
org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices |
201 | 159 |
.getMDIManager().getActiveWindow(); |
branches/v2_0_0_prep/extensions/extCatalog/src/org/gvsig/catalog/CatalogClientExtension.java | ||
---|---|---|
181 | 181 |
* @return |
182 | 182 |
*/ |
183 | 183 |
private ServerData[] getDefaultServers() { |
184 |
ServerData[] servers = new ServerData[4];
|
|
184 |
ServerData[] servers = new ServerData[0];
|
|
185 | 185 |
Calendar cal = new GregorianCalendar(); |
186 | 186 |
Date date = cal.getTime(); |
187 | 187 |
|
188 |
servers[0] = new ServerData("http://delta.icc.es/indicio/csw", date, date, ServerData.SERVER_TYPE_CATALOG, ServerData.SERVER_SUBTYPE_CATALOG_CSW); |
|
189 |
servers[1] = new ServerData("mapas.euitto.upm.es:2100", date, date, ServerData.SERVER_TYPE_CATALOG, ServerData.SERVER_SUBTYPE_CATALOG_Z3950); |
|
190 |
servers[2] = new ServerData("193.43.36.137:2100", date, date, ServerData.SERVER_TYPE_CATALOG, ServerData.SERVER_SUBTYPE_CATALOG_Z3950); |
|
191 |
servers[3] = new ServerData("http://idee.unizar.es/SRW/servlet/search/ExplainSOAP",date,date,ServerData.SERVER_TYPE_CATALOG,ServerData.SERVER_SUBTYPE_CATALOG_SRW); |
|
188 |
//servers[0] = new ServerData("http://delta.icc.es/indicio/csw", date, date, ServerData.SERVER_TYPE_CATALOG, ServerData.SERVER_SUBTYPE_CATALOG_CSW);
|
|
189 |
//servers[1] = new ServerData("mapas.euitto.upm.es:2100", date, date, ServerData.SERVER_TYPE_CATALOG, ServerData.SERVER_SUBTYPE_CATALOG_Z3950);
|
|
190 |
//servers[2] = new ServerData("193.43.36.137:2100", date, date, ServerData.SERVER_TYPE_CATALOG, ServerData.SERVER_SUBTYPE_CATALOG_Z3950);
|
|
191 |
//servers[3] = new ServerData("http://idee.unizar.es/SRW/servlet/search/ExplainSOAP",date,date,ServerData.SERVER_TYPE_CATALOG,ServerData.SERVER_SUBTYPE_CATALOG_SRW);
|
|
192 | 192 |
return servers; |
193 | 193 |
} |
194 | 194 |
|
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/exceptions/NotSupportedVersionException.java | ||
---|---|---|
48 | 48 |
/** |
49 | 49 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
50 | 50 |
*/ |
51 |
public class NotSupportedVersionException extends Exception{ |
|
51 |
public class NotSupportedVersionException extends DiscoveryServiceException{
|
|
52 | 52 |
|
53 | 53 |
public NotSupportedVersionException(Throwable cause) { |
54 | 54 |
super(cause); |
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/exceptions/DiscoveryServiceException.java | ||
---|---|---|
1 |
/* gvSIG. Geographic Information System of the Valencian Government |
|
2 |
* |
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department |
|
4 |
* of the Valencian Government (CIT) |
|
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., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
*/ |
|
22 |
package org.gvsig.catalog.exceptions; |
|
23 |
|
|
24 |
import org.gvsig.tools.exception.BaseException; |
|
25 |
|
|
26 |
|
|
27 |
/** |
|
28 |
* @author gvSIG Team |
|
29 |
* @version $Id$ |
|
30 |
* |
|
31 |
*/ |
|
32 |
public class DiscoveryServiceException extends BaseException { |
|
33 |
private static final long serialVersionUID = -2033440799086244875L; |
|
34 |
|
|
35 |
private static final String MESSAGE = |
|
36 |
"Error connecting to a catalog service"; |
|
37 |
|
|
38 |
private static final String KEY = "_CatalogException"; |
|
39 |
|
|
40 |
/** |
|
41 |
* Constructor to be used in rare cases, usually you must create a new child |
|
42 |
* exception class for each case. |
|
43 |
* <strong>Don't use this constructor in child classes.</strong> |
|
44 |
*/ |
|
45 |
public DiscoveryServiceException() { |
|
46 |
super(MESSAGE, KEY, serialVersionUID); |
|
47 |
} |
|
48 |
|
|
49 |
/** |
|
50 |
* Constructor to be used in rare cases, usually you must create a new child |
|
51 |
* exception class for each case. |
|
52 |
* <p> |
|
53 |
* <strong>Don't use this constructor in child classes.</strong> |
|
54 |
* </p> |
|
55 |
* |
|
56 |
* @param cause |
|
57 |
* the original cause of the exception |
|
58 |
*/ |
|
59 |
public DiscoveryServiceException(Throwable cause) { |
|
60 |
super(MESSAGE, cause, KEY, serialVersionUID); |
|
61 |
} |
|
62 |
|
|
63 |
/** |
|
64 |
* @see BaseException#BaseException(String, String, long). |
|
65 |
* @param message |
|
66 |
* the default messageFormat to describe the exception |
|
67 |
* @param key |
|
68 |
* the key to use to search a localized messageFormnata |
|
69 |
* @param code |
|
70 |
* the unique code to identify the exception |
|
71 |
*/ |
|
72 |
protected DiscoveryServiceException(String message, String key, long code) { |
|
73 |
super(message, key, code); |
|
74 |
} |
|
75 |
|
|
76 |
/** |
|
77 |
* @see BaseException#BaseException(String, Throwable, String, long). |
|
78 |
* @param message |
|
79 |
* the default messageFormat to describe the exception |
|
80 |
* @param cause |
|
81 |
* the original cause of the exception |
|
82 |
* @param key |
|
83 |
* the key to use to search a localized messageFormnata |
|
84 |
* @param code |
|
85 |
* the unique code to identify the exception |
|
86 |
*/ |
|
87 |
protected DiscoveryServiceException(String message, Throwable cause, |
|
88 |
String key, long code) { |
|
89 |
super(message, cause, key, code); |
|
90 |
} |
|
91 |
} |
|
0 | 92 |
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/exceptions/NotSupportedProtocolException.java | ||
---|---|---|
51 | 51 |
/** |
52 | 52 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
53 | 53 |
*/ |
54 |
public class NotSupportedProtocolException extends Exception { |
|
54 |
public class NotSupportedProtocolException extends DiscoveryServiceException {
|
|
55 | 55 |
|
56 |
public NotSupportedProtocolException() { |
|
57 |
super(); |
|
58 |
} |
|
59 |
|
|
56 | 60 |
public NotSupportedProtocolException(Throwable cause) { |
57 | 61 |
super(cause); |
58 | 62 |
} |
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/exceptions/ServerIsNotReadyException.java | ||
---|---|---|
52 | 52 |
* This exception indicates that the server is not ready |
53 | 53 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
54 | 54 |
*/ |
55 |
public class ServerIsNotReadyException extends Exception { |
|
55 |
public class ServerIsNotReadyException extends DiscoveryServiceException {
|
|
56 | 56 |
private static final long serialVersionUID = 397526568003318327L; |
57 | 57 |
|
58 | 58 |
public ServerIsNotReadyException(Throwable cause) { |
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/protocols/HTTPGetProtocol.java | ||
---|---|---|
45 | 45 |
import java.util.Collection; |
46 | 46 |
|
47 | 47 |
import org.apache.commons.httpclient.NameValuePair; |
48 |
import org.slf4j.Logger; |
|
49 |
import org.slf4j.LoggerFactory; |
|
50 |
|
|
48 | 51 |
import org.gvsig.catalog.metadataxml.XMLTree; |
49 | 52 |
import org.gvsig.remoteclient.utils.Utilities; |
50 | 53 |
|
... | ... | |
56 | 59 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
57 | 60 |
*/ |
58 | 61 |
public class HTTPGetProtocol implements IProtocols { |
59 |
|
|
62 |
private static final Logger LOG = |
|
63 |
LoggerFactory.getLogger(HTTPGetProtocol.class); |
|
64 |
|
|
60 | 65 |
/** |
61 | 66 |
* |
62 | 67 |
* |
... | ... | |
79 | 84 |
"catalog-", null); |
80 | 85 |
|
81 | 86 |
} catch (Exception e) { |
82 |
return null; |
|
87 |
LOG.error("Error sending the request", e); |
|
88 |
return null; |
|
83 | 89 |
} |
84 | 90 |
|
85 | 91 |
Collection col = new java.util.ArrayList(); |
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/protocols/SOAPProtocol.java | ||
---|---|---|
1 | 1 |
|
2 | 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 |
*/ |
|
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 | 42 |
package org.gvsig.catalog.protocols; |
43 | 43 |
import java.io.BufferedReader; |
44 | 44 |
import java.io.ByteArrayInputStream; |
... | ... | |
56 | 56 |
import org.apache.soap.messaging.Message; |
57 | 57 |
import org.apache.soap.transport.SOAPTransport; |
58 | 58 |
import org.apache.soap.util.xml.XMLParserUtils; |
59 |
import org.gvsig.catalog.metadataxml.XMLTree; |
|
59 |
import org.slf4j.Logger; |
|
60 |
import org.slf4j.LoggerFactory; |
|
60 | 61 |
import org.w3c.dom.Document; |
61 | 62 |
import org.xml.sax.InputSource; |
62 | 63 |
|
64 |
import org.gvsig.catalog.metadataxml.XMLTree; |
|
63 | 65 |
|
66 |
|
|
64 | 67 |
/** |
65 | 68 |
* |
66 | 69 |
* |
... | ... | |
68 | 71 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
69 | 72 |
*/ |
70 | 73 |
public class SOAPProtocol implements IProtocols { |
71 |
|
|
72 |
/** |
|
73 |
* |
|
74 |
* |
|
75 |
* |
|
76 |
* @return |
|
77 |
* @param url |
|
78 |
* @param object |
|
79 |
* @param firstRecord |
|
80 |
*/ |
|
81 |
public Collection doQuery(URL url, Object object, int firstRecord) { |
|
74 |
private static final Logger LOG = |
|
75 |
LoggerFactory.getLogger(SOAPProtocol.class); |
|
76 |
|
|
77 |
/** |
|
78 |
* @return |
|
79 |
* @param url |
|
80 |
* @param object |
|
81 |
* @param firstRecord |
|
82 |
*/ |
|
83 |
public Collection doQuery(URL url, Object object, int firstRecord) { |
|
82 | 84 |
String message = (String) object; |
83 | 85 |
File fileAnswer = null; |
84 |
|
|
86 |
|
|
85 | 87 |
//get the envelope to send |
86 | 88 |
try { |
87 | 89 |
InputStream buffer = new ByteArrayInputStream(message.getBytes()); |
... | ... | |
89 | 91 |
Document doc = xdb.parse(new InputSource(buffer)); |
90 | 92 |
if (doc == null) { |
91 | 93 |
throw new SOAPException(Constants.FAULT_CODE_CLIENT, |
92 |
"parsing error");
|
|
94 |
"parsing error"); |
|
93 | 95 |
} |
94 | 96 |
Envelope msgEnv = Envelope.unmarshall(doc.getDocumentElement()); |
95 | 97 |
// send the message |
... | ... | |
110 | 112 |
fwAnswer.flush(); |
111 | 113 |
} |
112 | 114 |
fwAnswer.close(); |
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
115 | 117 |
} catch (Exception e) { |
118 |
LOG.error("Error sending the SOAP request", e); |
|
116 | 119 |
return null; |
117 | 120 |
} |
118 | 121 |
Collection col = new java.util.ArrayList(); |
... | ... | |
120 | 123 |
return col; |
121 | 124 |
} |
122 | 125 |
|
123 |
/** |
|
124 |
* |
|
125 |
* |
|
126 |
* |
|
127 |
* @return |
|
128 |
* @param url |
|
129 |
*/ |
|
126 |
/**
|
|
127 |
*
|
|
128 |
*
|
|
129 |
*
|
|
130 |
* @return
|
|
131 |
* @param url
|
|
132 |
*/
|
|
130 | 133 |
public static boolean isProtocolSupported(URL url) { |
131 | 134 |
return true; |
132 | 135 |
} |
133 | 136 |
|
134 |
/** |
|
135 |
* This function returns a SOAP message |
|
136 |
* |
|
137 |
* |
|
138 |
* @return |
|
139 |
* @param message the XML message |
|
140 |
* @param schemas |
|
141 |
*/ |
|
137 |
/**
|
|
138 |
* This function returns a SOAP message
|
|
139 |
*
|
|
140 |
*
|
|
141 |
* @return
|
|
142 |
* @param message the XML message
|
|
143 |
* @param schemas
|
|
144 |
*/
|
|
142 | 145 |
public static String setSOAPMessage(String message, String[] schemas) { |
143 | 146 |
String soap = "<SOAP:Envelope xmlns:SOAP=\"http://schemas.xmlsoap.org/soap/envelope/\" " + |
144 |
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" ;
|
|
147 |
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" ; |
|
145 | 148 |
if (schemas != null){ |
146 | 149 |
for (int i=0 ; i<schemas.length ; i++){ |
147 | 150 |
soap = soap + " " + schemas[i]; |
... | ... | |
150 | 153 |
soap = soap + ">"; |
151 | 154 |
soap = soap + "<SOAP:Body>" + message + "</SOAP:Body>" + "</SOAP:Envelope>"; |
152 | 155 |
return soap; |
153 |
|
|
156 |
|
|
154 | 157 |
} |
155 |
} |
|
158 |
} |
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/protocols/HTTPPostProtocol.java | ||
---|---|---|
50 | 50 |
import java.net.URL; |
51 | 51 |
import java.util.Collection; |
52 | 52 |
|
53 |
import org.slf4j.Logger; |
|
54 |
import org.slf4j.LoggerFactory; |
|
55 |
|
|
53 | 56 |
import org.gvsig.catalog.metadataxml.XMLTree; |
54 | 57 |
import org.gvsig.catalog.utils.Strings; |
55 | 58 |
|
... | ... | |
61 | 64 |
* @author Jorge Piera Llodra (piera_jor@gva.es) |
62 | 65 |
*/ |
63 | 66 |
public class HTTPPostProtocol implements IProtocols { |
64 |
|
|
65 |
/** |
|
66 |
* @return |
|
67 |
* @param url |
|
68 |
* @param message |
|
69 |
* @param firstRecord |
|
70 |
*/ |
|
67 |
private static final Logger LOG = |
|
68 |
LoggerFactory.getLogger(HTTPPostProtocol.class); |
|
69 |
|
|
70 |
/** |
|
71 |
* @return |
|
72 |
* @param url |
|
73 |
* @param message |
|
74 |
* @param firstRecord |
|
75 |
*/ |
|
71 | 76 |
public Collection doQuery(URL url, Object message, int firstRecord) { |
72 | 77 |
String body = (String) message; |
73 | 78 |
ByteArrayInputStream output = null; |
... | ... | |
103 | 108 |
output = new ByteArrayInputStream(str.getBytes()); |
104 | 109 |
|
105 | 110 |
} catch (IOException e) { |
106 |
// TODO Auto-generated catch block |
|
107 |
//e.printStackTrace(); |
|
111 |
LOG.error("Error sending the POST request", e); |
|
108 | 112 |
return null; |
109 | 113 |
} |
110 | 114 |
|
... | ... | |
148 | 152 |
|
149 | 153 |
|
150 | 154 |
} catch (IOException e) { |
151 |
e.printStackTrace();
|
|
155 |
LOG.error("Error sending the POST request", e);
|
|
152 | 156 |
} |
153 | 157 |
|
154 | 158 |
} |
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/DiscoveryServiceClient.java | ||
---|---|---|
10 | 10 |
import java.util.Properties; |
11 | 11 |
|
12 | 12 |
import org.apache.commons.httpclient.HttpConnection; |
13 |
|
|
13 | 14 |
import org.gvsig.catalog.drivers.DiscoveryServiceCapabilities; |
14 | 15 |
import org.gvsig.catalog.drivers.IDiscoveryServiceDriver; |
16 |
import org.gvsig.catalog.exceptions.DiscoveryServiceException; |
|
15 | 17 |
import org.gvsig.catalog.exceptions.NotSupportedProtocolException; |
16 | 18 |
import org.gvsig.catalog.exceptions.NotSupportedVersionException; |
17 | 19 |
import org.gvsig.catalog.exceptions.ServerIsNotReadyException; |
18 | 20 |
import org.gvsig.catalog.querys.DiscoveryServiceQuery; |
19 | 21 |
import org.gvsig.catalog.ui.search.SearchAditionalPropertiesPanel; |
20 | 22 |
import org.gvsig.catalog.utils.URIUtils; |
21 |
import org.gvsig.utils.swing.jcomboServer.ServerData; |
|
22 | 23 |
|
23 | 24 |
|
24 | 25 |
|
... | ... | |
109 | 110 |
* @return the service version |
110 | 111 |
* @throws ServerIsNotReadyException |
111 | 112 |
*/ |
112 |
public DiscoveryServiceCapabilities getCapabilities() throws ServerIsNotReadyException {
|
|
113 |
public DiscoveryServiceCapabilities getCapabilities() throws DiscoveryServiceException {
|
|
113 | 114 |
if (serverIsReady()){ |
114 | 115 |
try { |
115 | 116 |
if (getDriver().isProtocolSupported(getUri())) { |
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/ui/serverconnect/ServerConnectPanel.java | ||
---|---|---|
328 | 328 |
setProtocol(server.getServiceSubType()); |
329 | 329 |
} |
330 | 330 |
} |
331 |
|
|
332 |
public void updateServerByProtocol(){ |
|
333 |
IDiscoveryServiceDriver discoveryServiceDriver = |
|
334 |
(IDiscoveryServiceDriver)protocolCombo.getSelectedItem(); |
|
335 |
if (discoveryServiceDriver != null){ |
|
336 |
ServerData serverData = discoveryServiceDriver.getOneServer(); |
|
337 |
if (serverData != null){ |
|
338 |
serverCombo.setSelectedItem(serverData); |
|
339 |
} |
|
340 |
} |
|
341 |
} |
|
331 | 342 |
|
332 | 343 |
/** |
333 | 344 |
* @return the selected server |
branches/v2_0_0_prep/applications/appCatalog/src/org/gvsig/catalog/drivers/IDiscoveryServiceDriver.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.net.URI; |
4 | 4 |
|
5 |
import org.gvsig.catalog.exceptions.DiscoveryServiceException; |
|
5 | 6 |
import org.gvsig.catalog.exceptions.NotSupportedProtocolException; |
6 |
import org.gvsig.catalog.exceptions.NotSupportedVersionException; |
|
7 | 7 |
import org.gvsig.catalog.querys.DiscoveryServiceQuery; |
8 | 8 |
import org.gvsig.catalog.ui.search.SearchAditionalPropertiesPanel; |
9 | 9 |
import org.gvsig.utils.swing.jcomboServer.ServerData; |
... | ... | |
65 | 65 |
* @return Node with the server answer. |
66 | 66 |
* @param uri Server URI |
67 | 67 |
*/ |
68 |
public DiscoveryServiceCapabilities getCapabilities(URI uri) throws NotSupportedVersionException;
|
|
68 |
public DiscoveryServiceCapabilities getCapabilities(URI uri) throws DiscoveryServiceException;
|
|
69 | 69 |
|
70 | 70 |
/** |
71 | 71 |
* It have to prove if the specified protocol is supported. |
branches/v2_0_0_prep/applications/appGazetteer/src/org/gvsig/gazetteer/ui/serverconnect/ServerConnectDialogPanel.java | ||
---|---|---|
83 | 83 |
protected String serversFile = "servers/GazetteerServers.txt"; |
84 | 84 |
protected String currentServer = ""; |
85 | 85 |
private ConnectThread connectThread = null; |
86 |
protected boolean isUpdating = false; |
|
86 | 87 |
|
87 | 88 |
/** |
88 | 89 |
* Constructor |
... | ... | |
173 | 174 |
public void actionPerformed(ActionEvent e) { |
174 | 175 |
if (e.getActionCommand().compareTo(CatalogConstants.CONNECT_BUTTON_ACTION_COMMAND)==0) { |
175 | 176 |
connectButtonActionPerformed(); |
176 |
} |
|
177 |
if (e.getActionCommand().compareTo(CatalogConstants.SEARCH_BUTTON_ACTION_COMMAND)==0) { |
|
177 |
}else if (e.getActionCommand().compareTo(CatalogConstants.SEARCH_BUTTON_ACTION_COMMAND)==0) { |
|
178 | 178 |
searchButtonActionPerformed(); |
179 |
} |
|
180 |
if (e.getActionCommand().compareTo(CatalogConstants.CLOSE_BUTTON_ACTION_COMMAND)==0) { |
|
179 |
}else if (e.getActionCommand().compareTo(CatalogConstants.CLOSE_BUTTON_ACTION_COMMAND)==0) { |
|
181 | 180 |
closeButtonActionPerformed(); |
181 |
}else if (e.getActionCommand().compareTo(CatalogConstants.PROTOCOL_COMBO_ACTION_COMMAND)==0){ |
|
182 |
if (!isUpdating){ |
|
183 |
isUpdating = true; |
|
184 |
controlsPanel.updateServerByProtocol(); |
|
185 |
isUpdating = false; |
|
186 |
} |
|
187 |
}else if (e.getActionCommand().compareTo(CatalogConstants.SERVER_COMBO_ACTION_COMMAND)==0) { |
|
188 |
if (!isUpdating){ |
|
189 |
isUpdating = true; |
|
190 |
controlsPanel.updateProtocol(); |
|
191 |
isUpdating = false; |
|
192 |
} |
|
182 | 193 |
} |
183 |
if (e.getActionCommand().compareTo(CatalogConstants.PROTOCOL_COMBO_ACTION_COMMAND)==0){ |
|
184 |
|
|
185 |
} |
|
186 |
if (e.getActionCommand().compareTo(CatalogConstants.SERVER_COMBO_ACTION_COMMAND)==0) { |
|
187 |
controlsPanel.updateProtocol(); |
|
188 |
} |
|
189 | 194 |
} |
190 | 195 |
|
191 | 196 |
/** |
Also available in: Unified diff