Search in sources :

Example 1 with AbstractWorksapceUpdateTask

use of org.talend.dataprofiler.core.migration.AbstractWorksapceUpdateTask in project tdq-studio-se by Talend.

the class FileSystemImportWriter method migration.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.imex.model.IImexWriter#migration(org.eclipse.core.runtime.IProgressMonitor)
     */
public void migration(IProgressMonitor monitor) {
    List<IMigrationTask> modelTasks = new ArrayList<IMigrationTask>();
    if (versionFile != null && versionFile.exists()) {
        ProductVersion version = WorkspaceVersionHelper.getVesion(new Path(versionFile.getAbsolutePath()));
        MigrationTaskManager manager = new MigrationTaskManager(version, MigrationTaskType.FILE);
        List<IMigrationTask> taskList = manager.getValidTasks();
        if (!taskList.isEmpty()) {
            for (IMigrationTask task : taskList) {
                if (task.isModelTask()) {
                    ((AbstractWorksapceUpdateTask) task).setWorkspacePath(basePath);
                    modelTasks.add(task);
                } else {
                    // MOD msjian TDQ-7365 2013-5-27: only added the not inclued tasks
                    if (!commTasks.contains(task)) {
                        commTasks.add(task);
                    }
                // TDQ-7365~
                }
            }
        }
    }
    if (!modelTasks.isEmpty()) {
        MigrationTaskManager.doMigrationTask(modelTasks, monitor);
    }
}
Also used : Path(org.eclipse.core.runtime.Path) IPath(org.eclipse.core.runtime.IPath) MigrationTaskManager(org.talend.dataprofiler.migration.manager.MigrationTaskManager) AbstractWorksapceUpdateTask(org.talend.dataprofiler.core.migration.AbstractWorksapceUpdateTask) ArrayList(java.util.ArrayList) IMigrationTask(org.talend.dataprofiler.migration.IMigrationTask) ProductVersion(org.talend.utils.ProductVersion)

Aggregations

ArrayList (java.util.ArrayList)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 AbstractWorksapceUpdateTask (org.talend.dataprofiler.core.migration.AbstractWorksapceUpdateTask)1 IMigrationTask (org.talend.dataprofiler.migration.IMigrationTask)1 MigrationTaskManager (org.talend.dataprofiler.migration.manager.MigrationTaskManager)1 ProductVersion (org.talend.utils.ProductVersion)1