Revision 12750

View differences:

branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/CatalogClient.java
73 73
	/**
74 74
	 * The server status message
75 75
	 */
76
	private String serverStatus = null; 	
76
	private String serverStatus = null; 
77
	private CatalogCapabilities capabilities = null;
77 78
	
78 79
	/**
79 80
	 * Cosntructor
......
108 109
	public CatalogCapabilities getCapabilities() throws ServerIsNotReadyException {        
109 110
		if (serverIsReady()){
110 111
			if (getDriver().isProtocolSupported(getUri())) {
111
				 CatalogCapabilities capabilities = getDriver().getCapabilities(getUri());
112
				 serverStatus = getDriver().getServerAnswerReady();
112
				 capabilities = getDriver().getCapabilities(getUri());
113 113
				 return capabilities;
114 114
			}
115 115
		}
branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/csw/drivers/CSWCatalogServiceDriver.java
102 102
		nodes = new HTTPGetProtocol().doQuery(url, messages.getHTTPGETCapabilities(true), 0);
103 103
		CSWCapabilitiesParserv2_0_0 parser = new CSWCapabilitiesParserv2_0_0(url,this);
104 104
		CatalogCapabilities capabilities = parser.parse((XMLNode)nodes.toArray()[0]);
105
		capabilities.setServerMessage(getServerAnswerReady());
105 106
		return capabilities;
106 107
	} 
107 108

  
branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/ui/serverconnect/ServerConnectDialogPanel.java
60 60
import com.iver.utiles.swing.jcomboServer.ServerData;
61 61

  
62 62
import es.gva.cit.catalogClient.CatalogClient;
63
import es.gva.cit.catalogClient.drivers.CatalogCapabilities;
63 64
import es.gva.cit.catalogClient.drivers.ICatalogServiceDriver;
64 65
import es.gva.cit.catalogClient.ui.search.SearchDialog;
65 66
import es.gva.cit.catalogClient.utils.CatalogClientRegister;
......
267 268
		 */
