Search in sources :

Example 21 with JSONFileConnection

use of org.talend.repository.model.json.JSONFileConnection in project tdi-studio-se by Talend.

the class JSONConnectionContextHelper method setPropertiesForExistContextMode.

public static void setPropertiesForExistContextMode(ConnectionItem connectionItem, Set<IConnParamName> paramSet, Map<ContextItem, List<ConectionAdaptContextVariableModel>> map) {
    if (connectionItem == null) {
        return;
    }
    ContextItem selItem = null;
    if (map.keySet().size() == 1) {
        selItem = map.keySet().iterator().next();
    }
    Connection conn = connectionItem.getConnection();
    if (conn instanceof JSONFileConnection) {
        setJSONFilePropertiesForExistContextMode((JSONFileConnection) conn, paramSet, map);
    }
    // set connection for context mode
    connectionItem.getConnection().setContextMode(true);
    connectionItem.getConnection().setContextId(selItem.getProperty().getId());
    connectionItem.getConnection().setContextName(selItem.getDefaultContext());
}
Also used : ContextItem(org.talend.core.model.properties.ContextItem) JSONFileConnection(org.talend.repository.model.json.JSONFileConnection) Connection(org.talend.core.model.metadata.builder.connection.Connection) JSONFileConnection(org.talend.repository.model.json.JSONFileConnection)

Aggregations

JSONFileConnection (org.talend.repository.model.json.JSONFileConnection)21 Connection (org.talend.core.model.metadata.builder.connection.Connection)6 ArrayList (java.util.ArrayList)4 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)4 EList (org.eclipse.emf.common.util.EList)3 ProcessDescription (org.talend.metadata.managment.ui.preview.ProcessDescription)3 AbstractForm (org.talend.metadata.managment.ui.wizard.AbstractForm)3 JSONFileConnectionItem (org.talend.repository.model.json.JSONFileConnectionItem)3 List (java.util.List)2 CoreException (org.eclipse.core.runtime.CoreException)2 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 Composite (org.eclipse.swt.widgets.Composite)2 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)2 IDesignerCoreUIService (org.talend.core.ui.services.IDesignerCoreUIService)2 CsvArray (org.talend.core.utils.CsvArray)2 ContextType (org.talend.designer.core.model.utils.emf.talendfile.ContextType)2 JSONXPathLoopDescriptor (org.talend.repository.model.json.JSONXPathLoopDescriptor)2 HashMap (java.util.HashMap)1 Map (java.util.Map)1 GridData (org.eclipse.swt.layout.GridData)1