Revision a3072f4e
Added by Katja Luther over 1 year ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java | ||
---|---|---|
33 | 33 |
protected ICdmRepository applicationConfiguration; |
34 | 34 |
|
35 | 35 |
public static enum TYPE { |
36 |
Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name, SpecimenSearch, Gbif, Excel_Distribution, Ris, OWL
|
|
36 |
Jaxb, Tcs, Excel_Taxa, Sdd, Abcd, Excel_Name, SpecimenSearch, Gbif, Excel_Distribution, Ris, OWL
|
|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
protected AbstractIOManager( |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java | ||
---|---|---|
278 | 278 |
return JaxbImportConfigurator.NewInstance(null, null); |
279 | 279 |
case Tcs: |
280 | 280 |
return TcsXmlImportConfigurator.NewInstance(null, null); |
281 |
case Endnote: |
|
282 |
return EndnoteImportConfigurator.NewInstance(null, null); |
|
283 | 281 |
case Excel_Taxa: |
284 | 282 |
return NormalExplicitImportConfigurator.NewInstance(null, null, |
285 | 283 |
null, null); |
... | ... | |
287 | 285 |
return Abcd206ImportConfigurator.NewInstance(null, null); |
288 | 286 |
case Sdd: |
289 | 287 |
return SDDImportConfigurator.NewInstance(null, null); |
290 |
case SpecimenCdmExcel: |
|
291 |
return SpecimenCdmExcelImportConfigurator.NewInstance(null, null); |
|
292 | 288 |
case SpecimenSearch: |
293 | 289 |
return Abcd206ImportConfigurator.NewInstance(null, null); |
294 | 290 |
case Gbif: |
... | ... | |
328 | 324 |
return (TcsXmlImportConfigurator) getConfigurator(TYPE.Tcs); |
329 | 325 |
} |
330 | 326 |
|
331 |
/** |
|
332 |
* <p> |
|
333 |
* EndnoteConfigurator |
|
334 |
* </p> |
|
335 |
* |
|
336 |
* @return a |
|
337 |
* {@link eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator} |
|
338 |
* object. |
|
339 |
*/ |
|
340 |
public final EndnoteImportConfigurator EndnoteConfigurator() { |
|
341 |
return (EndnoteImportConfigurator) getConfigurator(TYPE.Endnote); |
|
342 |
} |
|
327 |
|
|
343 | 328 |
|
344 | 329 |
/** |
345 | 330 |
* <p> |
... | ... | |
379 | 364 |
return (Abcd206ImportConfigurator) getConfigurator(TYPE.Abcd); |
380 | 365 |
} |
381 | 366 |
|
382 |
public SpecimenCdmExcelImportConfigurator SpecimenCdmExcelImportConfigurator() { |
|
383 |
return (SpecimenCdmExcelImportConfigurator) getConfigurator(TYPE.SpecimenCdmExcel); |
|
384 |
} |
|
385 |
|
|
386 | 367 |
public DwcaImportConfigurator DwcaImportConfigurator() { |
387 | 368 |
return (DwcaImportConfigurator) getConfigurator(TYPE.Gbif); |
388 | 369 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/specimen/OpenExcelSpecimenImportWizard.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2017 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.io.e4.in.excel.specimen; |
|
10 |
|
|
11 |
import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard; |
|
12 |
import eu.etaxonomy.taxeditor.io.e4.in.AbstractOpenImportWizard; |
|
13 |
|
|
14 |
/** |
|
15 |
* @author pplitzner |
|
16 |
* @since Oct 5, 2017 |
|
17 |
*/ |
|
18 |
public class OpenExcelSpecimenImportWizard extends AbstractOpenImportWizard { |
|
19 |
|
|
20 |
@Override |
|
21 |
protected Class<? extends AbstractImportWizard> getImportWizardClass() { |
|
22 |
return SpecimenCdmExcelImportWizard.class; |
|
23 |
} |
|
24 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/in/excel/specimen/SpecimenCdmExcelImportWizard.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.io.e4.in.excel.specimen; |
|
10 |
|
|
11 |
import java.util.ArrayList; |
|
12 |
import java.util.List; |
|
13 |
|
|
14 |
import javax.inject.Inject; |
|
15 |
|
|
16 |
import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
|
17 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
|
18 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
|
19 |
|
|
20 |
import eu.etaxonomy.cdm.common.URI; |
|
21 |
import eu.etaxonomy.cdm.database.DbSchemaValidation; |
|
22 |
import eu.etaxonomy.cdm.io.specimen.excel.in.SpecimenCdmExcelImportConfigurator; |
|
23 |
import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard; |
|
24 |
import eu.etaxonomy.taxeditor.io.e4.in.GenericConfiguratorWizardPageE4; |
|
25 |
import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWithReferenceWizardPage; |
|
26 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
|
27 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
28 |
|
|
29 |
/** |
|
30 |
* TODO adapt to remoting, currently not in use |
|
31 |
* |
|
32 |
* @author pplitzner |
|
33 |
* @since Oct 5, 2017 |
|
34 |
*/ |
|
35 |
public class SpecimenCdmExcelImportWizard |
|
36 |
extends AbstractImportWizard<SpecimenCdmExcelImportConfigurator> { |
|
37 |
|
|
38 |
private SpecimenCdmExcelImportConfigurator configurator; |
|
39 |
|
|
40 |
private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage; |
|
41 |
|
|
42 |
@Inject |
|
43 |
public SpecimenCdmExcelImportWizard(IEclipseContext context, EPartService partService) { |
|
44 |
super(context, partService); |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
public SpecimenCdmExcelImportConfigurator getConfigurator() { |
|
49 |
return configurator; |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public void init() { |
|
54 |
configurator = CdmStore.getImportManager().SpecimenCdmExcelImportConfigurator(); |
|
55 |
} |
|
56 |
|
|
57 |
@Override |
|
58 |
public boolean performFinish() { |
|
59 |
URI source = dataSourcePage.getUri(); |
|
60 |
configurator.setSource(source); |
|
61 |
configurator.setDbSchemaValidation(DbSchemaValidation.CREATE); |
|
62 |
|
|
63 |
throw new RuntimeException("SpecimenCdmExcelImport is not yet transformed to remoting execution"); |
|
64 |
//TODO local IO not supportd anymore |
|
65 |
// CdmStore.getImportManager().run(configurator); |
|
66 |
// return true; |
|
67 |
} |
|
68 |
|
|
69 |
@Override |
|
70 |
public void addPages() { |
|
71 |
dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWithReferenceWizardPage.class, context); |
|
72 |
dataSourcePage.setTitle("Choose Specimen CDM Excel"); |
|
73 |
dataSourcePage.setDescription("Please choose an xls file in the SpecimenCdmExcel format."); |
|
74 |
dataSourcePage.setExtensions(new String[]{"*.xlsx", "*.xls", "*.*"}); |
|
75 |
|
|
76 |
addPage(dataSourcePage); |
|
77 |
super.addPages(); |
|
78 |
} |
|
79 |
|
|
80 |
@Override |
|
81 |
protected void addConfiguratorPage(){ |
|
82 |
List<String> ignoreMethods = new ArrayList<>(); |
|
83 |
ignoreMethods.add("setIgnoreNull"); |
|
84 |
ignoreMethods.add("setInteractWithUser"); |
|
85 |
ignoreMethods.add("setUseClassification"); |
|
86 |
ignoreMethods.add("setRegisterAuditing"); |
|
87 |
ignoreMethods.add("setDeduplicateAuthors"); |
|
88 |
ignoreMethods.add("setDeduplicateReferences"); |
|
89 |
pageConfiguration = ContextInjectionFactory.make(GenericConfiguratorWizardPageE4.class, context); |
|
90 |
pageConfiguration.initImport(getConfigurator(), ignoreMethods, Messages.ExcelSpecimenUpdateWizard_ConfiguratorWizard_label); |
|
91 |
addPage(pageConfiguration); |
|
92 |
} |
|
93 |
|
|
94 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/EndnoteImportWizard.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2007 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.io.wizard; |
|
10 |
|
|
11 |
import java.io.File; |
|
12 |
|
|
13 |
import javax.inject.Inject; |
|
14 |
|
|
15 |
import org.eclipse.e4.core.contexts.IEclipseContext; |
|
16 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
|
17 |
|
|
18 |
import eu.etaxonomy.cdm.common.URI; |
|
19 |
import eu.etaxonomy.cdm.io.reference.endnote.in.EndnoteImportConfigurator; |
|
20 |
import eu.etaxonomy.taxeditor.io.e4.in.AbstractImportWizard; |
|
21 |
import eu.etaxonomy.taxeditor.io.e4.in.ImportFromFileDataSourceWizardPage; |
|
22 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
23 |
|
|
24 |
/** |
|
25 |
* TODO adapt to remoting, currently not in use |
|
26 |
* |
|
27 |
* @author n.hoffmann |
|
28 |
* @created Sep 18, 2009 |
|
29 |
*/ |
|
30 |
public class EndnoteImportWizard extends AbstractImportWizard<EndnoteImportConfigurator> { |
|
31 |
|
|
32 |
private EndnoteImportConfigurator configurator; |
|
33 |
|
|
34 |
private ImportFromFileDataSourceWizardPage dataSourcePage; |
|
35 |
|
|
36 |
@Inject |
|
37 |
public EndnoteImportWizard(IEclipseContext context, EPartService partService) { |
|
38 |
super(context, partService); |
|
39 |
} |
|
40 |
|
|
41 |
@Override |
|
42 |
public boolean performFinish() { |
|
43 |
|
|
44 |
File file = dataSourcePage.getFile(); |
|
45 |
configurator.setSource(URI.fromFile(file)); |
|
46 |
|
|
47 |
//TODO local IO not supportd anymore |
|
48 |
// CdmStore.getImportManager().run(configurator); |
|
49 |
|
|
50 |
return true; |
|
51 |
} |
|
52 |
|
|
53 |
@Override |
|
54 |
public void addPages() { |
|
55 |
super.addPages(); |
|
56 |
|
|
57 |
dataSourcePage = new ImportFromFileDataSourceWizardPage(); |
|
58 |
addPage(dataSourcePage); |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public void init() { |
|
63 |
configurator = CdmStore.getImportManager().EndnoteConfigurator(); |
|
64 |
} |
|
65 |
|
|
66 |
@Override |
|
67 |
public EndnoteImportConfigurator getConfigurator() { |
|
68 |
return configurator; |
|
69 |
} |
|
70 |
} |
Also available in: Unified diff
ref #10220: remove unused import code