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());
}
Aggregations