Search in sources :

Example 71 with WorkflowProject

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

the class TomcatServerBehavior method getDefaultJavaOptions.

protected String getDefaultJavaOptions() {
    WorkflowProject project = getProject();
    String runtimeEnv = project != null && project.checkRequiredVersion(6, 0) ? "-Dmdw.runtime.env=dev" : "-DruntimeEnv=dev";
    return runtimeEnv + "\n" + "-Dmdw.config.location=" + (project == null ? "null" : project.getProjectDir()) + System.getProperty("file.separator") + "config\n" + "-Xms512m -Xmx1024m -XX:MaxPermSize=256m";
}
Also used : WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Example 72 with WorkflowProject

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

the class ServerConsole method addToMenuAndToolbar.

public void addToMenuAndToolbar() {
    // start action
    startAction = new Action("Start") {

        public void run() {
            WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
            actionHandler.run(getRunnableObject());
        }
    };
    startAction.setImageDescriptor(MdwPlugin.getImageDescriptor("icons/run.gif"));
    Object runnableObj = getRunnableObject();
    String startText = "Start";
    if (runnableObj instanceof WorkflowProject)
        startText += " " + ((WorkflowProject) runnableObj).getName();
    else if (runnableObj instanceof ServerSettings)
        startText += " " + ((ServerSettings) runnableObj).getServerName();
    startAction.setToolTipText(startText);
    startAction.setEnabled(runnableObj != null);
    // client shell action
    clientShellAction = new Action("Client Shell") {

        public void run() {
            WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
            actionHandler.clientShell(getRunnableObject());
        }
    };
    clientShellAction.setImageDescriptor(MdwPlugin.getImageDescriptor("icons/client_shell.gif"));
    clientShellAction.setToolTipText("Client Shell");
    clientShellAction.setEnabled(false);
    // deploy action
    deployAction = new Action("Deploy") {

        public void run() {
            WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
            actionHandler.deploy(getRunnableObject());
        }
    };
    deployAction.setImageDescriptor(MdwPlugin.getImageDescriptor("icons/deploy.gif"));
    deployAction.setToolTipText("Deploy");
    deployAction.setEnabled(false);
    // stop action
    stopAction = new Action("Stop") {

        public void run() {
            WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
            actionHandler.stop(getRunnableObject());
        }
    };
    stopAction.setImageDescriptor(MdwPlugin.getImageDescriptor("icons/stop.gif"));
    stopAction.setToolTipText("Stop");
    stopAction.setEnabled(false);
    // create menu
    getViewSite().getActionBars().getMenuManager().add(startAction);
    // getViewSite().getActionBars().getMenuManager().add(clientShellAction);
    getViewSite().getActionBars().getMenuManager().add(deployAction);
    getViewSite().getActionBars().getMenuManager().add(stopAction);
    getViewSite().getActionBars().getMenuManager().add(new Separator());
    // create toolbar
    getViewSite().getActionBars().getToolBarManager().add(startAction);
    getViewSite().getActionBars().getToolBarManager().add(clientShellAction);
    getViewSite().getActionBars().getToolBarManager().add(deployAction);
    getViewSite().getActionBars().getToolBarManager().add(stopAction);
    getViewSite().getActionBars().getToolBarManager().add(new Separator());
}
Also used : WorkflowElementActionHandler(com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler) Action(org.eclipse.jface.action.Action) ServerSettings(com.centurylink.mdw.plugin.project.model.ServerSettings) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) Separator(org.eclipse.jface.action.Separator)

Example 73 with WorkflowProject

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

the class ProcessExplorerContentProvider method handleElementChange.

