Revision 5830

View differences:

trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/wfs/WFSClient.java
54 54
 *
55 55
 * $Id$
56 56
 * $Log$
57
 * Revision 1.7  2006-05-25 10:28:25  jorpiell
57
 * Revision 1.8  2006-06-14 08:46:07  jorpiell
58
 * Se tiene en cuanta la opcion para refrescar las capabilities
59
 *
60
 * Revision 1.7  2006/05/25 10:28:25  jorpiell
58 61
 * Se ha a?adido un atributo al m?todo connect
59 62
 *
60 63
 * Revision 1.6  2006/05/23 13:23:22  jorpiell
......
107 110
	 * WFS client status. Contains all the information to create
108 111
	 * the query
109 112
	 */
110
	public void getCapabilities(WFSStatus status) {
111
		handler.getCapabilities(status);		
113
	public void getCapabilities(WFSStatus status, boolean override, ICancellable cancel) {
114
		handler.getCapabilities(status,override,cancel);		
112 115
	}
113 116
	
114 117
	/**
......
148 151
	 * capabilities.</p>
149 152
	 * 
150 153
	 */
151
	public boolean connect(ICancellable cancel) 
154
	public boolean connect(boolean override,ICancellable cancel) 
152 155
	{
153 156
		try {
154 157
			if (handler == null) {
......
160 163
					return false;
161 164
				}
162 165
			}
163
			getCapabilities(null);			
166
			getCapabilities(null,override,cancel);			
164 167
			
165 168
			return true;
166 169
			
......
172 175
	
173 176
	/*
174 177
	 *  (non-Javadoc)
178
	 * @see org.gvsig.remoteClient.RemoteClient#connect(org.gvsig.remoteClient.wms.ICancellable)
179
	 */
180
	public boolean connect(ICancellable cancel) {
181
		return connect(false, cancel);
182
	}
183
	
184
	/*
185
	 *  (non-Javadoc)
175 186
	 * @see org.gvsig.remoteClient.RemoteClient#close()
176 187
	 */
177 188
	public void close() {
trunk/libraries/libRemoteServices/src/org/gvsig/remoteClient/wfs/WFSProtocolHandler.java
9 9

  
10 10
import org.gvsig.remoteClient.OGCProtocolHandler;
11 11
import org.gvsig.remoteClient.utils.Utilities;
12
import org.gvsig.remoteClient.wms.ICancellable;
12 13

  
13 14
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
14 15
 *
......
54 55
 *
55 56
 * $Id$
56 57
 * $Log$
57
 * Revision 1.5  2006-06-14 07:54:18  jorpiell
58
 * Revision 1.6  2006-06-14 08:46:07  jorpiell
59
 * Se tiene en cuanta la opcion para refrescar las capabilities
60
 *
61
 * Revision 1.5  2006/06/14 07:54:18  jorpiell
58 62
 * Se parsea el online resource que antes se ignoraba
59 63
 *
60 64
 * Revision 1.4  2006/05/30 13:58:03  jaume
......
91 95
     * the response will be parse to extract the data needed by the
92 96
     * WFS client</p>
93 97
     */
94
    public void getCapabilities(WFSStatus status) {
98
    public void getCapabilities(WFSStatus status,boolean override, ICancellable cancel) {
95 99
           URL request = null;
96 100
            try {
97 101
                request = new URL(buildCapabilitiesRequest(status));
......
100 104
                e.printStackTrace();
101 105
            }
102 106
            try {
103
            	File f = Utilities.downloadFile(request,"wfs_capabilities.xml", null);
107
            	if (override){
108
    				Utilities.removeURL(request);
109
            	}
110
            	File f = Utilities.downloadFile(request,"wfs_capabilities.xml", cancel);
111
            	if (f == null)
112
    				return;
113
            	clear();
104 114
            	parseCapabilities(f);
105 115
            } catch(Exception e) {
106 116
            	e.printStackTrace();
107 117
            }
108
    }
118
    }    
119

  
120
    private void clear() {
121
		features.clear();
122
		serviceInfo.clear();
123
	}
109 124
    
110 125
    /**
111 126
     * @return
......
356 371
        public Vector formats;
357 372
        public HashMap operations; 
358 373
        
359
        public ServiceInformation()
360
        {  	
361
            version = new String();
374
        public ServiceInformation() {  	
375
        	clear();     
376
        }
377

  
378
		public void clear() {
379
			version = new String();
362 380
            name = new String();
363 381
            scope = new String();
364 382
            title = new String();
......
379 397
            fax = new String();
380 398
            email = new String();
381 399
            formats = new Vector();       	
382
            operations = new HashMap();            
383
        }
400
            operations = new HashMap();   			
401
		}
384 402

  
385 403
		/**
386 404
		 * @return Returns the online_resource.
trunk/extensions/extWFS2/src/com/iver/cit/gvsig/fmap/drivers/wfs/FMapWFSDriver.java
14 14
import org.gvsig.remoteClient.wfs.WFSFeature;
15 15
import org.gvsig.remoteClient.wfs.WFSStatus;
16 16
import org.gvsig.remoteClient.wfs.WFSProtocolHandler.ServiceInformation;
17
import org.gvsig.remoteClient.wms.ICancellable;
17 18

  
18 19
import com.hardcode.gdbms.engine.data.DataSourceFactory;
19 20
import com.hardcode.gdbms.engine.data.driver.ObjectDriver;
......
79 80
 *
80 81
 * $Id$
81 82
 * $Log$
82
 * Revision 1.10  2006-06-14 07:57:19  jorpiell
83
 * Revision 1.11  2006-06-14 08:46:24  jorpiell
84
 * Se tiene en cuanta la opcion para refrescar las capabilities
85
 *
86
 * Revision 1.10  2006/06/14 07:57:19  jorpiell
83 87
 * Ya no se usa la estrategia ni se usa geotools para hacer el getFeature. Ahora se usa ?nicamente para el parseo de GML
84 88
 *
85 89
 * Revision 1.9  2006/06/05 16:49:42  caballero
......
258 262
	 * </p>
259 263
	 * @throws IOException, DriverException.
260 264
	 */
261
	public boolean connect() throws IOException, DriverException {
262
		return remoteServicesClient.connect(null);
265
	public boolean connect(boolean override,ICancellable cancel) throws IOException, DriverException {
266
		return remoteServicesClient.connect(override,cancel);
263 267
	}
268
	
269
	public boolean connect(ICancellable cancel) {
270
	   return remoteServicesClient.connect(false, cancel);
271
	}
264 272

  
265 273
	/**
266 274
	 * Returns an array of WFSLayerNode's with the descriptors of
trunk/extensions/extWFS2/src/com/iver/cit/gvsig/gui/wizards/WFSWizard.java
4 4
import java.awt.geom.Rectangle2D;
5 5
import java.net.MalformedURLException;
6 6
import java.net.URL;
7
import java.util.prefs.Preferences;
7 8

  
8 9
import javax.swing.DefaultComboBoxModel;
9 10
import javax.swing.JCheckBox;
......
66 67
 *
67 68
 * $Id$
68 69
 * $Log$
69
 * Revision 1.8  2006-05-25 16:22:59  jorpiell
70
 * Revision 1.9  2006-06-14 08:46:24  jorpiell
71
 * Se tiene en cuanta la opcion para refrescar las capabilities
72
 *
73
 * Revision 1.8  2006/05/25 16:22:59  jorpiell
70 74
 * Se limpia el panel cada vez que se conecta con un servidor distinto
71 75
 *
72 76
 * Revision 1.7  2006/05/25 16:01:51  jorpiell
......
115 119
	private JLabel lblServerType = null;
116 120
	private JLabel lblServerTypeValue = null;
117 121
	private JCheckBox chkCaching = null;
122
	private static Preferences fPrefs = Preferences.userRoot().node( "gvsig.wfs-wizard" );
123
	private boolean refreshing = fPrefs.getBoolean("refresh_capabilities", false);
118 124
	
119 125
	/**
120 126
	 * This is the default constructor
......
177 183
		try {
178 184
			String host = cmbHost.getModel().getSelectedItem().toString();
179 185
					
180
			dataSource.setHost(new URL(host));
186
			dataSource.setHost(new URL(host), refreshing);
181 187
			addHost(host);
182 188
			getLblTitle().setText(dataSource.getTitle());
183 189
			getTxtAbstract().setText(dataSource.getAbstract());
......
623 629
			chkCaching.setBounds(7, 51, 349, 20);
624 630
			chkCaching.setText(PluginServices.getText(this, "refresh_capabilities"));
625 631
			chkCaching.setToolTipText(PluginServices.getText(this, "refresh_capabilities_tooltip"));
626
			//chkCaching.setSelected(refreshing);
632
			chkCaching.setSelected(refreshing);
627 633
			chkCaching.addItemListener(new java.awt.event.ItemListener() { 
628 634
				public void itemStateChanged(java.awt.event.ItemEvent e) {
629
					//refreshing = chkCaching.isSelected();
635
					refreshing = chkCaching.isSelected();
630 636
				}
631 637
			});
632 638
			chkCaching.addActionListener(new java.awt.event.ActionListener() { 
633 639
				public void actionPerformed(java.awt.event.ActionEvent e) {    
634
					//fPrefs.putBoolean("refresh_capabilities", chkCaching.isSelected());
640
					fPrefs.putBoolean("refresh_capabilities", chkCaching.isSelected());
635 641
				}
636 642
			});
637 643

  
trunk/extensions/extWFS2/src/com/iver/cit/gvsig/gui/wizards/WFSWizardData.java
55 55
 *
56 56
 * $Id$
57 57
 * $Log$
58
 * Revision 1.5  2006-05-23 13:21:59  jorpiell
58
 * Revision 1.6  2006-06-14 08:46:24  jorpiell
59
 * Se tiene en cuanta la opcion para refrescar las capabilities
60
 *
61
 * Revision 1.5  2006/05/23 13:21:59  jorpiell
59 62
 * Si hay alg?n problema en la carga se muestra un mensaje de error
60 63
 *
61 64
 * Revision 1.4  2006/05/23 08:09:53  jorpiell
......
102 105
	 * Server name
103 106
	 * @throws DriverException
104 107
	 */
105
	public void setHost(URL host) throws DriverException{
108
	public void setHost(URL host,boolean override) throws DriverException{
106 109
		driver = new FMapWFSDriver();
107 110
		try {
108 111
			driver.createClient(host);
109 112
			
110
			if (!driver.connect()){
113
			if (!driver.connect(override,null)){
111 114
				throw new DriverException(PluginServices.getText(this, "cant_connect") + host.toString());
112 115
			}		
113 116
			

Also available in: Unified diff