Search in sources :

Example 1 with ExportServiceWithMavenAction

use of org.talend.repository.services.ui.action.ExportServiceWithMavenAction in project tesb-studio-se by Talend.

the class ServiceExportWizard method performFinish.

@Override
public boolean performFinish() {
    final String destinationValue = mainPage.getDestinationValue();
    // TESB-7319: add confirm dialog
    if (new File(destinationValue).exists()) {
        boolean openQuestion = MessageDialog.openQuestion(getShell(), Messages.ServiceExportWizard_destinationExistTitle, Messages.ServiceExportWizard_destinationExistMessage);
        if (!openQuestion) {
            return false;
        }
    }
    // END TESB-7319
    Map<ExportChoice, Object> exportChoiceMap = mainPage.getExportChoiceMap();
    try {
        if (mainPage.isAddMavenScript()) {
            ServiceExportWithMavenManager mavenManager = new ServiceExportWithMavenManager(exportChoiceMap, IContext.DEFAULT, JobScriptsManager.LAUNCHER_ALL, IProcessor.NO_STATISTICS, IProcessor.NO_TRACES);
            IRunnableWithProgress action = new ExportServiceWithMavenAction(mavenManager, exportChoiceMap, serviceItem, destinationValue);
            getContainer().run(false, true, action);
        } else {
            IRunnableWithProgress action = new ExportServiceAction(serviceItem, destinationValue, exportChoiceMap);
            getContainer().run(true, true, action);
        }
        mainPage.finish();
    } catch (InvocationTargetException e) {
        MessageBoxExceptionHandler.process(e.getCause(), getShell());
        return false;
    } catch (InterruptedException e) {
        return false;
    }
    return true;
}
Also used : ExportServiceAction(org.talend.repository.services.ui.action.ExportServiceAction) ExportServiceWithMavenAction(org.talend.repository.services.ui.action.ExportServiceWithMavenAction) ExportChoice(org.talend.repository.ui.wizards.exportjob.scriptsmanager.JobScriptsManager.ExportChoice) ServiceExportWithMavenManager(org.talend.repository.services.ui.scriptmanager.ServiceExportWithMavenManager) File(java.io.File) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Aggregations

File (java.io.File)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)1 ExportServiceAction (org.talend.repository.services.ui.action.ExportServiceAction)1 ExportServiceWithMavenAction (org.talend.repository.services.ui.action.ExportServiceWithMavenAction)1 ServiceExportWithMavenManager (org.talend.repository.services.ui.scriptmanager.ServiceExportWithMavenManager)1 ExportChoice (org.talend.repository.ui.wizards.exportjob.scriptsmanager.JobScriptsManager.ExportChoice)1