Revision 44386 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

View differences:

DefaultExportProcess.java
38 38
    private Object context;
39 39
    private Expression filterExpression;
40 40
    private int featuresToUse;
41
    private AttributeNamesTranslator attributeNamesTranslator;
41
//    private AttributeNamesTranslator attributeNamesTranslator;
42 42

  
43 43
    public DefaultExportProcess() {
44 44

  
......
46 46

  
47 47
    @Override
48 48
    public void setOutputFormat(String serviceName) throws ExportException {
49
        
49 50
        if (this.factory != null && StringUtils.equalsIgnoreCase(serviceName, this.factory.getName())) {
50 51
            return;
51 52
        }
52 53
        ExportServiceManager serviceManager = ExportLocator.getServiceManager();
53 54
        this.factory = serviceManager.getServiceFactory(serviceName);
54 55
        this.parameters = this.factory.createParameters();
55
        ExportAttributes expAttrs = ExportLocator.getServiceManager()
56
                .createExportAttributes(this.parameters.getSourceFeatureType());
57
        this.attributeNamesTranslator = this.factory.createAttributeNamesTranslator();
58
        expAttrs.setNamesTranslator(this.attributeNamesTranslator);
59
        this.parameters.setExportAttributes(expAttrs);
60 56
        this.service = this.factory.createService(this.parameters);
61 57
        this.parameters.setSourceFeatureStore(this.sourceFeatureStore);
62 58
        if (this.parameters instanceof ExportParametersGeometry) {
......
72 68
    }
73 69

  
74 70
    @Override
71
    public void setParameters(ExportParameters params) {
72
        this.parameters = params;
73
        this.factory = this.parameters.getFactory();
74
        this.service = this.factory.createService(this.parameters);
75
        this.parameters.setSourceFeatureStore(this.sourceFeatureStore);
76
        this.parameters.setContext(this.context);
77
        
78
        this.featuresToUse = this.parameters.getFeaturesToUse();
79
        this.filterExpression = this.parameters.getFilterExpresion();
80
        if (this.parameters instanceof ExportParametersGeometry) {
81
            ExportParametersGeometry pa = (ExportParametersGeometry) this.parameters;
82
            this.contextProjection = pa.getContextProjection();
83
            this.sourceProjection = pa.getSourceProjection();
84
            this.sourceTransformation = pa.getSourceTransformation();
85
        }
86
    }
87
    
88
    @Override
75 89
    public void setSourceFeatureStore(FeatureStore store) {
76 90
        this.sourceFeatureStore = store;
77 91
        if (this.parameters != null) {
......
189 203
            this.parameters.setFeaturesToUse(featuresToUse);
190 204
        }
191 205
    }
206

  
192 207
}

Also available in: Unified diff