use of org.talend.designer.core.model.process.DataNode in project tdi-studio-se by Talend.
the class DesignerCoreService method getRefrenceNode.
@Override
public INode getRefrenceNode(String componentName, String paletteType) {
if (componentName == null) {
return null;
}
IComponentsFactory compFac = CorePlugin.getDefault().getRepositoryService().getComponentsFactory();
IComponent component = compFac.get(componentName, paletteType);
if (component == null) {
return null;
}
return new DataNode(component, componentName);
}
use of org.talend.designer.core.model.process.DataNode in project tdi-studio-se by Talend.
the class StatsAndLogsManager method createLogsNode.
private static DataNode createLogsNode(boolean useFile, boolean console, String dbOutput) {
JobLogsComponent logsComponent = new JobLogsComponent(useFile, console, dbOutput);
DataNode logsNode = new DataNode(logsComponent, LOG_UNIQUE_NAME);
logsNode.setStart(true);
logsNode.setSubProcessStart(true);
logsNode.setActivate(true);
logsNode.getMetadataList().clear();
// load the tLogCatcher to get the schema.
IComponent tmpComponent = ComponentsFactoryProvider.getInstance().get("tLogCatcher", //$NON-NLS-1$
ComponentCategory.CATEGORY_4_DI.getName());
//$NON-NLS-1$
DataNode tmpNode = new DataNode(tmpComponent, "tmp");
boolean found = false;
for (int k = 0; k < tmpNode.getElementParameters().size() && !found; k++) {
IElementParameter currentParam = tmpNode.getElementParameters().get(k);
if (currentParam.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) || currentParam.getFieldType().equals(EParameterFieldType.SCHEMA_REFERENCE)) {
Object value = currentParam.getValue();
if (value instanceof IMetadataTable) {
IMetadataTable table = ((IMetadataTable) value).clone();
table.setTableName(LOG_UNIQUE_NAME);
table.setAttachedConnector(currentParam.getContext());
logsNode.getMetadataList().add(table);
}
found = true;
}
}
return logsNode;
}
use of org.talend.designer.core.model.process.DataNode in project tdi-studio-se by Talend.
the class StatsAndLogsManager method createStatsNode.
private static DataNode createStatsNode(boolean useFile, boolean console, String dbOutput) {
JobStatsComponent statsComponent = new JobStatsComponent(useFile, console, dbOutput);
DataNode statsNode = new DataNode(statsComponent, STAT_UNIQUE_NAME);
statsNode.setStart(true);
statsNode.setSubProcessStart(true);
statsNode.setActivate(true);
statsNode.getMetadataList().clear();
// load the tStatCatcher to get the schema.
IComponent tmpComponent = ComponentsFactoryProvider.getInstance().get("tStatCatcher", //$NON-NLS-1$
ComponentCategory.CATEGORY_4_DI.getName());
//$NON-NLS-1$
DataNode tmpNode = new DataNode(tmpComponent, "tmp");
boolean found = false;
for (int k = 0; k < tmpNode.getElementParameters().size() && !found; k++) {
IElementParameter currentParam = tmpNode.getElementParameters().get(k);
if (currentParam.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) || currentParam.getFieldType().equals(EParameterFieldType.SCHEMA_REFERENCE)) {
Object value = currentParam.getValue();
if (value instanceof IMetadataTable) {
IMetadataTable table = ((IMetadataTable) value).clone();
table.setTableName(STAT_UNIQUE_NAME);
table.setAttachedConnector(currentParam.getContext());
statsNode.getMetadataList().add(table);
}
found = true;
}
}
return statsNode;
}
use of org.talend.designer.core.model.process.DataNode in project tdi-studio-se by Talend.
the class Connection method createParallelizeParameters.
private void createParallelizeParameters() {
// flag for start the parlization or not for the inputs
ElementParameter tmpParam = new ElementParameter(this);
tmpParam.setName(EParameterName.PARTITIONER.getName());
tmpParam.setValue(Boolean.FALSE);
tmpParam.setDisplayName(EParameterName.PARTITIONER.getDisplayName());
tmpParam.setFieldType(EParameterFieldType.RADIO);
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
tmpParam.setNumRow(1);
tmpParam.setReadOnly(false);
tmpParam.setRequired(false);
//$NON-NLS-1$
tmpParam.setGroup("TYPE");
tmpParam.setGroupDisplayName("Type");
tmpParam.setShowIf("(#NODE@OUT.END_OF_FLOW == 'false' OR #NODE@IN.SUBTREE_START == 'true')");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
tmpParam = new ElementParameter(this);
tmpParam.setName(EParameterName.DEPARTITIONER.getName());
tmpParam.setValue(Boolean.FALSE);
tmpParam.setDisplayName(EParameterName.DEPARTITIONER.getDisplayName());
tmpParam.setFieldType(EParameterFieldType.RADIO);
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
tmpParam.setNumRow(2);
tmpParam.setReadOnly(false);
tmpParam.setRequired(false);
tmpParam.setShowIf("#NODE@IN.SUBTREE_START == 'false'");
//$NON-NLS-1$
tmpParam.setGroup("TYPE");
tmpParam.setGroupDisplayName("Type");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
tmpParam = new ElementParameter(this);
tmpParam.setName(EParameterName.REPARTITIONER.getName());
tmpParam.setValue(Boolean.FALSE);
tmpParam.setDisplayName(EParameterName.REPARTITIONER.getDisplayName());
tmpParam.setFieldType(EParameterFieldType.RADIO);
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
tmpParam.setNumRow(3);
tmpParam.setReadOnly(false);
tmpParam.setRequired(false);
tmpParam.setShowIf("(#NODE@IN.SUBTREE_START == 'false' AND #NODE@OUT.END_OF_FLOW == 'false')");
//$NON-NLS-1$
tmpParam.setGroup("TYPE");
tmpParam.setGroupDisplayName("Type");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
tmpParam = new ElementParameter(this);
tmpParam.setName(EParameterName.NONE.getName());
tmpParam.setValue(Boolean.TRUE);
tmpParam.setDisplayName(EParameterName.NONE.getDisplayName());
tmpParam.setFieldType(EParameterFieldType.RADIO);
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
tmpParam.setNumRow(4);
tmpParam.setReadOnly(false);
tmpParam.setRequired(false);
tmpParam.setShow(true);
//$NON-NLS-1$
tmpParam.setGroup("TYPE");
tmpParam.setGroupDisplayName("Type");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
IComponent componentPar = ComponentsFactoryProvider.getInstance().get("tPartitioner", ComponentCategory.CATEGORY_4_DI.getName());
INode tmpNode = new DataNode(componentPar, source.getUniqueName());
tmpParam = (ElementParameter) tmpNode.getElementParameter("NUM_PARTITIONS");
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
tmpParam.setShowIf("(PARTITIONER == 'true' or REPARTITIONER=='true')");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
tmpParam = new ElementParameter(this);
tmpParam.setName("PART_QUEUE_SIZE");
tmpParam.setValue("1000");
tmpParam.setDisplayName(EParameterName.QUEUE_SIZE.getDisplayName());
tmpParam.setFieldType(EParameterFieldType.TEXT);
tmpParam.setNumRow(45);
tmpParam.setReadOnly(false);
tmpParam.setRequired(false);
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
tmpParam.setShowIf("(PARTITIONER == 'true' or REPARTITIONER=='true') and (DEPARTITIONER=='false')");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
tmpParam = (ElementParameter) tmpNode.getElementParameter("HASH_PARTITION");
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
tmpParam.setShowIf("(PARTITIONER == 'true' or REPARTITIONER=='true')");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
tmpParam = (ElementParameter) tmpNode.getElementParameter("HASH_KEYS");
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
tmpParam.setShowIf("(PARTITIONER == 'true' or REPARTITIONER=='true') and (HASH_PARTITION=='true')");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
tmpParam = new ElementParameter(this);
tmpParam.setName("DEPART_QUEUE_SIZE");
tmpParam.setValue("1000");
tmpParam.setDisplayName(EParameterName.QUEUE_SIZE.getDisplayName());
tmpParam.setFieldType(EParameterFieldType.TEXT);
tmpParam.setNumRow(45);
tmpParam.setReadOnly(false);
tmpParam.setRequired(false);
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
// "(DEPARTITIONER == 'true' or REPARTITIONER=='true')"
tmpParam.setShowIf("(DEPARTITIONER == 'true' or REPARTITIONER=='true') and (PARTITIONER=='false')");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
IComponent componentCol = ComponentsFactoryProvider.getInstance().get("tRecollector", ComponentCategory.CATEGORY_4_DI.getName());
INode tmpNode1 = new DataNode(componentCol, source.getUniqueName());
tmpParam = (ElementParameter) tmpNode1.getElementParameter("IS_SORTING");
tmpParam.setCategory(EComponentCategory.PARALLELIZATION);
tmpParam.setShowIf("(DEPARTITIONER == 'true' or REPARTITIONER=='true')");
tmpParam.setDefaultValue(tmpParam.getValue());
addElementParameter(tmpParam);
}
use of org.talend.designer.core.model.process.DataNode in project tdi-studio-se by Talend.
the class JobSettingsManager method getSchemaTablefromComponent.
private static IMetadataTable getSchemaTablefromComponent(final String componentName, final String tableName) {
IComponent tmpComponent = ComponentsFactoryProvider.getInstance().get(componentName, ComponentCategory.CATEGORY_4_DI.getName());
//$NON-NLS-1$
DataNode tmpNode = new DataNode(tmpComponent, "tmp");
for (int k = 0; k < tmpNode.getElementParameters().size(); k++) {
IElementParameter currentParam = tmpNode.getElementParameters().get(k);
if (currentParam.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) || currentParam.getFieldType().equals(EParameterFieldType.SCHEMA_REFERENCE)) {
Object value = currentParam.getValue();
if (value instanceof IMetadataTable) {
IMetadataTable table = null;
if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.JAVA)) {
table = ((IMetadataTable) value).clone(true);
} else {
table = ((IMetadataTable) value).clone();
}
table.setTableName(tableName);
table.setAttachedConnector(currentParam.getContext());
// fix for TUP-3972: set defult value
for (IMetadataColumn column : table.getListColumns()) {
column.setDefault("\"\"");
}
return table;
}
}
}
return null;
}
Aggregations