use of org.talend.designer.dbmap.external.converter.ExternalDataConverter in project tdi-studio-se by Talend.
the class MapperMain method createModelFromExternalData.
public void createModelFromExternalData(List<IOConnection> inputs, List<IOConnection> outputs, List<IMetadataTable> outputMetadataTables, ExternalDbMapData externalData, boolean checkProblems) {
if (externalData == null) {
externalData = new ExternalDbMapData();
}
mapperManager.getUiManager().setUiProperties(externalData.getUiProperties());
ExternalDataConverter converter = new ExternalDataConverter(mapperManager);
if (this.mapperModel == null) {
this.mapperModel = converter.prepareModel(inputs, outputs, outputMetadataTables, externalData, checkProblems);
}
}
use of org.talend.designer.dbmap.external.converter.ExternalDataConverter in project tdi-studio-se by Talend.
the class ProblemsAnalyser method checkProblems.
public List<Problem> checkProblems(ExternalDbMapData externalData) {
problems.clear();
if (externalData != null) {
List<IConnection> incomingConnections = new ArrayList<IConnection>(this.mapperManager.getComponent().getIncomingConnections());
List<IConnection> outgoingConnections = new ArrayList<IConnection>(this.mapperManager.getComponent().getOutgoingConnections());
ExternalDataConverter converter = new ExternalDataConverter(mapperManager);
MapperMain mapperMain = mapperManager.getComponent().getMapperMain();
List<IOConnection> inputsIOConnections = mapperMain.createIOConnections(incomingConnections);
ArrayList<InputTable> inputTables = converter.prepareInputTables(inputsIOConnections, externalData);
List<IOConnection> outputsIOConnections = mapperMain.createIOConnections(outgoingConnections);
ArrayList<OutputTable> outputTables = converter.prepareOutputTables(outputsIOConnections, this.mapperManager.getComponent().getMetadataList(), externalData);
List<? super AbstractInOutTable> tablesWriteMode = new ArrayList<AbstractInOutTable>();
tablesWriteMode.addAll(inputTables);
tablesWriteMode.addAll(outputTables);
List<? extends AbstractInOutTable> tablesReadMode = (List<? extends AbstractInOutTable>) tablesWriteMode;
ProblemsManager problemsManager = new ProblemsManager(mapperManager);
ArrayList<Problem> problemsLocal = new ArrayList<Problem>();
for (AbstractInOutTable table : tablesReadMode) {
List<IColumnEntry> columnEntries = table.getColumnEntries();
problemsManager.checkProblemsForAllEntries(columnEntries);
for (IColumnEntry entry : columnEntries) {
List<Problem> problemsOfEntry = entry.getProblems();
if (problemsOfEntry != null) {
problemsLocal.addAll(problemsOfEntry);
}
}
}
problems.addAll(problemsLocal);
}
return getProblems();
}
Aggregations