use of org.talend.mdm.repository.ui.dialogs.deploy.DeployStatusDialog in project tmdm-studio-se by Talend.
the class AbstractDeployAction method showDeployStatus.
protected void showDeployStatus(IStatus status) {
int count = 0;
if (status.isMultiStatus()) {
for (IStatus child : status.getChildren()) {
if (child.isMultiStatus()) {
count += child.getChildren().length;
} else {
count++;
}
}
}
MultiStatusDialog dialog = new DeployStatusDialog(getShell(), status);
dialog.open();
}
use of org.talend.mdm.repository.ui.dialogs.deploy.DeployStatusDialog in project tmdm-studio-se by Talend.
the class DeployService method showDeployStatus.
private void showDeployStatus(Shell shell, IStatus status) {
MultiStatusDialog dialog = new DeployStatusDialog(shell, status);
dialog.open();
}
use of org.talend.mdm.repository.ui.dialogs.deploy.DeployStatusDialog in project tmdm-studio-se by Talend.
the class UndeployAction method doRun.
/*
* (non-Javadoc)
*
* @see org.talend.mdm.repository.core.bridge.AbstractBridgeRepositoryAction#doRun()
*/
@Override
protected void doRun() {
DeployService deployService = DeployService.getInstance();
CommandManager cmanager = CommandManager.getInstance();
List<IRepositoryViewObject> viewObjs = getSelectedRepositoryViewObject();
if (viewObjs.size() < 1) {
return;
}
SelectServerDefDialog dialog = getServerDefDialog(viewObjs);
if (dialog.open() == IDialogConstants.OK_ID) {
MDMServerDef serverDef = dialog.getSelectedServerDef();
List<AbstractDeployCommand> deleteCommands = new ArrayList<AbstractDeployCommand>(viewObjs.size());
for (IRepositoryViewObject obj : viewObjs) {
ICommand deleteCmd = cmanager.getNewCommand(obj, ICommand.CMD_DELETE);
deleteCmd.init(obj);
deleteCommands.add((AbstractDeployCommand) deleteCmd);
}
IStatus status = deployService.runCommands(deleteCommands, serverDef);
IProgressMonitor monitor = new NullProgressMonitor();
deployService.updateChangedStatus(status);
if (status.isMultiStatus()) {
new DeployStatusDialog(getShell(), status).open();
}
for (IRepositoryViewObject viewObj : viewObjs) {
MDMServerDef lastServerDef = RepositoryResourceUtil.getLastServerDef(viewObj);
String id = viewObj.getId();
CommandStack stack = cmanager.findCommandStack(id);
if (stack != null) {
if (RepositoryResourceUtil.isSameMDMServerDef(lastServerDef, serverDef)) {
List<ICommand> commands = stack.getCommands(ICommand.PHASE_RESTORE);
for (ICommand cmd : commands) {
cmd.execute(null, monitor);
}
}
cmanager.removeCommandStack(id, ICommand.PHASE_RESTORE);
commonViewer.refresh(viewObj);
}
}
} else {
return;
}
}
Aggregations