Search in sources :

Example 1 with WSTransformerProcessStep

use of com.amalto.workbench.webservices.WSTransformerProcessStep in project tmdm-studio-se by Talend.

the class SetupTransformerInputVariablesDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Group comp = new Group(parent, SWT.NONE);
    comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    ((GridLayout) parent.getLayout()).marginTop = 5;
    ((GridLayout) parent.getLayout()).marginLeft = 5;
    ((GridLayout) parent.getLayout()).marginRight = 5;
    ((GridLayout) parent.getLayout()).marginBottom = 5;
    parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    comp.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
    comp.setLayout(new GridLayout(1, false));
    comp.setText(Messages.bind(Messages.SetupTransformerInputVariablesDialog_CompText, transformer.getName()));
    // Get the input variable names
    Set<String> inputVariables = new HashSet<String>();
    for (WSTransformerProcessStep step : transformer.getProcessSteps()) {
        for (WSTransformerVariablesMapping mapping : step.getInputMappings()) {
            inputVariables.add(mapping.getPipelineVariable() == null ? TransformerMainPage.DEFAULT_VAR : mapping.getPipelineVariable());
        }
    }
    ComplexTableViewerColumn[] columns = new ComplexTableViewerColumn[] { new // name
    ComplexTableViewerColumn(// name
    Messages.SetupTransformerInputVariablesDialog_InputVariables, // is Nillable ?
    true, // Nill value//$NON-NLS-1$
    "_DEFAULT_", // Nill display//$NON-NLS-1$
    "_DEFAULT_", // Default Value//$NON-NLS-1$
    "", // is Combo ?
    ComplexTableViewerColumn.COMBO_STYLE, // Combo Values
    inputVariables.toArray(new String[inputVariables.size()]), // Text Lines
    0), new // name
    ComplexTableViewerColumn(// name
    Messages.SetupTransformerInputVariablesDialog_ContentType, // is Nillable ?
    false, // Nill value//$NON-NLS-1$
    "", // Nill display//$NON-NLS-1$
    "", // Default Value//$NON-NLS-1$
    "text/xml", // is Combo ?
    ComplexTableViewerColumn.COMBO_STYLE, // Combo Values
    EContentType.allTypes().toArray(new String[EContentType.allTypes().size()]), // Text Lines
    0), new // name
    ComplexTableViewerColumn(// name
    Messages.SetupTransformerInputVariablesDialog_Value, // is Nillable ?
    true, // Nill value//$NON-NLS-1$
    "", // Nill display//$NON-NLS-1$
    "", // Default Value//$NON-NLS-1$
    "", // is Combo ?
    ComplexTableViewerColumn.TEXT_STYLE, // Combo Values
    null, // Text Lines
    10) };
    objectViewer = new ComplexTableViewerR(Arrays.asList(columns), toolkit, comp, page.getSite());
    objectViewer.create();
    Table table = objectViewer.getViewer().getTable();
    table.getColumns()[2].setWidth(500);
    // GridData gd=(GridData)objectViewer.getTxtLists().get(0).getLayoutData();
    // gd.minimumHeight=200;
    // gd.minimumWidth=300;
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    // ((GridData)table.getLayoutData()).minimumWidth = 600;
    if (page.getCacheList() != null) {
        objectViewer.getViewer().setInput(page.getCacheList());
    } else {
        List<Line> list = new ArrayList<Line>();
        objectViewer.getViewer().setInput(list);
    }
    final CCombo combo = (CCombo) objectViewer.getColumns().get(1).getControl();
    combo.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            if (combo.getText().equals(EInputTemplate.APPLICATION_ITEMPK.getName())) {
                Text t = (Text) objectViewer.getColumns().get(2).getControl();
                t.setText(EInputTemplate.APPLICATION_ITEMPK.getContent());
            }
        }
    });
    return comp;
}
Also used : Group(org.eclipse.swt.widgets.Group) Table(org.eclipse.swt.widgets.Table) ComplexTableViewerColumn(com.amalto.workbench.widgets.ComplexTableViewerColumn) ComplexTableViewerR(com.amalto.workbench.widgets.ComplexTableViewerR) ArrayList(java.util.ArrayList) Text(org.eclipse.swt.widgets.Text) Line(com.amalto.workbench.models.Line) GridLayout(org.eclipse.swt.layout.GridLayout) CCombo(org.eclipse.swt.custom.CCombo) WSTransformerVariablesMapping(com.amalto.workbench.webservices.WSTransformerVariablesMapping) GridData(org.eclipse.swt.layout.GridData) WSTransformerProcessStep(com.amalto.workbench.webservices.WSTransformerProcessStep) SelectionEvent(org.eclipse.swt.events.SelectionEvent) HashSet(java.util.HashSet) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 2 with WSTransformerProcessStep

