Revision f6a8dc56
Added by Patrick Plitzner over 10 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.io.wizard; |
12 | 12 |
|
13 |
import java.io.File; |
|
14 |
import java.io.FileInputStream; |
|
15 |
import java.io.FileNotFoundException; |
|
13 | 16 |
import java.net.URI; |
14 | 17 |
|
18 |
import org.apache.log4j.Logger; |
|
15 | 19 |
import org.eclipse.jface.viewers.IStructuredSelection; |
16 | 20 |
import org.eclipse.ui.IWorkbench; |
17 | 21 |
|
... | ... | |
28 | 32 |
*/ |
29 | 33 |
public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigurator> { |
30 | 34 |
|
35 |
private static final Logger logger = Logger.getLogger(AbcdImportWizard.class); |
|
36 |
|
|
31 | 37 |
private Abcd206ImportConfigurator configurator; |
32 | 38 |
private ImportFromFileDataSourceWizardPage dataSourcePage; |
33 |
|
|
39 |
|
|
34 | 40 |
/* (non-Javadoc) |
35 | 41 |
* @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator() |
36 | 42 |
*/ |
... | ... | |
47 | 53 |
@Override |
48 | 54 |
public boolean performFinish() { |
49 | 55 |
URI source = dataSourcePage.getUri(); |
50 |
configurator.setSource(source); |
|
56 |
try { |
|
57 |
configurator.setSource(new FileInputStream(new File(source))); |
|
58 |
} catch (FileNotFoundException e) { |
|
59 |
logger.error("File not found!", e); |
|
60 |
return false; |
|
61 |
} |
|
51 | 62 |
configurator.setDbSchemaValidation(DbSchemaValidation.CREATE); |
52 |
|
|
63 |
|
|
53 | 64 |
CdmStore.getImportManager().run(configurator); |
54 | 65 |
return true; |
55 |
|
|
66 |
|
|
56 | 67 |
} |
57 | 68 |
|
58 | 69 |
/* (non-Javadoc) |
59 | 70 |
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) |
60 | 71 |
*/ |
61 | 72 |
/** {@inheritDoc} */ |
62 |
public void init(IWorkbench workbench, IStructuredSelection selection) { |
|
73 |
@Override |
|
74 |
public void init(IWorkbench workbench, IStructuredSelection selection) { |
|
63 | 75 |
super.init(workbench, selection); |
64 | 76 |
configurator = CdmStore.getImportManager().AbcdConfigurator(); |
65 | 77 |
} |
66 |
|
|
78 |
|
|
67 | 79 |
/* (non-Javadoc) |
68 | 80 |
* @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages() |
69 | 81 |
*/ |
... | ... | |
71 | 83 |
@Override |
72 | 84 |
public void addPages() { |
73 | 85 |
super.addPages(); |
74 |
|
|
86 |
|
|
75 | 87 |
dataSourcePage = ImportFromFileDataSourceWizardPage.XML(); |
76 | 88 |
addPage(dataSourcePage); |
77 | 89 |
} |
Also available in: Unified diff
merged model adaptions to cdmlib 3.2.4 from campanula branch