@Override public void accept(SalesforceRuntimeSourceOrSink runtime) throws IOException { List<NamedThing> moduleNames = runtime.getSchemaNames(null); moduleName.setPossibleNamedThingValues(filter(moduleNames)); } };
@JsonIgnore // to avoid swagger failure because of the 2 similar following methods. public Property<String> setPossibleValues(List<?> possibleValues) { // check is the type is a NamedThing if (possibleValues != null && !possibleValues.isEmpty() && possibleValues.get(0) instanceof NamedThing) { setPossibleNamedThingValues((List<NamedThing>) possibleValues); } else { super.setPossibleValues(possibleValues); } return this; }
@Override public void accept(SalesforceRuntimeSourceOrSink runtime) throws IOException { List<NamedThing> moduleNames = runtime.getSchemaNames(null); moduleName.setPossibleNamedThingValues(filter(moduleNames)); } };
public ValidationResult beforeModuleName() throws Exception { // Before selecting of a target record type we should provide // set of record types that are available for work. try { List<NamedThing> types = getRecordTypes(); moduleName.setPossibleNamedThingValues(types); return ValidationResult.OK; } catch (TalendRuntimeException ex) { return exceptionToValidationResult(ex); } }
public ValidationResult beforeModuleName() throws Exception { try { List<NamedThing> moduleNames = SalesforceSourceOrSink.getSchemaNames(null, connection); moduleName.setPossibleNamedThingValues(moduleNames); } catch (ComponentException ex) { return ex.getValidationResult(); } return ValidationResult.OK; }
public ValidationResult beforeModuleName() throws Exception { // Before selecting of a target record type we should provide // set of record types that are available for searching. try { List<NamedThing> searchableTypes = getSearchableTypes(); moduleName.setPossibleNamedThingValues(searchableTypes); return ValidationResult.OK; } catch (Exception ex) { return exceptionToValidationResult(ex); } }
public ValidationResult beforeModuleName() throws Exception { // Before selecting of a target record type we should provide // set of record types that are available for work. try { List<NamedThing> types = getRecordTypes(); moduleName.setPossibleNamedThingValues(types); return ValidationResult.OK; } catch (TalendRuntimeException ex) { return exceptionToValidationResult(ex); } }
public ValidationResult beforeModuleName() throws Exception { // Before selecting of a target record type we should provide // set of record types that are available for searching. try { List<NamedThing> searchableTypes = getSearchableTypes(); moduleName.setPossibleNamedThingValues(searchableTypes); return ValidationResult.OK; } catch (Exception ex) { return exceptionToValidationResult(ex); } }
@Override public void accept(SalesforceRuntimeSourceOrSink runtime) throws IOException { List<NamedThing> moduleNames = runtime.getSchemaNames(null); moduleName.setPossibleNamedThingValues(filter(moduleNames)); Schema schema = runtime.getEndpointSchema(null, moduleName.getValue()); List<NamedThing> columns = new ArrayList<>(); for (Schema.Field field : schema.getFields()) { columns.add(new SimpleNamedThing(field.name(), field.name())); } selectColumnIds.setPossibleValues(columns); } };
@Override public void accept(SalesforceRuntimeSourceOrSink runtime) throws IOException { List<NamedThing> moduleNames = runtime.getSchemaNames(null); moduleName.setPossibleNamedThingValues(filter(moduleNames)); Schema schema = runtime.getEndpointSchema(null, moduleName.getValue()); List<NamedThing> columns = new ArrayList<>(); for (Schema.Field field : schema.getFields()) { columns.add(new SimpleNamedThing(field.name(), field.name())); } selectColumnIds.setPossibleValues(columns); } };
public ValidationResult beforeTableName() throws Exception { ValidationResultMutable vr = new ValidationResultMutable(); try { List<NamedThing> tableNames = SnowflakeSourceOrSink.getSchemaNames(null, connection); tableName.setPossibleNamedThingValues(tableNames); } catch (Exception ex) { vr.setMessage(ex.getMessage()); vr.setStatus(ValidationResult.Result.ERROR); } return vr; }
public ValidationResult beforeTablename() throws IOException { JdbcRuntimeInfo jdbcRuntimeInfo = new JdbcRuntimeInfo(connection, "org.talend.components.jdbc.runtime.JDBCSource"); try (SandboxedInstance sandboxI = RuntimeUtil.createRuntimeClass(jdbcRuntimeInfo, connection.getClass().getClassLoader())) { SourceOrSink ss = (SourceOrSink) sandboxI.getInstance(); ss.initialize(null, (ComponentProperties) connection); List<NamedThing> tablenames = ss.getSchemaNames(null); tablename.setPossibleNamedThingValues(tablenames); } catch (ComponentException ex) { return ex.getValidationResult(); } return ValidationResult.OK; }
public ValidationResult beforeTablename() throws IOException { JdbcRuntimeInfo jdbcRuntimeInfo = new JdbcRuntimeInfo(connection, "org.talend.components.jdbc.runtime.JDBCSource"); try (SandboxedInstance sandboxI = RuntimeUtil.createRuntimeClass(jdbcRuntimeInfo, connection.getClass().getClassLoader())) { SourceOrSink ss = (SourceOrSink) sandboxI.getInstance(); ss.initialize(null, (ComponentProperties) connection); List<NamedThing> tablenames = ss.getSchemaNames(null); tablename.setPossibleNamedThingValues(tablenames); } catch (ComponentException ex) { return ex.getValidationResult(); } return ValidationResult.OK; }
public ValidationResult beforeTableName() throws Exception { ValidationResultMutable vr = new ValidationResultMutable(); try (SandboxedInstance sandboxedInstance = getSandboxedInstance(SOURCE_OR_SINK_CLASS, USE_CURRENT_JVM_PROPS)) { SnowflakeRuntimeSourceOrSink ss = (SnowflakeRuntimeSourceOrSink) sandboxedInstance.getInstance(); ss.initialize(null, connection); List<NamedThing> tableNames = ss.getSchemaNames(null); tableName.setPossibleNamedThingValues(tableNames); } catch (Exception ex) { vr.setMessage(ex.getMessage()); vr.setStatus(ValidationResult.Result.ERROR); } return vr; }
public ValidationResult beforeTableName() throws Exception { ValidationResultMutable vr = new ValidationResultMutable(); try (SandboxedInstance sandboxedInstance = getSandboxedInstance(SOURCE_OR_SINK_CLASS, USE_CURRENT_JVM_PROPS)) { SnowflakeRuntimeSourceOrSink ss = (SnowflakeRuntimeSourceOrSink) sandboxedInstance.getInstance(); ss.initialize(null, connection); List<NamedThing> tableNames = ss.getSchemaNames(null); tableName.setPossibleNamedThingValues(tableNames); } catch (Exception ex) { vr.setMessage(ex.getMessage()); vr.setStatus(ValidationResult.Result.ERROR); } return vr; }
public ValidationResult afterModuleName() throws Exception { // After selecting of target record type we should: // - Set up main schema which will be used for records emitted by component // - Set up search query design-time model ValidationResult vr = ValidationResult.OK; try { if (isCachedModuleNameUsed()) { setupSchema(); setupSearchSchema(); } refreshLayout(getForm(Form.MAIN)); } catch (Exception ex) { vr = exceptionToValidationResult(ex); } moduleName.setPossibleNamedThingValues(Collections.<NamedThing>emptyList()); return vr; }
public ValidationResult afterTableName() throws Exception { ValidationResultMutable vr = new ValidationResultMutable(); //avoid retrieving schema of not existing table if (isCachedTableNameUsed()) { try (SandboxedInstance sandboxedInstance = getSandboxedInstance(SOURCE_OR_SINK_CLASS, USE_CURRENT_JVM_PROPS)) { SnowflakeRuntimeSourceOrSink ss = (SnowflakeRuntimeSourceOrSink) sandboxedInstance.getInstance(); ss.initialize(null, connection); main.schema.setValue(ss.getEndpointSchema(null, tableName.getValue())); } catch (Exception ex) { vr.setMessage(ex.getMessage()); vr.setStatus(ValidationResult.Result.ERROR); } } tableName.setPossibleNamedThingValues(Collections.<NamedThing>emptyList()); return vr; }
public ValidationResult afterModuleName() throws Exception { ValidationResultMutable vr = new ValidationResultMutable(); //avoid retrieving schema of not existing table if (isCachedModuleNameUsed()) { try (SandboxedInstance sandboxedInstance = getSandboxedInstance(SOURCE_OR_SINK_CLASS, USE_CURRENT_JVM_PROPS)) { SalesforceRuntimeSourceOrSink ss = (SalesforceRuntimeSourceOrSink) sandboxedInstance.getInstance(); ss.initialize(null, getEffectiveConnection()); main.schema.setValue(ss.getEndpointSchema(null, moduleName.getValue())); } catch (Exception ex) { vr.setMessage(ex.getMessage()); vr.setStatus(ValidationResult.Result.ERROR); } } moduleName.setPossibleNamedThingValues(Collections.<NamedThing>emptyList()); return vr; }
public ValidationResult beforeModuleName() throws Exception { try (SandboxedInstance sandboxedInstance = getSandboxedInstance(SOURCE_OR_SINK_CLASS, USE_CURRENT_JVM_PROPS)) { SalesforceRuntimeSourceOrSink ss = (SalesforceRuntimeSourceOrSink) sandboxedInstance.getInstance(); ss.initialize(null, getEffectiveConnection()); ValidationResult vr = ss.validate(null); if (vr.getStatus() == ValidationResult.Result.OK) { try { List<NamedThing> moduleNames = ss.getSchemaNames(null); moduleName.setPossibleNamedThingValues(moduleNames); } catch (Exception ex) { return ExceptionUtil.exceptionToValidationResult(ex); } } else { return vr; } return ValidationResult.OK; } }
public ValidationResult beforeModuleName() throws Exception { try (SandboxedInstance sandboxedInstance = getSandboxedInstance(SOURCE_OR_SINK_CLASS, USE_CURRENT_JVM_PROPS)) { SalesforceRuntimeSourceOrSink ss = (SalesforceRuntimeSourceOrSink) sandboxedInstance.getInstance(); ss.initialize(null, getEffectiveConnection()); ValidationResult vr = ss.validate(null); if (vr.getStatus() == ValidationResult.Result.OK) { try { List<NamedThing> moduleNames = ss.getSchemaNames(null); moduleName.setPossibleNamedThingValues(moduleNames); } catch (Exception ex) { return ExceptionUtil.exceptionToValidationResult(ex); } } else { return vr; } return ValidationResult.OK; } }