Search in sources :

Example 11 with ConnectionItem

use of org.talend.core.model.properties.ConnectionItem in project tdi-studio-se by Talend.

the class ConvertLabelForConnectionItemMigrationTask method execute.

@Override
public ExecutionResult execute(Item item) {
    boolean changed = false;
    if (item instanceof ConnectionItem) {
        ConnectionItem conItem = (ConnectionItem) item;
        Connection connection = conItem.getConnection();
        Set tables = ConnectionHelper.getTables(connection);
        for (Object tableObj : tables) {
            MetadataTable table = (MetadataTable) tableObj;
            String label = table.getLabel();
            if (label != null) {
                String validateValue = MetadataToolHelper.validateValue(label);
                if (validateValue != null && !label.equals(validateValue)) {
                    table.setLabel(validateValue);
                    changed = true;
                }
            }
        }
    }
    if (changed) {
        try {
            FACTORY.save(item, true);
            return ExecutionResult.SUCCESS_NO_ALERT;
        } catch (PersistenceException e) {
            ExceptionHandler.process(e);
            return ExecutionResult.FAILURE;
        }
    }
    return ExecutionResult.NOTHING_TO_DO;
}
Also used : Set(java.util.Set) ConnectionItem(org.talend.core.model.properties.ConnectionItem) Connection(org.talend.core.model.metadata.builder.connection.Connection) MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) PersistenceException(org.talend.commons.exception.PersistenceException)

Example 12 with ConnectionItem

use of org.talend.core.model.properties.ConnectionItem in project tdi-studio-se by Talend.

the class RepositoryChangeMetadataCommand method setTableRelevantParameterValues.

protected void setTableRelevantParameterValues() {
    Connection conn = connection;
    if (conn == null) {
        if (newPropValue != null && newPropValue instanceof String) {
            String schemaId = (String) newPropValue;
            //$NON-NLS-1$
            String[] values = schemaId.split(" - ");
            String repositoryID = values[0];
            IRepositoryNode repositoryNode = RepositorySeekerManager.getInstance().searchRepoViewNode(repositoryID);
            if (repositoryNode != null && repositoryNode.getObject() != null) {
                Item item = repositoryNode.getObject().getProperty().getItem();
                if (item instanceof ConnectionItem) {
                    ConnectionItem conItem = (ConnectionItem) item;
                    conn = conItem.getConnection();
                }
            }
        }
    }
    for (IDragAndDropServiceHandler handler : DragAndDropManager.getHandlers()) {
        if (handler.canHandle(conn)) {
            handler.handleTableRelevantParameters(conn, node, newOutputMetadata);
        }
    }
}
Also used : ConnectionItem(org.talend.core.model.properties.ConnectionItem) SalesforceSchemaConnectionItem(org.talend.core.model.properties.SalesforceSchemaConnectionItem) Item(org.talend.core.model.properties.Item) IRepositoryNode(org.talend.repository.model.IRepositoryNode) IDragAndDropServiceHandler(org.talend.core.model.utils.IDragAndDropServiceHandler) ConnectionItem(org.talend.core.model.properties.ConnectionItem) SalesforceSchemaConnectionItem(org.talend.core.model.properties.SalesforceSchemaConnectionItem) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) Connection(org.talend.core.model.metadata.builder.connection.Connection) XmlFileConnection(org.talend.core.model.metadata.builder.connection.XmlFileConnection) SalesforceSchemaConnection(org.talend.core.model.metadata.builder.connection.SalesforceSchemaConnection)

Example 13 with ConnectionItem

use of org.talend.core.model.properties.ConnectionItem in project tdi-studio-se by Talend.

the class ComponentChooseDialog method propaHadoopCfgChanges.

/**
     * DOC ycbai Comment method "propaHadoopCfgChanges".
     *
     * <P>
     * Propagate the changes from hadoop cluster to M/R process when drag&drop hadoop subnode from repository view to
     * M/R process.
     * </P>
     *
     * @param repositoryNode
     */
