Revision 5948 trunk/extensions/extWFS2/src/com/iver/cit/gvsig/fmap/drivers/geotools/WFSGetFeatureParser.java

View differences:

WFSGetFeatureParser.java
2 2

  
3 3
import java.io.File;
4 4
import java.io.FileInputStream;
5
import java.io.FileNotFoundException;
6
import java.io.IOException;
7 5
import java.io.InputStream;
8
import java.net.Authenticator;
9
import java.net.URI;
10
import java.net.URL;
11
import java.util.HashMap;
12
import java.util.List;
13
import java.util.Map;
14 6
import java.util.Vector;
15 7

  
16
import org.geotools.data.AbstractDataStore;
17
import org.geotools.data.DefaultQuery;
18 8
import org.geotools.data.FeatureReader;
19
import org.geotools.data.ows.FeatureSetDescription;
20
import org.geotools.data.ows.WFSCapabilities;
21 9
import org.geotools.data.wfs.WFSFeatureReader;
22 10
import org.geotools.data.wfs.WFSTransactionState;
23 11
import org.geotools.factory.FactoryConfigurationError;
......
26 14
import org.geotools.feature.FeatureType;
27 15
import org.geotools.feature.FeatureTypeBuilder;
28 16
import org.geotools.feature.SchemaException;
29
import org.geotools.xml.gml.GMLComplexTypes;
30
import org.geotools.xml.schema.Element;
31 17
import org.gvsig.remoteClient.wfs.WFSAttribute;
32 18
import org.gvsig.remoteClient.wfs.WFSStatus;
33 19
import org.xml.sax.SAXException;
......
79 65
 *
80 66
 * $Id$
81 67
 * $Log$
82
 * Revision 1.4  2006-06-15 11:17:06  jorpiell
68
 * Revision 1.5  2006-06-21 12:35:45  jorpiell
69
 * Se ha a?adido la ventana de propiedades. Esto implica a?adir listeners por todos los paneles. Adem?s no se muestra la geomatr?a en la lista de atributos y se muestran ?nicamnete los que se van a descargar
70
 *
71
 * Revision 1.4  2006/06/15 11:17:06  jorpiell
83 72
 * Se ha encontrado la forma de comprobar cuando se prodicia un error de parseo al hacer un hasnext (en la feature). Se atrapa y se lanza la excepci?n hacia arriba
84 73
 *
85 74
 * Revision 1.3  2006/06/15 10:34:12  jorpiell
......
173 162
	 private static FeatureType featureTypefromGeotoolsToGvSIG(WFSLayerNode schema) throws FactoryConfigurationError, SchemaException{
174 163
		 AttributeType[] types = attributteTypefromGeotoolsToGvSIG(schema);
175 164
		 String typeName = schema.getName();
176
		 
177
		 FeatureType	featureType = FeatureTypeBuilder.newFeatureType(types,typeName);					
165
		 FeatureType featureType = FeatureTypeBuilder.newFeatureType(types,typeName);					
178 166
		 return featureType;
179 167
	 }
180 168
	 
......
186 174
	 * @return
187 175
	 */
188 176
	 public static AttributeType[] attributteTypefromGeotoolsToGvSIG(WFSLayerNode schema){
189
		 Vector attributes = schema.getFields();
190
		 AttributeType[] types = new AttributeType[attributes.size()];
177
		 Vector attributes = schema.getSelectedFields();
178
		 AttributeType[] attributeTypes = new AttributeType[attributes.size()];
191 179
		 for (int i=0 ; i<attributes.size() ; i++){
192 180
			 WFSAttribute attribute = (WFSAttribute)attributes.get(i);
193
			 AttributeType type = AttributeTypeFactory.newAttributeType(attribute.getName(),
181
		 	AttributeType type = AttributeTypeFactory.newAttributeType(attribute.getName(),
194 182
					 WFSFilter.getAttributeJavaType(attribute));
195
			 types[i] = type;
183
		 	attributeTypes[i] = type;
196 184
		 }
197
		 return types;
185
		 return attributeTypes;
198 186
	 }
199 187
	 
188
	 public static AttributeType[] attributteTypefromGeotoolsToGvSIG2(WFSLayerNode schema){
189
		 Vector attributes = schema.getSelectedFields();
190
		 Vector addedAttributes = new Vector();
191
		 for (int i=0 ; i<attributes.size() ; i++){
192
			 WFSAttribute attribute = (WFSAttribute)attributes.get(i);
193
		 	 if (!(WFSFilter.isGeometry(attribute.getType()))){
194
		 		 AttributeType type = AttributeTypeFactory.newAttributeType(attribute.getName(),
195
		 				 WFSFilter.getAttributeJavaType(attribute));
196
		 		 addedAttributes.add(type);
197
		 	 }
198
		 }
199
		 AttributeType[] attributeTypes = new AttributeType[addedAttributes.size()];
200
		 for (int i=0 ; i<addedAttributes.size() ; i++){
201
			 attributeTypes[i] = (AttributeType)addedAttributes.get(i);
202
		 }
203
		 return attributeTypes;
204
	 }
200 205
	
201 206
}

Also available in: Unified diff