Revision 34026 branches/v2_0_0_prep/libraries/libRemoteServices/src/org/gvsig/remoteclient/wfs/WFSStatus.java
WFSStatus.java | ||
---|---|---|
6 | 6 |
import org.gvsig.compat.CompatLocator; |
7 | 7 |
import org.gvsig.compat.lang.StringUtils; |
8 | 8 |
import org.gvsig.fmap.geom.Geometry; |
9 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
9 | 10 |
import org.gvsig.fmap.geom.GeometryLocator; |
10 | 11 |
import org.gvsig.fmap.geom.GeometryManager; |
11 |
import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
|
12 | 12 |
import org.gvsig.fmap.geom.exception.CreateGeometryException; |
13 | 13 |
import org.gvsig.fmap.geom.primitive.Envelope; |
14 | 14 |
import org.gvsig.fmap.geom.primitive.GeneralPathX; |
... | ... | |
125 | 125 |
//WFS attributes |
126 | 126 |
private String featureName = null; |
127 | 127 |
private String namespacePrefix = null; |
128 |
private String namespace = null; |
|
128 |
private String namespaceLocation = null;
|
|
129 | 129 |
private String[] fields = null; |
130 | 130 |
private String onlineResource = null; |
131 | 131 |
private Integer timeout = new Integer(10000); |
132 |
private Integer buffer = new Integer(100);
|
|
132 |
private Integer maxFeatures = new Integer(100);
|
|
133 | 133 |
private String filterByAttribute = null; |
134 | 134 |
private WFSSpatialFilterOperation filterByArea = null; |
135 | 135 |
|
... | ... | |
157 | 157 |
|
158 | 158 |
public WFSStatus(String featureName, String namespace){ |
159 | 159 |
this.featureName = featureName; |
160 |
this.namespace = namespace; |
|
161 |
if (featureName != null){ |
|
162 |
int index = featureName.indexOf(":"); |
|
163 |
if (index>0){ |
|
164 |
namespacePrefix = featureName.substring(0, index); |
|
165 |
} |
|
166 |
} |
|
160 |
this.namespaceLocation = namespace; |
|
161 |
setFeatureName(featureName); |
|
167 | 162 |
lockAction = LOCKACTION_ALL; |
168 | 163 |
transactions = new ArrayList(); |
169 | 164 |
featuresLocked = new ArrayList(); |
... | ... | |
175 | 170 |
/** |
176 | 171 |
* @return Returns the buffer. |
177 | 172 |
*/ |
178 |
public Integer getBuffer() {
|
|
179 |
return buffer;
|
|
173 |
public Integer getMaxFeatures() {
|
|
174 |
return maxFeatures;
|
|
180 | 175 |
} |
181 | 176 |
|
182 | 177 |
|
183 | 178 |
/** |
184 | 179 |
* @param buffer The buffer to set. |
185 | 180 |
*/ |
186 |
public void setBuffer(Integer buffer) {
|
|
181 |
public void setMaxFeatures(Integer buffer) {
|
|
187 | 182 |
if (buffer != null){ |
188 |
this.buffer = buffer;
|
|
183 |
this.maxFeatures = buffer;
|
|
189 | 184 |
} |
190 | 185 |
} |
191 | 186 |
|
... | ... | |
196 | 191 |
public String getFeatureName() { |
197 | 192 |
return featureName; |
198 | 193 |
} |
194 |
|
|
195 |
public String getFeatureFullName(){ |
|
196 |
if (namespacePrefix == null){ |
|
197 |
return featureName; |
|
198 |
}else{ |
|
199 |
return namespacePrefix + ":" + featureName; |
|
200 |
} |
|
201 |
} |
|
199 | 202 |
|
200 | 203 |
|
201 | 204 |
/** |
202 | 205 |
* @param featureName The featureName to set. |
203 | 206 |
*/ |
204 | 207 |
public void setFeatureName(String featureName) { |
205 |
this.featureName = featureName; |
|
208 |
if (featureName != null){ |
|
209 |
int index = featureName.indexOf(":"); |
|
210 |
if (index>0){ |
|
211 |
this.featureName = featureName.substring(index+1, featureName.length()); |
|
212 |
namespacePrefix = featureName.substring(0, index); |
|
213 |
}else{ |
|
214 |
this.featureName = featureName; |
|
215 |
} |
|
216 |
} |
|
206 | 217 |
} |
207 | 218 |
|
208 | 219 |
/** |
... | ... | |
320 | 331 |
if (operation == null){ |
321 | 332 |
operation = new Integer(AbstractFilter.GEOMETRIC_OPERATOR_INTERSECT); |
322 | 333 |
} |
334 |
//TODO add a manager to register this |
|
323 | 335 |
this.filterByArea = new WFSGeometryFilterOperation(geometry, |
324 | 336 |
operation.intValue(), |
325 | 337 |
attributeName, |
338 |
getNamespacePrefix(), |
|
339 |
getNamespaceLocation(), |
|
326 | 340 |
srs); |
327 | 341 |
} |
328 | 342 |
|
... | ... | |
346 | 360 |
this.filterByArea = new WFSEnvelopeFilterOperation(envelope, |
347 | 361 |
operation.intValue(), |
348 | 362 |
attributeName, |
363 |
getNamespacePrefix(), |
|
364 |
getNamespaceLocation(), |
|
349 | 365 |
srs); |
350 | 366 |
} |
351 | 367 |
|
... | ... | |
407 | 423 |
filter.clearSpatialFilters(); |
408 | 424 |
filter.addSpatialFilter(geometryManager.createSurface(generalPath, SUBTYPES.GEOM2D), |
409 | 425 |
lockedAreaProperty, |
426 |
getNamespacePrefix(), |
|
427 |
getNamespaceLocation(), |
|
410 | 428 |
getSrs(), |
411 | 429 |
AbstractFilter.BBOX_ENCLOSES); |
412 | 430 |
} catch (CreateGeometryException e) { |
... | ... | |
481 | 499 |
WFSTTransaction transaction = WFSTransactionFactory.createTransaction(version, |
482 | 500 |
getFeatureName(), |
483 | 501 |
getNamespacePrefix(), |
484 |
getNamespace(), |
|
502 |
getNamespaceLocation(),
|
|
485 | 503 |
featuresLocked); |
486 | 504 |
transactions.add(transaction); |
487 | 505 |
return transaction; |
... | ... | |
592 | 610 |
/** |
593 | 611 |
* @return the namespace URL |
594 | 612 |
*/ |
595 |
public String getNamespace(){ |
|
596 |
return namespace; |
|
613 |
public String getNamespaceLocation(){
|
|
614 |
return namespaceLocation;
|
|
597 | 615 |
} |
598 | 616 |
|
599 | 617 |
/** |
... | ... | |
606 | 624 |
/** |
607 | 625 |
* @param namespace the namespace to set |
608 | 626 |
*/ |
609 |
public void setNamespace(String namespace) {
|
|
610 |
this.namespace = namespace;
|
|
627 |
public void setNamespaceLocation(String namespaceLocation) {
|
|
628 |
this.namespaceLocation = namespaceLocation;
|
|
611 | 629 |
} |
612 | 630 |
|
613 | 631 |
/** |
Also available in: Unified diff