Search in sources :

Example 71 with Form

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()));
}
Also used : Form(org.talend.daikon.properties.presentation.Form) Test(org.junit.Test)

Example 72 with Form

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);
}
Also used : Form(org.talend.daikon.properties.presentation.Form) Test(org.junit.Test)

Example 73 with Form

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);
}
Also used : Form(org.talend.daikon.properties.presentation.Form) Widget(org.talend.daikon.properties.presentation.Widget)

Example 74 with Form

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);
            }
        }
    }
}
Also used : Form(org.talend.daikon.properties.presentation.Form) ComponentException(org.talend.components.api.exception.ComponentException) PropertyFactory.newString(org.talend.daikon.properties.property.PropertyFactory.newString)

Example 75 with Form

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);
}
Also used : Form(org.talend.daikon.properties.presentation.Form)

Aggregations

Form (org.talend.daikon.properties.presentation.Form)436 Test (org.junit.Test)199 Widget (org.talend.daikon.properties.presentation.Widget)73 ComponentProperties (org.talend.components.api.properties.ComponentProperties)17 Property (org.talend.daikon.properties.property.Property)13 SalesforceConnectionProperties (org.talend.components.salesforce.SalesforceConnectionProperties)12 Schema (org.apache.avro.Schema)10 ArrayList (java.util.ArrayList)9 ComponentWizard (org.talend.components.api.wizard.ComponentWizard)8 NamedThing (org.talend.daikon.NamedThing)8 INode (org.talend.core.model.process.INode)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)6 SnowflakeTableProperties (org.talend.components.snowflake.SnowflakeTableProperties)6 GenericElementParameter (org.talend.designer.core.generic.model.GenericElementParameter)6 ElementParameter (org.talend.designer.core.model.components.ElementParameter)6 List (java.util.List)5 SalesforceInputProperties (org.talend.components.salesforce.dataprep.SalesforceInputProperties)5 PresentationItem (org.talend.daikon.properties.PresentationItem)5 ComponentWizardDefinition (org.talend.components.api.wizard.ComponentWizardDefinition)4 MarkLogicConnectionPropertiesTest (org.talend.components.marklogic.tmarklogicconnection.MarkLogicConnectionPropertiesTest)4