use of org.pentaho.di.trans.dataservice.optimization.pushdown.ui.ParameterPushdownModel in project pdi-dataservice-server-plugin by pentaho.
the class ParameterPushdownFactory method createModel.
public ParameterPushdownModel createModel(final DataServiceModel dialogModel) {
List<PushDownOptimizationMeta> optimizations = dialogModel.getPushDownOptimizations(ParameterPushdown.class);
ParameterPushdown parameterPushdown;
if (optimizations.isEmpty()) {
parameterPushdown = createPushDown();
PushDownOptimizationMeta optimizationMeta = new PushDownOptimizationMeta();
optimizationMeta.setStepName(dialogModel.getServiceStep());
optimizationMeta.setType(parameterPushdown);
dialogModel.add(optimizationMeta);
} else {
parameterPushdown = (ParameterPushdown) optimizations.get(0).getType();
}
if (optimizations.size() > 1) {
dialogModel.removeAll(optimizations.subList(1, optimizations.size()));
}
final ParameterPushdownModel parameterPushdownModel = new ParameterPushdownModel(parameterPushdown);
parameterPushdownModel.setFieldList(dialogModel.getStepFields());
dialogModel.addPropertyChangeListener("serviceStep", new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
parameterPushdownModel.setFieldList(dialogModel.getStepFields());
}
});
return parameterPushdownModel;
}
Aggregations