Search in sources :

Example 51 with ElementParameter

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

the class AbstractStatsLogsComponent method addFileOutputParameters.

protected void addFileOutputParameters(List<IElementParameter> elemParamList, INode node) {
    // parameters for file output.
    IElementParameter newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("FILENAME");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("ROWSEPARATOR");
    newParam.setFieldType(EParameterFieldType.TEXT);
    //$NON-NLS-1$
    newParam.setValue(TalendTextUtils.addQuotes("\\n", TalendTextUtils.QUOTATION_MARK));
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("FIELDSEPARATOR");
    newParam.setFieldType(EParameterFieldType.TEXT);
    //$NON-NLS-1$
    newParam.setValue(TalendTextUtils.addQuotes(";"));
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("APPEND");
    newParam.setFieldType(EParameterFieldType.CHECK);
    newParam.setValue(Boolean.TRUE);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("INCLUDEHEADER");
    newParam.setFieldType(EParameterFieldType.CHECK);
    newParam.setValue(Boolean.FALSE);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("ENCODING");
    newParam.setFieldType(EParameterFieldType.TEXT);
    //$NON-NLS-1$
    newParam.setValue(TalendTextUtils.addQuotes("ISO-8859-15"));
    elemParamList.add(newParam);
}
Also used : IElementParameter(org.talend.core.model.process.IElementParameter) ElementParameter(org.talend.designer.core.model.components.ElementParameter) IElementParameter(org.talend.core.model.process.IElementParameter)

Example 52 with ElementParameter

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

the class AbstractStatsLogsComponent method addDbParameters.

protected void addDbParameters(List<IElementParameter> elemParamList, INode node) {
    // parameters for db output.
    IElementParameter newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("HOST");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    // This parameter is use for Connection Component
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("USE_EXISTING_CONNECTION");
    newParam.setFieldType(EParameterFieldType.CHECK);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("CONNECTION");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    // This parameter is use for Oracle component
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("CONNECTION_TYPE");
    newParam.setFieldType(EParameterFieldType.TEXT);
    newParam.setShow(false);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("SERVER");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("DSN");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("PORT");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("DBNAME");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("DB_VERSION");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("PROPERTIES");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("SCHEMA_DB");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("USER");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("PASS");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("TABLE");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("TABLE_ACTION");
    newParam.setFieldType(EParameterFieldType.TEXT);
    //$NON-NLS-1$
    newParam.setValue("CREATE_IF_NOT_EXISTS");
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("DATA_ACTION");
    newParam.setFieldType(EParameterFieldType.TEXT);
    //$NON-NLS-1$
    newParam.setValue("INSERT");
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("COMMIT_EVERY");
    newParam.setFieldType(EParameterFieldType.TEXT);
    //$NON-NLS-1$
    newParam.setValue("1");
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("USE_SHARED_CONNECTION");
    newParam.setFieldType(EParameterFieldType.CHECK);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("SHARED_CONNECTION_NAME");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("USE_TRANSACTION");
    newParam.setFieldType(EParameterFieldType.CHECK);
    elemParamList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("LOCAL_SERVICE_NAME");
    newParam.setFieldType(EParameterFieldType.TEXT);
    elemParamList.add(newParam);
}
Also used : IElementParameter(org.talend.core.model.process.IElementParameter) ElementParameter(org.talend.designer.core.model.components.ElementParameter) IElementParameter(org.talend.core.model.process.IElementParameter)

Example 53 with ElementParameter

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

the class JobLogsComponent method createElementParameters.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.designer.core.model.process.statsandlogs.AbstractStatsLogsComponent#createElementParameters(org.talend
     * .core.model.process.INode)
     */
