Search in sources :

Example 1 with IODataComponentContainer

use of org.talend.core.model.components.IODataComponentContainer in project tdi-studio-se by Talend.

the class DbMapComponent method addInput.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.core.model.process.AbstractNode#addInput(org.talend.core.model.process.IConnection)
     */
@Override
public void addInput(IConnection connection) {
    Object eData = getExternalEmfData();
    if (eData == null) {
        return;
    }
    DBMapData externalEmfData = (DBMapData) eData;
    ExternalNodeUtils.prepareExternalNodeReadyToOpen(this);
    IODataComponentContainer iContainer = getIODataComponents();
    if (iContainer != null) {
        mapperMain.initIOConnections(iContainer);
        mapperMain.getMapperManager().initInternalData();
    }
    buildExternalData(externalEmfData);
}
Also used : DBMapData(org.talend.designer.dbmap.model.emf.dbmap.DBMapData) IODataComponentContainer(org.talend.core.model.components.IODataComponentContainer)

Example 2 with IODataComponentContainer

use of org.talend.core.model.components.IODataComponentContainer in project tdi-studio-se by Talend.

the class DbMapComponent method removeInput.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.core.model.process.AbstractNode#removeInput(org.talend.core.model.process.IConnection)
     */
@Override
public void removeInput(IConnection connection) {
    Connection conn = null;
    DBMapData externalEmfData = (DBMapData) getExternalEmfData();
    InputTable toRemove = null;
    for (InputTable inputTable : externalEmfData.getInputTables()) {
        if (inputTable.getTableName() != null && inputTable.getTableName().equals(connection.getName())) {
            toRemove = inputTable;
            break;
        }
    }
    if (toRemove != null) {
        EList<InputTable> inputTableList = externalEmfData.getInputTables();
        inputTableList.remove(toRemove);
        ExternalNodeUtils.prepareExternalNodeReadyToOpen(getExternalNode());
        IODataComponentContainer iContainer = getIODataComponents();
        if (iContainer != null) {
            mapperMain.initIOConnections(iContainer);
            mapperMain.getMapperManager().initInternalData();
        }
        buildExternalData(externalEmfData);
    }
}
Also used : InputTable(org.talend.designer.dbmap.model.emf.dbmap.InputTable) DBMapData(org.talend.designer.dbmap.model.emf.dbmap.DBMapData) Connection(org.talend.designer.core.ui.editor.connections.Connection) IConnection(org.talend.core.model.process.IConnection) IODataComponentContainer(org.talend.core.model.components.IODataComponentContainer)

Example 3 with IODataComponentContainer

use of org.talend.core.model.components.IODataComponentContainer 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;
}
Also used : IConnection(org.talend.core.model.process.IConnection) IODataComponent(org.talend.core.model.components.IODataComponent) IODataComponentContainer(org.talend.core.model.components.IODataComponentContainer)

Example 4 with IODataComponentContainer

use of org.talend.core.model.components.IODataComponentContainer in project tdi-studio-se by Talend.

the class WebServiceComponent 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, getMetadataList().get(1));
            outputs.add(component);
        }
    }
    List<IODataComponent> inputs = inAndOut.getInputs();
    for (IConnection currentConnection : getIncomingConnections()) {
        if (currentConnection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {
            IODataComponent component = new IODataComponent(currentConnection, inputMetadata);
            inputs.add(component);
        }
    }
    return inAndOut;
}
Also used : IConnection(org.talend.core.model.process.IConnection) IODataComponent(org.talend.core.model.components.IODataComponent) IODataComponentContainer(org.talend.core.model.components.IODataComponentContainer)

Example 5 with IODataComponentContainer

use of org.talend.core.model.components.IODataComponentContainer in project tdi-studio-se by Talend.

the class spssComponent method getIODataComponents.

@Override
public IODataComponentContainer getIODataComponents() {
    IODataComponentContainer inAndOut = new IODataComponentContainer();
    List<IODataComponent> outputs = inAndOut.getOuputs();
    if (null != getOutgoingConnections()) {
        for (IConnection currentConnection : getOutgoingConnections()) {
            IODataComponent component = new IODataComponent(currentConnection, getMetadataList().get(0));
            outputs.add(component);
        }
    }
    List<IODataComponent> inputs = inAndOut.getInputs();
    if (null != getIncomingConnections()) {
        for (IConnection currentConnection : getIncomingConnections()) {
            IODataComponent component = new IODataComponent(currentConnection, getMetadataList().get(0));
            inputs.add(component);
        }
    }
    return inAndOut;
}
Also used : IConnection(org.talend.core.model.process.IConnection) IODataComponent(org.talend.core.model.components.IODataComponent) IODataComponentContainer(org.talend.core.model.components.IODataComponentContainer)

Aggregations

IODataComponentContainer (org.talend.core.model.components.IODataComponentContainer)8 IConnection (org.talend.core.model.process.IConnection)7 IODataComponent (org.talend.core.model.components.IODataComponent)6 Connection (org.talend.designer.core.ui.editor.connections.Connection)2 DBMapData (org.talend.designer.dbmap.model.emf.dbmap.DBMapData)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 IExternalNode (org.talend.core.model.process.IExternalNode)1 InputTable (org.talend.designer.dbmap.model.emf.dbmap.InputTable)1