Search in sources :

Example 6 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method stop.

public void stop(Object element) {
    if (element instanceof WorkflowProject || element instanceof ServerSettings) {
        ServerSettings serverSettings;
        if (element instanceof WorkflowProject) {
            WorkflowProject workflowProject = (WorkflowProject) element;
            serverSettings = workflowProject.getServerSettings();
        } else {
            serverSettings = (ServerSettings) element;
        }
        ServerRunner runner = new ServerRunner(serverSettings, getShell().getDisplay());
        runner.stop();
    }
}
Also used : ServerRunner(com.centurylink.mdw.plugin.server.ServerRunner) ServerSettings(com.centurylink.mdw.plugin.project.model.ServerSettings) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Example 7 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method findCallers.

public void findCallers(WorkflowElement element) {
    WorkflowProcess processVersion = (WorkflowProcess) element;
    List<WorkflowProject> projects = new ArrayList<WorkflowProject>();
    projects.add(processVersion.getProject());
    Shell shell = MdwPlugin.getActiveWorkbenchWindow().getShell();
    ProcessSearchQuery searchQuery = new ProcessSearchQuery(projects, SearchQuery.SearchType.INVOKING_ENTITY, "*", true, shell);
    searchQuery.setInvokedEntityId(processVersion.getId());
    try {
        ProgressMonitorDialog context = new MdwProgressMonitorDialog(shell);
        NewSearchUI.runQueryInForeground(context, searchQuery);
        // this shouldn't be necessary according to the Eclipse API docs
        NewSearchUI.activateSearchResultView();
        ISearchResultViewPart part = NewSearchUI.getSearchResultView();
        part.updateLabel();
        SearchResultsPage page = (SearchResultsPage) part.getActivePage();
        page.setSearchQuery(searchQuery);
        page.setInput(searchQuery.getSearchResult(), null);
    } catch (OperationCanceledException ex) {
        MessageDialog.openInformation(shell, "Search Cancelled", "Search for callers cancelled.");
    } catch (Exception ex) {
        PluginMessages.uiError(shell, ex, "Search for Callers", processVersion.getProject());
    }
}
Also used : SearchResultsPage(com.centurylink.mdw.plugin.search.SearchResultsPage) Shell(org.eclipse.swt.widgets.Shell) ISearchResultViewPart(org.eclipse.search.ui.ISearchResultViewPart) MdwProgressMonitorDialog(com.centurylink.mdw.plugin.designer.dialogs.MdwProgressMonitorDialog) MdwProgressMonitorDialog(com.centurylink.mdw.plugin.designer.dialogs.MdwProgressMonitorDialog) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) ArrayList(java.util.ArrayList) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) WorkflowProcess(com.centurylink.mdw.plugin.designer.model.WorkflowProcess) ProcessSearchQuery(com.centurylink.mdw.plugin.search.ProcessSearchQuery) CoreException(org.eclipse.core.runtime.CoreException) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) PartInitException(org.eclipse.ui.PartInitException) InvocationTargetException(java.lang.reflect.InvocationTargetException) ConnectException(java.net.ConnectException) IOException(java.io.IOException)

Example 8 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method deploy.

public void deploy(Object element) {
    if (element instanceof WorkflowProject || element instanceof ServerSettings) {
        ServerSettings serverSettings;
        if (element instanceof WorkflowProject) {
            WorkflowProject workflowProject = (WorkflowProject) element;
            serverSettings = workflowProject.getServerSettings();
            MdwPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.PREFS_SERVER_WF_PROJECT, workflowProject.getName());
        } else {
            serverSettings = (ServerSettings) element;
            MdwPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.PREFS_RUNNING_SERVER, serverSettings.getServerName());
        }
        ServerConfigurator configurator = ServerConfigurator.Factory.create(serverSettings);
        configurator.doDeploy(getShell());
    }
}
Also used : ServerSettings(com.centurylink.mdw.plugin.project.model.ServerSettings) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) ServerConfigurator(com.centurylink.mdw.plugin.server.ServerConfigurator)

Example 9 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method refresh.

