use of org.talend.daikon.properties.presentation.Form in project components by Talend.
the class SalesforceGetDeletedUpdatedPropertiesTest method testSetupLayout.
@Test
public void testSetupLayout() {
properties.init();
Form mainForm = properties.getForm(Form.MAIN);
assertNotNull(mainForm.getWidget(properties.getConnectionProperties().getName()));
assertNotNull(mainForm.getChildForm(properties.getConnectionProperties().getName()).getChildForm(properties.getConnectionProperties().getName()));
assertNotNull(mainForm.getWidget(properties.startDate.getName()));
assertNotNull(mainForm.getWidget(properties.endDate.getName()));
Form advForm = properties.getForm(Form.ADVANCED);
assertNotNull(advForm.getWidget(properties.getConnectionProperties().getName()));
assertNotNull(advForm.getChildForm(properties.getConnectionProperties().getName()).getWidget(properties.getConnectionProperties().bulkConnection.getName()));
assertNotNull(advForm.getChildForm(properties.getConnectionProperties().getName()).getWidget(properties.getConnectionProperties().httpTraceMessage.getName()));
}
use of org.talend.daikon.properties.presentation.Form in project components by Talend.
the class SalesforceInputPropertiesTest method testSetupLayout.
@Test
public void testSetupLayout() {
properties.init();
Form mainForm = properties.getForm(Form.MAIN);
assertNotNull(mainForm);
}
use of org.talend.daikon.properties.presentation.Form in project components by Talend.
the class SalesforceConnectionProperties method setupLayout.
@Override
public void setupLayout() {
super.setupLayout();
Form wizardForm = Form.create(this, FORM_WIZARD);
wizardForm.addRow(name);
wizardForm.addRow(widget(loginType).setWidgetType(Widget.ENUMERATION_WIDGET_TYPE).setDeemphasize(true));
wizardForm.addColumn(Widget.widget(oauth2FlowType).setWidgetType(Widget.ENUMERATION_WIDGET_TYPE));
wizardForm.addRow(oauth2JwtFlow.getForm(Form.MAIN));
wizardForm.addRow(oauth.getForm(Form.MAIN));
wizardForm.addRow(userPassword.getForm(Form.MAIN));
wizardForm.addRow(widget(advanced).setWidgetType(Widget.BUTTON_WIDGET_TYPE));
wizardForm.addColumn(widget(testConnection).setLongRunning(true).setWidgetType(Widget.BUTTON_WIDGET_TYPE));
Form mainForm = Form.create(this, Form.MAIN);
mainForm.addRow(widget(loginType).setWidgetType(Widget.ENUMERATION_WIDGET_TYPE));
mainForm.addColumn(Widget.widget(oauth2FlowType).setWidgetType(Widget.ENUMERATION_WIDGET_TYPE));
mainForm.addRow(oauth2JwtFlow.getForm(Form.MAIN));
mainForm.addRow(oauth.getForm(Form.MAIN));
mainForm.addRow(userPassword.getForm(Form.MAIN));
Form advancedForm = Form.create(this, Form.ADVANCED);
advancedForm.addRow(endpoint);
advancedForm.addColumn(apiVersion);
advancedForm.addRow(bulkConnection);
advancedForm.addRow(reuseSession);
advancedForm.addRow(widget(sessionDirectory).setWidgetType(Widget.DIRECTORY_WIDGET_TYPE));
advancedForm.addRow(needCompression);
advancedForm.addRow(httpTraceMessage);
advancedForm.addRow(httpChunked);
advancedForm.addRow(clientId);
advancedForm.addRow(timeout);
advancedForm.addRow(proxy.getForm(Form.MAIN));
advanced.setFormtoShow(advancedForm);
// A form for a reference to a connection, used in a tSalesforceInput for example
Form refForm = Form.create(this, Form.REFERENCE);
Widget compListWidget = widget(referencedComponent).setWidgetType(Widget.COMPONENT_REFERENCE_WIDGET_TYPE);
refForm.addRow(compListWidget);
refForm.addRow(mainForm);
}
use of org.talend.daikon.properties.presentation.Form in project components by Talend.
the class SalesforceConnectionProperties method refreshLayout.
@Override
public void refreshLayout(Form form) {
super.refreshLayout(form);
String refComponentIdValue = getReferencedComponentId();
boolean useOtherConnection = refComponentIdValue != null && refComponentIdValue.startsWith(TSalesforceConnectionDefinition.COMPONENT_NAME);
if (form.getName().equals(Form.MAIN) || form.getName().equals(FORM_WIZARD)) {
if (useOtherConnection) {
form.getWidget(loginType.getName()).setHidden(true);
hideOauth2Properties(form, true);
form.getWidget(userPassword).setHidden(true);
} else {
form.getWidget(loginType.getName()).setHidden(false);
switch(loginType.getValue()) {
case Basic:
hideOauth2Properties(form, true);
form.getWidget(userPassword).setHidden(false);
break;
case OAuth:
refreshOauth2Properties(form);
form.getWidget(userPassword).setHidden(true);
break;
default:
throw new ComponentException(new Throwable("Enum value should be handled :" + loginType.getValue()));
}
}
}
if (form.getName().equals(Form.ADVANCED)) {
if (useOtherConnection) {
form.setHidden(true);
} else {
form.setHidden(false);
boolean bulkMode = bulkConnection.getValue();
form.getWidget(httpChunked.getName()).setHidden(bulkMode);
form.getWidget(httpTraceMessage.getName()).setHidden(!bulkMode);
boolean isBasicLogin = LoginType.Basic.equals(loginType.getValue());
form.getWidget(reuseSession.getName()).setVisible(isBasicLogin && !bulkMode);
form.getWidget(sessionDirectory.getName()).setVisible(isBasicLogin && !bulkMode && reuseSession.getValue());
form.getWidget(apiVersion.getName()).setHidden(isBasicLogin);
Form proxyForm = form.getChildForm(proxy.getName());
if (proxyForm != null) {
boolean isUseProxy = proxy.useProxy.getValue();
proxyForm.getWidget(proxy.host.getName()).setHidden(!isUseProxy);
proxyForm.getWidget(proxy.port.getName()).setHidden(!isUseProxy);
proxyForm.getWidget(proxy.userPassword.getName()).setHidden(!isUseProxy);
}
}
}
}
use of org.talend.daikon.properties.presentation.Form in project components by Talend.
the class TSalesforceInputProperties method setupLayout.
@Override
public void setupLayout() {
super.setupLayout();
Form mainForm = getForm(Form.MAIN);
mainForm.addRow(queryMode);
mainForm.addRow(condition);
mainForm.addRow(manualQuery);
mainForm.addColumn(Widget.widget(guessSchema).setWidgetType(Widget.BUTTON_WIDGET_TYPE));
mainForm.addColumn(Widget.widget(guessQuery).setWidgetType(Widget.BUTTON_WIDGET_TYPE));
mainForm.addRow(Widget.widget(query).setWidgetType(Widget.TEXT_AREA_WIDGET_TYPE));
mainForm.addRow(includeDeleted);
Form advancedForm = getForm(Form.ADVANCED);
advancedForm.addRow(safetySwitch);
advancedForm.addRow(jobTimeOut);
advancedForm.addRow(pkChunking);
advancedForm.addRow(chunkSize);
advancedForm.addRow(chunkSleepTime);
advancedForm.addRow(batchSize);
advancedForm.addRow(normalizeDelimiter);
advancedForm.addRow(columnNameDelimiter);
}
Aggregations