Revision 34113
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/fieldstree/FieldsTreeTableModel.java | ||
---|---|---|
212 | 212 |
if (element.getDataType() == null){ |
213 | 213 |
return ""; |
214 | 214 |
} |
215 |
return PluginServices.getText(this, element.getDataType().getName()); |
|
215 |
if (element.isGeometry()){ |
|
216 |
return PluginServices.getText(this, element.getType()); |
|
217 |
}else{ |
|
218 |
return PluginServices.getText(this, element.getDataType().getName()); |
|
219 |
} |
|
216 | 220 |
} |
217 | 221 |
} |
218 | 222 |
catch (SecurityException se) { } |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/WFSInfoPanel.java | ||
---|---|---|
8 | 8 |
import org.gvsig.app.project.documents.view.toc.gui.HTMLInfoPanel; |
9 | 9 |
import org.gvsig.fmap.dal.serverexplorer.wfs.WFSServerExplorer; |
10 | 10 |
import org.gvsig.gui.beans.panelGroup.IPanelGroup; |
11 |
import org.gvsig.remoteclient.wfs.WFSFeatureField; |
|
11 | 12 |
import org.gvsig.wfs.gui.panels.model.WFSSelectedFeature; |
12 |
import org.gvsig.wfs.gui.panels.model.WFSUtils; |
|
13 |
import org.gvsig.xmlschema.lib.api.som.IXSElementDeclaration; |
|
14 | 13 |
|
15 | 14 |
|
16 | 15 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
... | ... | |
195 | 194 |
layer_fields_text = ""; |
196 | 195 |
|
197 | 196 |
for (int i=0 ; i<fields.size() ; i++){ |
198 |
IXSElementDeclaration field = (IXSElementDeclaration)fields.get(i);
|
|
199 |
if (!((field.getTypeDefinition() != null) && (field.getTypeDefinition().isGeometry()))){
|
|
200 |
layer_fields_text = layer_fields_text + field.getNodeName() +
|
|
197 |
WFSFeatureField field = (WFSFeatureField)fields.get(i);
|
|
198 |
if (field.isGeometry()){
|
|
199 |
layer_fields_text = layer_fields_text + field.getName() + |
|
201 | 200 |
" (" + |
202 |
PluginServices.getText(this,WFSUtils.getFieldType(field.getTypeDefinition())) + ")";
|
|
201 |
PluginServices.getText(this, field.getType()) + ")";
|
|
203 | 202 |
}else{ |
204 |
layer_fields_text = layer_fields_text + field.getNodeName();
|
|
203 |
layer_fields_text = layer_fields_text + field.getName(); |
|
205 | 204 |
} |
206 | 205 |
if (i < fields.size() -1){ |
207 | 206 |
layer_fields_text = layer_fields_text + ", "; |
208 | 207 |
} |
209 | 208 |
} |
210 | 209 |
|
211 |
layer_geometry_text = PluginServices.getText(this,WFSUtils.getGeometry(layer));
|
|
210 |
layer_geometry_text = PluginServices.getText(this, layer.getGeometryField().getType());
|
|
212 | 211 |
if (layer_geometry_text.equals("")){ |
213 | 212 |
layer_geometry_text = "-"; |
214 | 213 |
} |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/wfs/gui/panels/WFSSelectFeaturePanel.java | ||
---|---|---|
721 | 721 |
return getLayerName(layer); |
722 | 722 |
} else { |
723 | 723 |
if (layer.getGeometryField() != null){ |
724 |
return PluginServices.getText(this, layer.getGeometryField().getDataType().getName());
|
|
724 |
return PluginServices.getText(this, layer.getGeometryField().getType());
|
|
725 | 725 |
} |
726 | 726 |
return ""; |
727 | 727 |
} |
branches/v2_0_0_prep/extensions/extWFS2/src/org/gvsig/fmap/dal/store/wfs/WFSStoreProvider.java | ||
---|---|---|
101 | 101 |
private static final Logger logger = LoggerFactory.getLogger(WFSStoreProvider.class); |
102 | 102 |
public static String NAME = "WFSStore"; |
103 | 103 |
public static String DESCRIPTION = "WFS store to load WFS resources"; |
104 |
|
|
104 |
|
|
105 | 105 |
private static final MetadataManager metadataManager = MetadataLocator.getMetadataManager(); |
106 | 106 |
private static final String METADATA_DEFINITION_NAME = "WFSStore"; |
107 | 107 |
private static final String METADATA_DEFINITION_DESCRIPTION = "WFSStore metadata definition"; |
108 |
|
|
108 |
|
|
109 | 109 |
private IProjection projection; |
110 | 110 |
private int featureCount = -1; |
111 | 111 |
private boolean isKnownEnvelope = false; |
112 | 112 |
|
113 | 113 |
/** |
114 |
* If the user has selected the filter by area option |
|
115 |
*/ |
|
116 |
private boolean hasFilterByArea = false; |
|
117 |
|
|
118 |
/** |
|
114 | 119 |
* GML provider used by delegation to read the GML files |
115 | 120 |
*/ |
116 | 121 |
private GPEStoreProvider storeProviderDelegate = null; |
... | ... | |
157 | 162 |
wfsParameters.getFeatureNamespace()); |
158 | 163 |
wfsStatus.setNamespacePrefix(wfsParameters.getFeaturePrefix()); |
159 | 164 |
wfsStatus.setFields(wfsParameters.getFields()); |
160 |
//wfsStatus.setFilterQuery(wfsParameters.getFilterEncoding()); |
|
165 |
|
|
166 |
//Select the filter by area |
|
167 |
wfsStatus.setFilterByArea(wfsParameters.getFilterByAreaGeometry(), wfsParameters.getFilterByAreaAttribute(), |
|
168 |
wfsParameters.getFilterByAreaCrs(), wfsParameters.getFilterByAreaOperation()); |
|
169 |
this.hasFilterByArea = (wfsStatus.getFilterByArea() != null); |
|
170 |
|
|
171 |
//Select the filter by attribute |
|
172 |
wfsStatus.setFilterByAttribute(wfsStatus.getFilterByAttribute()); |
|
173 |
|
|
161 | 174 |
wfsStatus.setTimeout(wfsParameters.getTimeOut()); |
162 | 175 |
wfsStatus.setMaxFeatures(wfsParameters.getMaxFeatures()); |
163 | 176 |
wfsStatus.setUserName(wfsParameters.getUser()); |
... | ... | |
193 | 206 |
|
194 | 207 |
projection = CRSFactory.getCRS(getEPSGCode(feature.getDefaultSRS())); |
195 | 208 |
this.setDynValue("CRS", projection); |
196 |
|
|
209 |
|
|
197 | 210 |
EditableFeatureType featureType = getStoreServices().createFeatureType(); |
198 |
|
|
211 |
|
|
199 | 212 |
for (int i=0 ; i<feature.getFieldSize() ; i++){ |
200 | 213 |
WFSFeatureField featureField = feature.getFieldAt(i); |
201 | 214 |
int dataType = DataTypes.OBJECT; |
... | ... | |
222 | 235 |
} |
223 | 236 |
featureType.add("gid", DataTypes.LONG); |
224 | 237 |
featureType.setHasOID(true); |
225 |
|
|
238 |
|
|
226 | 239 |
FeatureType defaultType = featureType.getNotEditableCopy(); |
227 | 240 |
List types = new ArrayList(1); |
228 | 241 |
types.add(defaultType); |
... | ... | |
301 | 314 |
if (metadataManager.getDefinition(METADATA_DEFINITION_NAME) == null) { |
302 | 315 |
DynStruct metadataDefinition = metadataManager.addDefinition( |
303 | 316 |
METADATA_DEFINITION_NAME, METADATA_DEFINITION_DESCRIPTION); |
304 |
|
|
317 |
|
|
305 | 318 |
metadataDefinition.addDynFieldObject("Envelope").setClassOfValue(Envelope.class).setMandatory(false); |
306 | 319 |
metadataDefinition.addDynFieldObject("CRS").setClassOfValue(IProjection.class).setMandatory(true); |
307 |
|
|
320 |
|
|
308 | 321 |
metadataDefinition.extend(metadataManager |
309 | 322 |
.getDefinition(FeatureStore.METADATA_DEFINITION_NAME)); |
310 | 323 |
} |
... | ... | |
342 | 355 |
public FeatureSetProvider createSet(FeatureQuery query, |
343 | 356 |
FeatureType featureType) throws DataException { |
344 | 357 |
File file = null; |
358 |
|
|
345 | 359 |
if (query == null){ |
346 | 360 |
file = executeQuery(); |
347 | 361 |
}else{ |
... | ... | |
387 | 401 |
private File executeQuery() throws DataException{ |
388 | 402 |
try{ |
389 | 403 |
wfsStatus.setResultType(WFSStatus.RESULTYPE_RESULTS); |
404 |
if (!hasFilterByArea){ |
|
405 |
wfsStatus.removeFilterByArea(); |
|
406 |
} |
|
390 | 407 |
return wfsClient.getFeature(wfsStatus, true, null); |
391 | 408 |
} catch (WFSException e) { |
392 | 409 |
throw new InitializeException("Impossible to retrieve the file", e); |
... | ... | |
501 | 518 |
public ResourceProvider getResource() { |
502 | 519 |
return storeProviderDelegate.getResource(); |
503 | 520 |
} |
504 |
|
|
521 |
|
|
505 | 522 |
protected FeatureProvider internalGetFeatureProviderByReference( |
506 | 523 |
FeatureReferenceProviderServices reference, FeatureType featureType) |
507 | 524 |
throws DataException { |
... | ... | |
539 | 556 |
// FIXME exception |
540 | 557 |
throw new UnsupportedOperationException(); |
541 | 558 |
} |
542 |
|
|
559 |
|
|
543 | 560 |
public boolean allowWrite() { |
544 | 561 |
return wfsClient.getServiceInformation().isOperationSupported("Transaction"); |
545 | 562 |
} |
546 |
|
|
563 |
|
|
547 | 564 |
public Envelope getEnvelope() throws DataException { |
548 | 565 |
return (Envelope) this.getDynValue("Envelope"); |
549 | 566 |
} |
branches/v2_0_0_prep/extensions/extGPE-gvSIG/src/org/gvsig/fmap/dal/store/gpe/GPEStoreParameters.java | ||
---|---|---|
64 | 64 |
public GPEStoreParameters(String parametersDefinitionName, String name) { |
65 | 65 |
super(); |
66 | 66 |
this.parameters = (DelegatedDynObject) FileHelper.newParameters(parametersDefinitionName); |
67 |
//TODO review this parameters |
|
68 | 67 |
this.parameters.getDynClass().addDynFieldObject(ENVELOPE_PARAMETER_NAME).setClassOfValue(Envelope.class).setMandatory(false); |
69 |
this.parameters.getDynClass().addDynField(DataStoreProviderServices.PROVIDER_PARAMTER_NAME);
|
|
68 |
this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, name);
|
|
70 | 69 |
} |
71 | 70 |
|
72 | 71 |
protected DelegatedDynObject getDelegatedDynObject() { |
branches/v2_0_0_prep/extensions/extGPE-gvSIG/src/org/gvsig/fmap/dal/store/gpe/handlers/FmapContentHandler.java | ||
---|---|---|
365 | 365 |
data = new DefaultFeatureProvider(featureType.getNotEditableCopy(), storeProvider.createNewOID()); |
366 | 366 |
Map elements = gpefeature.getelements(); |
367 | 367 |
Iterator keys = elements.keySet().iterator(); |
368 |
Long gid = new Long(gpefeature.getId());
|
|
368 |
String gid = gpefeature.getId();
|
|
369 | 369 |
data.set("gid", gid); |
370 | 370 |
data.setOID(gid); |
371 | 371 |
while (keys.hasNext()){ |
branches/v2_0_0_prep/extensions/extGPE-gvSIG/src/org/gvsig/fmap/dal/store/gpe/GPESetProvider.java | ||
---|---|---|
133 | 133 |
} |
134 | 134 |
|
135 | 135 |
protected void doDispose() throws BaseException { |
136 |
features.clear(); |
|
136 |
|
|
137 | 137 |
} |
138 | 138 |
} |
139 | 139 |
|
branches/v2_0_0_prep/extensions/extGPE-gvSIG/src/org/gvsig/fmap/dal/store/gpe/GPEStoreProvider.java | ||
---|---|---|
181 | 181 |
public FeatureProvider internalGetFeatureProviderByReference( |
182 | 182 |
FeatureReferenceProviderServices reference, FeatureType featureType) |
183 | 183 |
throws DataException { |
184 |
return this.getFeatureProviderByIndex((Long) reference.getOID(),
|
|
185 |
featureType);
|
|
184 |
return ((DefaultFeature)contentHandler.
|
|
185 |
getFeatureSet().get(reference.getOID())).getData();
|
|
186 | 186 |
} |
187 | 187 |
|
188 | 188 |
FeatureProvider getFeatureProviderByIndex(Long index, FeatureType fType) |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/WFSStatus.java | ||
---|---|---|
340 | 340 |
srs); |
341 | 341 |
} |
342 | 342 |
|
343 |
public void removeFilterByArea(){ |
|
344 |
this.filterByArea = null; |
|
345 |
} |
|
346 |
|
|
347 |
public void removeFilterByAttribute(){ |
|
348 |
this.filterByAttribute = null; |
|
349 |
} |
|
350 |
|
|
351 |
public void removeAllFilters(){ |
|
352 |
removeFilterByArea(); |
|
353 |
removeFilterByAttribute(); |
|
354 |
} |
|
355 |
|
|
343 | 356 |
/** |
344 | 357 |
* @param filterByArea |
345 | 358 |
* the filterByArea to set |
branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/wfs_1_1_0/request/WFSGetFeatureRequest1_1_0.java | ||
---|---|---|
51 | 51 |
* |
52 | 52 |
*/ |
53 | 53 |
/** |
54 |
* @author Jorge Piera Llodr? (jorge.piera@iver.es) |
|
54 |
* @author Jorge Piera Llodr? (jorge.piera@iver.es) |
|
55 | 55 |
*/ |
56 | 56 |
public class WFSGetFeatureRequest1_1_0 extends WFSGetFeatureRequest1_0_0{ |
57 | 57 |
|
58 |
public WFSGetFeatureRequest1_1_0(WFSStatus status, |
|
59 |
WFSProtocolHandler protocolHandler) { |
|
60 |
super(status, protocolHandler); |
|
61 |
} |
|
62 |
|
|
63 |
/* |
|
64 |
* (non-Javadoc) |
|
65 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getHttpGetRequest(java.lang.String) |
|
66 |
*/ |
|
67 |
protected String getHttpGetRequest(String onlineResource) { |
|
68 |
StringBuffer req = new StringBuffer(); |
|
69 |
req.append(super.getHttpGetRequest(onlineResource)); |
|
70 |
//Typename |
|
71 |
String typeName = status.getFeatureName(); |
|
72 |
if ((status.getNamespaceLocation() != null) && |
|
73 |
(status.getNamespacePrefix() != null)){ |
|
74 |
req.append("&"); |
|
75 |
req.append("NAMESPACE="); |
|
76 |
req.append("xmlns(" + status.getNamespacePrefix() + "="); |
|
77 |
req.append(status.getNamespaceLocation() + ")"); |
|
78 |
} |
|
79 |
if (status.getResultType() == WFSStatus.RESULTYPE_HITS){ |
|
80 |
req.append("&RESULTTYPE=hits"); |
|
81 |
} |
|
82 |
return req.toString(); |
|
83 |
} |
|
58 |
public WFSGetFeatureRequest1_1_0(WFSStatus status, |
|
59 |
WFSProtocolHandler protocolHandler) { |
|
60 |
super(status, protocolHandler); |
|
61 |
} |
|
84 | 62 |
|
85 |
/* (non-Javadoc) |
|
86 |
* @see org.gvsig.remoteClient.wfs.wfs_1_0_0.requests.WFSGetFeatureRequest1_0_0#addPropertyName(java.lang.StringBuffer) |
|
87 |
*/ |
|
88 |
protected void addPropertyName(StringBuffer req) { |
|
89 |
|
|
90 |
} |
|
91 |
|
|
92 |
|
|
63 |
/* |
|
64 |
* (non-Javadoc) |
|
65 |
* @see org.gvsig.remoteClient.wfs.requests.WFSRequest#getHttpGetRequest(java.lang.String) |
|
66 |
*/ |
|
67 |
protected String getHttpGetRequest(String onlineResource) { |
|
68 |
StringBuffer req = new StringBuffer(); |
|
69 |
req.append(super.getHttpGetRequest(onlineResource)); |
|
70 |
//Typename |
|
71 |
String typeName = status.getFeatureName(); |
|
72 |
if ((status.getNamespaceLocation() != null) && |
|
73 |
(status.getNamespacePrefix() != null)){ |
|
74 |
req.append("&"); |
|
75 |
req.append("NAMESPACE="); |
|
76 |
req.append("xmlns(" + status.getNamespacePrefix() + "="); |
|
77 |
req.append(status.getNamespaceLocation() + ")"); |
|
78 |
} |
|
79 |
if (status.getResultType() == WFSStatus.RESULTYPE_HITS){ |
|
80 |
req.append("&RESULTTYPE=hits"); |
|
81 |
} |
|
82 |
return req.toString(); |
|
83 |
} |
|
93 | 84 |
|
85 |
/* (non-Javadoc) |
|
86 |
* @see org.gvsig.remoteClient.wfs.wfs_1_0_0.requests.WFSGetFeatureRequest1_0_0#addPropertyName(java.lang.StringBuffer) |
|
87 |
*/ |
|
88 |
protected void addPropertyName(StringBuffer req) { |
|
89 |
String[] fields = status.getFields(); |
|
90 |
if (fields.length > 0){ |
|
91 |
req.append("PROPERTYNAME="); |
|
92 |
req.append(getFieldName(fields[0])); |
|
93 |
for (int i=1 ; i<fields.length ; i++){ |
|
94 |
req.append("," + getFieldName(fields[i])); |
|
95 |
} |
|
96 |
req.append("&"); |
|
97 |
} |
|
98 |
} |
|
99 |
|
|
100 |
private String getFieldName(String field){ |
|
101 |
if (status.getNamespacePrefix() != null){ |
|
102 |
return status.getNamespacePrefix() + ":" + field; |
|
103 |
} |
|
104 |
return field; |
|
105 |
} |
|
106 |
|
|
107 |
|
|
108 |
|
|
94 | 109 |
} |
Also available in: Unified diff