268 269
		public void run() {        
269 270
			try {
270
				client.getCapabilities();
271
				controlsPanel.enableSearchButton(true);
272
				currentServer = controlsPanel.getServerAddress();
273
				setCursor(new Cursor(Cursor.DEFAULT_CURSOR));   
274
				controlsPanel.setServerReply(client.getServerStatus());
275
				searchButtonActionPerformed();
271
				CatalogCapabilities capabilities = client.getCapabilities();
272
				if (capabilities.isAvailable()){
273
					controlsPanel.enableSearchButton(true);
274
					currentServer = controlsPanel.getServerAddress();
275
					searchButtonActionPerformed();				
276
				} 
277
				setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); 
278
				controlsPanel.setServerReply(capabilities.getServerMessage());
279
				
276 280
			} catch (Exception e) {
277 281
				controlsPanel.setServerReply(Messages.getText(e.toString()));
278 282
				e.printStackTrace();
branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/drivers/DiscoveryServiceCapabilities.java
1
package es.gva.cit.catalogClient.drivers;
2

  
3
import java.util.Properties;
4

  
5
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
6
 *
7
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
22
 *
23
 * For more information, contact:
24
 *
25
 *  Generalitat Valenciana
26
 *   Conselleria d'Infraestructures i Transport
27
 *   Av. Blasco Ib??ez, 50
28
 *   46010 VALENCIA
29
 *   SPAIN
30
 *
31
 *      +34 963862235
32
 *   gvsig@gva.es
33
 *      www.gvsig.gva.es
34
 *
35
 *    or
36
 *
37
 *   IVER T.I. S.A
38
 *   Salamanca 50
39
 *   46005 Valencia
40
 *   Spain
41
 *
42
 *   +34 963163400
43
 *   dac@iver.es
44
 */
45
/* CVS MESSAGES:
46
 *
47
 * $Id$
48
 * $Log$
49
 * Revision 1.1.2.1  2007-07-23 12:52:47  jorpiell
50
 * Refactoring of the capabilities message
51
 *
52
 *
53
 */
54
/**
55
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
56
 */
57
public class DiscoveryServiceCapabilities {
58
	private boolean isAvailable = true;
59
	private String version = null;
60
	private String serverMessage = null;
61
	private Properties properties = null;
62
	
63
	/**
64
	 * @return the isAvailable
65
	 */
66
	public boolean isAvailable() {
67
		return isAvailable;
68
	}
69
	
70
	/**
71
	 * @param isAvailable the isAvailable to set
72
	 */
73
	public void setAvailable(boolean isAvailable) {
74
		this.isAvailable = isAvailable;
75
	}
76
	
77
	/**
78
	 * @return the version
79
	 */
80
	public String getVersion() {
81
		return version;
82
	}
83
	
84
	/**
85
	 * @param version the version to set
86
	 */
87
	public void setVersion(String version) {
88
		this.version = version;
89
	}
90
	
91
	/**
92
	 * @return the serverMessage
93
	 */
94
	public String getServerMessage() {
95
		return serverMessage;
96
	}
97
	
98
	/**
99
	 * @param serverMessage the serverMessage to set
100
	 */
101
	public void setServerMessage(String serverMessage) {
102
		this.serverMessage = serverMessage;
103
	}
104
	
105
	/**
106
	 * @return the properties
107
	 */
108
	public Properties getProperties() {
109
		return properties;
110
	}
111
	
112
	/**
113
	 * @param properties the properties to set
114
	 */
115
	public void setProperties(Properties properties) {
116
		this.properties = properties;
117
	}
118
	
119
}
0 120

  
branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/catalogClient/drivers/CatalogCapabilities.java
46 46
 *
47 47
 * $Id$
48 48
 * $Log$
49
 * Revision 1.1.2.2  2007-07-13 12:00:35  jorpiell
49
 * Revision 1.1.2.3  2007-07-23 12:52:47  jorpiell
50
 * Refactoring of the capabilities message
51
 *
52
 * Revision 1.1.2.2  2007/07/13 12:00:35  jorpiell
50 53
 * Add the posibility to add a new panel
51 54
 *
52 55
 * Revision 1.1.2.1  2007/07/10 11:18:04  jorpiell
......
57 60
/**
58 61
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
59 62
 */
60
public class CatalogCapabilities {
61
	private String version = null;
62
	private Properties properties = null;
63
public class CatalogCapabilities extends DiscoveryServiceCapabilities{
63 64
	
64
	/**
65
	 * @return the version
66
	 */
67
	public String getVersion() {
68
		return version;
69
	}
70 65
	
71
	/**
72
	 * @param version the version to set
73
	 */
74
	public void setVersion(String version) {
75
		this.version = version;
76
	}
77
	
78
	/**
79
	 * @return the properties
80
	 */
81
	public Properties getProperties() {
82
		return properties;
83
	}
84
	
85
	/**
86
	 * @param properties the properties to set
87
	 */
88
	public void setProperties(Properties properties) {
89
		this.properties = properties;
90
	}
91
		
92 66
}
branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/adl/drivers/ADLGazetteerServiceDriver.java
88 88
		new AdlCapabilitiesParser(this).parse((XMLNode)nodes.toArray()[0]);
89 89
		GazetteerCapabilities capabilities = new GazetteerCapabilities();
90 90
		capabilities.setFeatureTypes(getFeatureTypes());
91
		capabilities.setServerMessage(getServerAnswerReady());
91 92
		return capabilities;
92 93
	} 
93 94
	
branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/GazetteerClient.java
118 118
		if (serverIsReady()){
119 119
			if (getDriver().isProtocolSupported(getUri())) {
120 120
				capabilities = getDriver().getCapabilities(getUri());
121
				serverStatus = getDriver().getServerAnswerReady();
122 121
				return capabilities;
123 122
			}
124 123
		}
branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/ui/serverconnect/ServerConnectDialogPanel.java
61 61

  
62 62
import es.gva.cit.catalogClient.utils.CatalogConstants;
63 63
import es.gva.cit.gazetteer.GazetteerClient;
64
import es.gva.cit.gazetteer.drivers.GazetteerCapabilities;
64 65
import es.gva.cit.gazetteer.drivers.IGazetteerServiceDriver;
65 66
import es.gva.cit.gazetteer.ui.search.SearchDialog;
66 67
import es.gva.cit.gazetteer.utils.GazetteerClientRegister;
......
270 271
		 */
271 272
		public void run() {        
272 273
			try {
273
				client.getCapabilities();
274
				controlsPanel.enableSearchButton(true);
275
				currentServer = controlsPanel.getServerAddress();
274
				GazetteerCapabilities capabilities = client.getCapabilities();
275
				if (capabilities.isAvailable()){
276
					controlsPanel.enableSearchButton(true);
277
					currentServer = controlsPanel.getServerAddress();
278
					searchButtonActionPerformed();
279
				}	
276 280
				setCursor(new Cursor(Cursor.DEFAULT_CURSOR));   
277
				searchButtonActionPerformed();
281
				controlsPanel.setServerReply(capabilities.getServerMessage());				
278 282
			} catch (Exception e) {
279 283
				controlsPanel.setServerReply(Messages.getText(e.toString()));
280 284
				e.printStackTrace();
branches/CatalogYNomenclator_v1_1_0_1005/applications/appCatalogYNomenclatorClient/src/es/gva/cit/gazetteer/drivers/GazetteerCapabilities.java
1 1
package es.gva.cit.gazetteer.drivers;
2 2

  
3
import java.util.Properties;
4

  
3
import es.gva.cit.catalogClient.drivers.DiscoveryServiceCapabilities;
5 4
import es.gva.cit.gazetteer.querys.FeatureType;
6 5

  
7 6
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
......
48 47
 *
49 48
 * $Id$
50 49
 * $Log$
51
 * Revision 1.1.2.1  2007-07-10 11:18:04  jorpiell
50
 * Revision 1.1.2.2  2007-07-23 12:52:47  jorpiell
51
 * Refactoring of the capabilities message
52
 *
53
 * Revision 1.1.2.1  2007/07/10 11:18:04  jorpiell
52 54
 * Added the registers
53 55
 *
54 56
 *
......
56 58
/**
57 59
 * @author Jorge Piera LLodr? (jorge.piera@iver.es)
58 60
 */
59
public class GazetteerCapabilities {
60
	private String version = null;
61
	private Properties properties = null;
61
public class GazetteerCapabilities extends DiscoveryServiceCapabilities{
62 62
	private FeatureType[] featureTypes = null;
63 63
	
64
	/**
65
	 * @return the version
66
	 */
67
	public String getVersion() {
68
		return version;
69
	}
70
	
71
	/**
72
	 * @param version the version to set
73
	 */
74
	public void setVersion(String version) {
75
		this.version = version;
76
	}
77
	
78
	/**
79
	 * @return the properties
80
	 */
81
	public Properties getProperties() {
82
		return properties;
83
	}
84
	
85
	/**
86
	 * @param properties the properties to set
87
	 */
88
	public void setProperties(Properties properties) {
89
		this.properties = properties;
90
	}
91 64

  
92 65
	/**
93 66
	 * @return the featureTypes
......
102 75
	public void setFeatureTypes(FeatureType[] featureTypes) {
103 76
		this.featureTypes = featureTypes;
104 77
	}
78

  
105 79
	
80
	
106 81
}

Also available in: Unified diff