private void propaHadoopCfgChanges(IRepositoryNode repositoryNode) {
    if (repositoryNode == null || repositoryNode.getObject() == null) {
        return;
    }
    IHadoopClusterService hadoopClusterService = HadoopRepositoryUtil.getHadoopClusterService();
    if (hadoopClusterService == null || !hadoopClusterService.isHadoopSubnode(repositoryNode)) {
        return;
    }
    IProcess process = editor.getProcess();
    if (!ComponentCategory.CATEGORY_4_MAPREDUCE.getName().equals(process.getComponentsType()) && !ComponentCategory.CATEGORY_4_SPARK.getName().equals(process.getComponentsType()) && !ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName().equals(process.getComponentsType())) {
        return;
    }
    if ((process instanceof IProcess2) && (((IProcess2) process).getProperty().getItem() instanceof JobletProcessItem)) {
        return;
    }
    Item subItem = repositoryNode.getObject().getProperty().getItem();
    String propertyParamName = MR_PROPERTY_PREFIX + EParameterName.PROPERTY_TYPE.getName();
    String propertyRepTypeParamName = MR_PROPERTY_PREFIX + EParameterName.REPOSITORY_PROPERTY_TYPE.getName();
    IElementParameter propertyParam = process.getElementParameter(propertyParamName);
    if (propertyParam == null) {
        return;
    }
    String repositoryValue = propertyParam.getRepositoryValue();
    if (repositoryValue == null) {
        return;
    }
    //$NON-NLS-1$
    String[] supportedRepositoryTypes = repositoryValue.split("\\|");
    String repositoryType = hadoopClusterService.getRepositoryTypeOfHadoopSubItem(subItem);
    if (!ArrayUtils.contains(supportedRepositoryTypes, repositoryType)) {
        return;
    }
    Item hadoopClusterItem = hadoopClusterService.getHadoopClusterBySubitemId(new Project(ProjectManager.getInstance().getProject(subItem)), subItem.getProperty().getId());
    String hadoopClusterId = hadoopClusterItem.getProperty().getId();
    if (EmfComponent.REPOSITORY.equals(propertyParam.getValue())) {
        // do nothing when select the same hadoop cluster.
        String propertyId = (String) process.getElementParameter(propertyRepTypeParamName).getValue();
        if (hadoopClusterId.equals(propertyId)) {
            return;
        }
    }
    Connection connection = ((ConnectionItem) subItem).getConnection();
    if (hadoopClusterService.hasDiffsFromClusterToProcess(subItem, process)) {
        boolean confirmUpdate = MessageDialog.openConfirm(editor.getSite().getShell(), //$NON-NLS-1$
        Messages.getString("TalendEditorDropTargetListener.updateHadoopCfgDialog.title"), //$NON-NLS-1$
        Messages.getString("TalendEditorDropTargetListener.updateHadoopCfgDialog.msg"));
        if (confirmUpdate) {
            // Update spark mode to YARN_CLIENT if repository
            if (ComponentCategory.CATEGORY_4_SPARK.getName().equals(process.getComponentsType()) || ComponentCategory.CATEGORY_4_SPARKSTREAMING.getName().equals(process.getComponentsType())) {
                IElementParameter sparkLocalParam = process.getElementParameter(HadoopConstants.SPARK_LOCAL_MODE);
                IElementParameter sparkParam = process.getElementParameter(HadoopConstants.SPARK_MODE);
                if (sparkLocalParam != null && (Boolean) (sparkLocalParam.getValue())) {
                    sparkLocalParam.setValue(false);
                }
                if (sparkParam != null && !HadoopConstants.SPARK_MODE_YARN_CLIENT.equals(sparkParam.getValue())) {
                    sparkParam.setValue(HadoopConstants.SPARK_MODE_YARN_CLIENT);
                }
            }
            propertyParam.setValue(EmfComponent.REPOSITORY);
            ChangeValuesFromRepository command = new ChangeValuesFromRepository(process, connection, propertyRepTypeParamName, subItem.getProperty().getId());
            execCommandStack(command);
        }
    }
}
Also used : ChangeValuesFromRepository(org.talend.designer.core.ui.editor.cmd.ChangeValuesFromRepository) ValidationRulesConnectionItem(org.talend.core.model.properties.ValidationRulesConnectionItem) ConnectionItem(org.talend.core.model.properties.ConnectionItem) MDMConnectionItem(org.talend.core.model.properties.MDMConnectionItem) SAPConnectionItem(org.talend.core.model.properties.SAPConnectionItem) DatabaseConnectionItem(org.talend.core.model.properties.DatabaseConnectionItem) EbcdicConnectionItem(org.talend.core.model.properties.EbcdicConnectionItem) HL7ConnectionItem(org.talend.core.model.properties.HL7ConnectionItem) PolylineConnection(org.eclipse.draw2d.PolylineConnection) MDMConnection(org.talend.core.model.metadata.builder.connection.MDMConnection) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) CDCConnection(org.talend.core.model.metadata.builder.connection.CDCConnection) Connection(org.talend.core.model.metadata.builder.connection.Connection) ValidationRulesConnectionItem(org.talend.core.model.properties.ValidationRulesConnectionItem) JobletProcessItem(org.talend.core.model.properties.JobletProcessItem) ConnectionItem(org.talend.core.model.properties.ConnectionItem) MDMConnectionItem(org.talend.core.model.properties.MDMConnectionItem) SQLPatternItem(org.talend.core.model.properties.SQLPatternItem) LinkRulesItem(org.talend.core.model.properties.LinkRulesItem) SAPConnectionItem(org.talend.core.model.properties.SAPConnectionItem) ProcessItem(org.talend.core.model.properties.ProcessItem) ContextItem(org.talend.core.model.properties.ContextItem) Item(org.talend.core.model.properties.Item) DatabaseConnectionItem(org.talend.core.model.properties.DatabaseConnectionItem) EbcdicConnectionItem(org.talend.core.model.properties.EbcdicConnectionItem) RulesItem(org.talend.core.model.properties.RulesItem) HL7ConnectionItem(org.talend.core.model.properties.HL7ConnectionItem) FileItem(org.talend.core.model.properties.FileItem) Project(org.talend.core.model.general.Project) IHadoopClusterService(org.talend.core.hadoop.IHadoopClusterService) JobletProcessItem(org.talend.core.model.properties.JobletProcessItem) IProcess2(org.talend.core.model.process.IProcess2) IElementParameter(org.talend.core.model.process.IElementParameter) IProcess(org.talend.core.model.process.IProcess)

