a7691d92f7774e1f93b2dd440bbc16e1e2b037bb
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / io / wizard / DarwinCoreArchiveExportWizard.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.taxeditor.io.wizard;
12
13 import java.io.File;
14
15 import org.eclipse.jface.viewers.IStructuredSelection;
16 import org.eclipse.ui.IWorkbench;
17
18 import eu.etaxonomy.cdm.io.dwca.out.DwcaTaxExportConfigurator;
19 import eu.etaxonomy.taxeditor.store.CdmStore;
20
21 /**
22 * @author n.hoffmann
23 * @created May 2, 2011
24 * @version 1.0
25 */
26 public class DarwinCoreArchiveExportWizard extends
27 AbstractExportWizard<DwcaTaxExportConfigurator> {
28
29 private DwcaTaxExportConfigurator configurator;
30 private ExportToFileDestinationWizardPage page;
31
32 /*
33 * (non-Javadoc)
34 *
35 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
36 * org.eclipse.jface.viewers.IStructuredSelection)
37 */
38 @Override
39 public void init(IWorkbench workbench, IStructuredSelection selection) {
40 configurator = DwcaTaxExportConfigurator.NewInstance(null, null, null);
41 }
42
43 /*
44 * (non-Javadoc)
45 *
46 * @see
47 * eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
48 */
49 @Override
50 public DwcaTaxExportConfigurator getConfigurator() {
51 return configurator;
52 }
53
54 /*
55 * (non-Javadoc)
56 *
57 * @see org.eclipse.jface.wizard.Wizard#performFinish()
58 */
59 @Override
60 public boolean performFinish() {
61 String urlString = page.getFolderText() + File.separator
62 + page.getExportFileName();
63
64 configurator.setDestination(new File(urlString));
65
66 CdmStore.getExportManager().run(configurator);
67
68 return true;
69 }
70
71 /*
72 * (non-Javadoc)
73 *
74 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
75 */
76 @Override
77 public void addPages() {
78 super.addPages();
79
80 page = ExportToFileDestinationWizardPage.Dwca();
81 addPage(page);
82 }
83 }