Search in sources :

Example 11 with SelectServerDefDialog

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;
}
Also used : SelectServerDefDialog(org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Example 12 with SelectServerDefDialog

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;
}
Also used : IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) SelectServerDefDialog(org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Example 13 with SelectServerDefDialog

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);
        }
    }
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) CommandManager(org.talend.mdm.repository.core.command.CommandManager) ICommand(org.talend.mdm.repository.core.command.ICommand) LockedDirtyObjectDialog(org.talend.mdm.repository.ui.dialogs.lock.LockedDirtyObjectDialog) SelectServerDefDialog(org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) AbstractDeployCommand(org.talend.mdm.repository.core.command.deploy.AbstractDeployCommand) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef) LinkedList(java.util.LinkedList)

Example 14 with SelectServerDefDialog

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());
                }
            }
        }
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IStatus(org.eclipse.core.runtime.IStatus) LockedDirtyObjectDialog(org.talend.mdm.repository.ui.dialogs.lock.LockedDirtyObjectDialog) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) SelectServerDefDialog(org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef) SelectVersionDialog(org.talend.mdm.repository.ui.dialogs.SelectVersionDialog)

Example 15 with SelectServerDefDialog

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);
        }
    }
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) SelectServerDefDialog(org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Aggregations

SelectServerDefDialog (org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog)17 MDMServerDef (org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)15 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)10 IStatus (org.eclipse.core.runtime.IStatus)5 XtentisException (com.amalto.workbench.utils.XtentisException)3 TMDMService (com.amalto.workbench.webservices.TMDMService)3 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 LockedDirtyObjectDialog (org.talend.mdm.repository.ui.dialogs.lock.LockedDirtyObjectDialog)3 WSPing (com.amalto.workbench.webservices.WSPing)2 File (java.io.File)2 WebServiceException (javax.xml.ws.WebServiceException)2 MultiStatus (org.eclipse.core.runtime.MultiStatus)2 FileDialog (org.eclipse.swt.widgets.FileDialog)2 CommandManager (org.talend.mdm.repository.core.command.CommandManager)2 ICommand (org.talend.mdm.repository.core.command.ICommand)2 AbstractDeployCommand (org.talend.mdm.repository.core.command.deploy.AbstractDeployCommand)2 IDataContentProcess (org.talend.mdm.repository.core.datacontent.IDataContentProcess)2 DataClusterService (org.talend.mdm.repository.core.service.DataClusterService)2 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1