Example 14 with ConnectionItem

use of org.talend.core.model.properties.ConnectionItem in project tdi-studio-se by Talend.

the class AbstractElementPropertySectionController method setAllConnectionParameters.

private void setAllConnectionParameters(String typ, IElement element) {
    IElementParameter basePropertyParameter = null;
    for (IElementParameter param : elem.getElementParameters()) {
        if (param.getFieldType() == EParameterFieldType.PROPERTY_TYPE) {
            if (param.getRepositoryValue().startsWith("DATABASE")) {
                basePropertyParameter = param;
                break;
            }
        }
    }
    // jobsetting view load the db info from current selected category
    IElementParameter updateBasePropertyParameter = updateBasePropertyParameter();
    if (updateBasePropertyParameter != null && !updateBasePropertyParameter.equals(basePropertyParameter)) {
        basePropertyParameter = updateBasePropertyParameter;
    }
    String type = null;
    ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
    if (typ != null && !typ.equals("")) {
        //$NON-NLS-1$
        type = typ;
    } else {
        //$NON-NLS-1$
        type = getValueFromRepositoryName(element, "TYPE", basePropertyParameter);
    }
    if (type.equals("Oracle") || type.contains("OCLE")) {
        IElementParameter ele = element.getElementParameter("CONNECTION_TYPE");
        if (ele != null) {
            type = (String) ele.getValue();
        } else {
            //$NON-NLS-1$
            type = "ORACLE_SID";
        }
    }
    // Get real hsqldb type
    if (type.equals(EDatabaseTypeName.HSQLDB.name()) && getValueFromRepositoryName(element, "RUNNING_MODE", basePropertyParameter).equals("HSQLDB_INPROGRESS_PERSISTENT")) {
        //$NON-NLS-1$
        type = EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName();
    }
    // If the dbtype has been setted don't reset it again unless the dbtype of connParameters is null.
    if (StringUtils.trimToNull(type) == null && StringUtils.trimToNull(connParameters.getDbType()) == null) {
        type = EDatabaseTypeName.GENERAL_JDBC.getXmlName();
    }
    if (StringUtils.trimToNull(type) != null) {
        connParameters.setDbType(type);
    }
    //$NON-NLS-1$
    String frameWorkKey = getValueFromRepositoryName(element, "FRAMEWORK_TYPE", basePropertyParameter);
    connParameters.setFrameworkType(frameWorkKey);
    String schema = getValueFromRepositoryName(element, EConnectionParameterName.SCHEMA.getName(), basePropertyParameter);
    connParameters.setSchema(schema);
    String userName = getValueFromRepositoryName(element, EConnectionParameterName.USERNAME.getName(), basePropertyParameter);
    connParameters.setUserName(userName);
    String password = getValueFromRepositoryName(element, EConnectionParameterName.PASSWORD.getName(), basePropertyParameter);
    connParameters.setPassword(password);
    String host = getValueFromRepositoryName(element, EConnectionParameterName.SERVER_NAME.getName(), basePropertyParameter);
    connParameters.setHost(host);
    String port = getValueFromRepositoryName(element, EConnectionParameterName.PORT.getName(), basePropertyParameter);
    connParameters.setPort(port);
    boolean https = Boolean.parseBoolean(getValueFromRepositoryName(element, EConnectionParameterName.HTTPS.getName(), basePropertyParameter));
    connParameters.setHttps(https);
    boolean isOracleOCI = type.equals(EDatabaseTypeName.ORACLE_OCI.getXmlName()) || type.equals(EDatabaseTypeName.ORACLE_OCI.getDisplayName());
    if (isOracleOCI) {
        String localServiceName = getValueFromRepositoryNameAndParameterName(element, EConnectionParameterName.SID.getName(), EParameterName.LOCAL_SERVICE_NAME.getName());
        // sid is the repository value both for DBName and Local_service_name
        connParameters.setLocalServiceName(localServiceName);
    }
    String datasource = getValueFromRepositoryName(element, EConnectionParameterName.DATASOURCE.getName(), basePropertyParameter);
    connParameters.setDatasource(datasource);
    // qli modified to fix the bug "7364".
    String dbName = getValueFromRepositoryName(element, EConnectionParameterName.SID.getName(), basePropertyParameter);
    if (EDatabaseTypeName.EXASOL.getDisplayName().equals(connParameters.getDbType())) {
        if (dbName.contains("\\\"")) {
            dbName = dbName.replace("\\\"", "");
        }
        dbName = TextUtil.removeQuots(dbName);
    } else if (EDatabaseTypeName.GENERAL_JDBC.getDisplayName().equals(connParameters.getDbType())) {
        //$NON-NLS-1$
        dbName = "";
    }
    connParameters.setDbName(dbName);
    if (connParameters.getDbType().equals(EDatabaseTypeName.SQLITE.getXmlName()) || connParameters.getDbType().equals(EDatabaseTypeName.ACCESS.getXmlName()) || connParameters.getDbType().equals(EDatabaseTypeName.FIREBIRD.getXmlName())) {
        String file = getValueFromRepositoryName(element, EConnectionParameterName.FILE.getName(), basePropertyParameter);
        connParameters.setFilename(file);
    }
    String dir = getValueFromRepositoryName(element, EConnectionParameterName.DIRECTORY.getName(), basePropertyParameter);
    if (type.equals(EDatabaseTypeName.HSQLDB_IN_PROGRESS.getDisplayName())) {
        dir = getValueFromRepositoryName(elem, EConnectionParameterName.DBPATH.getName(), basePropertyParameter);
    }
    connParameters.setDirectory(dir);
    // General jdbc
    String url = getValueFromRepositoryName(element, EConnectionParameterName.URL.getName(), basePropertyParameter);
    if (StringUtils.isEmpty(url)) {
        // to get the Oracle RAC url.
        if (EDatabaseTypeName.ORACLE_CUSTOM.getXmlName().equals(type)) {
            url = getValueFromRepositoryName(element, "RAC_" + EConnectionParameterName.URL.getName(), basePropertyParameter);
        }
    }
    connParameters.setUrl(TalendTextUtils.removeQuotes(url));
    String driverJar = getValueFromRepositoryName(element, EConnectionParameterName.DRIVER_JAR.getName(), basePropertyParameter);
    connParameters.setDriverJar(TalendTextUtils.removeQuotes(driverJar));
    String driverClass = getValueFromRepositoryName(element, EConnectionParameterName.DRIVER_CLASS.getName(), basePropertyParameter);
    String dbVersion = getValueFromRepositoryName(element, "DB_VERSION", basePropertyParameter);
    connParameters.setDbVersion(dbVersion);
    if (EDatabaseVersion4Drivers.VERTICA_5_1.getVersionValue().equals(dbVersion) || EDatabaseVersion4Drivers.VERTICA_6.getVersionValue().equals(dbVersion) || EDatabaseVersion4Drivers.VERTICA_6_1_X.getVersionValue().equals(dbVersion) || EDatabaseVersion4Drivers.VERTICA_7.getVersionValue().equals(dbVersion)) {
        driverClass = EDatabase4DriverClassName.VERTICA2.getDriverClass();
    }
    connParameters.setDriverClass(TalendTextUtils.removeQuotes(driverClass));
    if (driverClass != null && !"".equals(driverClass) && !EDatabaseTypeName.GENERAL_JDBC.getDisplayName().equals(connParameters.getDbType())) {
        if (driverClass.startsWith("\"") && driverClass.endsWith("\"")) {
            driverClass = TalendTextUtils.removeQuotes(driverClass);
        }
        String dbTypeByClassName = "";
        if (driverJar != null && !"".equals(driverJar)) {
            dbTypeByClassName = extractMeta.getDbTypeByClassNameAndDriverJar(driverClass, driverJar);
        } else {
            dbTypeByClassName = extractMeta.getDbTypeByClassName(driverClass);
        }
        if (dbTypeByClassName != null) {
            connParameters.setDbType(dbTypeByClassName);
        }
    }
    String jdbcProps = getValueFromRepositoryName(element, EConnectionParameterName.PROPERTIES_STRING.getName(), basePropertyParameter);
    connParameters.setJdbcProperties(jdbcProps);
    String realTableName = null;
    if (EmfComponent.REPOSITORY.equals(elem.getPropertyValue(EParameterName.SCHEMA_TYPE.getName()))) {
        final Object propertyValue = elem.getPropertyValue(EParameterName.REPOSITORY_SCHEMA_TYPE.getName());
        IMetadataTable metadataTable = null;
        String connectionId = propertyValue.toString().split(" - ")[0];
        String tableLabel = propertyValue.toString().split(" - ")[1];
        IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
        Item item = null;
        try {
            IRepositoryViewObject repobj = factory.getLastVersion(connectionId);
            if (repobj != null) {
                Property property = repobj.getProperty();
                if (property != null) {
                    item = property.getItem();
                }
            }
        } catch (PersistenceException e) {
            ExceptionHandler.process(e);
        }
        if (item != null && item instanceof ConnectionItem) {
            Connection connection = ((ConnectionItem) item).getConnection();
            for (org.talend.core.model.metadata.builder.connection.MetadataTable table : ConnectionHelper.getTables(connection)) {
                if (table.getLabel().equals(tableLabel)) {
                    metadataTable = ConvertionHelper.convert(table);
                    break;
                }
            }
        }
        if (metadataTable != null) {
            realTableName = metadataTable.getTableName();
        }
    }
    connParameters.setSchemaName(QueryUtil.getTableName(elem, connParameters.getMetadataTable(), TalendTextUtils.removeQuotes(schema), type, realTableName));
}
Also used : ConnectionItem(org.talend.core.model.properties.ConnectionItem) IMetadataConnection(org.talend.core.model.metadata.IMetadataConnection) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) Connection(org.talend.core.model.metadata.builder.connection.Connection) ExtractMetaDataUtils(org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) ConnectionItem(org.talend.core.model.properties.ConnectionItem) Item(org.talend.core.model.properties.Item) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) PersistenceException(org.talend.commons.exception.PersistenceException) IElementParameter(org.talend.core.model.process.IElementParameter) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) IDynamicProperty(org.talend.core.ui.properties.tab.IDynamicProperty) Property(org.talend.core.model.properties.Property) IProxyRepositoryFactory(org.talend.repository.model.IProxyRepositoryFactory)