@Override
public List<? extends IElementParameter> createElementParameters(INode node) {
    List<IElementParameter> paramList = (List<IElementParameter>) super.createElementParameters(node);
    IElementParameter newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("CATCH_RUNTIME_ERRORS");
    newParam.setFieldType(EParameterFieldType.TEXT);
    newParam.setValue(Boolean.TRUE);
    paramList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("CATCH_USER_ERRORS");
    newParam.setFieldType(EParameterFieldType.TEXT);
    newParam.setValue(Boolean.TRUE);
    paramList.add(newParam);
    newParam = new ElementParameter(node);
    //$NON-NLS-1$
    newParam.setName("CATCH_USER_WARNING");
    newParam.setFieldType(EParameterFieldType.TEXT);
    newParam.setValue(Boolean.FALSE);
    paramList.add(newParam);
    return paramList;
}
Also used : ElementParameter(org.talend.designer.core.model.components.ElementParameter) IElementParameter(org.talend.core.model.process.IElementParameter) IElementParameter(org.talend.core.model.process.IElementParameter) List(java.util.List)

Example 54 with ElementParameter

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

the class StatsAndLogsHelper method statsAndLogsParametersDBPart.

private static void statsAndLogsParametersDBPart(Element elem) {
    ElementParameter param;
    IPreferenceStore preferenceStore = DesignerPlugin.getDefault().getPreferenceStore();
    List<IElementParameter> paramList = (List<IElementParameter>) elem.getElementParameters();
    // checks current language, if it is perl, set languageType to 0(default value), otherwise to 1.
    int languageType = 0;
    if (LanguageManager.getCurrentLanguage().equals(ECodeLanguage.JAVA)) {
        languageType = 1;
    }
    //$NON-NLS-1$
    String languagePrefix = LanguageManager.getCurrentLanguage().toString() + "_";
    // on database
    param = new ElementParameter(elem);
    param.setName(EParameterName.ON_DATABASE_FLAG.getName());
    param.setValue(preferenceStore.getBoolean(languagePrefix + EParameterName.ON_DATABASE_FLAG.getName()));
    // On Database
    param.setDisplayName(EParameterName.ON_DATABASE_FLAG.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(50);
    //$NON-NLS-1$
    param.setShowIf("(ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')");
    paramList.add(param);
    ElementParameter parentPropertyType = new ElementParameter(elem);
    parentPropertyType.setName(EParameterName.PROPERTY_TYPE.getName());
    parentPropertyType.setDisplayName(EParameterName.PROPERTY_TYPE.getDisplayName());
    //$NON-NLS-1$
    parentPropertyType.setValue("");
    parentPropertyType.setCategory(EComponentCategory.STATSANDLOGS);
    parentPropertyType.setFieldType(EParameterFieldType.PROPERTY_TYPE);
    parentPropertyType.setRepositoryValue(ERepositoryCategoryType.DATABASE.getName());
    parentPropertyType.setNumRow(51);
    parentPropertyType.setShowIf(//$NON-NLS-1$
    "(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')");
    paramList.add(parentPropertyType);
    param = new ElementParameter(elem);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setName(EParameterName.PROPERTY_TYPE.getName());
    param.setDisplayName(EParameterName.PROPERTY_TYPE.getDisplayName());
    param.setListItemsDisplayName(new String[] { EmfComponent.TEXT_BUILTIN, EmfComponent.TEXT_REPOSITORY });
    param.setListItemsDisplayCodeName(new String[] { EmfComponent.BUILTIN, EmfComponent.REPOSITORY });
    param.setListItemsValue(new String[] { EmfComponent.BUILTIN, EmfComponent.REPOSITORY });
    param.setValue(preferenceStore.getString(languagePrefix + EParameterName.PROPERTY_TYPE.getName()));
    param.setNumRow(51);
    param.setFieldType(EParameterFieldType.TECHNICAL);
    param.setRepositoryValue(ERepositoryCategoryType.DATABASE.getName());
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')");
    param.setParentParameter(parentPropertyType);
    // paramList.add(param);
    param = new ElementParameter(elem);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setName(EParameterName.REPOSITORY_PROPERTY_TYPE.getName());
    param.setDisplayName(EParameterName.REPOSITORY_PROPERTY_TYPE.getDisplayName());
    param.setListItemsDisplayName(new String[] {});
    param.setListItemsValue(new String[] {});
    param.setNumRow(51);
    param.setFieldType(EParameterFieldType.TECHNICAL);
    param.setValue(// +
    preferenceStore.getString(// +
    languagePrefix + EParameterName.REPOSITORY_PROPERTY_TYPE.getName()));
    param.setShow(false);
    param.setRequired(true);
    // paramList.add(param);
    param.setParentParameter(parentPropertyType);
    // dbType
    param = new ElementParameter(elem);
    param.setName(EParameterName.DB_TYPE.getName());
    String type = preferenceStore.getString(languagePrefix + EParameterName.DB_TYPE.getName());
    if (type == null || "".equals(type.trim())) {
        //$NON-NLS-1$
        type = StatsAndLogsConstants.DB_COMPONENTS[languageType][0];
    }
    param.setValue(type);
    param.setDisplayName(EParameterName.DB_TYPE.getDisplayName());
    param.setFieldType(EParameterFieldType.CLOSED_LIST);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setListItemsDisplayName(StatsAndLogsConstants.DISPLAY_DBNAMES[languageType]);
    param.setListItemsValue(StatsAndLogsConstants.DB_COMPONENTS[languageType]);
    param.setListRepositoryItems(StatsAndLogsConstants.REPOSITORY_ITEMS[languageType]);
    param.setListItemsDisplayCodeName(StatsAndLogsConstants.CODE_LIST[languageType]);
    param.setNumRow(52);
    //$NON-NLS-1$
    param.setRepositoryValue("TYPE");
    param.setRequired(true);
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')");
    paramList.add(param);
    // dbVersion
    param = new ElementParameter(elem);
    param.setName(EParameterName.DB_VERSION.getName());
    param.setValue(StatsAndLogsConstants.DB_VERSION_DRIVER[1]);
    param.setDisplayName(EParameterName.DB_VERSION.getDisplayName());
    param.setFieldType(EParameterFieldType.CLOSED_LIST);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setListItemsDisplayName(StatsAndLogsConstants.DB_VERSION_DISPLAY);
    param.setListItemsValue(StatsAndLogsConstants.DB_VERSION_DRIVER);
    param.setListItemsDisplayCodeName(StatsAndLogsConstants.DB_VERSION_CODE);
    param.setNumRow(52);
    //$NON-NLS-1$
    param.setRepositoryValue("DB_VERSION");
    param.setRequired(true);
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (DB_TYPE == 'POSTGRESQL' or DB_TYPE == 'OCLE' or DB_TYPE == 'OCLE_OCI' or DB_TYPE == 'ACCESS' or DB_TYPE == 'MSSQL' or DB_TYPE == 'MYSQL') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')");
    paramList.add(param);
    // jdbc url
    param = new ElementParameter(elem);
    param.setName(EParameterName.URL.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.URL.getName())));
    param.setDisplayName(EParameterName.URL.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(53);
    //$NON-NLS-1$
    param.setRepositoryValue("URL");
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true') and (DB_TYPE=='JDBC')");
    paramList.add(param);
    // jdbc child param
    List<ModuleNeeded> moduleNeededList = ModulesNeededProvider.getModulesNeeded();
    Set<String> moduleNameList = new TreeSet<String>();
    Set<String> moduleValueList = new TreeSet<String>();
    for (ModuleNeeded module : moduleNeededList) {
        String moduleName = module.getModuleName();
        if (moduleName != null) {
            moduleNameList.add(moduleName);
            moduleValueList.add(TalendTextUtils.addQuotes(moduleName));
        }
    }
    Comparator<String> comprarator = new IgnoreCaseComparator();
    String[] moduleNameArray = moduleNameList.toArray(new String[0]);
    String[] moduleValueArray = moduleValueList.toArray(new String[0]);
    Arrays.sort(moduleNameArray, comprarator);
    Arrays.sort(moduleValueArray, comprarator);
    ElementParameter childParam = new ElementParameter(elem);
    childParam.setName("JAR_NAME");
    childParam.setDisplayName("JAR_NAME");
    childParam.setFieldType(EParameterFieldType.MODULE_LIST);
    childParam.setListItemsDisplayName(moduleNameArray);
    childParam.setListItemsValue(moduleValueArray);
    // driver jar for jdbc
    param = new ElementParameter(elem);
    param.setName(EParameterName.DRIVER_JAR.getName());
    param.setDisplayName(EParameterName.DRIVER_JAR.getDisplayName());
    param.setFieldType(EParameterFieldType.TABLE);
    param.setListItemsDisplayCodeName(new String[] { "JAR_NAME" });
    param.setListItemsDisplayName(new String[] { "Jar Name" });
    param.setListItemsValue(new ElementParameter[] { childParam });
    param.setValue(new ArrayList<Map<String, Object>>());
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(54);
    //$NON-NLS-1$
    param.setRepositoryValue("DRIVER_JAR");
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true') and (DB_TYPE=='JDBC')");
    paramList.add(param);
    // class name for jdbc
    param = new ElementParameter(elem);
    param.setName(EParameterName.DRIVER_CLASS.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.DRIVER_CLASS.getName())));
    param.setDisplayName(EParameterName.DRIVER_CLASS.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(57);
    //$NON-NLS-1$
    param.setRepositoryValue("DRIVER_CLASS");
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true') and (DB_TYPE=='JDBC')");
    paramList.add(param);
    // host
    param = new ElementParameter(elem);
    param.setName(EParameterName.HOST.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.HOST.getName())));
    param.setDisplayName(EParameterName.HOST.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(53);
    //$NON-NLS-1$
    param.setRepositoryValue("SERVER_NAME");
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true') and (DB_TYPE!='SQLITE' and DB_TYPE!='ACCESS' and DB_TYPE!='OCLE_OCI'  and DB_TYPE!='JDBC')");
    paramList.add(param);
    // port
    param = new ElementParameter(elem);
    param.setName(EParameterName.PORT.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.PORT.getName())));
    param.setDisplayName(EParameterName.PORT.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(53);
    //$NON-NLS-1$
    param.setRepositoryValue("PORT");
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true') and (DB_TYPE!='SQLITE' and DB_TYPE!='ACCESS' and DB_TYPE!='FIREBIRD' and DB_TYPE!='OCLE_OCI'  and DB_TYPE!='JDBC')");
    paramList.add(param);
    // dbName
    param = new ElementParameter(elem);
    param.setName(EParameterName.DBNAME.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.DBNAME.getName())));
    param.setDisplayName(EParameterName.DBNAME.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(54);
    //$NON-NLS-1$
    param.setRepositoryValue("SID");
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true') and (DB_TYPE!='SQLITE' and DB_TYPE!='ACCESS' and DB_TYPE!='FIREBIRD' and DB_TYPE!='OCLE_OCI'  and DB_TYPE!='JDBC')");
    paramList.add(param);
    // local service name
    param = new ElementParameter(elem);
    param.setName(EParameterName.LOCAL_SERVICE_NAME.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.LOCAL_SERVICE_NAME.getName())));
    param.setDisplayName(EParameterName.LOCAL_SERVICE_NAME.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(54);
    //$NON-NLS-1$
    param.setRepositoryValue("SID");
    //$NON-NLS-1$ 
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true') and DB_TYPE =='OCLE_OCI'");
    paramList.add(param);
    // additional parameters
    param = new ElementParameter(elem);
    param.setName(EParameterName.PROPERTIES.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.PROPERTIES.getName())));
    param.setDisplayName(EParameterName.PROPERTIES.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(54);
    //$NON-NLS-1$
    param.setRepositoryValue("PROPERTIES_STRING");
    //$NON-NLS-1$
    param.setShowIf("(DB_TYPE=='MSSQL' or DB_TYPE=='MYSQL' or DB_TYPE=='INFORMIX' or DB_TYPE=='OCLE' or DB_TYPE=='OCLE_OCI' or DB_TYPE=='SYBASE') and (ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')");
    paramList.add(param);
    // schema
    param = new ElementParameter(elem);
    param.setName(EParameterName.SCHEMA_DB.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.SCHEMA_DB.getName())));
    param.setDisplayName(EParameterName.SCHEMA_DB.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(54);
    //$NON-NLS-1$
    param.setRepositoryValue("SCHEMA");
    //$NON-NLS-1$
    param.setShowIf("(DB_TYPE=='OCLE' or DB_TYPE=='OCLE_OCI' or DB_TYPE=='POSTGRESQL' or DB_TYPE=='POSTGRESPLUS' or DB_TYPE=='MSSQL' or DB_TYPE=='INFORMIX' or DB_TYPE=='IBM_DB2' or DB_TYPE=='SYBASE') and (ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')");
    paramList.add(param);
    // username
    param = new ElementParameter(elem);
    param.setName(EParameterName.USER.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.USER.getName())));
    param.setDisplayName(EParameterName.USER.getDisplayName());
    param.setFieldType(EParameterFieldType.TEXT);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(55);
    param.setRequired(true);
    //$NON-NLS-1$
    param.setRepositoryValue("USERNAME");
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')and (DB_TYPE!='SQLITE')");
    paramList.add(param);
    // password
    param = new ElementParameter(elem);
    param.setName(EParameterName.PASS.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.PASS.getName())));
    param.setDisplayName(EParameterName.PASS.getDisplayName());
    param.setFieldType(EParameterFieldType.PASSWORD);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(55);
    param.setRequired(true);
    //$NON-NLS-1$
    param.setRepositoryValue("PASSWORD");
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true') and (DB_TYPE!='SQLITE')");
    paramList.add(param);
    // databse file path
    param = new ElementParameter(elem);
    param.setName(EParameterName.DBFILE.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.DBFILE.getName())));
    param.setDisplayName(EParameterName.DBFILE.getDisplayName());
    param.setFieldType(EParameterFieldType.FILE);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(56);
    //$NON-NLS-1$
    param.setRepositoryValue("FILE");
    //$NON-NLS-1$
    param.setShowIf("(DB_TYPE=='SQLITE' or DB_TYPE=='ACCESS' or DB_TYPE=='FIREBIRD') and (ON_DATABASE_FLAG == 'true') and (ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')");
    paramList.add(param);
    // Stats table
    param = new ElementParameter(elem);
    param.setName(EParameterName.TABLE_STATS.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.TABLE_STATS.getName())));
    param.setDisplayName(EParameterName.TABLE_STATS.getDisplayName());
    param.setFieldType(EParameterFieldType.DBTABLE);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(57);
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true' and ON_STATCATCHER_FLAG == 'true')");
    paramList.add(param);
    // Log table
    param = new ElementParameter(elem);
    param.setName(EParameterName.TABLE_LOGS.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.TABLE_LOGS.getName())));
    param.setDisplayName(EParameterName.TABLE_LOGS.getDisplayName());
    param.setFieldType(EParameterFieldType.DBTABLE);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(58);
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true' and ON_LOGCATCHER_FLAG == 'true')");
    paramList.add(param);
    // Metter table
    param = new ElementParameter(elem);
    param.setName(EParameterName.TABLE_METER.getName());
    param.setValue(addQuotes(preferenceStore.getString(languagePrefix + EParameterName.TABLE_METER.getName())));
    param.setDisplayName(EParameterName.TABLE_METER.getDisplayName());
    param.setFieldType(EParameterFieldType.DBTABLE);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(59);
    //$NON-NLS-1$
    param.setShowIf("(ON_DATABASE_FLAG == 'true' and ON_METERCATCHER_FLAG == 'true')");
    paramList.add(param);
}
Also used : IElementParameter(org.talend.core.model.process.IElementParameter) ElementParameter(org.talend.designer.core.model.components.ElementParameter) TreeSet(java.util.TreeSet) IElementParameter(org.talend.core.model.process.IElementParameter) ArrayList(java.util.ArrayList) List(java.util.List) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) ModuleNeeded(org.talend.core.model.general.ModuleNeeded) Map(java.util.Map)