private void handleElementChange(ElementChangeEvent ece) {
    if (ece.getChangeType().equals(ChangeType.ELEMENT_CREATE)) {
        Object parent = getParent(ece.getElement());
        if (parent == null) {
            treeViewer.refresh(true);
            ece.getElement().addElementChangeListener(this);
        } else {
            if (parent instanceof WorkflowPackage) {
                try {
                    ((WorkflowPackage) parent).getFolder().refreshLocal(IResource.DEPTH_ONE, null);
                } catch (Exception ex) {
                    PluginMessages.log(ex);
                }
            }
            treeViewer.refresh(parent, true);
        }
        treeViewer.expandToLevel(ece.getElement(), 0);
        treeViewer.setSelection(ece.getElement());
    } else if (ece.getChangeType().equals(ChangeType.ELEMENT_DELETE)) {
        Object parent = getParent(ece.getElement());
        if (parent != null) {
            if (ece.getElement() instanceof ActivityImpl)
                // impl can be associated with
                treeViewer.refresh();
            else
                // multiple packages
                treeViewer.refresh(parent, true);
        } else {
            // must be a workflowProject
            ece.getElement().removeElementChangeListener(this);
            treeViewer.refresh();
        }
    } else if (ece.getChangeType().equals(ChangeType.RENAME)) {
        treeViewer.refresh(ece.getElement(), true);
        treeViewer.getControl().forceFocus();
    } else if (ece.getChangeType().equals(ChangeType.VERSION_CHANGE)) {
        treeViewer.refresh(ece.getElement(), true);
        if (ece.getElement() instanceof WorkflowPackage)
            treeViewer.refresh(ece.getElement().getProject().getArchivedUserVisiblePackagesFolder(), true);
    } else if (ece.getChangeType().equals(ChangeType.LABEL_CHANGE)) {
        treeViewer.update(ece.getElement(), null);
    } else if (ece.getChangeType().equals(ChangeType.SETTINGS_CHANGE)) {
        // only applies for workflow projects
        if (ece.getElement() instanceof WorkflowProject) {
            WorkflowProject workflowProject = (WorkflowProject) ece.getElement();
            if (ece.getNewValue() instanceof JdbcDataSource) {
                treeViewer.collapseToLevel(workflowProject, TreeViewer.ALL_LEVELS);
                treeViewer.refresh(workflowProject, true);
            } else if (ece.getNewValue() == null) {
                // general refresh
                treeViewer.refresh(workflowProject, true);
            }
        } else {
            treeViewer.refresh(ece.getElement(), true);
        }
    } else if (ece.getChangeType().equals(ChangeType.STATUS_CHANGE)) {
        treeViewer.update(ece.getElement(), null);
        if (ece.getElement() instanceof AutomatedTestCase) {
            AutomatedTestCase testCase = (AutomatedTestCase) ece.getElement();
            Object testResults;
            if (testCase.isLegacy())
                testResults = testCase.getLegacyExpectedResults();
            else
                testResults = testCase.getExpectedResults();
            if (testResults != null)
                treeViewer.refresh(testResults, true);
        }
    }
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) ActivityImpl(com.centurylink.mdw.plugin.designer.model.ActivityImpl) JdbcDataSource(com.centurylink.mdw.plugin.project.model.JdbcDataSource) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) AutomatedTestCase(com.centurylink.mdw.plugin.designer.model.AutomatedTestCase) DataAccessOfflineException(com.centurylink.mdw.dataaccess.DataAccessOfflineException) InvocationTargetException(java.lang.reflect.InvocationTargetException) DataUnavailableException(com.centurylink.mdw.designer.DataUnavailableException)

Example 74 with WorkflowProject

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

the class ProcessExplorerDropTarget method handleDropActivityImpl.

private boolean handleDropActivityImpl(String activityImplInfo, WorkflowPackage targetPackage, int operation) {
    Long activityImplId = getActivityImplId(activityImplInfo);
    WorkflowProject workflowProject = targetPackage.getProject();
    WorkflowPackage sourcePackage = workflowProject.getPackage(getPackageName(activityImplInfo));
    DesignerProxy designerProxy = workflowProject.getDesignerProxy();
    if (operation == DND.DROP_COPY) {
        if (!targetPackage.isDefaultPackage()) {
            designerProxy.addActivityImplToPackage(activityImplId, targetPackage);
            ((TreeViewer) getViewer()).refresh(targetPackage, true);
            return true;
        }
        return false;
    } else if (operation == DND.DROP_MOVE) {
        if (targetPackage.isDefaultPackage()) {
            designerProxy.removeActivityImplFromPackage(activityImplId, sourcePackage);
        } else {
            designerProxy.addActivityImplToPackage(activityImplId, targetPackage);
            if (RunnerStatus.SUCCESS.equals(designerProxy.getRunnerStatus()))
                designerProxy.removeActivityImplFromPackage(activityImplId, sourcePackage);
        }
        ((TreeViewer) getViewer()).refresh(targetPackage.getProject(), true);
        return true;
    } else {
        return false;
    }
}
Also used : WorkflowPackage(com.centurylink.mdw.plugin.designer.model.WorkflowPackage) TreeViewer(org.eclipse.jface.viewers.TreeViewer) DesignerProxy(com.centurylink.mdw.plugin.designer.DesignerProxy) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Example 75 with WorkflowProject

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

the class ProcessExplorerView method handleRefresh.

public void handleRefresh() {
    BusyIndicator.showWhile(getSite().getShell().getDisplay(), new Runnable() {

        public void run() {
            treeViewer.collapseAll();
            WorkflowProjectManager projectMgr = WorkflowProjectManager.getInstance();
            projectMgr.refresh();
            treeViewer.setInput(projectMgr.getWorkflowProjects());
        }
    });
    WorkflowElementActionHandler actionHandler = new WorkflowElementActionHandler();
    for (WorkflowProject project : WorkflowProjectManager.getInstance().getWorkflowProjects()) {
        if (!project.isFilePersist())
            actionHandler.syncOpenEditors(project);
    }
}
Also used : WorkflowElementActionHandler(com.centurylink.mdw.plugin.actions.WorkflowElementActionHandler) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) WorkflowProjectManager(com.centurylink.mdw.plugin.project.WorkflowProjectManager)

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