use of org.talend.designer.core.model.components.MultipleComponentManager in project tdi-studio-se by Talend.
the class AbstractStatsLogsComponent method loadMultipleComponentManager.
protected void loadMultipleComponentManager() {
String lastComponent = null;
if (useConsole) {
//$NON-NLS-1$
lastComponent = "CONSOLE";
} else if (useDb) {
//$NON-NLS-1$
lastComponent = "DB";
} else {
//$NON-NLS-1$
lastComponent = "FILE";
}
// create base items
IMultipleComponentManager multipleComponentManager = new MultipleComponentManager(componentId, lastComponent);
IMultipleComponentItem currentItem = multipleComponentManager.addItem(componentId, subComponent);
if (useFile) {
//$NON-NLS-1$ //$NON-NLS-2$
currentItem.getOutputConnections().add(new MultipleComponentConnection("FLOW", "FILE"));
//$NON-NLS-1$ //$NON-NLS-2$
currentItem = multipleComponentManager.addItem("FILE", "tFileOutputDelimited");
}
if (useDb) {
//$NON-NLS-1$ //$NON-NLS-2$
currentItem.getOutputConnections().add(new MultipleComponentConnection("FLOW", "DB"));
//$NON-NLS-1$
currentItem = multipleComponentManager.addItem("DB", dbComponent);
}
if (useConsole) {
//$NON-NLS-1$ //$NON-NLS-2$
currentItem.getOutputConnections().add(new MultipleComponentConnection("FLOW", "CONSOLE"));
//$NON-NLS-1$ //$NON-NLS-2$
currentItem = multipleComponentManager.addItem("CONSOLE", "tLogRow");
}
multipleComponentManager.validateItems();
multipleComponentManagers.add(multipleComponentManager);
createMultipleComponentsParameters();
}
use of org.talend.designer.core.model.components.MultipleComponentManager in project tdi-studio-se by Talend.
the class Component method createMultipleComponentManagers.
@Override
protected List<IMultipleComponentManager> createMultipleComponentManagers() {
List<IMultipleComponentManager> multipleComponentManagers = new ArrayList<>();
if (componentDefinition instanceof VirtualComponentDefinition) {
VirtualComponentDefinition definition = (VirtualComponentDefinition) componentDefinition;
String inputComponentName = null;
String outputComponentName = null;
ComponentDefinition inputComponentDefinition = definition.getInputComponentDefinition();
if (inputComponentDefinition != null) {
inputComponentName = inputComponentDefinition.getName();
}
ComponentDefinition outputComponentDefinition = definition.getOutputComponentDefinition();
if (outputComponentDefinition != null) {
outputComponentName = outputComponentDefinition.getName();
}
if (inputComponentName == null || outputComponentName == null) {
return multipleComponentManagers;
}
IMultipleComponentManager multipleComponentManager = new MultipleComponentManager(inputComponentName, outputComponentName);
IMultipleComponentItem inputItem = multipleComponentManager.addItem(inputComponentName, inputComponentName);
multipleComponentManager.setExistsLinkTo(true);
// FIXME: should get the connector type by other way.
String cType = EConnectionType.ON_ROWS_END.getName();
inputItem.getOutputConnections().add(new MultipleComponentConnection(cType, outputComponentName));
multipleComponentManager.addItem(outputComponentName, outputComponentName);
multipleComponentManager.validateItems();
multipleComponentManagers.add(multipleComponentManager);
}
return multipleComponentManagers;
}
use of org.talend.designer.core.model.components.MultipleComponentManager in project tdi-studio-se by Talend.
the class JobContextLoadComponent method loadMultipleComponentManager.
protected void loadMultipleComponentManager() {
IMultipleComponentManager multipleComponentManager = null;
// create base items
if (isFile) {
multipleComponentManager = new MultipleComponentManager(FILE_INPUT_REGEX, CONTEXT_LOAD);
IMultipleComponentItem currentItem = multipleComponentManager.addItem(FILE_INPUT_REGEX, FILE_INPUT_COMPONENT);
currentItem.getOutputConnections().add(new MultipleComponentConnection(EConnectionType.FLOW_MAIN.getName(), CONTEXT_LOAD));
currentItem = multipleComponentManager.addItem(CONTEXT_LOAD, CONTEXTLOAD_COMPONENT);
} else {
if (dbComponent == null) {
return;
}
multipleComponentManager = new MultipleComponentManager(DB_INPUT, CONTEXT_LOAD);
IMultipleComponentItem currentItem = multipleComponentManager.addItem(DB_INPUT, dbComponent);
currentItem.getOutputConnections().add(new MultipleComponentConnection(EConnectionType.FLOW_MAIN.getName(), CONTEXT_LOAD));
currentItem = multipleComponentManager.addItem(CONTEXT_LOAD, CONTEXTLOAD_COMPONENT);
}
multipleComponentManager.validateItems();
multipleComponentManagers.add(multipleComponentManager);
createMultipleComponentsParameters();
}
Aggregations