Search in sources :

Example 6 with BatchDeployJobCommand

use of org.talend.mdm.repository.core.command.deploy.job.BatchDeployJobCommand in project tmdm-studio-se by Talend.

the class CommandManager method removeCommandStack.

public void removeCommandStack(ICommand cmd, int phase) {
    if (cmd == null) {
        return;
    }
    if (cmd instanceof BatchDeployJobCommand) {
        BatchDeployJobCommand jobCommand = (BatchDeployJobCommand) cmd;
        removeCommandStack(jobCommand.getSubCmds(), phase);
        removeCommandStack(jobCommand.getSubDeleteCmds(), phase);
    } else {
        removeCommandStack(cmd.getCommandId(), phase);
    }
}
Also used : BatchDeployJobCommand(org.talend.mdm.repository.core.command.deploy.job.BatchDeployJobCommand)

Example 7 with BatchDeployJobCommand

use of org.talend.mdm.repository.core.command.deploy.job.BatchDeployJobCommand in project tmdm-studio-se by Talend.

the class CommandManager method arrangeForJobCommands.

public void arrangeForJobCommands(List<ICommand> cmds) {
    BatchDeployJobCommand jobCommand = new BatchDeployJobCommand();
    for (Iterator<ICommand> il = cmds.iterator(); il.hasNext(); ) {
        ICommand cmd = il.next();
        IRepositoryViewObject viewObject = cmd.getViewObject();
        if (viewObject.getRepositoryObjectType() == ERepositoryObjectType.PROCESS) {
            if (cmd instanceof CompoundCommand) {
                for (ICommand subCmd : ((CompoundCommand) cmd).getSubCommands()) {
                    int type = subCmd.getCommandType();
                    if (type == ICommand.CMD_DELETE) {
                        jobCommand.addDeleteCommand(subCmd);
                    } else if (type == ICommand.CMD_MODIFY) {
                        jobCommand.addCommand(subCmd);
                    }
                }
            } else {
                int type = cmd.getCommandType();
                if (type == ICommand.CMD_DELETE) {
                    jobCommand.addDeleteCommand(cmd);
                } else {
                    jobCommand.addCommand(cmd);
                }
            }
            il.remove();
        }
    }
    if (!jobCommand.isEmpty()) {
        cmds.add(jobCommand);
    }
}
Also used : BatchDeployJobCommand(org.talend.mdm.repository.core.command.deploy.job.BatchDeployJobCommand) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) DeployCompoundCommand(org.talend.mdm.repository.core.command.deploy.DeployCompoundCommand)

Aggregations

BatchDeployJobCommand (org.talend.mdm.repository.core.command.deploy.job.BatchDeployJobCommand)7 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)4 IStatus (org.eclipse.core.runtime.IStatus)3 ICommand (org.talend.mdm.repository.core.command.ICommand)3 MultiStatus (org.eclipse.core.runtime.MultiStatus)2 AbstractDeployCommand (org.talend.mdm.repository.core.command.deploy.AbstractDeployCommand)2 DeployCompoundCommand (org.talend.mdm.repository.core.command.deploy.DeployCompoundCommand)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 Display (org.eclipse.swt.widgets.Display)1 Shell (org.eclipse.swt.widgets.Shell)1 IWorkbench (org.eclipse.ui.IWorkbench)1 SpagoBiServer (org.talend.core.model.properties.SpagoBiServer)1 DeployOnMDMExportWizard (org.talend.mdm.engines.client.ui.wizards.DeployOnMDMExportWizard)1 CommandManager (org.talend.mdm.repository.core.command.CommandManager)1 DeployStatus (org.talend.mdm.repository.core.service.DeployService.DeployStatus)1 MDMServerDef (org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)1