Revision 44753 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.lib/org.gvsig.exportto.lib.impl/src/main/java/org/gvsig/export/impl/DefaultExportProcess.java
DefaultExportProcess.java | ||
---|---|---|
18 | 18 |
import org.gvsig.expressionevaluator.ExpressionUtils; |
19 | 19 |
import org.gvsig.fmap.dal.OpenDataStoreParameters; |
20 | 20 |
import org.gvsig.fmap.dal.exception.DataException; |
21 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
21 | 22 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
22 | 23 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
23 | 24 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
... | ... | |
46 | 47 |
private Expression filterExpression; |
47 | 48 |
private int featuresToUse; |
48 | 49 |
private SimpleTaskStatus taskStatus; |
50 |
private FeatureQuery featureQuery; |
|
49 | 51 |
|
50 | 52 |
public DefaultExportProcess() { |
51 | 53 |
|
... | ... | |
57 | 59 |
ExportServiceManager serviceManager = ExportLocator.getServiceManager(); |
58 | 60 |
this.factory = serviceManager.getServiceFactory(serviceName); |
59 | 61 |
this.parameters = this.factory.createParameters(); |
62 |
this.parameters.setFeatureQuery(featureQuery); |
|
60 | 63 |
// this.service = this.factory.createService(this.parameters); |
61 | 64 |
this.parameters.setSourceFeatureStore(this.sourceFeatureStore); |
62 | 65 |
this.parameters.setFeaturesToUse(featuresToUse); |
... | ... | |
201 | 204 |
} |
202 | 205 |
try { |
203 | 206 |
FeatureSet featureSet; |
207 |
FeatureQuery exportFeatureQuery; |
|
208 |
if (this.featureQuery!=null) { |
|
209 |
exportFeatureQuery = this.featureQuery.getCopy(); |
|
210 |
exportFeatureQuery.clearFilter(); |
|
211 |
exportFeatureQuery.retrievesAllAttributes(); |
|
212 |
} else { |
|
213 |
exportFeatureQuery = null; |
|
214 |
} |
|
204 | 215 |
switch (this.parameters.getFeaturesToUse()) { |
205 | 216 |
case ExportParameters.USE_ALL_FEATURES: |
206 | 217 |
default: |
207 |
featureSet = this.parameters.getSourceFeatureStore().getFeatureSet(); |
|
218 |
featureSet = this.parameters.getSourceFeatureStore().getFeatureSet(exportFeatureQuery);
|
|
208 | 219 |
break; |
209 | 220 |
case ExportParameters.USE_SELECTED_FEATURES: |
210 | 221 |
featureSet = this.parameters.getSourceFeatureStore().getFeatureSelection(); |
211 | 222 |
break; |
212 | 223 |
case ExportParameters.USE_FILTERED_FEATURES: |
213 |
featureSet = this.parameters.getSourceFeatureStore().getFeatureSet(this.parameters.getFilterExpresion()); |
|
224 |
if (exportFeatureQuery!=null) { |
|
225 |
exportFeatureQuery.setFilter(this.parameters.getFeatureQuery().getExpressionFilter()); |
|
226 |
} else { |
|
227 |
exportFeatureQuery = this.parameters.getFeatureQuery(); |
|
228 |
} |
|
229 |
|
|
230 |
if (exportFeatureQuery!=null) { |
|
231 |
exportFeatureQuery.retrievesAllAttributes(); |
|
232 |
} |
|
233 |
featureSet = this.parameters.getSourceFeatureStore().getFeatureSet(exportFeatureQuery); |
|
214 | 234 |
break; |
215 | 235 |
} |
216 | 236 |
ExportService service = this.factory.createService(this.parameters); |
... | ... | |
262 | 282 |
} |
263 | 283 |
} |
264 | 284 |
|
285 |
@Override |
|
286 |
public void setFeatureQuery(FeatureQuery featureQuery) { |
|
287 |
this.featureQuery = featureQuery; |
|
288 |
} |
|
289 |
|
|
265 | 290 |
} |
Also available in: Unified diff