public void refresh(WorkflowElement element) {
    if (element instanceof WorkflowProject) {
        final WorkflowProject workflowProject = (WorkflowProject) element;
        workflowProject.clear();
        workflowProject.fireElementChangeEvent(workflowProject, ChangeType.SETTINGS_CHANGE, null);
        BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {

            public void run() {
                if (!workflowProject.isFilePersist())
                    syncOpenEditors(workflowProject);
            }
        });
    } else if (element instanceof AutomatedTestSuite) {
        AutomatedTestSuite testSuite = (AutomatedTestSuite) element;
        testSuite.readLegacyCases();
        testSuite.fireElementChangeEvent(testSuite, ChangeType.SETTINGS_CHANGE, null);
    } else if (element instanceof AutomatedTestCase) {
        AutomatedTestCase testCase = (AutomatedTestCase) element;
        testCase.setTestCase(testCase.getTestCase());
        testCase.fireElementChangeEvent(testCase, ChangeType.SETTINGS_CHANGE, null);
    }
}
Also used : WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) AutomatedTestCase(com.centurylink.mdw.plugin.designer.model.AutomatedTestCase) AutomatedTestSuite(com.centurylink.mdw.plugin.designer.model.AutomatedTestSuite)

Example 10 with WorkflowProject

use of com.centurylink.mdw.plugin.project.model.WorkflowProject in project mdw-designer by CenturyLinkCloud.

the class WizardPage method createWorkflowProjectControls.

protected void createWorkflowProjectControls(Composite parent, int ncol, final boolean handleFieldChanged) {
    workflowProjects = WorkflowProjectManager.getInstance().getWorkflowProjects();
    if (workflowProjects == null || workflowProjects.isEmpty())
        MessageDialog.openError(parent.getShell(), "Error", "No MDW projects found");
    if (getElement() != null && getElement().getProject() != null) {
        workflowProject = getElement().getProject();
    } else if (!workflowProjects.isEmpty()) {
        for (WorkflowProject project : workflowProjects) {
            if (project.isLoaded()) {
                workflowProject = project;
                break;
            }
        }
        if (workflowProject == null)
            // last resort
            workflowProject = workflowProjects.get(0);
        getElement().setProject(workflowProject);
    }
    new Label(parent, SWT.NONE).setText("Workflow Project:");
    workflowProjectCombo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
    GridData gd = new GridData(GridData.BEGINNING);
    gd.horizontalSpan = ncol - 1;
    gd.widthHint = 200;
    workflowProjectCombo.setLayoutData(gd);
    workflowProjectCombo.removeAll();
    for (WorkflowProject project : workflowProjects) {
        workflowProjectCombo.add(project.getSourceProjectName());
    }
    workflowProjectCombo.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            workflowProject = WorkflowProjectManager.getInstance().getWorkflowProject(workflowProjectCombo.getText());
            getElement().setProject(workflowProject);
            if (workflowPackageCombo != null) {
                workflowPackageCombo.removeAll();
                for (WorkflowPackage packageVersion : workflowProject.getProject().getTopLevelUserVisiblePackages()) workflowPackageCombo.add(packageVersion.getName());
                workflowPackageCombo.select(0);
            }
            if (handleFieldChanged)
                handleFieldChanged();
        }
    });
    if (getElement().getProject() != null)
        workflowProjectCombo.setText(getElement().getProject().getName());
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) Combo(org.eclipse.swt.widgets.Combo)

Aggregations

WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)128 WorkflowPackage (com.centurylink.mdw.plugin.designer.model.WorkflowPackage)31 WorkflowElement (com.centurylink.mdw.plugin.designer.model.WorkflowElement)25 WebLaunchAction (com.centurylink.mdw.plugin.actions.WebLaunchActions.WebLaunchAction)22 ArrayList (java.util.ArrayList)22 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)21 CoreException (org.eclipse.core.runtime.CoreException)19 Action (org.eclipse.jface.action.Action)19 IAction (org.eclipse.jface.action.IAction)18 IProject (org.eclipse.core.resources.IProject)17 IFile (org.eclipse.core.resources.IFile)16 PartInitException (org.eclipse.ui.PartInitException)16 IWorkbenchAction (org.eclipse.ui.actions.ActionFactory.IWorkbenchAction)16 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)15 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)12 AutomatedTestCase (com.centurylink.mdw.plugin.designer.model.AutomatedTestCase)11 InvocationTargetException (java.lang.reflect.InvocationTargetException)11 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)11 IOException (java.io.IOException)10 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)9