use of com.amalto.workbench.webservices.WSTransformerProcessStep in project tmdm-studio-se by Talend.

the class TransformerMainPage method executeProcess.

protected void executeProcess(final FormToolkit toolkit) {
    try {
        // check if we have a step to perfom
        // ((WSTransformerV2)getXObject().getWsObject())
        java.util.List<WSTransformerProcessStep> steps = transformer.getProcessSteps();
        if ((steps == null) || (steps.size() == 0)) {
            MessageDialog.openError(TransformerMainPage.this.getSite().getShell(), Messages.TransformerMainPage_ErrorTitle1, Messages.TransformerMainPage_ErrorMsg1);
            return;
        }
        // perform save
        performSave();
        // Open form Dialog
        if (transformerDialog == null) {
            transformerDialog = new SetupTransformerInputVariablesDialog(TransformerMainPage.this.getSite().getShell(), toolkit, getXObject(), TransformerMainPage.this);
            transformerDialog.create();
            transformerDialog.getShell().setText(Messages.TransformerMainPage_DialogTitle);
        }
        openTransformerDialog();
    } catch (Exception ex) {
        log.error(ex.getMessage(), ex);
    }
}
Also used : SetupTransformerInputVariablesDialog(com.amalto.workbench.dialogs.SetupTransformerInputVariablesDialog) WSTransformerProcessStep(com.amalto.workbench.webservices.WSTransformerProcessStep) PartInitException(org.eclipse.ui.PartInitException) InvocationTargetException(java.lang.reflect.InvocationTargetException) XtentisException(com.amalto.workbench.utils.XtentisException)

Example 3 with WSTransformerProcessStep

use of com.amalto.workbench.webservices.WSTransformerProcessStep in project tmdm-studio-se by Talend.

the class TransformerMainPage method refreshData.

@Override
protected void refreshData() {
    try {
        if (this.comitting) {
            return;
        }
        this.refreshing = true;
        WSTransformerV2 wsTransformer = (WSTransformerV2) (getXObject().getWsObject());
        desAntionComposite.getTextWidget().setText(// $NON-NLS-1$
        wsTransformer.getDescription() == null ? "" : wsTransformer.getDescription());
        stepsList.removeAll();
        java.util.List<WSTransformerProcessStep> specs = wsTransformer.getProcessSteps();
        if (specs != null) {
            for (WSTransformerProcessStep step : specs) {
                stepsList.add(step.getDescription());
            }
        }
        stepsList.select(currentPlugin);
        if (stepsList.getItemCount() > 0 && stepsList.getSelectionIndex() == -1) {
            refreshStep(0);
        } else {
            refreshStep(stepsList.getSelectionIndex());
        }
        stepsList.forceFocus();
        this.refreshing = false;
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        MessageDialog.openError(this.getSite().getShell(), Messages.TransformerMainPage_ErroRefreshPage, Messages.bind(Messages.TransformerMainPage_ErroRefreshPageXX, e.getLocalizedMessage()));
    }
}
Also used : WSTransformerV2(com.amalto.workbench.webservices.WSTransformerV2) WSTransformerProcessStep(com.amalto.workbench.webservices.WSTransformerProcessStep) PartInitException(org.eclipse.ui.PartInitException) InvocationTargetException(java.lang.reflect.InvocationTargetException) XtentisException(com.amalto.workbench.utils.XtentisException)

Example 4 with WSTransformerProcessStep

use of com.amalto.workbench.webservices.WSTransformerProcessStep in project tmdm-studio-se by Talend.

the class TransformerMainPage method createCharacteristicsContent.

