use of org.talend.core.model.components.IODataComponent in project tdi-studio-se by Talend.
the class ChangeMetadataCommand method initializeContainer.
private void initializeContainer() {
outputdataContainer = new IODataComponentContainer();
for (Connection connec : (List<Connection>) node.getIncomingConnections()) {
if (connec.getLineStyle().equals(EConnectionType.FLOW_MAIN)) {
IODataComponent input = null;
if (newInputMetadata == null) {
input = new IODataComponent(connec);
} else {
if (connec.getMetaName().equals(newInputMetadata.getTableName())) {
input = new IODataComponent(connec, newInputMetadata);
}
}
if (input != null) {
outputdataContainer.getInputs().add(input);
}
}
}
for (Connection connec : (List<Connection>) node.getOutgoingConnections()) {
if (connec.getLineStyle().equals(EConnectionType.FLOW_MAIN) || isinputContainerOutput(connec) || ((connec.getLineStyle().equals(EConnectionType.FLOW_MERGE) && (connec.getInputId() == 1)))) {
if ((!connec.getSource().getConnectorFromType(connec.getLineStyle()).isMultiSchema()) || (connec.getMetaName().equals(newOutputMetadata.getTableName()))) {
IODataComponent output = new IODataComponent(connec, newOutputMetadata);
outputdataContainer.getOuputs().add(output);
}
}
}
if (inputNode != null) {
inputdataContainer = new IODataComponentContainer();
for (Connection connec : (List<Connection>) inputNode.getOutgoingConnections()) {
if (connec.getTarget().equals(node)) {
if ((!connec.getSource().getConnectorFromType(connec.getLineStyle()).isMultiSchema()) || (connec.getMetaName().equals(newInputMetadata.getTableName()))) {
IODataComponent output = new IODataComponent(connec, newInputMetadata);
inputdataContainer.getOuputs().add(output);
}
}
}
}
}
use of org.talend.core.model.components.IODataComponent in project tdi-studio-se by Talend.
the class ExternalNodeUtils method prepareExternalNodeReadyToOpen.
/**
* DOC amaumont Comment method "prepareExternalNodeReadyToOpen".
*
* @param node
* @param externalNode
* @return
*/
public static IExternalNode prepareExternalNodeReadyToOpen(IExternalNode externalNode) {
IODataComponentContainer inAndOut = new IODataComponentContainer();
List<IODataComponent> inputs = inAndOut.getInputs();
if (externalNode.getIncomingConnections() != null) {
for (IConnection currentConnection : externalNode.getIncomingConnections()) {
IODataComponent component = new IODataComponent(currentConnection);
inputs.add(component);
}
}
List<IODataComponent> outputs = inAndOut.getOuputs();
if (externalNode.getOutgoingConnections() != null) {
for (IConnection currentConnection : externalNode.getOutgoingConnections()) {
IODataComponent component = new IODataComponent(currentConnection);
outputs.add(component);
}
}
externalNode.setIODataComponents(inAndOut);
return externalNode;
}
use of org.talend.core.model.components.IODataComponent in project tdi-studio-se by Talend.
the class ExternalUtilities method getExternalNodeReadyToOpen.
public static IExternalNode getExternalNodeReadyToOpen(Node node) {
IExternalNode externalNode = node.getExternalNode();
if (externalNode == null) {
return null;
}
externalNode.setExternalData(node.getExternalData());
externalNode.setOriginalNode(node);
IODataComponentContainer inAndOut = new IODataComponentContainer();
List<IODataComponent> inputs = inAndOut.getInputs();
for (IConnection currentConnection : node.getIncomingConnections()) {
if (currentConnection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
IODataComponent component = new IODataComponent(currentConnection);
inputs.add(component);
}
}
List<IODataComponent> outputs = inAndOut.getOuputs();
for (IConnection currentConnection : node.getOutgoingConnections()) {
if (currentConnection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
IODataComponent component = new IODataComponent(currentConnection, currentConnection.getMetadataTable().clone(true));
outputs.add(component);
}
}
externalNode.setIODataComponents(inAndOut);
return externalNode;
}
use of org.talend.core.model.components.IODataComponent in project tdi-studio-se by Talend.
the class RowGeneratorComponent method getIODataComponents.
@Override
public IODataComponentContainer getIODataComponents() {
IODataComponentContainer inAndOut = new IODataComponentContainer();
List<IODataComponent> outputs = inAndOut.getOuputs();
for (IConnection currentConnection : getOutgoingConnections()) {
if (currentConnection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
IODataComponent component = new IODataComponent(currentConnection, metadataListOut.get(0));
outputs.add(component);
}
}
return inAndOut;
}
use of org.talend.core.model.components.IODataComponent in project tdi-studio-se by Talend.
the class RowGenMain method createModelFromExternalData.
/**
* qzhang Comment method "createModelFromExternalData".
*
* @param dataComponents
* @param metadataList
* @param externalData
* @param b
*/
public void createModelFromExternalData(IODataComponentContainer dataComponents, List<IMetadataTable> metadataList, ExternalRowGeneratorData externalData, boolean b) {
List<IODataComponent> inputsData = dataComponents.getInputs();
List<IODataComponent> ouputsData = dataComponents.getOuputs();
ArrayList<IOConnection> inputs = new ArrayList<IOConnection>(inputsData.size());
for (IODataComponent iData : inputsData) {
inputs.add(new IOConnection(iData));
}
ArrayList<IOConnection> outputs = new ArrayList<IOConnection>(ouputsData.size());
for (IODataComponent oData : ouputsData) {
outputs.add(new IOConnection(oData));
}
createModelFromExternalData(inputs, outputs, metadataList, externalData, false);
}
Aggregations