use of org.talend.mdm.repository.ui.dialogs.SelectVersionDialog in project tmdm-studio-se by Talend.
the class DeployAnotherVersionAction method doRun.
@Override
protected void doRun() {
boolean checkMissingJar = MissingJarService.getInstance().checkMissingJar(true);
if (!checkMissingJar) {
return;
}
List<IRepositoryViewObject> viewObjs = getSelectedRepositoryViewObject();
if (viewObjs.size() == 0) {
return;
}
String originVersion = viewObjs.get(0).getProperty().getVersion();
// open the version dialog
SelectVersionDialog versionDialog = new SelectVersionDialog(getShell(), Messages.DeployAnotherVersionAction_selectAnother, viewObjs.get(0));
versionDialog.create();
if (versionDialog.open() == IDialogConstants.OK_ID) {
if (versionDialog.getSelection() != null) {
viewObjs = new ArrayList<IRepositoryViewObject>();
IRepositoryViewObject modelviewObj = versionDialog.getSelection();
viewObjs.add(modelviewObj);
viewObjs.addAll(getAssociatedObjects(modelviewObj));
}
SelectServerDefDialog dialog = new SelectServerDefDialog(getShell());
if (dialog.open() == IDialogConstants.OK_ID) {
// save editors
LockedDirtyObjectDialog lockDirtyDialog = new LockedDirtyObjectDialog(getShell(), Messages.AbstractDeployAction_promptToSaveEditors, viewObjs);
if (lockDirtyDialog.needShowDialog() && lockDirtyDialog.open() == IDialogConstants.CANCEL_ID) {
return;
}
lockDirtyDialog.saveDirtyObjects();
// deploy
MDMServerDef serverDef = dialog.getSelectedServerDef();
if (doCheckServerConnection(serverDef)) {
IStatus status = DeployService.getInstance().deployAnotherVersion(serverDef, viewObjs);
if (status.isMultiStatus()) {
showDeployStatus(status);
}
if (isLatestVersion(viewObjs.get(0), originVersion)) {
updateChangedStatus(status);
updateLastServer(status, new NullProgressMonitor());
}
}
}
}
}
Aggregations