@Override
protected void createCharacteristicsContent(final FormToolkit toolkit, Composite topComposite) {
    try {
        initTransformer();
        descriptionComposite = toolkit.createComposite(topComposite, SWT.NONE);
        descriptionComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
        descriptionComposite.setLayout(new GridLayout(3, false));
        // edit by ymli; fix the bug:0012024 Make Process descriptions multilingual.
        // description
        /*
             * Label descriptionLabel = toolkit.createLabel(descriptionComposite, "Description", SWT.NULL);
             * descriptionLabel.setLayoutData( new GridData(SWT.FILL,SWT.CENTER,false,true,1,1) ); descriptionText =
             * toolkit.createText(descriptionComposite, "",SWT.BORDER|SWT.MULTI); descriptionText.setLayoutData( new
             * GridData(SWT.FILL,SWT.FILL,true,true,1,1) ); ((GridData)descriptionText.getLayoutData()).minimumHeight =
             * 30; descriptionText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { if
             * (refreshing) return; //commit as we go TransformerMainPage.this.comitting= true;
             * //((WSTransformerV2)getXObject().getWsObject()) transformer.setDescription(descriptionText.getText());
             * TransformerMainPage.this.comitting= false; //markDirtyWithoutCommit(); markDirtyWithoutCommit(); } });
             */
        desAntionComposite = new DescAnnotationComposite(Messages.TransformerMainPage_Description, // $NON-NLS-1$
        " ...", // $NON-NLS-1$
        toolkit, // $NON-NLS-1$
        descriptionComposite, this, false);
        desAntionComposite.getTextWidget().addModifyListener(new ModifyListener() {

            public void modifyText(ModifyEvent e) {
                if (refreshing) {
                    return;
                }
                TransformerMainPage.this.comitting = true;
                transformer.setDescription(desAntionComposite.getText());
                TransformerMainPage.this.comitting = false;
                markDirtyWithoutCommit();
            }
        });
        // make the Page window a DropTarget - we need to dispose it
        windowTarget = new DropTarget(this.getPartControl(), DND.DROP_MOVE);
        windowTarget.setTransfer(new Transfer[] { TextTransfer.getInstance() });
        windowTarget.addDropListener(new DCDropTargetListener());
        sequenceGroup = this.getNewSectionComposite(Messages.TransformerMainPage_StepsSequence);
        sequenceGroup.setLayout(new GridLayout(1, false));
        Composite sequenceComposite = toolkit.createComposite(sequenceGroup, SWT.NONE);
        sequenceComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
        sequenceComposite.setLayout(new GridLayout(6, false));
        Label l3 = toolkit.createLabel(sequenceComposite, Messages.TransformerMainPage_StepDesc, SWT.NULL);
        l3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true, 1, 1));
        // $NON-NLS-1$
        stepText = toolkit.createText(sequenceComposite, "", SWT.BORDER | SWT.SINGLE);
        stepText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
        stepText.addKeyListener(new KeyListener() {

            public void keyPressed(KeyEvent e) {
            }

            public void keyReleased(KeyEvent e) {
                if (e.keyCode == 13) {
                    // enter
                    performAdd();
                    int index = stepsList.getItemCount() - 1;
                    performSelect(index);
                }
            }
        });
        // $NON-NLS-1$
        Button addStepButton = toolkit.createButton(sequenceComposite, "", SWT.PUSH);
        addStepButton.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, false, true, 1, 1));
        addStepButton.setToolTipText(Messages.TransformerMainPage_Add);
        addStepButton.setImage(ImageCache.getCreatedImage(EImage.ADD_OBJ.getPath()));
        addStepButton.addSelectionListener(new SelectionListener() {

            public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
            }

            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                // commit as we go
                performAdd();
            }
        });
        stepsList = new List(sequenceComposite, SWT.V_SCROLL | SWT.BORDER);
        stepsList.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1));
        ((GridData) stepsList.getLayoutData()).heightHint = 40;
        /*
             * DragSource stepsSource = new DragSource(stepsList,DND.DROP_MOVE); stepsSource.setTransfer(new
             * Transfer[]{TextTransfer.getInstance()}); stepsSource.addDragListener(new DCDragSourceListener());
             */
        stepsList.addSelectionListener(new SelectionListener() {

            public void widgetDefaultSelected(SelectionEvent e) {
                widgetSelected(e);
            }

            public void widgetSelected(SelectionEvent e) {
                performSelect(stepsList.getSelectionIndex());
            }
        });
        wrap.Wrap(this, stepsList);
        stepsList.addFocusListener(new FocusListener() {

            public void focusGained(FocusEvent e) {
                if (stepsList.getSelectionIndex() >= 0) {
                    refreshStep(stepsList.getSelectionIndex());
                    section.setVisible(true);
                }
            }

            public void focusLost(FocusEvent e) {
            }
        });
        Composite stepUpDownComposite = toolkit.createComposite(sequenceComposite, SWT.NONE);
        stepUpDownComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
        stepUpDownComposite.setLayout(new GridLayout(1, false));
        // $NON-NLS-1$
        Button stepUpButton = toolkit.createButton(stepUpDownComposite, "", SWT.PUSH | SWT.CENTER);
        stepUpButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
        stepUpButton.setImage(ImageCache.getCreatedImage(EImage.PREV_NAV.getPath()));
        stepUpButton.setToolTipText(Messages.TransformerMainPage_MoveUpTheItem);
        stepUpButton.addSelectionListener(new SelectionListener() {

            public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
            }

            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                int index = TransformerMainPage.this.stepsList.getSelectionIndex();
                if (index > 0) {
                    // commit as we go
                    TransformerMainPage.this.comitting = true;
                    String val = TransformerMainPage.this.stepsList.getItem(index);
                    TransformerMainPage.this.stepsList.remove(index);
                    TransformerMainPage.this.stepsList.add(val, index - 1);
                    TransformerMainPage.this.stepsList.select(index - 1);
                    // (WSTransformerV2)getXObject().getWsObject();
                    WSTransformerV2 wsTransformer = transformer;
                    java.util.List<WSTransformerProcessStep> list = wsTransformer.getProcessSteps();
                    WSTransformerProcessStep spec = list.get(index);
                    list.remove(index);
                    list.add(index - 1, spec);
                    performSelect(index - 1);
                    TransformerMainPage.this.comitting = false;
                    TransformerMainPage.this.stepsList.forceFocus();
                    markDirtyWithoutCommit();
                }
            }
        });
        // $NON-NLS-1$
        Button stepDownButton = toolkit.createButton(stepUpDownComposite, "", SWT.PUSH | SWT.CENTER);
        stepDownButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
        stepDownButton.setImage(ImageCache.getCreatedImage(EImage.NEXT_NAV.getPath()));
        stepDownButton.setToolTipText(Messages.TransformerMainPage_MoveDownTheItem);
        stepDownButton.addSelectionListener(new SelectionListener() {

            public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
            }

            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                int index = TransformerMainPage.this.stepsList.getSelectionIndex();
                if ((index >= 0) && (index < TransformerMainPage.this.stepsList.getItemCount() - 1)) {
                    // commit as we go
                    TransformerMainPage.this.comitting = true;
                    String val = TransformerMainPage.this.stepsList.getItem(index);
                    TransformerMainPage.this.stepsList.remove(index);
                    TransformerMainPage.this.stepsList.add(val, index + 1);
                    TransformerMainPage.this.stepsList.select(index + 1);
                    // (WSTransformerV2)getXObject().getWsObject();
                    WSTransformerV2 wsTransformer = transformer;
                    java.util.List<WSTransformerProcessStep> list = wsTransformer.getProcessSteps();
                    WSTransformerProcessStep spec = list.get(index);
                    list.remove(index);
                    list.add(index + 1, spec);
                    TransformerMainPage.this.comitting = false;
                    TransformerMainPage.this.stepsList.forceFocus();
                    markDirtyWithoutCommit();
                }
            }
        });
        // $NON-NLS-1$
        Button deleteStepButton = toolkit.createButton(stepUpDownComposite, "", SWT.PUSH | SWT.CENTER);
        deleteStepButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
        deleteStepButton.setImage(ImageCache.getCreatedImage(EImage.DELETE_OBJ.getPath()));
        deleteStepButton.setToolTipText(Messages.TransformerMainPage_DelTheItem);
        deleteStepButton.addSelectionListener(new SelectionListener() {

            public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
            }

            public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
                int index = TransformerMainPage.this.stepsList.getSelectionIndex();
                if ((index >= 0) && (index < TransformerMainPage.this.stepsList.getItemCount())) {
                    removeStep(index);
                }
            }
        });
        // Plugin Specifications
        // Sequence
        section = this.getNewSection(Messages.TransformerMainPage_StepSpecification);
        section.setVisible(false);
        sequenceGroup.setLayout(new GridLayout(4, false));
        disabledButton = toolkit.createButton((Composite) section.getClient(), Messages.TransformerMainPage_Disabled, SWT.CHECK);
        disabledButton.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true, 4, 1));
        specsComposite = toolkit.createComposite((Composite) section.getClient(), SWT.NULL);
        specsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
        specsComposite.setLayout(new GridLayout(4, false));
        disabledButton.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                WidgetUtils.enable(specsComposite, !disabledButton.getSelection());
                markDirtyWithoutCommit();
                if (stepsList.getSelectionIndex() >= 0) {
                    transformer.getProcessSteps().get(stepsList.getSelectionIndex()).setDisabled(disabledButton.getSelection());
                }
            }
        });
        // $NON-NLS-1$
        stepLabel = toolkit.createLabel(specsComposite, "", SWT.NULL);
        stepLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
        FontData fd = stepLabel.getFont().getFontData()[0];
        fd.setStyle(SWT.BOLD);
        stepLabel.setFont(new Font(Display.getDefault(), fd));
        stepWidget = new TransformerStepWidget(toolkit, specsComposite);
        stepWidget.create();
        btnAutoIndent = new Button(specsComposite, SWT.CHECK);
        btnAutoIndent.setText(Messages.TransformerMainPage_AutoIndent);
        btnAutoIndent.setImage(ImageCache.getCreatedImage(EImage.INTENT.getPath()));
        btnAutoIndent.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
        // refreshAutoIndentTooltip();
        btnAutoIndent.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                refreshAutoIndentTooltip();
            }
        });
        btnOpenXsltEditor = new Button(specsComposite, SWT.PUSH);
        btnOpenXsltEditor.setText(Messages.TransformerMainPage_open);
        btnOpenXsltEditor.setToolTipText(Messages.TransformerMainPage_opentext);
        btnOpenXsltEditor.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
        btnOpenXsltEditor.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                openInXSLTEditor();
            }

            public void openInXSLTEditor() {
                refreshEnableState(false);
                try {
                    // $NON-NLS-1$
                    IPreferenceStore preference = new ScopedPreferenceStore(new InstanceScope(), "org.eclipse.wst.xsl.ui");
                    // $NON-NLS-1$
                    String charSet = preference.getString("outputCodeset");
                    String xslcontent = parameterEditor.getContent().getContent();
                    IFile file = FileProvider.createdTempFile(xslcontent, getXSLTFileName(), charSet);
                    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
                    xsltEditorInput = new XSLTFileEditorInput(file, new MainPageRefresher(), true);
                    page.openEditor(xsltEditorInput, XSLTEditor.ID);
                } catch (PartInitException e) {
                    log.error(e.getMessage(), e);
                }
            }
        });
        Group parametersGroup = new Group(specsComposite, SWT.SHADOW_NONE);
        parametersGroup.setText(Messages.TransformerMainPage_Parameters);
        parametersGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
        ((GridData) parametersGroup.getLayoutData()).minimumHeight = 300;
        parametersGroup.setLayout(new GridLayout(1, true));
        parameterEditor = new ExtensibleContentEditor(parametersGroup, SWT.NONE, EXCONTENTEDITOR_ID);
        parameterEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
        parameterEditorListener = new ProcessPluginParameterEditorListener();
        refreshParameterEditor();
        refreshData();
        addToolBarItem();
        this.oldBackground = parameterEditor.getBackground();
    } catch (Exception e) {
        log.error(e.getMessage(), e);
    }
}
Also used : ExtensibleContentEditor(com.amalto.workbench.widgets.xmleditor.ExtensibleContentEditor) XSLTFileEditorInput(com.amalto.workbench.editors.xslteditor.XSLTFileEditorInput) Group(org.eclipse.swt.widgets.Group) IFile(org.eclipse.core.resources.IFile) ModifyListener(org.eclipse.swt.events.ModifyListener) Label(org.eclipse.swt.widgets.Label) FocusEvent(org.eclipse.swt.events.FocusEvent) Font(org.eclipse.swt.graphics.Font) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) SelectionEvent(org.eclipse.swt.events.SelectionEvent) InstanceScope(org.eclipse.core.runtime.preferences.InstanceScope) ArrayList(java.util.ArrayList) WSGetTransformerPluginV2SList(com.amalto.workbench.webservices.WSGetTransformerPluginV2SList) List(org.eclipse.swt.widgets.List) WSTransformerPluginV2SList(com.amalto.workbench.webservices.WSTransformerPluginV2SList) PartInitException(org.eclipse.ui.PartInitException) Composite(org.eclipse.swt.widgets.Composite) DescAnnotationComposite(com.amalto.workbench.widgets.DescAnnotationComposite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) FontData(org.eclipse.swt.graphics.FontData) PartInitException(org.eclipse.ui.PartInitException) InvocationTargetException(java.lang.reflect.InvocationTargetException) XtentisException(com.amalto.workbench.utils.XtentisException) DescAnnotationComposite(com.amalto.workbench.widgets.DescAnnotationComposite) WSTransformerV2(com.amalto.workbench.webservices.WSTransformerV2) GridData(org.eclipse.swt.layout.GridData) WSTransformerProcessStep(com.amalto.workbench.webservices.WSTransformerProcessStep) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) KeyListener(org.eclipse.swt.events.KeyListener) DropTarget(org.eclipse.swt.dnd.DropTarget) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) FocusListener(org.eclipse.swt.events.FocusListener) ScopedPreferenceStore(org.eclipse.ui.preferences.ScopedPreferenceStore) SelectionListener(org.eclipse.swt.events.SelectionListener)

