Search in sources :

Example 11 with ImportItem

use of org.talend.repository.items.importexport.handlers.model.ImportItem in project tdi-studio-se by Talend.

the class RoutineImportHandler method afterImportingItems.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.repository.items.importexport.handlers.imports.ImportRepTypeHandler#afterImportingItemRecords(org
     * .eclipse.core.runtime.IProgressMonitor,
     * org.talend.repository.items.importexport.ui.wizard.imports.managers.ResourcesManager,
     * org.talend.repository.items.importexport.ui.wizard.imports.models.ItemRecord)
     */
@Override
public void afterImportingItems(IProgressMonitor monitor, ResourcesManager resManager, ImportItem selectedItemRecord) {
    // deploy routines Jar
    final Item item = selectedItemRecord.getItem();
    if (validEClass(item) && item instanceof RoutineItem) {
        RoutineItem rItem = (RoutineItem) item;
        Set<String> extRoutines = new HashSet<String>();
        for (IMPORTType type : (List<IMPORTType>) rItem.getImports()) {
            extRoutines.add(type.getMODULE());
        }
        if (resManager instanceof ProviderManager || resManager instanceof ZipFileManager) {
            deployJarToDestForArchive(resManager, extRoutines);
        } else {
            deployJarToDest(resManager, extRoutines);
        }
    }
    super.afterImportingItems(monitor, resManager, selectedItemRecord);
}
Also used : RoutineItem(org.talend.core.model.properties.RoutineItem) Item(org.talend.core.model.properties.Item) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) ProviderManager(org.talend.repository.items.importexport.ui.managers.ProviderManager) IMPORTType(org.talend.designer.core.model.utils.emf.component.IMPORTType) RoutineItem(org.talend.core.model.properties.RoutineItem) List(java.util.List) ZipFileManager(org.talend.repository.items.importexport.ui.managers.ZipFileManager) HashSet(java.util.HashSet)

Example 12 with ImportItem

use of org.talend.repository.items.importexport.handlers.model.ImportItem in project tdi-studio-se by Talend.

the class DqDemoImportTest method importDqDemo.

@Before
public void importDqDemo() throws Exception {
    initDemo(DQ_DEMO_PLUGIN_ID);
    Assert.assertNotNull(currentDemo);
    initTestPaths();
    initTempPro();
    // For DQ,has special structure to create for temp project before test
    initDQStructure();
    dqResManager = DemoImportTestUtil.getResourceManager(currentDemo);
    Assert.assertNotNull(dqResManager);
    ImportExportHandlersManager importManager = new ImportExportHandlersManager();
    List<ImportItem> projectRecords = importManager.populateImportingItems(dqResManager, true, new NullProgressMonitor());
    Assert.assertTrue(projectRecords.size() > 0);
    importManager.importItemRecords(new NullProgressMonitor(), dqResManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);
}
Also used : ImportExportHandlersManager(org.talend.repository.items.importexport.handlers.ImportExportHandlersManager) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) Before(org.junit.Before)

Example 13 with ImportItem

use of org.talend.repository.items.importexport.handlers.model.ImportItem in project tdi-studio-se by Talend.

the class EsbDemoImportTest method importEsbDemo.

@Before
public void importEsbDemo() throws Exception {
    initDemo(ESB_DEMO_PLUGIN_ID);
    Assert.assertNotNull(currentDemo);
    initTestPaths();
    initTempPro();
    esbResManager = DemoImportTestUtil.getResourceManager(currentDemo);
    Assert.assertNotNull(esbResManager);
    ImportExportHandlersManager importManager = new ImportExportHandlersManager();
    List<ImportItem> projectRecords = importManager.populateImportingItems(esbResManager, true, new NullProgressMonitor());
    Assert.assertTrue(projectRecords.size() > 0);
    importManager.importItemRecords(new NullProgressMonitor(), esbResManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);
}
Also used : ImportExportHandlersManager(org.talend.repository.items.importexport.handlers.ImportExportHandlersManager) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) Before(org.junit.Before)

Example 14 with ImportItem

use of org.talend.repository.items.importexport.handlers.model.ImportItem in project tdi-studio-se by Talend.

the class MdmEeDemoImportTest method importMdmEeDemo.

@Before
public void importMdmEeDemo() throws Exception {
    initDemo(MDM_EE_DEMO_PLUGIN_ID);
    Assert.assertNotNull(currentDemo);
    initTestPaths();
    initTempPro();
    mdmResEeManager = DemoImportTestUtil.getResourceManager(currentDemo);
    Assert.assertNotNull(mdmResEeManager);
    ImportExportHandlersManager importManager = new ImportExportHandlersManager();
    List<ImportItem> projectRecords = importManager.populateImportingItems(mdmResEeManager, true, new NullProgressMonitor());
    Assert.assertTrue(projectRecords.size() > 0);
    importManager.importItemRecords(new NullProgressMonitor(), mdmResEeManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);
}
Also used : ImportExportHandlersManager(org.talend.repository.items.importexport.handlers.ImportExportHandlersManager) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) Before(org.junit.Before)

Example 15 with ImportItem

use of org.talend.repository.items.importexport.handlers.model.ImportItem in project tdi-studio-se by Talend.

the class DiDemoImportTest method importDiDemo.

@Before
public void importDiDemo() throws Exception {
    initDemo(DI_DEMO_PLUGIN_ID);
    Assert.assertNotNull(currentDemo);
    initTestPaths();
    initTempPro();
    diResManager = DemoImportTestUtil.getResourceManager(currentDemo);
    Assert.assertNotNull(diResManager);
    ImportExportHandlersManager importManager = new ImportExportHandlersManager();
    List<ImportItem> projectRecords = importManager.populateImportingItems(diResManager, true, new NullProgressMonitor());
    Assert.assertTrue(projectRecords.size() > 0);
    importManager.importItemRecords(new NullProgressMonitor(), diResManager, projectRecords, true, projectRecords.toArray(new ImportItem[0]), null);
}
Also used : ImportExportHandlersManager(org.talend.repository.items.importexport.handlers.ImportExportHandlersManager) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ImportItem(org.talend.repository.items.importexport.handlers.model.ImportItem) Before(org.junit.Before)

Aggregations

ImportItem (org.talend.repository.items.importexport.handlers.model.ImportItem)16 ImportExportHandlersManager (org.talend.repository.items.importexport.handlers.ImportExportHandlersManager)8 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)7 Before (org.junit.Before)7 Item (org.talend.core.model.properties.Item)6 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 ResourcesManager (org.talend.repository.items.importexport.manager.ResourcesManager)4 ProcessItem (org.talend.core.model.properties.ProcessItem)3 FileNotFoundException (java.io.FileNotFoundException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ZipException (java.util.zip.ZipException)2 ZipFile (java.util.zip.ZipFile)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 TarException (org.eclipse.ui.internal.wizards.datatransfer.TarException)2 PersistenceException (org.talend.commons.exception.PersistenceException)2 RoutineItem (org.talend.core.model.properties.RoutineItem)2 File (java.io.File)1 URL (java.net.URL)1 HashSet (java.util.HashSet)1