Project

General

Profile

Download (2.26 KB) Statistics
| Branch: | Tag: | Revision:
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

    
10
package eu.etaxonomy.taxeditor.io.wizard;
11

    
12
import java.io.File;
13

    
14
import org.eclipse.core.runtime.jobs.Job;
15
import org.eclipse.jface.viewers.IStructuredSelection;
16
import org.eclipse.ui.IWorkbench;
17
import org.eclipse.ui.progress.IProgressConstants;
18

    
19
import eu.etaxonomy.cdm.io.dwca.out.DwcaTaxExportConfigurator;
20
import eu.etaxonomy.taxeditor.store.CdmStore;
21

    
22
/**
23
 * @author n.hoffmann
24
 * @created May 2, 2011
25
 * @version 1.0
26
 */
27
public class DarwinCoreArchiveExportWizard extends
28
		AbstractExportWizard<DwcaTaxExportConfigurator> {
29

    
30
	private DwcaTaxExportConfigurator configurator;
31
	private ExportToFileDestinationWizardPage page;
32

    
33
	/*
34
	 * (non-Javadoc)
35
	 *
36
	 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
37
	 * org.eclipse.jface.viewers.IStructuredSelection)
38
	 */
39
	@Override
40
	public void init(IWorkbench workbench, IStructuredSelection selection) {
41
		configurator = DwcaTaxExportConfigurator.NewInstance(null, null, null);
42
	}
43

    
44
	/*
45
	 * (non-Javadoc)
46
	 *
47
	 * @see
48
	 * eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
49
	 */
50
	@Override
51
	public DwcaTaxExportConfigurator getConfigurator() {
52
		return configurator;
53
	}
54

    
55
	/*
56
	 * (non-Javadoc)
57
	 *
58
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
59
	 */
60
	@Override
61
	public boolean performFinish() {
62
		String urlString = page.getFolderText() + File.separator
63
				+ page.getExportFileName();
64

    
65
		File destination = new File(urlString);
66
		configurator.setDestination(destination);
67
		CdmStore.getExportManager().runMoniteredOperation(configurator);
68
//		Job exportJob = CdmStore.getExportManager().createIOServiceJob(configurator, destination);
69
//		exportJob.setProperty(IProgressConstants.KEEP_PROPERTY, true);
70
//		exportJob.setUser(true);
71
        // schedule job
72
//		exportJob.schedule();
73

    
74
		return true;
75
	}
76

    
77
	/*
78
	 * (non-Javadoc)
79
	 *
80
	 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
81
	 */
82
	@Override
83
	public void addPages() {
84
		super.addPages();
85

    
86
		page = ExportToFileDestinationWizardPage.Dwca(configurator);
87
		addPage(page);
88
	}
89
}
(13-13/30)