Example 5 with WSTransformerProcessStep

use of com.amalto.workbench.webservices.WSTransformerProcessStep in project tmdm-studio-se by Talend.

the class ProcessAllCallJobVariableCandidatesHolder method getExternalInfo.

@Override
public String[] getExternalInfo() {
    if (service == null) {
        return new String[0];
    }
    Set<String> inputVariables = new HashSet<String>();
    for (WSTransformerProcessStep step : service.getProcessSteps()) {
        for (WSTransformerVariablesMapping mapping : step.getInputMappings()) {
            inputVariables.add(mapping.getPipelineVariable() == null ? TransformerMainPage.DEFAULT_VAR : mapping.getPipelineVariable());
        }
    }
    String[] results = inputVariables.toArray(new String[0]);
    Arrays.sort(results);
    return results;
}
Also used : WSTransformerVariablesMapping(com.amalto.workbench.webservices.WSTransformerVariablesMapping) WSTransformerProcessStep(com.amalto.workbench.webservices.WSTransformerProcessStep) HashSet(java.util.HashSet)

Aggregations

WSTransformerProcessStep (com.amalto.workbench.webservices.WSTransformerProcessStep)7 XtentisException (com.amalto.workbench.utils.XtentisException)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)4 PartInitException (org.eclipse.ui.PartInitException)4 WSTransformerV2 (com.amalto.workbench.webservices.WSTransformerV2)3 WSTransformerVariablesMapping (com.amalto.workbench.webservices.WSTransformerVariablesMapping)3 ArrayList (java.util.ArrayList)3 HashSet (java.util.HashSet)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 SelectionListener (org.eclipse.swt.events.SelectionListener)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Group (org.eclipse.swt.widgets.Group)2 SetupTransformerInputVariablesDialog (com.amalto.workbench.dialogs.SetupTransformerInputVariablesDialog)1 XSLTFileEditorInput (com.amalto.workbench.editors.xslteditor.XSLTFileEditorInput)1 Line (com.amalto.workbench.models.Line)1 WSGetTransformerPluginV2SList (com.amalto.workbench.webservices.WSGetTransformerPluginV2SList)1 WSTransformerPluginV2SList (com.amalto.workbench.webservices.WSTransformerPluginV2SList)1 ComplexTableViewerColumn (com.amalto.workbench.widgets.ComplexTableViewerColumn)1 ComplexTableViewerR (com.amalto.workbench.widgets.ComplexTableViewerR)1