Example 55 with ElementParameter

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

the class StatsAndLogsHelper method statsAndLogsParametersTitlePart.

private static void statsAndLogsParametersTitlePart(Element elem) {
    ElementParameter param;
    IPreferenceStore preferenceStore = DesignerPlugin.getDefault().getPreferenceStore();
    List<IElementParameter> paramList = (List<IElementParameter>) elem.getElementParameters();
    //$NON-NLS-1$
    String languagePrefix = LanguageManager.getCurrentLanguage().toString() + "_";
    param = new ElementParameter(elem);
    param.setName(EParameterName.UPDATE_COMPONENTS.getName());
    param.setValue(Boolean.FALSE);
    param.setDisplayName(EParameterName.UPDATE_COMPONENTS.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(1);
    param.setReadOnly(true);
    param.setRequired(false);
    param.setShow(false);
    paramList.add(param);
    param = new ElementParameter(elem);
    param.setName(EParameterName.STATS_DEFAULT_PROJECTSETTING.getName());
    param.setValue(Boolean.TRUE);
    param.setGroupDisplayName(EParameterName.STATS_DEFAULT_PROJECTSETTING.getDisplayName());
    param.setDisplayName(EParameterName.STATS_DEFAULT_PROJECTSETTING.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(3);
    param.setShow(false);
    paramList.add(param);
    param = new ElementParameter(elem);
    param.setName(EParameterName.ON_STATCATCHER_FLAG.getName());
    param.setValue(preferenceStore.getBoolean(languagePrefix + EParameterName.ON_STATCATCHER_FLAG.getName()));
    param.setDisplayName(EParameterName.ON_STATCATCHER_FLAG.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(1);
    paramList.add(param);
    param = new ElementParameter(elem);
    param.setName(EParameterName.ON_LOGCATCHER_FLAG.getName());
    param.setValue(preferenceStore.getBoolean(languagePrefix + EParameterName.ON_LOGCATCHER_FLAG.getName()));
    param.setDisplayName(EParameterName.ON_LOGCATCHER_FLAG.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(1);
    paramList.add(param);
    param = new ElementParameter(elem);
    param.setName(EParameterName.ON_METERCATCHER_FLAG.getName());
    param.setValue(preferenceStore.getBoolean(languagePrefix + EParameterName.ON_METERCATCHER_FLAG.getName()));
    param.setDisplayName(EParameterName.ON_METERCATCHER_FLAG.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(1);
    paramList.add(param);
    // on console
    param = new ElementParameter(elem);
    param.setName(EParameterName.ON_CONSOLE_FLAG.getName());
    param.setValue(Boolean.FALSE);
    param.setDisplayName(EParameterName.ON_CONSOLE_FLAG.getDisplayName());
    param.setFieldType(EParameterFieldType.CHECK);
    param.setCategory(EComponentCategory.STATSANDLOGS);
    param.setNumRow(2);
    //$NON-NLS-1$
    param.setShowIf("(ON_STATCATCHER_FLAG == 'true' or ON_LOGCATCHER_FLAG == 'true' or ON_METERCATCHER_FLAG == 'true')");
    paramList.add(param);
}
Also used : IElementParameter(org.talend.core.model.process.IElementParameter) ElementParameter(org.talend.designer.core.model.components.ElementParameter) IElementParameter(org.talend.core.model.process.IElementParameter) ArrayList(java.util.ArrayList) List(java.util.List) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore)

Aggregations

ElementParameter (org.talend.designer.core.model.components.ElementParameter)72 IElementParameter (org.talend.core.model.process.IElementParameter)62 ArrayList (java.util.ArrayList)44 List (java.util.List)26 INode (org.talend.core.model.process.INode)20 Map (java.util.Map)19 HashMap (java.util.HashMap)15 Node (org.talend.designer.core.ui.editor.nodes.Node)12 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)11 GenericElementParameter (org.talend.designer.core.generic.model.GenericElementParameter)10 Test (org.junit.Test)9 IComponent (org.talend.core.model.components.IComponent)8 ComponentProperties (org.talend.components.api.properties.ComponentProperties)7 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)7 IConnection (org.talend.core.model.process.IConnection)7 Form (org.talend.daikon.properties.presentation.Form)6 ModuleNeeded (org.talend.core.model.general.ModuleNeeded)5 IMetadataColumn (org.talend.core.model.metadata.IMetadataColumn)5 INodeConnector (org.talend.core.model.process.INodeConnector)5 IProcess (org.talend.core.model.process.IProcess)4