Example 15 with ConnectionItem

use of org.talend.core.model.properties.ConnectionItem in project tdi-studio-se by Talend.

the class RepositoryValueUtils method updateRepositoryList.

private void updateRepositoryList() {
    IProxyRepositoryFactory factory = DesignerPlugin.getDefault().getProxyRepositoryFactory();
    tableIdAndDbTypeMap = new HashMap<String, String>();
    tableIdAndDbSchemaMap = new HashMap<String, String>();
    repositoryTableMap = new HashMap<String, IMetadataTable>();
    repositoryQueryStoreMap = new HashMap<String, Query>();
    repositoryConnectionItemMap = new HashMap<String, ConnectionItem>();
    List<ConnectionItem> metadataConnectionsItem = null;
    try {
        metadataConnectionsItem = factory.getMetadataConnectionsItem();
    } catch (PersistenceException e) {
        throw new RuntimeException(e);
    }
    if (metadataConnectionsItem != null) {
        repositoryTableMap.clear();
        repositoryQueryStoreMap.clear();
        repositoryConnectionItemMap.clear();
        tablesMap.clear();
        queriesMap.clear();
        List<String> tableNamesList = new ArrayList<String>();
        List<String> tableValuesList = new ArrayList<String>();
        List<String> queryStoreNameList = new ArrayList<String>();
        List<String> queryStoreValuesList = new ArrayList<String>();
        for (ConnectionItem connectionItem : metadataConnectionsItem) {
            Connection connection = connectionItem.getConnection();
            if (!connection.isReadOnly()) {
                //$NON-NLS-1$
                repositoryConnectionItemMap.put(connectionItem.getProperty().getId() + "", connectionItem);
                repositoryDBIdAndNameMap.put(connectionItem.getProperty().getId(), getRepositoryAliasName(connectionItem) + //$NON-NLS-1$
                ":" + connectionItem.getProperty().getLabel());
                for (Object tableObj : ConnectionHelper.getTables(connection)) {
                    org.talend.core.model.metadata.builder.connection.MetadataTable table;
                    table = (org.talend.core.model.metadata.builder.connection.MetadataTable) tableObj;
                    if (factory.getStatus(connectionItem) != ERepositoryStatus.DELETED) {
                        if (!factory.isDeleted(table)) {
                            String name = //$NON-NLS-1$
                            getRepositoryAliasName(connectionItem) + ":" + connectionItem.getProperty().getLabel() + " - " + //$NON-NLS-1$
                            table.getLabel();
                            //$NON-NLS-1$
                            String value = connectionItem.getProperty().getId() + " - " + table.getLabel();
                            IMetadataTable newTable = ConvertionHelper.convert(table);
                            repositoryTableMap.put(value, newTable);
                            if (connection instanceof DatabaseConnection) {
                                String dbType = ((DatabaseConnection) connection).getDatabaseType();
                                String schema = ((DatabaseConnection) connection).getUiSchema();
                                tableIdAndDbTypeMap.put(newTable.getId(), dbType);
                                if (schema != null && !schema.equals("")) {
                                    //$NON-NLS-1$
                                    tableIdAndDbSchemaMap.put(newTable.getId(), schema);
                                }
                            }
                            tableNamesList.add(name);
                            tableValuesList.add(value);
                        }
                    }
                }
            }
            tablesMap.put(connectionItem.getProperty().getId(), tableValuesList);
            if (connection instanceof DatabaseConnection && !connection.isReadOnly()) {
                DatabaseConnection dbConnection = (DatabaseConnection) connection;
                QueriesConnection queriesConnection = dbConnection.getQueries();
                if (queriesConnection != null) {
                    List<Query> qs = queriesConnection.getQuery();
                    for (Query query : qs) {
                        String name = //$NON-NLS-1$
                        getRepositoryAliasName(connectionItem) + ":" + connectionItem.getProperty().getLabel() + " - " + //$NON-NLS-1$
                        query.getLabel();
                        //$NON-NLS-1$
                        String value = connectionItem.getProperty().getId() + " - " + query.getLabel();
                        repositoryQueryStoreMap.put(value, query);
                        queryStoreNameList.add(name);
                        queryStoreValuesList.add(value);
                    }
                }
            }
            queriesMap.put(connectionItem.getProperty().getId(), queryStoreValuesList);
        }
    }
}
Also used : QueriesConnection(org.talend.core.model.metadata.builder.connection.QueriesConnection) Query(org.talend.core.model.metadata.builder.connection.Query) ConnectionItem(org.talend.core.model.properties.ConnectionItem) ArrayList(java.util.ArrayList) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) Connection(org.talend.core.model.metadata.builder.connection.Connection) QueriesConnection(org.talend.core.model.metadata.builder.connection.QueriesConnection) IMetadataTable(org.talend.core.model.metadata.IMetadataTable) PersistenceException(org.talend.commons.exception.PersistenceException) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) IProxyRepositoryFactory(org.talend.repository.model.IProxyRepositoryFactory)

Aggregations

ConnectionItem (org.talend.core.model.properties.ConnectionItem)79 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)44 PersistenceException (org.talend.commons.exception.PersistenceException)38 Connection (org.talend.core.model.metadata.builder.connection.Connection)38 IElementParameter (org.talend.core.model.process.IElementParameter)38 Item (org.talend.core.model.properties.Item)34 DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)31 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)27 DatabaseConnectionItem (org.talend.core.model.properties.DatabaseConnectionItem)20 ArrayList (java.util.ArrayList)19 IMetadataTable (org.talend.core.model.metadata.IMetadataTable)19 Property (org.talend.core.model.properties.Property)17 ChangeValuesFromRepository (org.talend.designer.core.ui.editor.cmd.ChangeValuesFromRepository)17 RepositoryNode (org.talend.repository.model.RepositoryNode)17 INode (org.talend.core.model.process.INode)15 Node (org.talend.designer.core.ui.editor.nodes.Node)15 List (java.util.List)14 CompoundCommand (org.eclipse.gef.commands.CompoundCommand)14 PropertyChangeCommand (org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand)13 ProcessItem (org.talend.core.model.properties.ProcessItem)12