use of org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog in project tmdm-studio-se by Talend.
the class SelectImportedModulesDialog2 method getPort.
@Override
protected TMDMService getPort() throws XtentisException {
SelectServerDefDialog dialog = new SelectServerDefDialog(getShell());
if (dialog.open() == IDialogConstants.OK_ID) {
MDMServerDef serverDef = dialog.getSelectedServerDef();
this.serverDef = serverDef;
return RepositoryWebServiceAdapter.getMDMService(serverDef);
}
return null;
}
use of org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog in project tmdm-studio-se by Talend.
the class ConnectToWebUIAction method getUrl.
private String getUrl() {
// $NON-NLS-1$
String path = "/talendmdm";
// $NON-NLS-1$
String defaultHostPort = "http://localhost:8080";
List<IRepositoryViewObject> viewObjects = ServerDefService.getAllServerDefViewObjects();
if (viewObjects == null || viewObjects.size() == 0) {
return defaultHostPort + path;
}
SelectServerDefDialog selServerDlg = getSelectServerDefDialog();
if (selServerDlg.open() == IDialogConstants.OK_ID) {
MDMServerDef serverDef = selServerDlg.getSelectedServerDef();
return serverDef.getProtocol() + serverDef.getHost() + ":" + serverDef.getPort() + // $NON-NLS-1$
Util.getContextPath(serverDef.getPath());
}
return null;
}
use of org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog in project tmdm-studio-se by Talend.
the class RemoveFromServerAction method doRun.
protected void doRun() {
SelectServerDefDialog dialog = new SelectServerDefDialog(getShell());
if (dialog.open() == IDialogConstants.OK_ID) {
// save editors
LockedDirtyObjectDialog lockDirtyDialog = new LockedDirtyObjectDialog(getShell(), Messages.AbstractDeployAction_promptToSaveEditors, getSelectedRepositoryViewObject());
if (lockDirtyDialog.needShowDialog() && lockDirtyDialog.open() == IDialogConstants.CANCEL_ID) {
return;
}
lockDirtyDialog.saveDirtyObjects();
// remove
MDMServerDef serverDef = dialog.getSelectedServerDef();
List<AbstractDeployCommand> commands = new LinkedList<AbstractDeployCommand>();
CommandManager commandManager = CommandManager.getInstance();
for (Object obj : getSelectedObject()) {
IRepositoryViewObject viewObj = (IRepositoryViewObject) obj;
ICommand deleteCommand = commandManager.getNewCommand(ICommand.CMD_DELETE);
deleteCommand.init(viewObj);
commands.add((AbstractDeployCommand) deleteCommand);
}
//
IStatus status = DeployService.getInstance().runCommands(commands, serverDef);
if (status.isMultiStatus()) {
showDeployStatus(status);
}
}
}
use of org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog 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());
}
}
}
}
}
use of org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog in project tmdm-studio-se by Talend.
the class DeployToAction method doRun.
@Override
protected void doRun() {
boolean checkMissingJar = MissingJarService.getInstance().checkMissingJar(true);
if (!checkMissingJar) {
return;
}
List<IRepositoryViewObject> viewObjs = getSelectedRepositoryViewObject();
viewObjs = doCheckDependency(viewObjs);
if (viewObjs == null) {
return;
}
SelectServerDefDialog dialog = getSelectServerDefDialog(viewObjs);
if (dialog.open() == IDialogConstants.OK_ID) {
// save editors
if (!doBeforeDeploy(viewObjs)) {
return;
}
// deploy
MDMServerDef serverDef = dialog.getSelectedServerDef();
IStatus status = deploy(serverDef, viewObjs, ICommand.CMD_MODIFY);
if (status.getSeverity() != IStatus.CANCEL) {
updateChangedStatus(status);
if (status.isMultiStatus()) {
showDeployStatus(status);
}
doPostDeploy(status);
}
}
}
Aggregations